Read Mode

Reverse Engg. a Compiled Exe File | *.Exe to *.Bat - Decompilation

Reverse Engg. a Compiled Exe File | .Exe to .Bat Decompilation

Reverse Engineering a Compiled *.Exe File to *.Bat Again: Yes! You are reading it right. This is Possible. Although, Most of the Beginners and Newbie Batch Programmers Don't know about this trick of Reverse Engineering a Batch file from the Compiled Executable File. Please, keep one thing in mind - That, Not every *.Exe file can be reverse engineered. If you Run a File, And You have doubt that it is a Batch file working behind this *.Exe File. Only, then this trick is possible. Otherwise, There is no real way to Reverse Engineer a compiled *.Exe File.

You may have downloaded a Compiled Exe file from Our Blog ( or any other online source - And Found that file is Compiled to be an *.Exe. And, you can't see its source code and learn the things author has done for a particular output. But, Now - We're gonna tell you a method to Dig out the real chocolate hidden inside the Wrapper. All You need to do is - Remove the wrapper from the sides. (oops! Just kidding! ☺)

How Is this Possible??

The Reality is, There is no original Compiler available for the Batch Files. And, Most of the Batch Compilers available online - just takes your code and Just Wrap them in an EXE File. So, Your Compiled Batch Project will be nothing more than just a Compressed Zip File. Although, It seems Impossible to Take the Real Source Code out From those Files. But, it is not the Case. Keep reading to know about Unlocking this Secret.

Although, There are many Batch Compilers are available out there on the internet. But, Not all works the same way. They Put the wrapper around your batch Project using different colored papers and paper material. I.e. They use different methods and techniques to put the wrapper of *.Exe. So, The trick for unwrapping these *.Exe's will not be same for all of them. So, There will be different Methods to UnCompile them to *.Bat File. Here, We'll talk about the basic and universal methods of Getting the Batch Code from an Executable File. So, Lets start by Looking at them one by one.

Reverse Engineering a Compiled *.Exe File to *.Bat:

Now, We know that the method varies from the compiler to compiler. But, the mostly used Compiler is 'Advanced Bat2Exe Converter' and Somewhat near that Numbers lies - F2KO Batch Compiler. So, We'll mainly focus on these two Batch Compilers in the section below.

#1. Check The 'Temp' Directory:

Yeah! While Running The *.Exe File. Don't let it close. Otherwise, The Wrapper will Delete the Files After the Execution of the Program. So, our main goal is to Don't let the Program Close. And, Untill the Program is running / Opened in your System. You can find the Related items in the "Temp" Folder.
You can simply Navigate to this folder via Pressing - Window + R (Run) >> TYPE "%Temp%" >>  Enter. And, Now You can simply Find a Unusual Folder. Or If you are not sure about the location, Try Pressing F3 and Type "*.Bat" in the Search Field. It will definitely help you in finding the Hidden Batch File. Watch The Video below - To See this method in action.


#2. The UPX Method:

Here, If you've compiled Your Batch File Using the F2KO Batch Compiler. Then you can simply download this small Third party Tool named UPX (The Ultimate Packer for eXecutables). It is a Free, portable, high-performance executable package Creator for several executable formats. Indirectly - It binds the Files, instead of Compiling them. 

After Downloading this Tool to Your Computer. You can Use the following Syntax for Fetching out the original Batch Code from the Executable. Please Note, You can only Get the code by this method - If the Programmer has not used any password while compiling the Program. Otherwise, you Need to Provide the Password too in the Syntax to Grab the Code.

"UPX -d [Your Exe File] -o [Output File]"

After this, you can simply Open the Output File with any text Editor and you'll find the complete unchanged Batch Code there. Isn't it Scary?? So, That's the reason Why - Open Source Is So Awesome that, You don't care about Hiding your Source code. But, You do care about learning new things from the changes ad updation in the code. 

“Computers are useless.  
They can only give you answers.”
-Pablo Picasso

So, With the Happy Note of "Keep Learning" I want to say Good Bye. I'll be again back with awesome concept that will take you to the next level of Batch programming. And, In learning new things about this stupid Box in front of you. 
If You Know any other method, or Found another way of getting the Source Code form The Exe's. Please Do Comment below. We'll be happy to know about it. And, We'll try to add it in the article too. Thanks for Your Time.

Keep Sharing, Keep Learning...
Be Happy, Spread Happiness...

1 comment:

Powered by Blogger.