I wrote a very basic crackme to learn how assembly works.
Even though I wrote it myself, I am having some trouble understanding a few pieces of the assembly:
What I know up to now is: [rbp+rax+input_buffer]
is basically input_buffer[rax]
, xor'ing two of the same registers resets them and that's about it (apart from the very basic stuff like add, mov, inc).
I specifically don't understand what movsx ..
and add ecx, 0FFF..
is doing.
The input_buffer is filled with _fgets
. I'm intentionally not saying a working input to see if you can figure it out (it shouldn't be hard anyways).
A proper input would be 0123456789\n
, note that I discard the newline via strcspn
.