📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  Is Flow Reconstruction the Answer?

Topic created on: April 3, 2007 19:00 CDT by yermak .

I wish to read every instruction in a PE executable.. I have a disassembler engine.  

How do I go about finding the all of the locations where actual instructions (i.e. not padding, garbage, pointers, etc) begin?  The entry point tells me one of these locations, the exports tell me others.. do I now have to follow every branch,call,jump from those locations?  Will that find them all?

Every disassembler program out there has solved this, I'm just not sure what the right search keywords are to locate the documenation.  Thanks!

- yermak

  RolfRolles     April 3, 2007 23:09.01 CDT
The terms you are looking for are "linear sweep" and "recursive traversal".  Here's a paper that describes both.

Be aware though that disassembly is an incomplete process that can give both false negatives and false positives in terms of deciding what is code and what is data (which is why IDA allows you to change this on the fly).  Here's what Cifuentes had to say on the subject:

"Binary code often mixes data and instructions in the same address space in a way that cannot be distinguished given the same representation for data and code in Von Neumann machines.  This problem is exacerbated within direct or indexed jumps, where the target value of the jump is known at runtime, but hard to determine statically.  [...] These problems and more are common to binary-code manipulation tools such as disassemblers and decompilers, as the static parsing of the machine instructions in the binary file is a partially incomplete step given its equivalence to the halting problem [HM79] and hence undecidable in general."

The reference [HM79] is R.N. Horspool and N.Marovac:  An approach to the problem of detranslation of computer programs.

  yermak   April 4, 2007 09:20.05 CDT
Thanks for the info, very helpful.

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit