Jump to content

Exe2Aut.exe


Recommended Posts

I was looking for the command lines for Aut2Exe and found them without a problem, but i could not find any command lines for Exe2Aut.exe. I tried using the same command lines as Aut2Exe but it just errored out.

Can anyone let me know if Exe2Aut has command lines?

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Allright, i have run into a bit of a problem though. This is the problem:

D:\PROGRA~2\AutoIt3\Beta\Aut2Exe\Aut2Exe.exe /in D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\AUTOIT~1.AU3 /out D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\temp.exe

When i run that command line, Aut2Exe runs and begins to compile temp.exe, but then all of a sudden it crashes. I check the temp dir and both AUTOIT~1.AU3 and temp.exe are there, but when run, temp.exe says that it is unable to open the script file. Any ideas?

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Allright, i have run into a bit of a problem though. This is the problem:

D:\PROGRA~2\AutoIt3\Beta\Aut2Exe\Aut2Exe.exe /in D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\AUTOIT~1.AU3 /out D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\temp.exe

When i run that command line, Aut2Exe runs and begins to compile temp.exe, but then all of a sudden it crashes. I check the temp dir and both AUTOIT~1.AU3 and temp.exe are there, but when run, temp.exe says that it is unable to open the script file. Any ideas?

post the .au3 which is producing the crash or PM me if you don't like to share with others.

I will check where the crash come from :)

Link to comment
Share on other sites

I have tried the same command line with multiple scripts and it always has some sort or memory error.

AppName: aut2exe.exe AppVer: 3.2.1.3 ModName: ntdll.dll

ModVer: 5.2.3790.1830 Offset: 00021e8d

Not sure why, i am going to update my autoit.

[EDIT]

Nope, still errors when i compile it via the command lines, but it is fine if i compile via right click or with SCITE.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Moderators

I have tried the same command line with multiple scripts and it always has some sort or memory error.

AppName: aut2exe.exe AppVer: 3.2.1.3 ModName: ntdll.dll

ModVer: 5.2.3790.1830 Offset: 00021e8d

Not sure why, i am going to update my autoit.

[EDIT]

Nope, still errors when i compile it via the command lines, but it is fine if i compile via right click or with SCITE.

Show exactly how you are running it.

Edit:

Here try this:

Func _CompileDecompile($hFile, $hCompileLocation, $hAut2ExeLocation, $hExe2AutLocation, $sPass = 123)
    RunWait($hAut2ExeLocation & ' /in "' & $hFile & '" /out "' & $hCompileLocation & 'exe' & '" /pass "' & $sPass & '"')
    RunWait($hExe2AutLocation & ' /in "' & $hCompileLocation & 'exe' & '" /out "' & $hCompileLocation & 'au3' & '" /pass "' & $sPass & '"')
    FileDelete($hCompileLocation & 'exe')
EndFunc
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

:) It didn't work. For some reason whenever i try to compile things via command lines, aut2exe crashes, not the script. I get a memory access error, so it is something wrong with autoit itself, not my script.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Moderators

:) It didn't work. For some reason whenever i try to compile things via command lines, aut2exe crashes, not the script. I get a memory access error, so it is something wrong with autoit itself, not my script.

Does EnCodeIt crash when you use it? I use the pseudo code like the above I showed you, however I use a string for the pass.

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

You mean Encodeit 2.0? Nope, no problem with it. The only time Aut2Exe crashes is when i call it with command lines from an autoit script to compile another autoit script

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Moderators

You mean Encodeit 2.0? Nope, no problem with it. The only time Aut2Exe crashes is when i call it with command lines from an autoit script to compile another autoit script

Weird... can you show me "exactly" how you're calling it, the only thing different in mine, is I don't pass the parameters, they are local for me, and my pass is a litteral string.

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 am calling it like this

$Au2Exe = @ProgramFilesDir & '\AutoIt3\Beta'
$Exe2Aut  = @ProgramFilesDir & '\AutoIt3'

$tempname ="temp.au3"
$filename = @tempdir & "\" & $tempname

_CompileDecompile($filename,@TempDir & "\temp.exe",$Au2Exe & '\Aut2Exe\Aut2Exe.exe',$Exe2Aut & '\Extras\Exe2Aut\Exe2Aut.exe')

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Moderators

you have to use the /pass ... take out the parameter, and make it a plain string.

'" /pass "123"')

