Giter Club home page Giter Club logo

asm-to-graphs's Introduction

Usage

Build

make -C src asm2graphs

Test

make -C tests check

JSON format

All inclusive graph

{
  "routines": [
  {
    "tag":"start__",
    "label":"start##",
    "type":"user",
    "callees":[
      { "tag":"___A" }
    ],
    "blocks":[
      {
        "tag":"loc_0",
        "label":"loc@0",
        "out_true":"loc_0",
        "out_false":"",
        "last_inst":"jmp",
        "instructions":[
          { "str":"call @$%A" },
          { "str":"jmp loc@0" }
        ],
        "callees":[
          { "tag":"___A" }
        ]
      }
    ]
  }
  ]
}

Call Graph only

The generated call graphs contain a list of routines:

{
  "routines": []
}

Each routines has a tag, a label, a list of callees, and a type:

{
  "tag":"rtn_0",
  "label":"rtn_0",
  "callees":[
    { "tag":"sub_0" }
  ],
  "type":"ours"
}

Tags are the label where all special characters have beeen replaced by _ The type field is one of:

  • idapro: generated by IDA-Pro (label starts with "sub_")
  • ours: generated by our analysis (label starts with "rtn_")
  • user: user defined routine
  • library: routine not present in the code (DLLs)
  • indirect: indirect call (ie: "call [ebp+var]")

Control Flow Graph only

Every routine which type is idapro, ours, or user, a CFG is generated. These are made of a list of blocks.

{
  "blocks":[]
}

Each block has a tag and a label. In addition they have true/false out edges (out_true and out_false) and the last instruction in the block (last_inst) if significant. Finally they have a list of instructions and a list of callees.

{
  "tag":"label_2",
  "label":"label_2",
  "out_true":"loc_1",
  "out_false":"",
  "last_inst":"jmp",
  "instructions":[
    { "str":"call sub_1" },
    { "str":"jmp loc_1" }
  ],
  "callees":[
    { "tag":"sub_1" }
  ]
}

Batch processing

Given a file ("malwares.lst") which contains a list of malware with absolute path:

for malware in `cat malwares.lst`
do
  $MS_ASM_HOME/scripts/generate.sh $malware
  rm -rf ${malware%.*} # to save space
done
tar czf malwares.tar.gz *.tar.gz 

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.