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 


Best Way to overwrite partial section of file using resource

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dlpb
Advanced Cheater
Reputation: 0

Joined: 11 Dec 2013
Posts: 71

PostPosted: Fri Dec 23, 2016 8:22 pm    Post subject: Best Way to overwrite partial section of file using resource Reply with quote

Code:
 
        R := TResourceStream.Create(HInstance, 'LaunchDat', RT_RCDATA);
        TRY
       
          RPoint:= R.memory;

          if Modlist.Text <> '***' then
          Inc(RPoint, $425F0);

          LauncherFS.Position:= 0;
          LauncherFs.WriteBuffer(RPoint^, $425F0)

        FINALLY
          R.Free;
        END;


I am using Delphi 7. This is how I am doing it. "LauncherFS" opens an executable file for writing [not shown above]. Different sets of bytes will be written depending if "Modlist.text" = *** or not. I noticed that the buffer in Writebuffer can accept a pointer to the data - and that TResourceStream returns the address to the embedded data using .memory.

Is this the best way of doing this?

I could have used external binary file with the needed changes, but chose to place it inside the project exe.

See what I am thinking is, the resource data (in this case a binary file) is in the project exe regardless of if I use "R.create". So question is if it's possible to find the address of that data without using R.Create / .memory ?
Back to top
View user's profile Send private message
dlpb
Advanced Cheater
Reputation: 0

Joined: 11 Dec 2013
Posts: 71

PostPosted: Sun Jan 08, 2017 7:23 pm    Post subject: Reply with quote

Anyone? Sad
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 programming 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