Wednesday 21 May 2014

Flash application .swf de-compiling

Flash application .swf de-compilation

Flash is the technology developed by Adobe which were first named as Micormedia the flash work like java and .net they have created a flash plyer which execute the compiled application flash applications are developed in different tools like Flash professional and adobe flux they have different platform here we will focus on the .swf platform which is used for application development. The .swf applications are portable and light weight we use the are mostly used for online web application. there are a lot number of applications and games which are developed in flash the miniclip.com is one of the beg resource which contains the .swf appliction more ever the flash appliction development is alo easy as compared to other and gives a rich visual user interface to the users 
 So most of the flash applications are developed in adobe flash professional and gives out put for distribution as .swf. The swf files contains the Action Script and images and others resources.These .swf files are rendered in Web Browser where they execute on the client side at flash player as like the the java JVM. The flash is the big platform for such a types of applications and many of the web sites have them now days flash is an important part of web development

De-compilation of Flash .swf files

Download the JPEXS flash free de-compiler
The de-compiler is free of cost and easy to download
The installation process is straight forward
Double click on .exe and setup process will start
Its pre-requisite is java
Go to java page and download
Install it and run
Now your de-compilation starts
Click on Open
And select your .swf file and Open
Now click on export Export to Fla
And it would be saved as flash professional cs 6 .fla
Which is compressed file

Recompilation of flash .fla of .swf file

the .fla is flash supported file
Open the file in the Flash Professional
Make the changes you needed in its ide
And recompile it to the .swf file
It is an easy process

Android application .apk decompiling

Android application .apk decompiling

Android development is different from general desktop application development it use different languages and package the application as android package. The applications are developed using java and XML mostly. XML is used for designing and java for backed processing it is also the modern application development methodology where program is separated from code it have its own virtual machine for application development is developed by keeping mobile devices resources in mind. Android is a huge platform the Virtual machine used for its application execution is Dalvik VM developed in Google the binaries here for execution are the .apk file so we will focus on how it execute the below figure show the execution of the .apk on android.


Here due to the VM concept the de-compilation process is easy so we will go through de-compilation rather then dissembling.the dissembling and and de-compiling both are easy here because the dissembly code are in form of simula language which is an easy to understand but here we will focus on the de-compilation of the application so below is the process for the purpose of both de-compilation and dissembling.

De-compilation of Android .apk files

Download Apk_OneClick tool from internet using google
Extract the attached achieve to hard disk.
Open the extracted folder.
double-click 'shellext-add.cmd'
It will install the Apk_onclick tool
And will also add the context menu items by right clicking on .apk it would be shown
So here we will de-compile all the .dex files with the it
As we know that .apk is basically an archive for execution
So extract it through 7Zip or any utility

Now Right click again on the and Click on Browse code
Browse the code in jd-gui and save as source project
Place back the code in the extracted apk in its required sequence
Import that in your Eclipse sdk environment and make change as you needed
This is your jd-Gui view which would be familiar to you if you have done of java DE-compilation
Or read out the de java DE-compilation and you will learn
Now you will face som difficulties because the akp don’t give you the full flagged and android importable package so you have to make it by your self or have to make change

Recompilation of Android package to .apk

Make your project formate like of android
Make change through any other editor and save
Use the command line to compile and package the project
Than send it to your phone and check whether you have done the good job or bad
We don’t have showed here a specific way because every one choose and create an easy way in reverse engineering for there self
You can also make the package for eclipse and then compile and make changes in it there but the process would be more time consuming instead of using command line so do it in your way in which you like
We will show you the Dissembling process in future which is the best way for doing it

Sunday 2 March 2014

C# and VB code de-compilation and recompilation


As now days the c# and vb based business application are rapidly increasing due to its easiness and productivity rate developers are moving toward it.it use .net platform for development the .net have the similar architecture design like Java the code is compiled to .exe or .dll library those binary's are basically the MSIL(Microsoft Intermediate Language) or CIL (common Intermediate language) which is then compiled and executed by the .Net Just in time compiler the process is as bellow






In the above diagram we have shown the process of execution of .net based application the application is firstly compiled to to MSIL or CIL from all languages these are saved as .exe or .dll which exhibit the binary format so the code is used to be compiled by the CLR (Common Language Runtime) which will execute the .exe or the .dll on machine based instructions
The .net platform give us many great feature that create once and execute on any machine which have the platform installed here we do not have the need to change a single instruction and we just execute it.The applications are mostly developed in C# which is the newest and advanced easy language which contains all the great features of old languages or we can say that it is developed from the good features of those languages which were in past. .exe and .dll can be both de-compiled easily but disassembling is also possible easily but in first we will discuss the de-compilation process

C# and VB .exe and .dll de-compilation

Ø Go to http://www.ilspy.net/ and download ILSpy
Ø Download the binaries
Ø It would be in .zip formate extract it to some directory
Ø Double click on the ILSpy.exe
Ø The window will pop up
Ø
Ø Next step is to go to File menu Click on Open
Ø Select your required file which may be .exe or .dll and Open it
Ø You will get the following form of your code
Ø

