Codefuser

Patching an offset?

6 posts in this topic

Any ideas on how I can patch an offset of an external file from AutoIt? I want to figure out to overwrite that offset with random data.

Share this post


Link to post
Share on other sites



FileSetPos?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

So something like

$file = FileOpen("file.exe",1)

FileSetPos($file, "0x45FFF", 0)

But then how many characters are in an offset?

Share this post


Link to post
Share on other sites

What is the purpose of your script and please don't come back with an answer that you want to write binary data to an EXE, but rather explain what and why you want to do this?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

It is to patch a few bytes in UPX-ed executables to make it slightly harder to unpack.

Share this post


Link to post
Share on other sites

Good luck with that. Just read the file binary, change the position and write it back to the file.
The helpfile is your friend. When you have issues making it work just post the code you have so we can see what is wrong.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now