| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Jun 23, 2004 9:02 am Post subject: How to convert compiled .exe file back to .ahk file? |
|
|
| I lost my script file .ahk, but the compiled .exe file is good. So how can I convert it back to script file, like Autoit 2, exe2aut.exe. Thanks a lot. |
|
| Back to top |
|
 |
ahk_man
Joined: 20 Jun 2004 Posts: 39
|
Posted: Wed Jun 23, 2004 9:19 am Post subject: Good Question |
|
|
| Hey, Good question! I wanted to ask the same question two days ago, but I forgot. I would love to hear it from the Xpert. Thank You. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Wed Jun 23, 2004 12:15 pm Post subject: |
|
|
| It won't work unless you know the original password it was compiled with. Assuming you do know, I'll try to make a simple converter. |
|
| Back to top |
|
 |
ice
Joined: 23 Jun 2004 Posts: 3
|
Posted: Wed Jun 23, 2004 3:32 pm Post subject: |
|
|
| good, thanks a lot. please let us know when you release the converter. |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Wed Jun 23, 2004 4:40 pm Post subject: |
|
|
though i can't help with that particular script, but it helps have this function in your scripts.
IfEqual, 1, password
{
FileInstall, scriptname, %a_scriptdir%\source.ahk
ExitApp
}
(scriptname is the name of the script which contains this code) _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Wed Jun 23, 2004 7:07 pm Post subject: |
|
|
That's a great tip, Rajat. Doing it that way also preserves your comments, since they are normally stripped when you compile the script. The only thing it won't do is automatically save copies of your #included files (if any).
| Quote: | | I lost my script file .ahk, but the compiled .exe file is good. |
I'm having trouble creating the script decompiler due to the proprietary nature of the AutoIt encryption. Does your EXE have a custom icon? If so, I think I can decompile it manually due to a quirk in the way the AutoIt decompiler works. So e-mail it to support@autohotkey.com in a ZIP file if it has a custom icon and it's contents aren't sensitive.
For the next AHK release, I'm going to try to change things so that the AutoIt decompiler will always work. Eventually, I'd like to switch to something open source such as the NSIS Installer routines, which offer better compression. |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Wed Jun 23, 2004 7:15 pm Post subject: |
|
|
| Quote: | | The only thing it won't do is automatically save copies of your #included files (if any). |
ok, thanx for bringing that to my notice!  _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Wed Jun 23, 2004 11:13 pm Post subject: |
|
|
I checked it on a no-pwd compiled script and it worked great!
kudos to you and Jon!
 _________________
 |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Wed Jun 23, 2004 11:32 pm Post subject: |
|
|
here's an easy way around:
IfEqual, 1, password
{
FileInstall, scriptname, %a_scriptdir%\source.ahk
FileInstall, includefile1, %a_scriptdir%\includefile1source.ahk
FileInstall, includefile2, %a_scriptdir%\includefile2source.ahk
ExitApp
}
useful if one wants to save the comments. _________________
 |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Thu Jun 24, 2004 12:53 am Post subject: |
|
|
Tested on a password compiled script, and that also worked great. One note to users wanting to test this program, if a .AHK file already exists with the same name as the .EXE and you decompile the EXE with this utility it will overwrite the existing .AHK file.
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Thu Jun 24, 2004 2:33 am Post subject: |
|
|
| Quote: | | it will overwrite the existing .AHK file. |
Thanks, I changed it so that it will use a .new extension if the .ahk file already exists. |
|
| Back to top |
|
 |
ice
Joined: 23 Jun 2004 Posts: 3
|
Posted: Thu Jun 24, 2004 3:46 am Post subject: |
|
|
| thank you all very much. it works well, and I got back my script files. It's really useful for me to do some automation PC support. I love it. |
|
| Back to top |
|
 |
delcolt Guest
|
Posted: Sat Jul 31, 2004 12:22 am Post subject: |
|
|
| im experiencing difficulties :S when i try to open the file, it goes black, like command prompt and then it says something and immediatly closes |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1717
|
Posted: Sat Jul 31, 2004 4:54 am Post subject: |
|
|
ahh, ppl are so used to GUI!
actually you've to use it from cmd prompt. try opening a cmd prompt and run it from there or drop exe2ahk on it and press enter in cmd prompt. _________________
 |
|
| Back to top |
|
 |
|