Ø Now the next Step is go to File menu
Ø Click on Save Code

Ø The File would be saved as .csproj
Ø Which is the default project file of C#
Ø Now open it in the Visual Studio remove the errors and Redefine the references of which libraries are not saved in .csproj
Ø Make changes in it which you want

Recompilation of the c# (.csproj) project

As the .csproj is the default C# project file so open it in C# make changes in it for which you have de-compiled the project and remove the errors from it and click on Run.
The process is easy but you know that practice make a man perfect you have to do those things repeatedly and you will learn the fastest ways for doing this there are a lot of other Open Source and closed source tools but the one which we have used (ILSpy) is also good so use it and work on different types of tools and a day will came when you will get your way of doing those things faster
It is Really a funny work and you will get a lot of fun out of it.It will also teach you that how the things work in real so this is your start we have started the thing from De-compilation of Java and C# because if you directly start from the disassembling you will newer enjoy learning it because the disassembling needs more efforts than the de-compilation so practice on it you will get a lot of c# based program from web

Saturday 22 February 2014

Java .jar and .class De-compilation and recompilation


Java .jar and .class de-compilation and recompilation

if you are familiar with java it is too good but hover you must be have to know that how to write program in java.Java is an advanced language it is mostly used in network based application and for cross platform development the java application execution architecture is as follow




Java code which are saved in .java file are compiled to .class file which basically execute on the JVM for distribution the .class files are packaged in .jar archives which also execute on the JVM so now as our binaries must be .class or .jar files so we have to work on those to reverse it the .class file have the name as that of .java and when the .class file is brought to JVM it frist start to execute main() function if it exists(in libraries there are no main() function) So our starting file in java files must be that one which have main.Now we know that .class is byte code executable on JVM files so we are going here to de-compile it to the .java so we can also use the .jar to be de-compiled the same way de-compilation process is below in simple steps

De-compilation of .Jar or .Class files

Ø First of all go to to the site http://java.decompiler.free.fr and download “Java Decompiler
Ø if it does’t exists search in google “Java Decompiler” or Jd-Gui and download it
Ø It is a single stand alone Gui application just double click and open it
Ø An Application will pop up like below one





Ø This is Java Decompiler window
Ø Go to File menu and click on open
Ø Select your .jar or .class file and click on open
Ø And you will see the code as below in Java Decompiler



Ø Go to file and Click on Save all sources if you have opened a .Jar package
Ø The next step is to give name and it would be saved as named given a zip archive


Ø Save it
Ø Now you have successfully de-compiled the byte code
Ø It is now time to make changes in the code according to your needs
Ø Do it and save the .java file
Ø If your file contains too much class and codes you have to use extra tools to get to your required position
Ø Make the changes you want and save file

Recompilation of .java files

The java files compile easily with the java jdk(Java Development Kit) use it and compile your changed .java files. The process is easy but making the required change take a lot of time so you have to do it be patiently. Firstly you have to understand the code many tools can help you in the process there are a lot of free and paid tools those tool also recover the architecture and also to recover the class diagram this is the easiest type of Reverse Engineering you will find a lot of fun as we go further and further read on you can do it and you will learn a lot
Ø Keep in mind java program always start from main(String[] arg) function

Reverse Engineering Intro

Software reverse engineering is the process of recovering a software code from its binary and making changes in it.the software companies like Microsoft,Adobe etc are trying to protect there software's against the Copying or illegal distribution.They provide the online activation process.The protection of there software are there legal right but still people are trying to remove these constraint and redistribute or copy it. The process is done by reverse engineering.
This is illegal but upon they are good we know a lot of country in the world are said 3rd world countries the people of those countries are poor and have right to use those new things in the world, which exists so they use reverse engineering process and get a way to use it.
The Reverse engineering of software involves the study of software, which should be reversed there are some steps in reversing which are bellow.

I. Study of Software
II. Get information from Software
III. De-compiling the Software if possible
IV. Disassembling the Software
V. Making changes in the de-compiled/disassemble code
VI. Recompiling the changed code
VII. Executing and testing

If you are going to crack a platform based full compiled or instruction based binary the you have to knowledge of assembly language.if your binary is a VM(virtual Machine) based then it is easy you can just De-compile and you will see all the original code of the binary.like if it is Java .class or .jar then you will get the .java files We will discuss all of the type using the following sequence.

1. Java .jar and .class de-compilation and recompilation.
2. C# and VB assemblies(.exe and .dll) de-compilation and recompilation.
3. Android .apk de-compilation and recompilation.
4. Flash .swf files de-compilation and recompilation.
5. .Net based assemblies(.exe and .dll) disassembling and Assembling.
6. C++ generic files disassembling and Assembling.
7. Delphi files disassembling and Assembling.

By following the above sequence at the end you will be at the pretty sure to say your self a Software reverse engineering the first type would be an easy and going through toward the harder way here we will use a lot of open source softwares to do the above job you dont have a need to buy a Paid tool but paid are also available try them by your self