Hi,
You have solved the crackme, well done! But, we can solve the crackme without patching :-)
This is the syntax of FormKeyDown function: TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
we are interested in the last two parameters:
- Key, the key that is been pressed
- Shift, it can take many values but the more interesting are: ssShift, ssAlt and ssCtrl.
Quote:
where BL is changed in the code |
The value of bl is related to 'shift' parameter, in particular you have:
bl = 1 if shift is pressed (ssShift)
bl = 2 if alt is pressed (ssAlt)
bl = 3 if shift+alt is pressed
bl = 4 if ctrl is pressed (ssCtrl)
bl = 5 if shift+ctrl is pressed
and so on...
We have to pass these two checks:
CODE:0043C49E test bl, 1 ; checks if the first bit of bl is setted
CODE:0043C4A1 jz short loc_43C4B8 ; jump if it's not setted
CODE:0043C4A3 test bl, 2 ; checks if the second bit of bl is setted
CODE:0043C4A6 jz short loc_43C4B8 ; jump if it's not setted
The 'test' instruction performs a logical 'and' between the two operands, so, bl must have both first and second bit setted to 1: bl=00000011=03. If bl=03 and 'k' is pressed the crackme is solved :-)
ZaiRoN