Sean1337 Master Cheater
Reputation: 0
Joined: 04 May 2007 Posts: 478
|
Posted: Mon Aug 06, 2007 1:43 am Post subject: Little pointer problem (MASM) |
|
|
Alright here's the scenario.
FROM CE:
ecx, [eax]
eax, [ecx+24]
movzx edx, byte ptr [eax+1234]
cmp byte ptr [edx+eax+1235], 09
I'm trying to get pointer for [edx+eax+1235].
So here's what I know.
I have the pointer for ecx (static).
So follow the code.
I got, [pointer+24] = eax
then, [eax+1234] = edx
then, edx+eax+1235 is the pointer I want.
[eax+1234] is a 2 level pointer. Basically code should be like this.
Code: |
mov eax, pointer
mov eax, [eax]
add eax, 0024h
mov eax, [eax] ;after this instruction, eax should contain the value of pointer + 24.
push eax
add eax, 1234h ;2nd level, add 1234 to the value of pointer + 24.
mov eax, [eax] ;move value of 2nd level pointer into eax
mov ecx, eax ;save eax into ecx
pop eax
add eax, 1235h ;add 1235 to value of pointer + 24
add eax, ecx ;add value in edx
mov dword ptr ds:[eax],0 ;move 0 into pointer [edx+eax+1235] |
I'm not sure whether I did it correctly, but my goal is so that the last line mov [eax], 0 moves 0 into [edx+eax+1235]
|
|