Torque
June 16th, 2003, 23:33
Hello,
I was following a tut for a crackme I found and there is something on the tut that I have a question on.
Here is the code:
Now, my question is how does one figure out that the cmp's at 00403255 and 004032FF are checking if the editbox has focus? Its not explained in the tut and I dont know how I would have figured that out.
Also, the cmp at 0040330F. How can you tell if that is comparing al to 0D to check which key was pressed or if it is comparing for some other purpose? How do you tell when it is checking which key was pressed?
And at 0040330C, it gets the next char. Is the only way to figure out that it is actually getting the char you typed to look at EAX and see if it is a match or are there other clues?
Sorry if these questions are too vague or anything. Just looking for some pointers
Any help is greatly appreciated.
-Torque
P.S. If you need any additional info on the program being discussed plz let me know
I was following a tut for a crackme I found and there is something on the tut that I have a question on.
Here is the code:
Code:
:0040324F 55 push ebp
:00403250 8BEC mov ebp, esp
:00403252 83C4FC add esp, FFFFFFFC
:00403255 817D0C02010000 cmp dword ptr [ebp+0C], 00000102 ;focus on editbox.
:0040325C 0F859D000000 jne 004032FF
We follow the jne at 40325c:
:004032FF 817D0C00010000 cmp dword ptr [ebp+0C], 00000100 ;focus on editbox.
:00403306 0F85F4000000 jne 00403400
:0040330C 8B4510 mov eax, dword ptr [ebp+10] ; Getting the char.
:0040330F 3C0D cmp al, 0D ;0D = press Enter button
:00403311 7573 jne 00403386 ; getting the char of the editbox
:00403313 833D1560400001 cmp dword ptr [00406015], 00000001
:0040331A 7514 jne 00403330 ; BAD jump!
:0040331C 6A40 push 00000040
Now, my question is how does one figure out that the cmp's at 00403255 and 004032FF are checking if the editbox has focus? Its not explained in the tut and I dont know how I would have figured that out.
Also, the cmp at 0040330F. How can you tell if that is comparing al to 0D to check which key was pressed or if it is comparing for some other purpose? How do you tell when it is checking which key was pressed?
And at 0040330C, it gets the next char. Is the only way to figure out that it is actually getting the char you typed to look at EAX and see if it is a match or are there other clues?
Sorry if these questions are too vague or anything. Just looking for some pointers

Any help is greatly appreciated.
-Torque
P.S. If you need any additional info on the program being discussed plz let me know