Git Product home page Git Product logo

fentanyl's Introduction

Fentanyl

Introduction

Fentanyl is an IDAPython script that makes patching significantly easier. Fentanyl lets you patch from IDA Pro or Demo easily. Most patches can be done without touching a hex editor but if you must edit raw bytes you can simply use IDA's hex view. You can also undo and redo changes to the idb.

Fentanyl supercedes other tools for binary patching by being able to assemble with IDA's built in assemblers which can support more than x86 and x86_64. Fentanyl also automates commonly performed patches. One of Fentanyl's best features is that it supports Undo/Redo. We can see changes to the graph live and undo them if they aren't to our liking.

Setup (IDA 7.x / Python 3)

Simply move all items from this repository into the following directory:

%IDA%\plugins

The %IDA% directory can usually be found bellow:

C:\Program Files\IDA <version>\

Now on program start, the plugin will be loaded automatically.

Setup (IDA 6.x / Python 2)

Need to add backwards compatibility with IDA 6.x / Python2 or mark as deprecated.

IDAPython

  1. Download IDAPython here.
  2. Move appropriate folders to IDA plugins directory as per the README

IDA PySide

  1. Download (custom built by ancat): Python 2.7 PySide bindings installer or raw.
  2. Extract and move PySide folder to C:\python27\Lib\site-packages\

Usage

Loading Fentanyl.py

IDA 7.x / Python 3

Follow instructions under Setup.

IDA 6.x / Python 2

  1. Alt+F7 or File > Script File to load scripts
  2. Browse to main.py and open it
  3. That's it!

Key Bindings

Some of these keybindings can be accessed by right-clicking on the screen in graph view.

  • Ctrl-Alt-N Convert instructions to nops
  • Ctrl-Alt-X Nop all xrefs to this function
  • Ctrl-Alt-J Invert conditional jump
  • Ctrl-Alt-P Patch instruction
  • Alt-Z Undo modification (Won't always work. Should still be careful editing.)
  • Alt-Y Redo modification (Won't always work. Should still be careful editing.)
  • Ctrl-Alt-S Save file
  • Ctrl-Alt-C Find Code Caves
  • Ctrl-Alt-F Make jump unconditional
  • Alt-N Neuter the binary (remove calls to fork, setuid, setgid, getpwnam, setgroups, and chdir)

Extras

Loading Fentanyl on Startup

Check out this example.

PySide

PySide is annoying to compile. If you don't want to use the PySide binaries available here, or don't want to compile it yourself, you don't actually need it. Fentanyl will not use the GUI if PySide is not available.

fentanyl's People

Contributors

axelmierczuk avatar coldheat avatar kiwiz avatar vanhoefm 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  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

fentanyl's Issues

Add functionality to add new sections to the binary

Code caves are okay for small pieces of code, but sometimes it makes more sense to allocate an entire section within the binary. This allows for introduction of larger pieces of code to the binary with less restrictions.

Pros:

  • Inject more code very easily

Cons:

  • Modifies the binary more significantly than using a code cave
  • Might require IDA to reload the binary

Conflicting Keyboard shortcut

The new update causes "Convert instructions to nops" and "Neuter the binary" to both use Ctrl+Alt+N. This results in conflict when using IDA Pro.

image

Attribute Error

After I install Python 2.7 PySide and IDAPython I try to load the script file main.py but I encounter this error:

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
IDAPython v1.5.2 final (serial 3) (c) The IDAPython Team [email protected]

type object 'Form' has no attribute 'MultiLineTextControl'
Traceback (most recent call last):
File "C:\Program Files\IDA PRO Advanced Edition\python\idaapi.py", line 396, in IDAPython_ExecScript
execfile(script, g)
File "C:/Documents and Settings/Owner/My Documents/Downloads/Fentanyl/main.py", line 51, in
asf = AssembleForm.AssembleForm()
File "C:/Documents and Settings/Owner/My Documents/Downloads/Fentanyl\AssembleForm.py", line 14, in init
'inp':idaapi.Form.MultiLineTextControl('', idaapi.textctrl_info_t.TXTF_FIXEDFONT),
AttributeError: type object 'Form' has no attribute 'MultiLineTextControl'

Exception AttributeError: "'AssembleForm' object has no attribute 'ui_cntls'" in <bound method AssembleForm.del of <AssembleForm.AssembleForm object at 0x068D99D0>> ignored

Documentation/Examples

Better document this tool for easier startup as well examples of the tool being used (writeups).

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.