Downloads
Overzichten van artikelen en software
Handigheidjes
Gerelateerde sites
downloads  programmeren  scripts
Scripts for easier reverse engineering of assembly
Printer vriendelijke versieDownload artikel als PDF
Door Maurice op 9 oktober 2003 (aangepast op 1 februari 2005) populariteit:
Recently I created a pair of Perl scripts to assist me with a reverse engineering job for a pocketpc application. The scripts parse assembly code which is re-engineered by IDA and create a GraphVis .dot file of it. This .dot file can be used with GraphVis to create a graphical representation of the branches within the code.

There are two kind of scripts: *_sub.pl and *_loc.pl. The first one looks for jumps to other subroutines, the second one looks for jumps to other memory locations. It is recommended not to use a complete assembly program as input for the scripts, but only the part of interest. Or you must use a large ... LARGE... printer. .

What you need
- IDA to reverse engineer assembly code
- GraphVis to create graphs
- The Perl scripts I created (see below)
- Some assembly and Perl skills

GraphVis and Perl can be downloaded for free and are both available for both Windows and Linux platform. However, I used GraphVis under Windows and Perl under Linux. For other tools see http://www.exetools.com.

How to use
1. First reverse engineer the program of your choice with IDA

2. Save only the part of interest to a separate file (for example: )

3. I was only interested in the memory location branching, so I ran pocketty.txt through the sh3_ida2graphvis_loc.pl script:

perl sh3_ida2graphvis_loc.pl < pocketty.txt > graph.dot


4. Then I loaded the graph.dot into GraphVis, using the 'dot' tool under Windows.

GraphVis dot


5. The resulting gif-file is still very big, so only a part is shown below.

Part of resulting gif file


A graphical reprentation works better than ascii-only .

Downloads
Note: these scripts currently only work for SH3 assembly code. However, it is not difficult to change the scripts for other assembly code by editing the functions:

find_condition()
find_conditional_branch()
find_unconditional_branch()

Download sh3_ida2graphvis_sub.pl - Perl script for sub routine branching of IDA SH3 assembly code
Download sh3_ida2graphvis_loc.pl - Perl script for memory location branching of IDA SH3 assembly code

PS: If you have made changes to the scripts to fit them for other assembly languages I like to place them here.


Opmerkingen laatste update

Fixed file downloads
Copyright © 1999-2009 Maurice de Bijl. Dit artikel is gepubliceerd op 2003-10-09, laatste update was op 2005-02-01 in downloads  programmeren  scripts

Was dit artikel nuttig voor je? Help mij dan door met behulp van de toolbar hieronder het artikel te tweeten, een eKudo te geven of toe te voegen aan Hyves, Facebook, Delicous, Digg of andere site. Bedankt!

Printer vriendelijke versieDownload artikel als PDF

Reacties op dit artikel
Er zijn nog geen reacties geplaatst op dit artikel. Je kunt de eerste zijn.

Reactie toevoegen
Een reactie toevoegen is simpel en registratie is niet nodig!

Je IP-adres wordt gelogd, maar niet gepubliceerd, alle reacties hebben een E-mail bevestiging nodig en worden stuk voor stuk gemodereerd. Misbruik wordt niet getolereerd.
Naderhand wijzigen van je reactie is niet mogelijk

Naam:
E-mail adres:

E-mail wordt alleen gebruikt voor bevestiging en zal niet gepubliceerd worden.

Reactie:

Reacties a.u.b. in taal van artikel (Engels).
HTML is niet toegestaan, BB-code wel.

 Populaire tags 
Klik om dicht te klappen
 Zoek trefwoord 
Klik om dicht te klappen
 Volg ons 
Klik om dicht te klappen
 Spreuk van de Dag 
Klik om dicht te klappen
 Webwinkel 
Klik om dicht te klappen
 Getwitter 
Klik om dicht te klappen
Copyright ©
1999-2009 Maurice de Bijl
16197 page requests
Gegenereerd op 10-03-2010 07:07:10 CET in 116.16 msec op srv010106.webreus.nl rev# 1:23M