Git Product home page Git Product logo

edeco's Introduction

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

edeco's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.