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 


Need advice for hacking a binary file

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
EugGNZ
Newbie cheater
Reputation: 0

Joined: 14 Dec 2014
Posts: 12

PostPosted: Mon Jul 13, 2015 8:09 am    Post subject: Need advice for hacking a binary file Reply with quote

Nevermind, solved in here: forum/viewtopic.php?p=5498675&sid=174019403c3434f148142c5c0dc842d4


---------OLD--------------------------------
Hi, I will try to explain (in the best way I can) my situation:

1) I have a game, which I can hack with cheat engine (with auto assemble, e.g. create an space with my instructions then jump, execute and jump back)

2) I found that the parts I want to hack, they are written in a file of the game, like this:
SEE BELOW JPG

What I want:

A permanent hack by changing the file (previously back up), and not to open/load cheat engine every time.

Where I need advice:

I can only hack the file as long as I replace byte by byte (I can't create an space to add more bytes or instructions)

So I was thinking to add the space at the end of the file (36 mb) and hope that I can access via jump (so far i failed to do it)
OR
Create a dll with my assembly code and just make a call to it from the game? (dunno how to do it)
OR
Something else?

by the way the code could be something like this:
Code:
setCameraValues:
   //Get camera value
   mov eax,[ecx-2478]
   //Compare with float 0x43C80000 = 400
   cmp eax,0x43C80000
    jg maxValue
   //Compare with float 43960000 = 300
   cmp eax,0x43960000
    jl minValue
    //something...
    ret
maxValue:
    mov [ecx-2478],0x43C80000
    movss xmm0,[ecx-2478]
    mov [ecx-2478],eax
    ret
minValue:
    mov [ecx-2478],0x43960000
    movss xmm0,[ecx-2478]
    mov [ecx-2478],eax
    ret



cheaten-doubt.jpg
 Description:
 Filesize:  418.84 KB
 Viewed:  5678 Time(s)

cheaten-doubt.jpg


Back to top
View user's profile Send private message
Daijobu
Master Cheater
Reputation: 13

Joined: 05 Feb 2013
Posts: 301
Location: the Netherlands

PostPosted: Mon Jul 13, 2015 3:13 pm    Post subject: Reply with quote

I've not done this before but some thoughts:

Find a code cave (I might be abusing the term here since you're not using Virtual Allocation) long enough for you to store your custom code (in order to prevent shifting addresses).
Then create a jump to your new code and back to it's origin.

You want to replace a space inhabited with only null (0x00) as a your code cave.

I might be entirely mistaken here, clevererererer folk than me will probably correct me.

_________________
Scripts/tables from scratch. Relation to other scripts is coincidental. Use of posted code is credited properly.
Euro Truck Simulator 2 Backwards Compatible Cheat
American Truck Simulator Backwards Compatible Cheat
Back to top
View user's profile Send private message
EugGNZ
Newbie cheater
Reputation: 0

Joined: 14 Dec 2014
Posts: 12

PostPosted: Mon Jul 13, 2015 5:30 pm    Post subject: Reply with quote

Daijobu wrote:
I've not done this before but some thoughts:

Find a code cave (I might be abusing the term here since you're not using Virtual Allocation) long enough for you to store your custom code (in order to prevent shifting addresses).
Then create a jump to your new code and back to it's origin.

You want to replace a space inhabited with only null (0x00) as a your code cave.

I might be entirely mistaken here, clevererererer folk than me will probably correct me.


Thanks for the reply, that is actually what i was doing since a couple of hours, it's all discussed in this forum with this topic:

forum/viewtopic.php?p=5498675&sid=174019403c3434f148142c5c0dc842d4
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