Sign in to follow this  
Followers 0
damian666

can i hex edit a dll in autoit?

32 posts in this topic

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!!!

Share this post


Link to post
Share on other sites



thanx zedna, but those links are dead man

any way i can get that hex editor?

thanx man

Damian666


and proud of it!!!

Share this post


Link to post
Share on other sites

oh, forget it man, cross posts :D

thanx

damian666


and proud of it!!!

Share this post


Link to post
Share on other sites

i cant read your language man, any change that you can supply me with a english translation?

damian666


and proud of it!!!

Share this post


Link to post
Share on other sites

yeah right, dont you think i didnt try that?

sp3 uxtheme is not yet supported man...

damian666


and proud of it!!!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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!!!

Share this post


Link to post
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?

Share this post


Link to post
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!!!

Share this post


Link to post
Share on other sites

cool, i will take a look man.

thanx

damian666


and proud of it!!!

Share this post


Link to post
Share on other sites

to bad, they only talk about replacing it with a pre hacked file.

thats not what i want, but thanx man.

damian666


and proud of it!!!

Share this post


Link to post
Share on other sites

to bad, they only talk about replacing it with a pre hacked file.

thats not what i want, but thanx man.

damian666

Do you have an example of the modifications that need to be done?

Share this post


Link to post
Share on other sites

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"


and proud of it!!!

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I don't think you need SringToBinary() in there, because you read in the data in Binary form to start with, so there's not a string to convert to binary, it should already be there.

Share this post


Link to post
Share on other sites

hmm, i will try those...

thanx guys, i will let you know.

damian666


and proud of it!!!

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
Sign in to follow this  
Followers 0