Coder Social home page Coder Social logo

thebabush / nampa Goto Github PK

View Code? Open in Web Editor NEW
75.0 9.0 15.0 84 KB

Nampa - FLIRT for (binary) ninjas

License: GNU Lesser General Public License v3.0

Python 99.20% Shell 0.80%
reverse-engineering security signature-matcher binary-analysis binary-ninja binary-ninja-plugin

nampa's Issues

Ref function support

TL;DR first: I have this working for my purposes but it won't fly with Binja as-is. I'm not sure how much time I'll have on this after this week so I wanted to share what I have so far and since r2 can talk to IDA pretty easily, I'm not sure if they'll actually get around to implementing this.

I've got an implementation that appears to work for me but won't do anything for you. I don't have Binary Ninja so I can't do any testing outside of my work on angr which is currently held up by a missing feature in CFG generation, which may not be implemented for a while.

Also, I'm afraid that this relies on REF functions always first being defined as Public functions in the SIG file, meaning they can be identified in the binary ahead of time, but I'm not sure that's always the case. And, with angr, I'm using your code as a module in my own plugin, which is where I do my checks for whether the function was already identified and re-generating the CFG based on the FLIRT signature's claim of what the function should look like; I'm guessing this will have to be done in nampa itself in order to work with Binja.

My Python is more of a pseudo-C so I didn't want to try ham-fisting this into your nice Pythonic implementation.

EDIT: My test binary, lib and signature is here.

Undefined behavior when multiple functions are matched by the same signature

As far as I can tell, the behavior for when multiple functions that match the same signature is not specified. For small functions, it's quite common to encounter multiple matches for the same FLIRT signature (especially for small functions).
It would be optimal to be able to specify whether the matches are ignored or alternate behaviors when multiple functions match a single pattern, however documenting the current behavior in the readme would be a step in the right direction.
IDA lets you specify the behavior (the first suggestion) and was the inspiration for this issue.

Function Addr and Offset

I don't use Binja so I'm not sure how it's handled there but the callback returns the plain addr. The addr only refers to the buffer so the matched function's actual address in the binary is at addr+funk.offset.

Was that intentional?

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.