evol Posted April 23, 2012 Posted April 23, 2012 (edited) Hi guys found this on a blog today and i was just wondering how this works as ive tried the example but i cant get it to work for myself ?Here is the blog entry http://www.sadeghi85.info/articles/using-php-functions-inside-autoit/#more-189If anyone has any ideas or pointer id appreciate it. Edited April 27, 2012 by evol
Skitty Posted April 23, 2012 Posted April 23, 2012 I wouldn't bother with that, it's most likely that whatever you're looking to do will be "doable" in pure autoit script.
evol Posted April 25, 2012 Author Posted April 25, 2012 True but its the setup their using that im interested in, they say......... Download latest version of PHP if you haven’t already done so, we only need "php.exe" and "php5.dll"(or "php5ts.dll"). Then create a text file, name it "index.php" and paste the code below into it: <?php $input = STDIN; $command = ''; while(!feof($input)) { $command .= fread($input, 8192); } eval($command); exit; ?> Now pack all these three files to "php4autoit.7z". Ok ive done that now what ? where does php4autoit.7z go now because they dont tell you and i always get a error on line 17 of there code. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <constants.au3> $rand = "\~" & Random(1, 100000, 1) $_7_zip32_dll_path = @TempDir & "\7-zip32.dll" $files_7z_path = @TempDir & "\php4autoit.7z" $extracted_files_path = @TempDir & $rand DirCreate($extracted_files_path) FileInstall("7-zip32.dll", $_7_zip32_dll_path) FileInstall("php4autoit.7z", $files_7z_path) DllCall($_7_zip32_dll_path, "long", "SevenZip", "HWND", Chr(0), "str", 'x -hide -y "' & $files_7z_path & '" "' & @TempDir & "\" & '" "' & $extracted_files_path & '\"', "str", "", "long", 0) $s = "test" $s = StringToBinary($s, 4) $php = "$au3_text = '" & StringMid($s, 3) & "'; echo base64_encode(hex2bin($au3_text));" $foo = Run($extracted_files_path & "\php.exe -f index.php", "", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($foo, $php) ; Calling with no 2nd arg closes stream StdinWrite($foo) ; Read from child's STDOUT and show $data = '' While True $data &= StdoutRead($foo, false, True) If @error Then ExitLoop Sleep(25) WEnd MsgBox(0, 'base64 encoded text', BinaryToString($data)) DirRemove($extracted_files_path, 1) Exit Remember im still a noob trying to learn thanks.
hannes08 Posted April 25, 2012 Posted April 25, 2012 But you can read the code, right? $files_7z_path = @TempDir & "php4autoit.7z" Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
evol Posted April 26, 2012 Author Posted April 26, 2012 Finally i worked it out its the line....... DllCall($_7_zip32_dll_path, "long", "SevenZip", "HWND", Chr(0), "str", 'x -hide -y "' & $files_7z_path & '" "' & @TempDir & "" & '" "' & $extracted_files_path & '"', "str", "", "long", 0) It should be..... DllCall($_7_zip32_dll_path, "long", "SevenZip", "HWND", Chr(0), "str", 'x -hide -y "' & $files_7z_path & _ '" "' & @TempDir & "" & '" "' & $extracted_files_path & '"', "str", "", "long", 0) There was a _ missing.
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