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 


Finding the assembly for a save game checksum

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

Joined: 15 Mar 2016
Posts: 3

PostPosted: Tue Mar 15, 2016 5:48 pm    Post subject: Finding the assembly for a save game checksum Reply with quote

I tried searching for this but wasn't able to find any similar questions, but sorry if this is a duplicate.

I'm trying to write a save game editor for a game I'm playing. The save has a 32-bit checksum that I need to crack. I have an example where one bit changed and the resulting checksum was an entirely different number, so it's not something I'm going to be able to guess unfortunately.

How would I ago about finding the assembly code that executes to compute this checksum? I am hopeful that I could reverse engineer the algorithm if I can find the assembly, but I don't know where to begin. I'm very new to cheat engine so any high level tips on how to attack this problem would be greatly appreciated. I am familiar with assembly and programming, but not game design or hacking.

Thanks!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4722

PostPosted: Wed Mar 16, 2016 4:31 pm    Post subject: Reply with quote

Add that address to the address list as a 4-byte value.
Right click on it and select "Find out what writes to this address".
Backtrace it from there. Topic involving backtracing here.

You could also choose "Find out what accesses this address", find a read from it, and see how it decrypts that.

Ultimap might also be useful to find the call to encrypt/decrypt stuff.


It might be easier to find the subroutine asking "Hey, is this checksum right?" and always make it return "Yeah, it's fine, just go ahead and load the save". Ultimap would be pretty useful in that case, but you could also try to backtrace the right read(s) from the checksum to find it.

_________________
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
ph00d
How do I cheat?
Reputation: 0

Joined: 15 Mar 2016
Posts: 3

PostPosted: Fri Mar 18, 2016 8:37 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Add that address to the address list as a 4-byte value..


What address? The checksum is in a file on disk. I don't know how to find where the checksum is computed or where it is written to the file. This is kind of what I mean in that I don't know how to get started. I have a file on disk, and clearly it is being written somewhere, but I have no idea how to find the code that writes to it.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Mar 18, 2016 8:50 pm    Post subject: Reply with quote

I would first explain how you determined that the target was performing some sort of integrity check. It wouldn't hurt to also share the name of the target, if possible, or, at least state whether or not the target retrieves any sort of data from a remote server. If a server-sided check is being performed, you may want to reconsider moving forward.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4722

PostPosted: Fri Mar 18, 2016 8:59 pm    Post subject: Reply with quote

Oh. I figured you had found it already in the game's memory. I guess you could try searching around for the same bytes that's on disk.

If you still can't find it, then I guess you could try to backtrace it from whatever routine writes to the file (e.g. WriteFile from Kernel32.dll). Get creative with your use of conditional breakpoints to find it. I really would not recommend doing it like this as it would probably take too much time to make it worthwhile.

Again... if there's a "save" button or something, ultimap should easily be able to find the subroutine that saves data. Look into it; it's probably your best hope.

_________________
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
ph00d
How do I cheat?
Reputation: 0

Joined: 15 Mar 2016
Posts: 3

PostPosted: Wed Mar 23, 2016 5:06 pm    Post subject: Reply with quote

++METHOS wrote:
I would first explain how you determined that the target was performing some sort of integrity check. It wouldn't hurt to also share the name of the target, if possible, or, at least state whether or not the target retrieves any sort of data from a remote server. If a server-sided check is being performed, you may want to reconsider moving forward.


By "target" do you mean what game? This is Just Cause 3. I am guessing that there is an integrity check based on these facts:

1. Many games have such integrity checks to avoid save game tampering.
2. I have analyzed the save files manually by making small changes to my state in the game and looking at the save file with a hex editor. Most of the file changes in predicable ways. For example, I can see bit arrays changing one bit at a time as I finish different tasks. But the first 4 bytes are drastically different for every unique save point.
3. Changing a single bit of the save file, such as one corresponding to completing a particular task, causes the game to erase the save and start over. If there were no integrity check then the game would most likely accept this sort of change.

ParkourPenguin wrote:
Oh. I figured you had found it already in the game's memory. I guess you could try searching around for the same bytes that's on disk.


I have tried this approach. I haven't been able to find the checksum in the game memory. If it's there, it seems to only be there for a very short time. In Just Cause 3 there is no explicit save/load action: it could happen anywhere in about a 1-minute window. So it's hard to nail the checksum down. Also, attaching a debugger immediately crashes the game.

ParkourPenguin wrote:
If you still can't find it, then I guess you could try to backtrace it from whatever routine writes to the file (e.g. WriteFile from Kernel32.dll). Get creative with your use of conditional breakpoints to find it. I really would not recommend doing it like this as it would probably take too much time to make it worthwhile.


I think this is the only approach that will work. I understand how problematic it is but the developers seem to have gone through some lengths to avoid tampering. Thank you for the suggestion.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Mar 23, 2016 5:23 pm    Post subject: Reply with quote

Does JC3 have any online components such as stored stats, ranks, awards etc.? If not, I don't see why there would be any checks on the save file.

When you make changes to the save file, are you doing it while the process is running? Have you tried making changes to the save file while the target process is not running?

Are you using the VEH 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