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 


Theme Hospital (GOG Edition) DMA problem

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

Joined: 12 Sep 2012
Posts: 83

PostPosted: Sun Dec 13, 2015 5:01 pm    Post subject: Theme Hospital (GOG Edition) DMA problem Reply with quote

Hello I want to make a trainer for this game, Its the GOG version of Theme Hospital and the game uses a DOXBox launcher.

I find a one adres that holds the money value. I scan for pointers and there are no pointers so I do code injection:

0C99DEDF - 89 14 08 - mov [eax+ecx],edx

EDX holds the value of money so it is: mov edx, NEWVAL

It works but however there is one problem. When I restart the game this instruction is located at an another adres. So this adres is changing every time you restart the game.

How can I solve this?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4715

PostPosted: Sun Dec 13, 2015 9:12 pm    Post subject: Reply with quote

An AoB injection. You should always use that over a standard code injection.
Tutorial here.

Just make sure you have a good signature to scan for. Make sure you avoid addresses in it (e.g. if you had mov eax,[00405678], avoid the bytes 78 56 40 00), and avoid excessively large offsets (e.g. mov eax,[ebx+7777]). If you really want to, you can avoid the bytes of the operands all together and only use the bytes of the instructions. You might have a hard time finding a unique AoB, though.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Studio80
Advanced Cheater
Reputation: 2

Joined: 12 Sep 2012
Posts: 83

PostPosted: Sun Dec 13, 2015 9:21 pm    Post subject: Reply with quote

Yes thanks for your answer. It has been a longtime that I had been making game trainers. It seems like I have been missing something. I just read that tutorial and I understand this.

The only problem I have now is with my VB.NET template. I got the template from this forum which had been posted on this topic:

http://forum.cheatengine.org/viewtopic.php?t=557211

I have an AoB injection that works in CE. But in my trainer template it crashes with an exception error:

Arithmetic operation resulted in an overflow.

On this code:
Return (M.BaseAddress.ToInt32 + Integer.Parse(tmp(1), NumberStyles.HexNumber))

This is the piece of code in the trainer:

Mem.Patch(Mem.AobScan("solitaire.exe+0", &HF00000, "FF4008E8????????8B462C"), "909090", "FF4008")

I have been trying to search on the internet on how to solve this but its driving me crazy
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4715

PostPosted: Sun Dec 13, 2015 9:47 pm    Post subject: Reply with quote

Sorry, I don't know any VB.NET, so I'm not sure how much help I can give.

So you have M.BaseAddress.ToInt32. If you're in a 64 bit process and the "base address" is outside the range of a 32 bit value, then I'd guess it would result in an overflow. Maybe you could try somehow printing out what M.BaseAddress.ToInt32 is and what Integer.Parse(...) is? That would be helpful.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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