Coder Social home page Coder Social logo

0rshemesh / idalibcautoflags Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0xmirasio/idalibcautoflags

0.0 0.0 0.0 250 KB

a simple plugin that replace decimals flags with enum on standard libc function

Python 70.31% C 28.61% Makefile 1.08%

idalibcautoflags's Introduction

AutoLibcFlags

AutoLibcFlags is a IDApro plugin that will automatically replace the flags in libc standard functions with enum.
The plugin support also custom functions, See #Adding new functions. Only X64 is supported for the moment.

WARNING

This is a simple POC project. This project isn't very usefull since enum flag will change following source and compilator so i will only track recent linux source.

REQUIRE IDA7.X+ OR SUPERIOR

All libc standard enum which are supported are in enum/ folder. Feel free to pull requests to add new functions.

Preview

Install

git clone [email protected]:0xMirasio/IDALibcAutoFlags.git
cd IDALibcAutoFlags 
python3 install.py

Usage

Press CTRL+Shit+F1 or Edit->Plugins->IDALibcAutoFlags to use plugins! (+F5 to refresh page for decompilation output)

Add new functions

edit functions.json file.
You need to add the following format:
{"function_name": [ [index, register_associated_enum], [index, register_associated_enum], ...]}

For example, SendCrypto(&buf, &output, O_RDONLY, USE_SSL) -> the flags are on index 2 and 3. O_RDONLY come from fcntl.h and USE_SSL from customssl.h headers.

We will have:
{
"SendCrypto":
[2,"fcntl"],
[3, "customssl"]
}

You must create a enumFile in enum/ with the following format:

1 USE_SSL

That's it ! You can also use the parseHeaders.py script in scripts for autoParse C header file and generate the corresponding file required.
(Small modifications may be required, just a develloper helper script)

Bug and limitations

Only x64 classical is supported for the moment. Bug and fails will occur on others platforms. Lot of missing flags

idalibcautoflags's People

Contributors

0xmirasio avatar 0rshemesh 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.