Giter Club home page Giter Club logo

nao's Introduction

nao

nao(no-meaning assembly omiter) is simple dead code eliminator plugin for IDA pro.

Nao is just a prototype

before:

before

after:

after

Requirement

  • IDAPython
  • Unicorn and Python binding

How to Install Unicorn

Please follow the link.

Download – Unicorn – The ultimate CPU emulator

Installation

Please copy the contents of nao directory in this repository to $IDA_ROOT/plugins folder, or just run nao/nao.py as the IDAPython script. After you install nao.py, you'll see eliminate dead code button on Edit/Plugins menu.

plugins_menu

Usage

Shift-D display eliminated disassemble code from current function.

Licence

GPL v3 license

nao's People

Contributors

mauricekayser avatar n-o-o-n avatar pinksawtooth avatar tkmru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nao's Issues

In unitetest, ImportError: No module named idaapi

nao> python -m unittest discover
E
======================================================================
ERROR: tests.test_eliminate (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_eliminate
Traceback (most recent call last):
  File "C:\Python27\lib\unittest\loader.py", line 254, in _find_tests
    module = self._get_module_from_name(name)
  File "C:\Python27\lib\unittest\loader.py", line 232, in _get_module_from_name
    __import__(name)
  File "C:\Downloads\nao\tests\test_eliminate.py", line 6, in <module>
    from nao import eliminate
  File "C:\Downloads\nao\nao\eliminate.py", line 6, in <module>
    import idaapi
ImportError: No module named idaapi


----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

handle infinite loop

  • use timeout on unicorn
  • hook jxx instruction, get LBR. judge for loop or infinite loop by checking ecx .

Error : String index out of range

Hello,

I tried running this plugin on a CTF binary from GreHack 2015 (This one) and the plugin crashes when I try to run dead code elimination.

Here is the python traceback :

Traceback (most recent call last):
  File "D:/Logiciels/IDA6.8/scripts/nao/nao.py", line 201, in create_view
    view.Create()
  File "D:/Logiciels/IDA6.8/scripts/nao/nao.py", line 104, in Create
    self.load(ea)
  File "D:/Logiciels/IDA6.8/scripts/nao/nao.py", line 118, in load
    if not self.eliminate_deadcode(ea):
  File "D:/Logiciels/IDA6.8/scripts/nao/nao.py", line 149, in eliminate_deadcode
    if b'\x90' != i[1][0]:  # check dead code
IndexError: string index out of range

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.