Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Compare address of health to stored address

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
erris
How do I cheat?
Reputation: 0

Joined: 05 May 2012
Posts: 2

PostPosted: Sun May 06, 2012 12:54 am    Post subject: Compare address of health to stored address Reply with quote

I am injecting the following with Auto assemble. I am having troubles comparing the address of the player's health to the known address that I find every session.

My comparison below always ends up being not equal, I'm unsure where I am going wrong. Any help is appreciated.

Code:
alloc(fullHealthInjection, 2048)
alloc(healthPointer, 4)
label(backToMain)
label(isPlayer)

fullHealthInjection:
pushfd
push eax
push ecx

//hard-coded address of player health, found each game
mov [healthPointer],0x434562F8

//load the address of player health into ecx, [ebx+00000118]
lea ecx,[ebx+00000118]
cmp [healthPointer],ecx
pop ecx

je isPlayer

//Kill enemies
//pop top value of the stack
fstp st(0)

//Load -1 into register
mov eax,(float)-1

//Load 0 into the FPU register stack
fld [eax]

//Restore original
pop eax
popfd
jmp backToMain

isPlayer:
//pop top value of the stack
fstp st(0)

//Load 1000 into register
mov eax,(float)1000

//Load 1000 into the FPU register stack
fld [eax]

//Restore original
pop eax
popfd
jmp backToMain

//the address that we find writing to our health
//when called, [ebx+00000118] is the address of health
//originally:
//0BD2717C - D8 AB 18010000             - fsubr dword ptr [ebx+00000118]
//0BD27182 - D9 9B 18010000             - fstp dword ptr [ebx+00000118]

0BD2717C:
jmp fullHealthInjection
nop
backToMain:
Back to top
View user's profile Send private message
661089799107
Expert Cheater
Reputation: 3

Joined: 25 Jan 2009
Posts: 186

PostPosted: Sun May 06, 2012 3:25 am    Post subject: Reply with quote

Have you tried setting a BP on the instruction before the compare to see what the problem is?
Back to top
View user's profile Send private message
erris
How do I cheat?
Reputation: 0

Joined: 05 May 2012
Posts: 2

PostPosted: Sun May 06, 2012 9:40 pm    Post subject: Reply with quote

Wow, CE rocks. I found my issues using the debugger.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites