View previous topic :: View next topic |
Author |
Message |
happyreadygo Advanced Cheater
Reputation: 1
Joined: 14 Sep 2011 Posts: 87
|
Posted: Fri Aug 17, 2012 1:45 pm Post subject: (pointer level2 reference)autoassemble excution error |
|
|
this is the error line cmp [[esi+58]+4],076450d4
esi address = 05650704
esi+58 address = 0565075c has value as pointer P->0fcd9144
0fcd9148 has value as pointer P->076450d4
I want to compare a value of 0fcd9148 to 076450d4. What's the correct code for this one?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25790 Location: The netherlands
|
Posted: Fri Aug 17, 2012 2:20 pm Post subject: |
|
|
push eax
mov eax,[esi+58]
cmp [eax+4], 076450d4
pop eax
je dosomething
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
happyreadygo Advanced Cheater
Reputation: 1
Joined: 14 Sep 2011 Posts: 87
|
Posted: Sat Aug 18, 2012 1:53 am Post subject: |
|
|
Thank you dark byte .
I founded another problem .
in the following code , why we need push ecx and pop ecx.
When I remove them , the execution is success , but it make game crash ..
When I added push ecx and pop ecx , the cheat success without any problem.
I don't see any use of ecx in the code anyway.
Code: |
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push eax
push ebx
push ecx // without this the game crash
mov eax,[0096aa00]
mov ebx,[eax+24]
mov [ebx+14],1a
pop eax
pop ebx
pop ecx // without this the game crash
originalcode:
ret 0008
nop
nop
exit:
jmp returnhere
"game.dat"+DE858:
jmp newmem
returnhere:
|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25790 Location: The netherlands
|
Posted: Sat Aug 18, 2012 4:21 am Post subject: |
|
|
You are popping in the wrong order
push eax decreases esp and places the value of eax into [esp]
pop eax places the value of [esp] into eax and increases esp
so if you do, push eax, push ebx and then pop eax, you place the stored address of ebx into eax
so do
push eax
push ebx
...
pop ebx
pop eax
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
|