|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
kurashi How do I cheat? Reputation: 0
Joined: 22 Sep 2013 Posts: 4
|
Posted: Sat Dec 06, 2014 12:17 am Post subject: Determining values between party and enemy |
|
|
Currently I am learning how to make these scripts using Epic Battle Fantasy 4 (Steam version) as my practice game. I figured I would start with something somewhat simple-Health. Now I am certain this has been answered but a quick search didn't give me any reliable results, but the problem is even though the script works as it should it makes my enemies invulnerable as well.
Here is my code:
Code: |
[ENABLE]
alloc(newmem,100)
label(returnhere)
label(exit)
label(_matthealth)
registersymbol(_matthealth)
aobscan(matthealth, 89 47 14 8b 47 10 85 C0)
newmem:
db 90 90 90
exit:
jmp returnhere
matthealth:
_matthealth:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
_matthealth:
db 89 47 14 8b 47 10 85 C0
unregistersymbol(_matthealth)
|
I guess the above is pretty basic.
Can anyone either instruct me in my stupidity or direct me to somewhere that this has been answered already, please?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sat Dec 06, 2014 6:21 am Post subject: |
|
|
Try step 9 of the tutorial. It describes this situation
In short, use data dissect to compare the player and enemy structures and figure out a way to distinguish between them (e.g a team number, or a pointer to the ai controller filled in, etc...)
_________________
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 |
|
|
kurashi How do I cheat? Reputation: 0
Joined: 22 Sep 2013 Posts: 4
|
Posted: Sat Dec 06, 2014 4:17 pm Post subject: |
|
|
Dark Byte wrote: | Try step 9 of the tutorial. It describes this situation
In short, use data dissect to compare the player and enemy structures and figure out a way to distinguish between them (e.g a team number, or a pointer to the ai controller filled in, etc...) | Well the tutorial didn't really help me much in terms of making the script however I watched some videos and came up with this script
Code: |
[ENABLE]
alloc(newmem,100)
label(returnhere)
label(originalcode)
label(teamhealth)
label(exit)
aobscan(damagecode, 89 47 14 8b 47 10 85 C0)
label(_damagecode)
registersymbol(_damagecode)
newmem: //this is allocated memory, you have read,write,execute access
cmp [edi+10],00000001
je teamhealth
jmp originalcode
teamhealth:
mov edi+14,[edi+18]
mov eax,[edi+10]
originalcode:
mov [edi+14],eax
mov eax,[edi+10]
exit:
jmp returnhere
damagecode:
_damagecode:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
_damagecode:
db 89 47 14 8b 47 10 85 C0
unregistersymbol(_damagecode)
|
0x14 is the current health.
0x18 is the max health.
0x10 seems to always be 1 for party and 0 for enemies.
I think that I did this right with the aobscan and dissection however there must be something wrong/ not possible because I get the message "Not all code is Injectable" when I try to save. And of course the script doesn't even activate
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat Dec 06, 2014 8:50 pm Post subject: |
|
|
For starters...
Code: | ////////////////code above
teamhealth:
mov edi+14,[edi+18] //////////////don't do this, instead, see new code
mov eax,[edi+10]
jmp returnhere ////////////////add this
originalcode:
mov [edi+14],eax
mov eax,[edi+10]
exit:
jmp returnhere
////////////////code below |
New code:
Code: | teamhealth:
push edx
mov edx,[edi+18]
mov [edi+14],edx
pop edx
mov eax,[edi+10]
jmp returnhere |
|
|
Back to top |
|
|
DeaconGlen How do I cheat? Reputation: 0
Joined: 10 Dec 2014 Posts: 5
|
Posted: Wed Dec 10, 2014 1:28 pm Post subject: |
|
|
So, Is it working?
Can we have an update table please?
|
|
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
|
|