Or even try this:

'" /pass "1"')
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

Nope, Aut2Exe crashed. It had a memory error and i got the dialogue asking me if i would like to debug the process. Not anything wrong with my script, but with autoit, perhaps a major bug.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Moderators

Nope, Aut2Exe crashed. It had a memory error and i got the dialogue asking me if i would like to debug the process. Not anything wrong with my script, but with autoit, perhaps a major bug.

Can't be autoit if it's encodeit worked for you :)

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

Nah, it isn't autoit itself, it is the autoit compiler that has the bug. It keeps crashing with memory errors. Running the script normally is no problem and compiling it normally is no problem either. It is only a problem when i compile it via command lines in my script.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Developers

Nah, it isn't autoit itself, it is the autoit compiler that has the bug. It keeps crashing with memory errors. Running the script normally is no problem and compiling it normally is no problem either. It is only a problem when i compile it via command lines in my script.

You mentioned it works fine from SciTE...

How do you think its done AutoIt3Wrapper (SciTE)? :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I think the problem is how the command line is invoked. Perhaps the directory names are too long or the current directory path is too long and awkward causing autoit to crash. I am not sure why it is doing this. When i write bat files with command lines and place them in the same folder as Aut2Exe it compiles the scripts fine, but when i try to do it through another script deep inside the My Documents subdirectories, it crashes.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

  • Developers

I think the problem is how the command line is invoked. Perhaps the directory names are too long or the current directory path is too long and awkward causing autoit to crash. I am not sure why it is doing this. When i write bat files with command lines and place them in the same folder as Aut2Exe it compiles the scripts fine, but when i try to do it through another script deep inside the My Documents subdirectories, it crashes.

You will have to provide us with the exact script that runs aut2exe and the script that causes it to crash (Unless any example crashes.....) Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Not a problem. I am doing this for my Script Stripper which is completely open source.

#include <array.au3>
#include <file.au3>
#include <GUIConstants.au3>
Opt("TrayIconDebug", 1)

Global $text = ''
Global $Input1
Global $filename
Global $av_stringtxt, $file, $Checkbox3, $tempname
;~ MsgBox(64,"Important","To properly use this program you must first compile your autoit script.  Once compiled use Exe2Aut to then decompile the script back to a .au3 file.  Then open the new decompiled .au3 script with this script stripper." & @CRLF & @CRLF & "If you don't do this no error will occur but all the junk remaining in the include files will still be present when you re-compile it.")
;~ $filename = FileOpenDialog("Open...","", "AutoIt Script (*.au3)",3)

