AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to convert compiled .exe file back to .ahk file?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Jun 23, 2004 9:02 am    Post subject: How to convert compiled .exe file back to .ahk file? Reply with quote

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

PostPosted: Wed Jun 23, 2004 9:19 am    Post subject: Good Question Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Wed Jun 23, 2004 12:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ice



Joined: 23 Jun 2004
Posts: 3

PostPosted: Wed Jun 23, 2004 3:32 pm    Post subject: Reply with quote

good, thanks a lot. please let us know when you release the converter.
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Wed Jun 23, 2004 4:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Wed Jun 23, 2004 7:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Wed Jun 23, 2004 7:15 pm    Post subject: Reply with quote

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! Smile
_________________
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Wed Jun 23, 2004 10:25 pm    Post subject: Reply with quote

With help from Jon Bennett, I've created the exe2ahk utility. It's available at http://www.autohotkey.com/download/Exe2Ahk.exe and I will make mention of it in the help file too.
Back to top
View user's profile Send private message Send e-mail
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Wed Jun 23, 2004 11:13 pm    Post subject: Reply with quote

I checked it on a no-pwd compiled script and it worked great!

kudos to you and Jon!

Very Happy
_________________
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Wed Jun 23, 2004 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Thu Jun 24, 2004 12:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Thu Jun 24, 2004 2:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ice



Joined: 23 Jun 2004
Posts: 3

PostPosted: Thu Jun 24, 2004 3:46 am    Post subject: Reply with quote

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
View user's profile Send private message
delcolt
Guest





PostPosted: Sat Jul 31, 2004 12:22 am    Post subject: Reply with quote

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

PostPosted: Sat Jul 31, 2004 4:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group