Hi all.
Please, help me to rewrite the sendMove sub to make it work on server with kind-of antibot protection.
There is some code has been patched to exe, and a small function in external dll.
My first goal is to pack a valid packet like EXE does.
And please help me to rewrite some assembler instructions to perl analogues.
Here is the example.
x,y - coordinates in unsigned int.
A7 00 37 33 00 47 0C 00
1)A7 00 - is a packet "header"
2)37 33 - two last chars from strange 6-char string (random?) example: cfae96 (not from this example packet)
3)47 - encrypted X coordinate.
Algorithm:
SAR X(dword),2 (perhaps binary shift to right by 2.)
4)0C - encrypted Y coordinate.
Algorithm:
SAR Y(dword),4
AND Y(lower byte of Y coordinate),0x3F (wtf how to work with only lower byte on perl?)
SHL X(lower byte of X coordinate),6
OR Y(lower byte of Y coordinate),X(lower byte of X coordinate)
now we have 1-byte encrypted Y
that's all for EXE's encryption.
Thanks in advance for answers
Help to rewrite moving packet
Moderator: Moderators
Re: Help to rewrite moving packet
$a = 0xFFFF;flo4t wrote:Hi all.
AND Y(lower byte of Y coordinate),0x3F (wtf how to work with only lower byte on perl?)
$a = $a & 0x00FF;
now $a is just a lower byte.
the upper:
$a = 0xFFFF
$a = $a >> 8
$a = $a & 0xFF
now $a is just an upper byte.
you can use pack/unpack tricks too.
Re: Help to rewrite moving packet
thank you for response!kLabMouse wrote:$a = 0xFFFF;flo4t wrote:Hi all.
AND Y(lower byte of Y coordinate),0x3F (wtf how to work with only lower byte on perl?)
$a = $a & 0x00FF;
now $a is just a lower byte.
the upper:
$a = 0xFFFF
$a = $a >> 8
$a = $a & 0xFF
now $a is just an upper byte.
you can use pack/unpack tricks too.
And can I work with string as array? Like that
$str = "test";
$str[0] == "t"
Re: Help to rewrite moving packet
Yes, Perl strings are just arrays of chars.
Got your topic trashed by a mod?
Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.
Have a nice day.
Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.
Have a nice day.
Re: Help to rewrite moving packet
how can I output something to console from sendMove sub? printf() and debug() (in config.txt I set debug to 1) do not working.
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: Help to rewrite moving packet
Log::messageflo4t wrote:how can I output something to console from sendMove sub? printf() and debug() (in config.txt I set debug to 1) do not working.
Re: Help to rewrite moving packet
Hello. I'am noob in programming.
Can you explain me this algorithm in common language:
It's information about monster:
Where is here monster location(x,y) and what algorithm to get it?
Can you explain me this algorithm in common language:
Second question:3)47 - encrypted X coordinate.
Algorithm:
SAR X(dword),2 (perhaps binary shift to right by 2.)
4)0C - encrypted Y coordinate.
Algorithm:
SAR Y(dword),4
AND Y(lower byte of Y coordinate),0x3F (wtf how to work with only lower byte on perl?)
SHL X(lower byte of X coordinate),6
OR Y(lower byte of Y coordinate),X(lower byte of X coordinate)
now we have 1-byte encrypted Y
It's information about monster:
Where is here monster id and what algorithm to get it?86 00 1B B0 8E 06 23 CC 52 3C CB 88 8C DC AE 02
Where is here monster location(x,y) and what algorithm to get it?