 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
kik4444 Expert Cheater
Reputation: 0
Joined: 07 Sep 2013 Posts: 120 Location: Bulgaria
|
Posted: Mon Dec 22, 2014 3:42 pm Post subject: Isaac Rebirth teleport script |
|
|
So this is the 1st time I've attempted to create my own teleport script for a simple 2D game. I've used previous teleport script discussions as a reference, but I can't figure out what's wrong. Basically when I try to finish the code, it says that many labels are not defined in the script while they ARE in there. I'll post my script and my whole cheat table.
Code: | [ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(save)
label(load)
label(savex)
label(savey)
label(saveco)
label(loadco)
registersymbol(saveco)
registersymbol(loadco)
newmem:
cmp [saveco],1
je save
cmp [loadco],1
je load
jmp originalcode
save:
mov [saveco],0
push eax
mov eax,[ebx+00000414]
mov [savex],eax
mov eax,[ebx+00000418]
mov [savey],eax
pop eax
jmp originalcode
load:
mov [loadco],0
push eax
mov eax,[savex]
mov [ebx+00000414],eax
mov eax,[savey]
mov [ebx+00000418],eax
pop eax
jmp originalcode
originalcode:
fstp dword ptr [ebx+00000414]
exit:
jmp returnhere
"isaac-ng.exe"+46BEB:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"isaac-ng.exe"+46BEB:
fstp dword ptr [ebx+00000414]
unregistersymbol(saveco)
unregistersymbol(loadco)
//Alt: db D9 9B 14 04 00 00 |
Description: |
|
 Download |
Filename: |
Isaac Rebirth.CT |
Filesize: |
1.07 MB |
Downloaded: |
2125 Time(s) |
_________________
Silence will fall when the question is asked...
Last edited by kik4444 on Mon Dec 22, 2014 3:49 pm; edited 1 time in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Mon Dec 22, 2014 3:48 pm Post subject: |
|
|
you have not defined savex, savey, saveco and loadco
instead of defining them as labels you may want to define them as allocs
e.g:
instead of
Code: |
label(savex)
label(savey)
label(saveco)
label(loadco)
|
do
Code: |
alloc(savex,4)
alloc(savey,4)
alloc(saveco,4)
alloc(loadco,4)
|
_________________
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 |
|
 |
kik4444 Expert Cheater
Reputation: 0
Joined: 07 Sep 2013 Posts: 120 Location: Bulgaria
|
Posted: Mon Dec 22, 2014 4:32 pm Post subject: |
|
|
Thx, that solved the label defining problem, but my script doesn't work, are there any problems with it? here's the new one Code: | [ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(save)
label(load)
alloc(savex,4)
alloc(savey,4)
alloc(saveco,4)
alloc(loadco,4)
registersymbol(saveco)
registersymbol(loadco)
newmem:
cmp [saveco],1
je save
cmp [loadco],1
je load
jmp originalcode
save:
mov [saveco],0
push eax
mov eax,[ebx+00000414]
mov [savex],eax
mov eax,[ebx+00000418]
mov [savey],eax
pop eax
jmp originalcode
load:
mov [loadco],0
push eax
mov eax,[savex]
mov [ebx+00000414],eax
mov eax,[savey]
mov [ebx+00000418],eax
pop eax
jmp originalcode
originalcode:
fstp dword ptr [ebx+00000414]
exit:
jmp returnhere
"isaac-ng.exe"+46BEB:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"isaac-ng.exe"+46BEB:
fstp dword ptr [ebx+00000414]
unregistersymbol(saveco)
unregistersymbol(loadco)
//Alt: db D9 9B 14 04 00 00 |
Description: |
Here's the newer one with the allocs |
|
 Download |
Filename: |
Isaac Rebirth.CT |
Filesize: |
1.2 MB |
Downloaded: |
2080 Time(s) |
_________________
Silence will fall when the question is asked... |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Mon Dec 22, 2014 4:50 pm Post subject: |
|
|
fstp dword ptr [ebx+00000414] will override your new value in [ebx+00000414]
and it's likely that the code after that also restores [ebx+418]
You may wish to pop that value from the fpu stack and jump to after the original code
Or change the value in the fpu stack instead (don't ask me, I never use the ancient fpu instruction set)
Or try finding a better code injection point (e.g AFTER it has been set )
_________________
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 |
|
 |
kik4444 Expert Cheater
Reputation: 0
Joined: 07 Sep 2013 Posts: 120 Location: Bulgaria
|
Posted: Mon Dec 22, 2014 4:53 pm Post subject: |
|
|
Here's the code I just re-wrote Code: | [ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(save)
label(load)
alloc(savex,4)
alloc(savey,4)
alloc(saveco,4)
alloc(loadco,4)
registersymbol(saveco)
registersymbol(loadco)
newmem:
cmp [saveco],1
je save
cmp [loadco],1
je load
jmp exit
save:
mov [saveco],0
push eax
mov eax,[ebx+00000414]
mov [savex],eax
mov eax,[ebx+00000418]
mov [savey],eax
pop eax
jmp exit
load:
mov [loadco],0
cmp [savex],0
cmp [savey],0
je exit
push eax
mov eax,[savex]
mov [ebx+00000414],eax
mov eax,[savey]
mov [ebx+00000418],eax
pop eax
originalcode:
fstp dword ptr [ebx+00000414]
exit:
jmp returnhere
savex:
dd 0
savey:
dd 0
saveco:
dd 0
loadco:
dd 0
"isaac-ng.exe"+46BEB:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"isaac-ng.exe"+46BEB:
fstp dword ptr [ebx+00000414]
unregistersymbol(saveco)
unregistersymbol(loadco)
//Alt: db D9 9B 14 04 00 00 |
So far it works, however, for some reason when it's activated I can't move sideways, only up and down - basically my X coord becomes frozen.
_________________
Silence will fall when the question is asked... |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Mon Dec 22, 2014 4:56 pm Post subject: |
|
|
your load is still going to execute "fstp dword ptr [ebx+00000414] "
easiest is to find a different code injection spot.
Find out where "fstp dword ptr [ebx+00000418]" is and do a code injection right after that line
Code: |
mov [loadco],0
cmp [savex],0
cmp [savey],0
je exit
|
that means that if there is no save at all the original code never gets executed (and I guess that the code after it still does)
also, it only checks savey , savex is ignored
_________________
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 |
|
 |
kik4444 Expert Cheater
Reputation: 0
Joined: 07 Sep 2013 Posts: 120 Location: Bulgaria
|
Posted: Mon Dec 22, 2014 5:08 pm Post subject: |
|
|
Ok, happy to report that my code finally works, turns out I had made a mistake in the beginning that I didn't notice, basically I was comparing if my saveco & loadco were 0 and THEN I was jumping to the saving and loading, and not when they were 1. Anyways, here's my new working code. Is there anything unnecessary in there?
Although in this type of game, being able to save and load your position doesn't do much, since it's in small rooms and if you attempt to load a saved position in another room, the game crashes, but I only intended all of this for practicing my teleport scripts and actually being able to teleport in a previous spot in the same room in this game has no practical use. Code: | [ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(save)
label(load)
alloc(save_x,4)
alloc(save_y,4)
alloc(saveco,4)
alloc(loadco,4)
registersymbol(saveco)
registersymbol(loadco)
newmem:
cmp [saveco],1
je save
cmp [loadco],1
je load
jmp exit
save:
mov [saveco],0
push edx
mov edx,[eax+00000414]
mov [save_x],edx
mov edx,[eax+00000418]
mov [save_y],edx
pop edx
jmp exit
load:
cmp [save_x],0
je exit
cmp [save_y],0
je exit
mov [loadco],0
push edx
mov edx,[save_x]
mov [eax+00000414],edx
mov edx,[save_y]
mov [eax+00000418],edx
pop edx
jmp exit
originalcode:
mov edx,[eax+00000414]
exit:
jmp returnhere
save_x:
dd 0
save_y:
dd 0
saveco:
dd 0
loadco:
dd 0
"isaac-ng.exe"+12E345:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"isaac-ng.exe"+12E345:
mov edx,[eax+00000414]
unregistersymbol(saveco)
unregistersymbol(loadco)
//Alt: db 8B 90 14 04 00 00 |
_________________
Silence will fall when the question is asked...
Last edited by kik4444 on Mon Dec 22, 2014 5:29 pm; edited 2 times in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Mon Dec 22, 2014 5:25 pm Post subject: |
|
|
Now the original code is never called when both save and load are 0
In this case, the original code is safe as it doesn't overwrite your new data
_________________
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 |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|