I am currently trying to bypass a CRC check, that exists inline on many places in an application to check if memory pages in the .text section have been modified.
Short explanation of the
crc32
instruction:
Starting with an initial value in the first operand (destination operand), accumulates a CRC32 (polynomial 11EDC6F41H) value for the second operand (source operand) and stores the result in the destination operand.
Okay so: rsi
contains the pointer of the next memory page that gets scanned and rax
is the offset/counter. rdx
is usually 200 (200 loops).
My goal: find where rsi
is set. There has to be some instruction like mov rsi, next_memory_page_to_be_scanned
.
So here are the loop vars initialized (rdx,rax
).
So here is one of the things I am stuck: the yellow marked part seems to be the first instructions I can bp that gets executed before CRC_CHECK. I mean some other place obviously calls it, but I don't know how to find that place.
I tried to follow the return pointer:
but the return pointer points to nothing basically. Breakpointing one instruction above (and [rcx], al
) won't trigger the bp (seems to not have anything todo with the CRC check). How do I backtrace this further?
The value of rsi
lays also not on the stack when I bp the CRC.
Thanks!
and al,[rdx+r14*8-7BFAEFF1h]
looks strange and I suspect some obfuscation going on which IDA maybe fails to recognize and shows you the wrong disassembly. – Paweł Łukasik May 21 '18 at 10:36