Sending Packets

07/14/2015 21:51 suigetsu4229#421
Hi, I've noticed neither c# nor autoit will send packets over 127 bytes in size and crash the client. Is this related to the methods of allocating memory in these examples or is there a restriction put up by elementclient (doubtful about this because I've sniffed packets bigger than the "limit")? If it's the latter, are there any workarounds?
07/15/2015 09:30 Sᴡoosh#422
No, it's due to the fact that byte length isn't a byte, it'S a CUInt (packed int). After 127, it is two bytes long with a special encoding.
07/16/2015 11:35 suigetsu4229#423
Quote:
Originally Posted by Sᴡoosh View Post
No, it's due to the fact that byte length isn't a byte, it'S a CUInt (packed int). After 127, it is two bytes long with a special encoding.
Hey, thanks for your answer. However, I'm still lost as to how to pass two bytes as packet length. Here, in the opcode:

PHP Code:
            0x60,                                   //PUSHAD
            
0xB80x000x000x000x00,           //MOV EAX, SendPacketAddress
            
0x8B0x0D0x000x000x000x00,     //MOV ECX, DWORD PTR [realBaseAddress]
            
0x8B0x490x20,                       //MOV ECX, DWORD PTR [ECX+20]
            
0xBF0x000x000x000x00,           //MOV EDI, packetAddress
            
0x6A0x00,  <--                        //PUSH packetSize
            
0x57,                                   //PUSH EDI
            
0xFF0xD0,                             //CALL EAX
            
0x61,                                   //POPAD
            
0xC3                                    //RET 
There's only place for one byte to write. I tried adding an additional byte and encoding the length in 128 base, but that produces the same result - crashes the client. Sorry if this is really easy and I'm missing something obvious, but I've tried to do this for a good few hours and I can't seem to figure it out myself. :(
07/16/2015 12:47 Sᴡoosh#424
Yeah, Push only supports one byte as opcode. There's a different function that handles this correctly. This function was never meant to be called directly by the programmers.

What the hell are you sending in a C22 packet that's over 127 bytes btw?
07/16/2015 13:33 suigetsu4229#425
Quote:
Originally Posted by Sᴡoosh View Post
Yeah, Push only supports one byte as opcode. There's a different function that handles this correctly. This function was never meant to be called directly by the programmers.

What the hell are you sending in a C22 packet that's over 127 bytes btw?
The packet I'm trying to send is the one that recrafts weapons. Normal crafting packet is 18 or so bytes long, but this packet has additional 128 bytes as it needs to pass to the client itemTypeID and index in inventory of each ingredient. What boggles me, though, is that there's 32 empty bytes after itemTypeID bytes and another 32 after index bytes.

Anywho, there was a russian autocraft for 1.4.6- versions, but I guess it doesn't work anymore and I can't seem to find anything related to how it sends packets.

So, is this possible to be done by sending packets? My knowledge about asm and memory manipulating is still low so I wouldn't know how to find the function you mentioned.

Edit: Never mind, I just had to load packetsize into a register and push that register.
01/16/2017 23:07 ariesta1503#426
how to find SendPacketAddress please. :(
01/21/2017 10:59 Kruger2001#427
I found out today how to double the accountstash to 32 slots, when you take everything out, it's gone again.
Just push an item from the stash to position 17, via packet, to expand ;)
01/25/2017 23:28 Sh@dowX#428
Quote:
Originally Posted by Kruger2001 View Post
I found out today how to double the accountstash to 32 slots, when you take everything out, it's gone again.
Just push an item from the stash to position 17, via packet, to expand ;)
This I'd love to learn how to do. My stash shows 32 but i'm only able to use 16 slots.
01/26/2017 09:59 Kruger2001#429
Quote:
Originally Posted by Sh@dowX View Post
This I'd love to learn how to do. My stash shows 32 but i'm only able to use 16 slots.
Yes, I also noticed, I have a stack shared and one on each slot, thats worked for all 32 slots and so I thought it worked with everyone.
01/26/2017 19:31 jasty#430
To put in more than 16 items put something stackable in your stash, split the stack into another slot of the stash by holding down alt key and dragging. Then swap something into your inventory into the newly occupied spot. I found this packet when they merged the servers.
02/25/2017 18:03 aplavin#431
Is it possible to start a catshop with packets (ingame)? I tried sending packet 0x54 (which opens the catshop creation window, as expected) and then 0x4c (copied exactly from a packet sniffer). It works only if I opened the catshop manually before, but not when I remove all items manually and send the same packets.
So, what else is needed for opening a catshop?
06/26/2017 19:48 ppjdee#432
wow, this thread has been going on for a while now lol
03/26/2019 04:32 tonyphillips1#433
Quote:
Originally Posted by burple6 View Post
Here is the autoit code for hunting and gathering resources, as well as the interaction function in AutoIt form. Please note that the code is referencing variables and functions defined in Prophet Bot Recoded, but should be easily changed to suit your environment.



can you put these offset from the prophet in this code?