Jump to content

can i hex edit a dll in autoit?


Recommended Posts

i got the sp3 from msdn, and it install fine and all...

but my themes wont work, so i have to replace the uxtheme file, which i can do by a modified version ofcourse, but i want to be able to patch it myself on every OS, i will install in a few weeks.

and because i like autoit very much, i want to do it in autoit, but dont know how to begin, or if its even possible?

anyone have a idea?

Damian666

and proud of it!!!
Link to comment
Share on other sites

yeah right, dont you think i didnt try that?

sp3 uxtheme is not yet supported man...

damian666

You can easily get one dll working and use FileInstall() to integrate it into your script.

Link to comment
Share on other sites

yes, i agree, but what if its different on other languages?

i cant replace a dutch version with a english version man.

thats why i need a way to patch it on script runtime...

damian666

edit: and its a messy solution to include all language versions man.

i am looking for a clean solution.

Edited by damian666
and proud of it!!!
Link to comment
Share on other sites

yes, i agree, but what if its different on other languages?

i cant replace a dutch version with a english version man.

thats why i need a way to patch it on script runtime...

damian666

edit: and its a messy solution to include all language versions man.

i am looking for a clean solution.

Let me ask you this, if the file is different across languages, how can you expect to modify it the same way? You will have to supply code to account for all differing versions, no?

Link to comment
Share on other sites

because i think that the hex patch is the same in all, but you are right...

i dont know that yet.

but i rather supply all the code, then the files itself.

that will result in a smaller file.

and its just the way i want it to be man :D

but thanx anyway man.

damian666

and proud of it!!!
Link to comment
Share on other sites

  • Moderators

as far as i know i have to replace "81 EC 88 00 00 00 A1 18"

with "33 F6 8B C6 C9 C2 08 00"

Why not just write to the file through binary then... psuedo code
$hFile = FileOpen(File, 16+2)
$var = FileRead(File)
$strbin = StringToBinary($var)
$strrep = StringReplace($strbin, "81EC88000000A118", "33F68BC6C9C20800")
$binstr = BinaryToString($strrep)
FileWrite(File, $binstr)
FileClose($hFile)
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'm not sure whats happening...I made a copy of my original uxtheme.dll file and used XVI32 (hex editor) to search for the original hex string, which was found at address 1BB6C. I run the script and afterwards the modified string can not be found. Jumping to that address shows the original string still intact.

Here is the code I used:

$infile = "uxtheme.ubk"
$outfile = "test.dll"

;Open original file read only
$hIn = FileOpen($infile, 16)

;Read in contents
$var = FileRead($hIn)

;Close handle to original file
FileClose($hIn)

;Convert to binary code
$strbin = StringToBinary($var)

;Perform replacement
$strrep = StringReplace($strbin, "81EC88000000A118", "33F68BC6C9C20800")

If @ERROR Then
    MsgBox(0,"","Match not found")
Else
    ;Convert binary back to string
    $binstr = BinaryToString($strrep)

    ;Open handle to output file
    $hOut = FileOpen($outfile, 16+2)

    ;Write to output file
    FileWrite($hOut , $binstr)

    ;Close handle to output file
    FileClose($hOut)
EndIf
Edited by weaponx
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...