 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
redleouf Advanced Cheater
Reputation: 0
Joined: 13 Feb 2013 Posts: 76
|
Posted: Thu Feb 28, 2013 11:51 am Post subject: [ASM] Problem with my "Crew Godmod" script |
|
|
Hello,
I am making a cheat table for the game "Faster Than Light" but I have a problem with my "Crew Godmod" script. In fact, it was working good until I've decided to change it.
Before I change it, the script was just putting the life of every crew members to 100 with the ligne "mov [eax+28],(float)100". It was working fine but it was looking a bit weird for some "special" crew members who doesn't have their maximal health to 100. The health bar wasn't full, even if it wasn't decreasing when they was hit. So that was kind of "ugly" I guess x)
What I've decided to set the health "[eax+28]" to the max health "[eax+54]" so every health bar will look full, so I've changed my script like that :
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
mov edx,[eax+54]
mov [eax+28],edx
originalcode:
fld dword ptr [eax+28]
mov edx,[edx+08]
exit:
jmp returnhere
"FTLGame.exe"+109091:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"FTLGame.exe"+109091:
fld dword ptr [eax+28]
mov edx,[edx+08]
//Alt: db D9 40 28 8B 52 08 |
The problem is that now, the script crash the game everytime I activate it. I've tested differents solutions but none on them work. I assume the game crash because I save the [eax+54] value into the eax register, but [eax+54] is already in the eax register so that may cause problem ?
I've tried save [eax+54] into others registers but either it crash the game, either the script is not working and create bugs
Can anyone help me out here ? Thank you ^^
|
|
Back to top |
|
 |
DDS Expert Cheater
Reputation: 3
Joined: 10 Feb 2011 Posts: 112 Location: Bill's Planet
|
Posted: Thu Feb 28, 2013 12:32 pm Post subject: |
|
|
u Forgat to Save the Register edx, thats why ur Script is Crashing.
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
fld dword ptr [eax+28]
push edx //Always Save the Registers
mov edx,[eax+54]
mov [eax+28],edx
pop edx // and When you get Done Restore Them to their Original Value
originalcode:
mov edx,[edx+08]
exit:
jmp returnhere
"FTLGame.exe"+109091:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"FTLGame.exe"+109091:
fld dword ptr [eax+28]
mov edx,[edx+08]
//Alt: db D9 40 28 8B 52 08 |
Also, whenever you are Working with Float Values, Always Change Their Value After they been Put, on Top of the FPU Stack.
Take Care
DDSTrainers
_________________
elDarkDragonSlayer |
|
Back to top |
|
 |
redleouf Advanced Cheater
Reputation: 0
Joined: 13 Feb 2013 Posts: 76
|
Posted: Thu Feb 28, 2013 12:58 pm Post subject: |
|
|
Thank you for the quick answer and those two tips
But unfortunately it is still not working, at least it don't crash anymore, but when I activate the script all my crew members instantly die
I've also tried to replace "edx" by "eax" but that one just crash the game again.
|
|
Back to top |
|
 |
DDS Expert Cheater
Reputation: 3
Joined: 10 Feb 2011 Posts: 112 Location: Bill's Planet
|
|
Back to top |
|
 |
redleouf Advanced Cheater
Reputation: 0
Joined: 13 Feb 2013 Posts: 76
|
Posted: Thu Feb 28, 2013 1:52 pm Post subject: |
|
|
Wow, I found it ! Thank you a lot !
It is weird that the offset 54 was showing the same value of the max health for 2 characters in the "Dissect Data/Structures" but show a total other value when you enter it as a pointer !
Do you know why ?
And thank you again for the quick answer and the good help !
|
|
Back to top |
|
 |
DDS Expert Cheater
Reputation: 3
Joined: 10 Feb 2011 Posts: 112 Location: Bill's Planet
|
|
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
|
|