-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
48 lines (37 loc) · 1.98 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
fuc & xtensa deasm flow detector.
Second incarnation.
Requires Python 2.7+
For current usage, refer to edeco.py -h.
usage: edeco.py [-h] -m {fuc,xtensa} [--cmap CMAP] [-x] [-f FUNCTION]
deasm deco
positional arguments:
deasm input deasm file
deco output decompiled file
required arguments:
-m {fuc,xtensa}, --microcode {fuc,xtensa}
microcode name
optional arguments:
-h, --help show help message and exit
--cmap CMAP code space map file
-x, --no-autodetect Don't autodetect functions
-f FUNCTION, --function FUNCTION
Function address: decimal (123) or hex (0x12ab)
What it does:
Takes a deasm file, analyzes gotos and outputs a nicely formatted flow structure (asm pieces inside C-like braces where appropriate). works with arbitrarily entangled control flow.
Gotchas:
This version of the program does not cope well with goto/break/return - these break hierarchical control flow and it's not really possible to determine whether they are exits in terms of original C-like source code. Therefore they will always be followed until a single exit is found, which might make output messy. The lightest example is switch (first single exit at the end of statement) interpreted as a chain of if{}else{if{}else{...}}, the heaviest is a return from within a loop (first single exit is the end of the function) - total mess.
Some of that might get improved in the future via smart guessing or hiding of control-only code.
What it will do again:
* recognize simple control flow structures
* find call addresses
* generate pseudocode for store instructions
* find and label memory structures
What new it could do:
* analyze data flow
* find branch conditions
* hide ASM blocks only used for control flow (and simplify flow graph further)
* find iowr/iost addresses
* find loop invariants
* become an emulator
* take into account custom memory labels and function names
* become interactive