Gerifield Posted November 9, 2008 Share Posted November 9, 2008 This program generate an includable au3 file from a dll.(The result au3 file is like the "SQLite.dll.au3")You can call your "unpacker" like this:_dll_create_AU3NAME("unpacked dll name.dll")For example if you save "mydll.au3", and include it into your program, use this command:_dll_create_mydll("dllname.dll") -> This will create "dllname.dll", and that'll be the original dll.Code:expandcollapse popup$dllname = FileOpenDialog("Open",@Scriptdir,"*.* (*.*)") If FileExists($dllname) Then $au3_out = FileSaveDialog("Save",@Scriptdir,"AU3 (*.au3)",16) Else Exit EndIf If $au3_out <> "" Then $readin = FileOpen($dllname,16) $holder = FileRead($readin) FileClose($readin) $holder=StringReplace($holder,"0x","",1) ;MsgBox(0,"",$holder) $tester = FileOpen("test.txt",17) FileWrite($tester,$holder) FileClose($tester) $reopen = FileOpen("test.txt",0) $au3_gen = FileOpen($au3_out,6) $fname = StringSplit($au3_out,"\") $fn = StringSplit($fname[$fname[0]],".") FileWrite($au3_gen,"Func _dll_create_"&$fn[1]&"($n)"&@CRLF) FileWrite($au3_gen,'$dll_data=""'&@CRLF) $holder2="" While 1 $holder2=FileRead($reopen,600) If @error == -1 Then ;MsgBox(0,"","End Of Read!") ExitLoop EndIf $holder2=StringReplace($holder2,"0x","",1) FileWrite($au3_gen,'$dll_data&="'&$holder2&'"'&@CRLF) $holder2="" WEnd FileClose($reopen) FileDelete("test.txt"); -> If you want the dll binary source, don't delete the test.txt FileWrite($au3_gen,@CRLF&'$writer=FileOpen($n,2)'&@CRLF) FileWrite($au3_gen,'$dll_data = "0x" & $dll_data'&@CRLF) FileWrite($au3_gen,'FileWrite($writer,Binary($dll_data))'&@CRLF) FileWrite($au3_gen,'FileClose($writer)'&@CRLF&'EndFunc') FileClose($au3_gen) EndIfI know, this code works like FileInstall, but I think it'll be useful for somebody.... This program works with any file, BUT the au3 size is bigger, than the original file!(Dll, exe, jpg...)I know, that's not the best way, but it works! Sorry, but i don't speak English very well... :SExamples:SQLite with guiMake AU3 from DLL Link to comment Share on other sites More sharing options...
jvanegmond Posted November 9, 2008 Share Posted November 9, 2008 First of all.. This is redundant. It's like FileInstall as you say. Secondly, you should probably convert the file into Base64 before you write it in your script.. Although I have no doubt your method works, it just seems a bit 'hacky' i guess. github.com/jvanegmond Link to comment Share on other sites More sharing options...
mmavipc Posted November 9, 2008 Share Posted November 9, 2008 what does this do? [size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N Link to comment Share on other sites More sharing options...
Gerifield Posted November 10, 2008 Author Share Posted November 10, 2008 what does this do?It read the dll source in binary mode, and save it into an au3 file.If you include this created file and call the function, it'll create the original file.(You can store the dll files into the exe, like FileInstall.) Sorry, but i don't speak English very well... :SExamples:SQLite with guiMake AU3 from DLL Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now