Battery Posted May 27, 2010 Posted May 27, 2010 Alright, I want to patch a file (.exe) and add to it whatever I want, for example: Add to a file a messagebox, like, everytime you open the file, you have to click OK on the message box and then it opens. Sorry if it's hard to understand, but I really need your help here, thanks guys.
zorphnog Posted May 27, 2010 Posted May 27, 2010 You can't just add code to an arbitrary executable file. You need the the source code of the compiled executable in order to modify it in the way you are suggesting.
Battery Posted May 27, 2010 Author Posted May 27, 2010 So how come some programs can patch a file and add their splash screen into it?
zorphnog Posted May 27, 2010 Posted May 27, 2010 Because they have the source code! You can do anything if you have the source code.
Battery Posted May 27, 2010 Author Posted May 27, 2010 I know, I'm not an idiot, I mean like: WinLicense, this program's demo will patch any file, when you open the file, it will make a short splash screen of WinLicense and then the program opens.
joakim Posted May 27, 2010 Posted May 27, 2010 You will need to know some assembler/reversing to inject code into executables. Here's a beginners tute; http://home.inf.fh-rhein-sieg.de/~ikarim2s/how2injectcode/code_inject.html This forum might not be the right place for such things.. Joakim
Battery Posted May 28, 2010 Author Posted May 28, 2010 Yeah well, that's what I want, but I wonder if can I do it with autoit?
Tvern Posted May 28, 2010 Posted May 28, 2010 Yeas it's psooible, but there is other software more suitable to do so. If you require help doing it in autoit it might be hard for the following reasons: 1. Most people on the forum don't know the first thing about this kind of code injection. (I know I don't) 2. The potential for malicious use is probably rather high.
Battery Posted May 28, 2010 Author Posted May 28, 2010 Well, can you explain more about the "other software more suitable to do so"?
Tvern Posted May 28, 2010 Posted May 28, 2010 I only tried this type of thing once a long time ago, but the software shown in the link seems to do exactly what you want and I believe it can also be done using Cheatengine.
joakim Posted May 28, 2010 Posted May 28, 2010 I don't think there exist a simple solution to code injection. The tools you need are; 1. Hex editor (WinHex) 2. Disassembler (IDA) 3. Debugger (Ollydbg, IDA) 4. PE editor (PEiD) 5. Knowledge of assembler/reversing and the win api. Some of the above are not freeware though. Actually the patcher itself can be written in autoit, but figuring out the patch must be done through either or all of the above-mentioned tools. Joakim
Moderators JLogan3o13 Posted May 28, 2010 Moderators Posted May 28, 2010 I'm not an expert with AutoIT, but I would think this would depend mainly upon the executable you're wanting to "add" to. If it is a commonly installed windows app (Notepad for example), that you expect to already be on the system, you could simply write the script to do what you want, and then call the executable. Something like:$message = "Loading... "SplashTextOn("Starting Application", $message, 500, 50)For $x = 1 to 10 $message = $message & $x & " " ControlSetText("Starting Application", "", "Static1", $message) sleep(300)Next$var = Msgbox(262144+4, "Accept", "This application is only for company employees. Click Yes if you wish to continue or no to exit.") If $var = 6 Then Run( "Notepad" ) Else Exit EndIfIf, however, it is an executable you are delivering with the splash screen/msgbox, etc., you might try an open source wrapper utility such as QuickBFC. With that, you can launch your first executable, and then whenever the conditions are met, use it to call the second. QuickBFC (I know there are others, but it is what I use) will wrap both executables into a single .exe for you. Hope this helps. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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