ajom
Well-known member
I am trying to intercept raknet bitstream that carries a dialog RPC. When my client accepted this RPC, it will project this dialog:
http://ugbase.eu/index.php?attachments/dialog-info-png.7312/
And my goal is to get the user id value "98670". That is why I made this code:
I can detect my target RPC dialog, but I can't get the contents of the dialog. As you can see on the image, the code generates a chat message "info:<dialog contents>" but it only shows this:
http://ugbase.eu/index.php?attachments/chatmessage-png.7313/
I am sure I did not make any mistake since I got the RPC data structure on this site:
I will appreciate the help of the community.
http://ugbase.eu/index.php?attachments/dialog-info-png.7312/
And my goal is to get the user id value "98670". That is why I made this code:
Code:
{$CLEO .cs}
{$INCLUDE SF}
0000: NOP
const
CMDVAR1 = 31@
CMDVAR2 = 30@
end
repeat
wait 0
until 0AFA: is_samp_available
0BE3: raknet setup_incoming_rpc_hook @in_rpc
0BDE: pause_thread 0
:in_rpc
0BE5: raknet CMDVAR1 = get_hook_param PARAM_PACKETID
if CMDVAR1 == RPC_SCRSHOWDIALOG
then
0BE5: raknet CMDVAR1 = get_hook_param PARAM_BITSTREAM
0BE7: raknet 0@ = bit_stream_read CMDVAR1 type BS_TYPE_SHORT // Dialog ID
0BE7: raknet 1@ = bit_stream_read CMDVAR1 type BS_TYPE_BYTE // Dialog Style
if and
0@ == 100
1@ == 0
then
for 0@ = 1 to 3 // Title,Buton1,Button2
0BE7: raknet CMDVAR2 = bit_stream_read CMDVAR1 type BS_TYPE_BYTE // Length
CMDVAR2 *= 8 // convert bytes to bits
0BEB: raknet bit_stream CMDVAR1 ignore_bits CMDVAR2
end
0BF0: raknet CMDVAR2 = bit_stream CMDVAR1 get_number_of_unread_bits // length of dialog info
CMDVAR2 /= 8 // bits to bytes
if CMDVAR2 > 0
then
CMDVAR2++
alloc 2@ CMDVAR2
CMDVAR2--
0BE8: raknet bit_stream CMDVAR1 read_array 2@ size CMDVAR2 // copy the message with the specified length from the bitstream to buffer
0C1E: array 2@ element CMDVAR2 el_size 1 = 0 // terminate the buffer with a null character
0AF8: samp add_message_to_chat "info: %s" color 0xFF00FF00 2@
free 2@
end
end
end
0BE0: raknet hook_ret true
I can detect my target RPC dialog, but I can't get the contents of the dialog. As you can see on the image, the code generates a chat message "info:<dialog contents>" but it only shows this:
http://ugbase.eu/index.php?attachments/chatmessage-png.7313/
I am sure I did not make any mistake since I got the RPC data structure on this site:
Dialogs
- ShowDialog - ID: 61
Parameters: UINT16 wDialogID, UINT8 bDialogStyle, UINT8 bTitleLength, char[] szTitle, UINT8 bButton1Len, char[] szButton1, UINT8 bButton2Len, char[] szButton2, CSTRING szInfo
I will appreciate the help of the community.
Attachments
Last edited: