GithubHelp home page GithubHelp logo

75f2cc / idacraft Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infectedpacket/idacraft

0.0 1.0 0.0 30 KB

Wrapper class for IDAPython. Regroups various useful functions for reverse engineering of binaries.

Python 100.00%

idacraft's Introduction

What is Enoki ?

The Enoki script is a wrapper class for IDAPython. It regroups various useful functions for reverse engineering of non-standard and/or uncommon binaries. Many of the scripts currently available online are geared towards malware analysis of Windows Portable Executable (PE) files and as such, most of their functionalities are geared toward Intel-based systems and perform many tasks to detect or deobfuscate malicious, well-known file standards. Enoki seeks to provide a set of basic functions for analysis of binaries, memory maps or other non-malware oriented files for reverse engineering purposes.

Summary

The Enoki script is a wrapper around many IDAPython functions and is designed for analysts conducting reverse engineering on non-standard and uncommon files such as firmware of embedded devices or simply plain unknown files for ICS systems. Enoki provides additional shortcut functions for extracting, searching and analyzing machines code, useful when IDA as issue parsing or detecting the actual processor.

Usage

To use Enoki with IDA, simply load the enoki.py file into IDA. An instance of the Enoki object will automatically be created in the e variable or you can create your own instance using the following command in the interpreter:

e = Enoki()

Simply call any of the function required using the instance, for example:

Python>hex(e.current_file_offset())
0x74fc

Examples

This section provides some example of the functionalities provded by the Enoki script. More details can be found by consulting the wiki of the project.

Find a byte string

One of the function provided by Enoki is the find_byte_string, which allow the analyst to search for specific sequence of bytes or words in the machine code. The function will return all locations where the specific byte string has been found in the range searched.

Python>e.find_byte_string(ScreenEA(), ScreenEA() + 0x1000, "7980 ????")
[150, 155, 173, 198, 208]

If you need the output in hexadecimal addresses, simply wrap the result using the hex() function:

Python>[hex(i) for i in e.find_byte_string(ScreenEA(), ScreenEA() + 0x1000, "7980 ????")]
['0x96', '0x9b', '0xad', '0xc6', '0xd0']

Compare two code ranges for similarity

Another functionality available is to compare the similarity of two code segments via the compare_code function. This function will take two arrays of opcodes or assembly instructions and calculate the similarity of the sequence. In the example below, the similarity is only 11%, meaning the 2 code segments are quite different.

Python>c1 = e.get_words_between(0x2C00, 0x2CFF)
Python>c2 = e.get_words_between(0x8000, 0x80FF)
Python>e.compare_code(c1, c2)
0.11328125

Other functions are available within Enoki and more details can be found in the comments of the script or in the future wiki of the project.

References

If you find this script useful for your projects or research, please add a reference or link to this project to help make it better.

idacraft's People

Contributors

infectedpacket avatar

Watchers

 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.