; == GUI generated with Koda ==
$Form1 = GUICreate("Script Stripper v3.0.0.1 - By The Kandie Man", 484, 150, 197, 137)
$Input1 = GUICtrlCreateInput("", 16, 24, 345, 21, -1, $WS_EX_CLIENTEDGE)
$Button1 = GUICtrlCreateButton("Browse", 392, 24, 73, 25)
GUICtrlCreateLabel("Select Script to Strip:", 16, 8, 103, 17)
$Group1 = GUICtrlCreateGroup("Options", 16, 56, 457, 89)
$Checkbox1 = GUICtrlCreateCheckbox("Remove Comments", 32, 72, 129, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetState(-1, $GUI_DISABLE)
$Checkbox2 = GUICtrlCreateCheckbox("Remove Unused Functions", 32, 96, 161, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetState(-1, $GUI_DISABLE)
$Checkbox4 = GUICtrlCreateCheckbox("Remove Unused Global Variables", 32, 120, 180, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlSetState(-1, $GUI_DISABLE)
$Checkbox3 = GUICtrlCreateCheckbox("Use Beta Includes", 192, 72, 153, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateLabel("Number of Passes:", 192, 96, 93, 17)
$input2 = GUICtrlCreateInput ("5",285, 93, 38, 20, 8192)
$updown = GUICtrlCreateUpdown($input2)
GUICtrlSetLimit($input2,999,1)
$Button2 = GUICtrlCreateButton("Strip Script", 384, 96, 73, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1
        $v_filename = FileOpenDialog("Open",@ScriptDir,"AutoIt v3 (*.au3)",3)
        If NOT @error And FileExists($v_filename) Then
            GUICtrlSetData($Input1,$v_filename)
        Endif
    Case $msg = $Button2
        StripScript()
        ;;;;;;;
    EndSelect
Wend

Func StripScript()
    $origfilename = GUICtrlRead($Input1)
    Local $szDrive, $szDir, $szFName, $szExt
    _PathSplit($origfilename,$szDrive, $szDir, $szFName, $szExt)
    $tempname ="temp.au3"
    $filename = @tempdir & "\" & $tempname 
    FileCopy($origfilename,$filename,1)

$readinput2 = GUICtrlRead($input2)
$timestamp = TimerInit()
If Not $readinput2 >= 1 And Not $readinput2 <= 99 Then
    $readinput2 = 5
Endif
If Not AddIncludes() Then Return 0
For $x = 1 to $readinput2
    $av_stringtxt = 0
    $text = ""
    StripEngine()
Next
ClipPut(_ArrayToString($av_stringtxt,@LF,1))
$i_secondstocomplete = Int(TimerDiff($timestamp)/1000)

MsgBox(64,"Done!","The script took " & $i_secondstocomplete & " seconds to strip and it has been placed on your clipboard.  To get the script use a text editor such as SCITE and paste the script into it." & @CRLF & @CRLF & "Notepad WILL NOT CORRECTLY DISPLAY THE NEW CODE.  You will have to use a more advanced text editor, such as SCITE.")
EndFunc

Func StripEngine()
    
    $file = FileOpen($filename, 0)
; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Return 0
EndIf
local $i_lines = _FileCountLines( $filename )
$totalsteps = 5
ProgressOn("Working...", "Step 1 of " & $totalsteps, "Stripping Lines",-1,-1,16 )
; Read in lines of text until the EOF is reached
Local $i_linecounter = 1
$cs = 0
While 1
    ProgressSet(($i_linecounter/$i_lines)*100)
  $line = FileReadLine($file)
  If @error = -1 Then ExitLoop
  $line = StringStripWS($line, 3)
  If StringLeft($line,15)='#comments-end' or StringLeft($line,3)='#ce' Then
    $cs = 0
    ContinueLoop  ;prevent #ce from appearing in the output
  EndIf
  If $cs = 0 And $line <> '' And StringLeft($line,1) <> ';' Then
    If StringLeft($line,15)='#comments-start' or StringLeft($line,3)='#cs' Then
      $cs = 1
    Else
      ; Check for line contiutations; if found, remove them
      If StringRight($line, 1) = '_' Then ;get rest of line continued line
        $full = "" ;build up the entire line without line continues
        While 1
          $full = StringStripWS( $full & StringStripWS($line,3) , 3 )
          If StringRight($full,1) = '_' Then $full = StringTrimRight($full,1)
          $line = FileReadLine($file)
          If @error or StringRight(StringStripWS($line,3) , 1) <> '_' Then
            $text = $text & $full & StringStripWS($line,3)
            $line = '' ;prevents $text = $text & $line & @LF from duplicating text
            ExitLoop
          EndIf
        WEnd
      EndIf
      $text = $text & $line & @LF
    EndIf
EndIf
$i_linecounter += 1
Wend
ProgressSet(100)
;~ ProgressOff()
$av_stringtxt = Stringsplit($text,@LF)
ProgressSet ( 0, "Stripping Code Line Comments","Step 2 of " &$totalsteps)
For $i_commentcount = 1 to UBound($av_stringtxt)-1
    $semipos = StringInStr($av_stringtxt[$i_commentcount],";",-1)
;~  ProgressSet ( Int($i_commentcount/$av_stringtxt*100), "Stripping Code Line Comments","Step 2 of 3")
    If $semipos >0 Then
        If StringInStr($av_stringtxt[$i_commentcount],"'",0,-1) < $semipos AND StringInStr($av_stringtxt[$i_commentcount],'"',0,-1) < $semipos Then
            $av_stringtxt[$i_commentcount] = StringLeft($av_stringtxt[$i_commentcount],$semipos-1)
        Endif
    EndIf
Next
ProgressSet ( 100, "Stripping Code Line Comments","Step 2 of " & $totalsteps)
sleep(50)
ProgressSet ( 0, "Stripping Functions","Step 3 of "&$totalsteps)
$ubound  = UBound($av_stringtxt)
$strippedtext = StringStripWS($text,8)
For $i_counter = 1 to $ubound-1
    ProgressSet ( Int($i_counter/$ubound*100))
;~  ConsoleWrite($i_counter &"|"& $ubound&@LF)
    If $i_counter = $ubound Then Exitloop
    If  StringLeft($av_stringtxt[$i_counter],5) = "Func " Then
        $i_LPpos = StringInStr($av_stringtxt[$i_counter],"(")
        If $i_LPpos = 0 Then ContinueLoop
        $i_funcnamelen = $i_LPpos - (5)
        $s_Funcname = StringMid($av_stringtxt[$i_counter],5,$i_funcnamelen)
        $s_Funcname = StringStripWS($s_Funcname,8)
        $firstpos = StringInStr($strippedtext,$s_Funcname & "(")
        $secondpos = StringInStr($strippedtext,$s_Funcname &"(",0,-1)
;~      FileWriteLine("functions.log",$s_Funcname & "|" & $firstpos & "|" & $secondpos)
;~      ConsoleWrite($s_Funcname & "|" & $firstpos & "|" & $secondpos &@LF)
        If $firstpos = $secondpos Then
            $i_counter2 = $i_counter
            _ArrayDelete ( $av_stringtxt, $i_counter2)
;~          Msgbox(0,"OMG","Only one instance of this function!" & @CRLF & $s_Funcname)
;~          FileWriteLine("debuglog.txt",$s_Funcname)
            While 1
;~              $i_counter2 += 1
;~              Msgbox(0,$i_counter2, UBound($av_stringtxt))
;~              _ArrayDisplay($av_stringtxt,"array")
                If $i_counter2 = UBound($av_stringtxt) Then Exitloop
                If StringInStr($av_stringtxt[$i_counter2],"EndFunc") Then
                    _ArrayDelete ($av_stringtxt, $i_counter2)
                    ExitLoop
                Endif
                _ArrayDelete ($av_stringtxt, $i_counter2)
            Wend
            $ubound  = UBound($av_stringtxt)
        EndIf
;~      Msgbox(0,"Number",$i_LPpos & "|" &$i_Funcpos & "|" & $i_funcnamelen)
;~      Msgbox(0,"Func Name:",'"' & StringStripWS($s_Funcname,8) & '"')
    Endif
Next
For $2passcounter = 4 to 5
    $newtext = _ArrayToString($av_stringtxt,@LF)
    $varcounter = 1 
While 1
    $varcounter +=1
    If $varcounter = UBound($av_stringtxt) Then Exitloop
    ProgressSet(INT($varcounter/UBound($av_stringtxt)*100),"Stripping Unused Variables","Step " & $2passcounter & " of " & $totalsteps)
    $trimedline = StringStripWS($av_stringtxt[$varcounter],8)
;~  Msgbox(0,"Info",$trimedline)
    If Stringleft($trimedline,11) = "GlobalConst" Then
;~      ConsoleWrite($trimedline &@LF)
        $equalpos = StringinStr($trimedline,"=")
        $varname = StringMid($trimedline,12,$equalpos - 12)
        $firstpos = StringInStr($newtext,$varname)
        $secondpos = StringInStr($newtext,$varname,0,-1)
;~      ConsoleWrite($varname & "|"& $firstpos & "|"& $secondpos & @LF)
        If $firstpos = $secondpos Then
            _ArrayDelete($av_stringtxt,$varcounter)
            $varcounter -=1
        Endif
    EndIf
Wend
Next
ProgressOff()
FileClose($file)
$file = FileOpen($filename,2)
FileWrite($file,_ArrayToString($av_stringtxt,@LF,1))
FileClose($file)

EndFunc

Func _DirAutoIt($version = 'Prod')
    Switch $version
        Case 'Prod'
            Switch True
                Case FileExists(@ProgramFilesDir & '\AutoIt3')
                    Return @ProgramFilesDir & '\AutoIt3'
                Case RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
                    Return RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
            EndSwitch
        Case 'Beta'
            Switch True
                Case FileExists(@ProgramFilesDir & '\AutoIt3\Beta')
                    Return @ProgramFilesDir & '\AutoIt3\Beta'
                Case RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir')
                    Return RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'betaInstallDir')
            EndSwitch
    EndSwitch
    If $version = 'Prod' Then $version = 'Public Release'    
    Return FileSelectFolder('Locate AutoIt Directory  (' & $version & ' version)', @HomeDrive)
EndFunc

Func AddIncludes()
    local $v_line
    If GUICtrlREad($Checkbox3) = $GUI_CHECKED Then
        $Au2Exe = _DirAutoIt("Beta")
    Else
        $Au2Exe = _DirAutoIt("Prod")
    Endif
    If Not FileExists($Au2Exe) Then
        $Au2Exe = FileOpenDialog('Select Autoit2Exe Executable',@HomeDrive,'Executables (*.exe)','Aut2exe.exe')
    Endif
        $Exe2Aut = _DirAutoIt("Prod")
    #cs
    Method 3 - The Command Line
        The Aut2Exe.exe program can be run from the command line as follows:

        Aut2exe.exe /in <infile.au3> [/out <outfile.exe>] [/icon <iconfile.ico>] [/nodecompile] [/comp 0-4] [/pass <passphrase>]


        Long filenames should be enclosed in double-quotes like  "C:\Program Files\Test\test.au3".  If no "out" file is given the input filename is used with a .exe extension.
    #ce

    ConsoleWrite($Au2Exe & '\Aut2Exe\Aut2Exe.exe /in "' & $filename & '" /out "' & @TempDir & '\temp.exe"')
;~  Runwait ($Au2Exe & '\Aut2Exe\Aut2Exe.exe /in "' & $filename & '" /out "' & $filename & '.exe" /pass "asdf"')
;~  Run(@ComSpec & " /c " & '"' & $Au2Exe & '\Aut2Exe\Aut2Exe.exe" /in "' & $filename & '" /out "' & @HomeDrive & '\temp.exe"')
    $batcommand = '"' & $Au2Exe & '\Aut2Exe\Aut2Exe.exe" /in "' & $filename & '" /out "' & @TempDir & '\temp.exe"'
    $tempbat = @tempdir & "\compile.bat"
    Filedelete($tempbat)
    FileWrite($tempbat,$batcommand)
    Run($tempbat)
    sleep(500)
    While ProcessExists("Aut2Exe.exe")
        sleep(20)
    WEnd
;~  Run($Au2Exe & '\Aut2Exe\Aut2Exe.exe /in "' & $filename & '" /out "' & @TempDir & '\temp.exe"')
;~  Runwait (FileGetShortName($Au2Exe & '\Aut2Exe\Aut2Exe.exe') & ' /in ' & FileGetShortName($filename) & ' /out ' & FileGetShortName(@TempDir & '\temp.exe'))
;~ Runwait (FileGetShortName($Au2Exe & '\Aut2Exe\Aut2Exe.exe') & ' /in ' & $tempname & ' /out ' & $tempname & ".exe",@TempDir)
        
;~      sleep(5000)
;~      msgbox(0,"","")
        FileDelete($filename )
;~  Runwait($Exe2Aut & '\Extras\Exe2Aut\Exe2Aut.exe /in "' & $filename & '.exe" /out "' & $filename & '" /pass "asdf"')
    Runwait($Exe2Aut & '\Extras\Exe2Aut\Exe2Aut.exe /in "' & @TempDir & '\temp.exe" /out "' & $filename & '"')  

#cs
        _CompileDecompile($filename,@TempDir & "\temp.exe",$Au2Exe & '\Aut2Exe\Aut2Exe.exe',$Exe2Aut & '\Extras\Exe2Aut\Exe2Aut.exe',1)
#ce
        If FileExists(@TempDir & "\temp.exe" & "au3") Then
            Msgbox(0,"Success","It converted the .exe back to a script")
            Return 1
        Else
            Msgbox(0,"Failure","It did not convert the .exe to a script")
            Return 0
        Endif
        
EndFunc
    
Func _CompileDecompile($hFile, $hCompileLocation, $hAut2ExeLocation, $hExe2AutLocation, $sPass = 123)
    RunWait($hAut2ExeLocation & ' /in "' & $hFile & '" /out "' & $hCompileLocation & 'exe' & '" /pass "' & $sPass & '"')
    RunWait($hExe2AutLocation & ' /in "' & $hCompileLocation & 'exe' & '" /out "' & $hCompileLocation & 'au3' & '" /pass "' & $sPass & '"')
    FileDelete($hCompileLocation & 'exe')
EndFunc

Pardon the mess, i am in the process of debuging the script.

Any script that i attempt to compile seems to crash, so no point in sending you a test script.

[EDIT]

This is what i get when i try to compile using Aut2Exe using command lines in my script.

Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

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