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 


Shared Health Routines

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
HonestGamer
Cheater
Reputation: 1

Joined: 13 Aug 2009
Posts: 27
Location: India

PostPosted: Thu Aug 13, 2009 12:29 pm    Post subject: Shared Health Routines Reply with quote

Okay training "Land of the Dead" is getting tough for me.

As I am not a pro in game hacking, I fail in making conditions. So this game uses the same oppcode for player and AI. So if I try to inject a code or just NOP it, it affects the AI too. And yes there are no pointers found for health as the addresses change only on player death, not on game restart, level change, etc.

So here is the code:-

10136E9E: mov [ebx],eax

So I took advice from DABhand from FileForums and CheatHappens. He introduced me to a concept which crashed the game for me (Code areas are not mentioned as I am not checking it now!).

So I find a code cave with a code cave finder. And yes it has read-write attributes.

So 101369E: jmp codecave1 (The oppcode is 2 bytes only so I check to NOP the left out area, noting the oppcodes that were eliminated)

codecave1:

cmp esi, XXXXXXXX (When I check for the register's value for the player, I find out esi remains static, and the XXXXXXXX is the value I find when I double click on the oppcode)
je codecave2 (If it is equal, jump to codecave2)
mov [ebx],00000000 (move it to a 0 value for AI, this gives a one hit kill effect!)
mov ebx,eax (Terminated code for creating a jmp in the game code)
mov eax,[esp+14] (Again a terminated code!)
jmp 101369E (Back to game code)

codecave2:

mov [ebx],00000064 (Force 100 value for player only)
mov ebx,eax
mov eax,[esp+14]
jmp 101369E

So after I return to the game, it freezes and hangs. Any mistakes I made?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25949
Location: The netherlands

PostPosted: Thu Aug 13, 2009 4:07 pm    Post subject: Reply with quote

Does your codecave have execute attributes and is big enough? (Really, use virtualallocex, it saves so much trouble)

also, are you sure he meant esi is the same? not [esi] (that is the value of the 4 bytes located at the address esi points at)?


But the real problem here is that you have a jmp 101369e, that means you jump right into your jmp codecave1 meaning a infinite loop (freeze and hang)
You should jump to after the jmp and the other overwritten code

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
HonestGamer
Cheater
Reputation: 1

Joined: 13 Aug 2009
Posts: 27
Location: India

PostPosted: Fri Aug 14, 2009 12:01 am    Post subject: Reply with quote

Dark Byte wrote:
Does your codecave have execute attributes and is big enough? (Really, use virtualallocex, it saves so much trouble)

also, are you sure he meant esi is the same? not [esi] (that is the value of the 4 bytes located at the address esi points at)?


But the real problem here is that you have a jmp 101369e, that means you jump right into your jmp codecave1 meaning a infinite loop (freeze and hang)
You should jump to after the jmp and the other overwritten code


Can you please explain me further? And I don't think it has execute attribute. I use Spookie's CodeCaver tool and search for zeros with (rw) - read write attributes. And yes, they are normally in the .data region!

Can you show me how do I write this in auto assemblar?

EDIT: Forgot, yes esi is static, its not [esi], but still I have my doubts on it? Are there any other ways of comparing and then making one-sided options?
Back to top
View user's profile Send private message
Recifense
I post too much
Reputation: 166

Joined: 17 Mar 2008
Posts: 3688
Location: Pernambuco - Brazil

PostPosted: Fri Aug 14, 2009 7:08 am    Post subject: Reply with quote

Hi,

About the real problem that DB refers to, here is something to help clarifying it:

Considering the info you have passed, the original code should be like this:
Code:

0101369e 89 03        mov [ebx],eax
010136a0 8b d8        mov ebx,eax
010136a2 8b 44 24 14  mov eax,[esp+14]
010136a6 <--- next instruction (the coming back point)


1 - A jump far instruction takes 5 bytes and the code above takes 8 bytes.
Two changings:
a - Hacking point should be like this:
Code:

0101369E:
 jmp codecave1 
 nop
 nop
 nop


b - The back to game code should be like this:
Code:

jmp 010136a6


2 - Looking at the code, we can see that ebx is loaded with same value of eax (maybe it will be used later on the game code):
So, with a little chenge, the code could be like this:
Code:
 
  mov eax ,00
  mov [ebx],eax (move it to a 0 value for AI, this gives a one hit kill effect!)
...


and

Code:

  mov eax ,00000064
  mov [ebx],eax       (Force 100 value for player only)
 ...


Note: With the use of labels the jump out / back to main code could be easier. There are some exemples on the forum.

Cheers!
Back to top
View user's profile Send private message Send e-mail
HonestGamer
Cheater
Reputation: 1

Joined: 13 Aug 2009
Posts: 27
Location: India

PostPosted: Sat Aug 15, 2009 12:41 am    Post subject: Reply with quote

Thanks a lot. And this concept applies to this game where ESI remains static.

But what do you do when they are dynamic?

Which values do you compare to make an option player only?
Back to top
View user's profile Send private message
The_DABhand
How do I cheat?
Reputation: 0

Joined: 01 Nov 2009
Posts: 3

PostPosted: Sun Nov 01, 2009 9:48 am    Post subject: Reply with quote

I know this has been answered ages ago, but please dont throw names about if you dont understand which in turn makes me look like an idiot HG Razz


As said your infinite loop is the problem, you ALWAYS ALWAYS jump/ret back from code caves to the op code after your own op code that Jump/Call's to the code cave.

And by the look of the address its a case of Code Shifting.

You wil really have to read basic stuff so you understand it 100%. You have potential, but you need to goto school and learn properly.
Back to top
View user's profile Send private message
Bswap
Newbie cheater
Reputation: 0

Joined: 18 Aug 2009
Posts: 21

PostPosted: Sun Nov 01, 2009 9:07 pm    Post subject: re: Reply with quote

I'm certain any advice or information DAB has given out would be 100% accurate and reliable. It's not DAB's advice on the concept which is causing the GPF, it's your implementation of the advice.

I find 'Hit Tracing' in OllyDbg is perfect for shared routines.

I hate to refer away from CEF, but www.gamehacking.com (see the tutorials section) has some excellent tutorials detailing when and how to use 'Hit Tracing' . One by Labrynth comes to mind, [Psych] as well.

Hit tracing is a neat feature that highlights the exact path of execution, providing valuable information about the flow of code.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25949
Location: The netherlands

PostPosted: Thu Nov 05, 2009 10:45 am    Post subject: Reply with quote

it might be easier to just use ce's "find out what addresses this code accesses"
This will log all memory accesses by the specified instruction showing it when the enemy's memory is accessed and yours.
You can then inspect the address, and even the register states when it got asccessed.

It's perfect for shared routines

And you can then use the structure definer to compare two different objects to eachother to find out how to distinguish

http://wiki.cheatengine.org/index.php?title=Shared_health_routines

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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