All Projects → pfalcon → Scratchabit

pfalcon / Scratchabit

Licence: gpl-3.0
Easily retargetable and hackable interactive disassembler with IDAPython-compatible plugin API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Scratchabit

Idarling
Collaborative Reverse Engineering plugin for IDA Pro & Hex-Rays
Stars: ✭ 588 (+59.35%)
Mutual labels:  ida, ida-plugin, idapython, reverse-engineering
Flare Ida
IDA Pro utilities from FLARE team
Stars: ✭ 1,374 (+272.36%)
Mutual labels:  ida, ida-plugin, idapython, reverse-engineering
obfDetect
IDA plugin to pinpoint obfuscated code
Stars: ✭ 99 (-73.17%)
Mutual labels:  ida, ida-plugin, idapython
Amie
A Minimalist Instruction Extender for the ARM architecture and IDA Pro
Stars: ✭ 136 (-63.14%)
Mutual labels:  ida, idapython, reverse-engineering
Ida Batch decompile
*Decompile All the Things* - IDA Batch Decompile plugin and script for Hex-Ray's IDA Pro that adds the ability to batch decompile multiple files and their imports with additional annotations (xref, stack var size) to the pseudocode .c file
Stars: ✭ 198 (-46.34%)
Mutual labels:  ida, ida-plugin, reverse-engineering
Necromancer
IDA Pro V850 Processor Module Extension
Stars: ✭ 21 (-94.31%)
Mutual labels:  ida, ida-plugin, idapython
Ida For Delphi
IDA Python Script to Get All function names from Event Constructor (VCL)
Stars: ✭ 92 (-75.07%)
Mutual labels:  ida, idapython, reverse-engineering
Rematch
REmatch, a complete binary diffing framework that is free and strives to be open source and community driven.
Stars: ✭ 141 (-61.79%)
Mutual labels:  ida, ida-plugin, reverse-engineering
Ipyida
IPython console integration for IDA Pro
Stars: ✭ 358 (-2.98%)
Mutual labels:  ida, ida-plugin, idapython
Redasm
The OpenSource Disassembler
Stars: ✭ 1,042 (+182.38%)
Mutual labels:  disassembler, ida, reverse-engineering
Ret Sync
ret-sync is a set of plugins that helps to synchronize a debugging session (WinDbg/GDB/LLDB/OllyDbg2/x64dbg) with IDA/Ghidra/Binary Ninja disassemblers.
Stars: ✭ 896 (+142.82%)
Mutual labels:  disassembler, ida-plugin, reverse-engineering
DriverBuddyReloaded
Driver Buddy Reloaded is an IDA Pro Python plugin that helps automate some tedious Windows Kernel Drivers reverse engineering tasks
Stars: ✭ 210 (-43.09%)
Mutual labels:  ida, ida-plugin, idapython
Hyara
Yara rule making tool (IDA Pro & Binary Ninja & Cutter Plugin)
Stars: ✭ 142 (-61.52%)
Mutual labels:  ida, ida-plugin, idapython
Hexrayspytools
IDA Pro plugin which improves work with HexRays decompiler and helps in process of reconstruction structures and classes
Stars: ✭ 873 (+136.59%)
Mutual labels:  ida, ida-plugin, idapython
Idacode
An integration for IDA and VS Code which connects both to easily execute and debug IDAPython scripts.
Stars: ✭ 312 (-15.45%)
Mutual labels:  ida, idapython, reverse-engineering
Jarvis
"Just Another ReVersIng Suite" or whatever other bullshit you can think of
Stars: ✭ 137 (-62.87%)
Mutual labels:  ida, ida-plugin, reverse-engineering
Awesome Reverse Engineering
Reverse Engineering Resources About All Platforms(Windows/Linux/macOS/Android/iOS/IoT) And Every Aspect! (More than 3500 open source tools and 2300 posts&videos)
Stars: ✭ 2,954 (+700.54%)
Mutual labels:  ida-plugin, idapython, reverse-engineering
Uefi retool
A tool for UEFI firmware reverse engineering
Stars: ✭ 227 (-38.48%)
Mutual labels:  ida-plugin, idapython, reverse-engineering
Idangr
Use angr in the IDA Pro debugger generating a state from the current debug session
Stars: ✭ 214 (-42.01%)
Mutual labels:  ida, ida-plugin, idapython
ida migrator
IDA Migrator is an IDA Pro plugin which helps migrate existing work from one database instance to another. It Conveniently migrates function names, structures and enums.
Stars: ✭ 65 (-82.38%)
Mutual labels:  ida, ida-plugin, idapython

ScratchABit

ScratchABit is an interactive incremental disassembler with data/control flow analysis capabilities. ScratchABit is dedicated to the efforts of the OpenSource reverse engineering community (reverse engineering to produce OpenSource drivers/firmware for hardware not properly supported by vendors, for hardware and software interoperability, for security research).

ScratchABit supports well-known in the community IDAPython API to write disassembly/extension modules.

ScratchABit is a work in progress, features are added on as needed basis, contributions are welcome.

ScratchABit is released under the terms of GNU General Public License v3 (GPLv3).

Requirements/manifesto

  1. Should not be written in an obfuscated language. These include languages which are too low-level, which allow to access non-initialized variables, which don't differentiate between variables and functions/procedures, which start array indexes from arbitrary numbers, etc., etc. ScratchABit is written in Python (modern version, Python3) for your pleasure and sanity.

  2. User interface framework should allow user interaction of the needed level, not add dependencies, bloat, issues, and incompatibilities between framework's versions. ScratchABit currently uses simple full-screen text user interface, using ANSI/VT100 terminal escape sequences (yes, even curses library was deemed too bloat a dependency to force upon users).

  3. Should leverage easy to use text formats to store "database", to facilitate easy reuse and tool writing, and storage in version control systems.

Installation

To use ScratchABit, you need Python3 installed (tested with Python 3.3 thru 3.7) and VT100 (minimum) or XTerm (recommended) terminal or terminal emulator (any Unix system should be compliant, like Linux/BSD/etc., see FAQ below for more).

Clone the code using:

git clone --recursive https://github.com/pfalcon/ScratchABit

If you cloned code without --recursive, run git submodule update --init in the ScratchABit directory.

ScratchABit now ships with Capstone Engine based CPU plugin(s), which allow access to a number of CPU architectures. To use it, recent Python bindings module for Capstone should be installed (in the preference to packages shipped by OS distributions, which are often outdated). The easiest way to install it is into the Python user packages directory:

pip3 install --no-cache-dir --user capstone

An alternative is to install it to a Python virtual environment within the ScratchABit directory:

python3 -m venv .venv
source .venv/bin/activate
pip3 install --no-cache-dir capstone

Whenever you open a new terminal session to work with ScratchABit, run source .venv/bin/activate command again to activate the virtual environment.

If nothing of the above works, you can try to install the capstone package system-wide (not recommended):

sudo pip3 install --system capstone

Quick start

If you want to disassemble a file in self-describing executable format (like ELF), just pass it as an argument to ScratchABit.py. The repository includes a number of example-*.elf files for various architectures for a quick start. For example, to try x86 32bit version:

python3 ScratchABit.py example-x86_32.elf

Alternatively, if you want to disassemble a raw binary file, you need to create a .def (definition) file, to specify what memory areas are defined for the code, at which address to load binary file, etc. (Note: a .def file may be useful for .elf and similar files too.) The repository includes a simple x86_64 raw binary code, and the corresponding example-x86_64.def file (look inside for description of available options):

python3 ScratchABit.py example-x86_64.def

Press F9 to access menus (mouse works too in XTerm-compatible terminals). Press F1 to get help about key bindings (most actions are also accessible via menu). The workflow of ScratchABit is similar to other interactive dissamblers (some previous experience or background reading may be helpful).

Using Plugins

IDAPython processor plugins can be loaded from anywhere on the Python module path. Alternatively, you can symlink/copy the plugin .py file(s) into the plugins/cpu/ subdirectory.

After the plugin is made available, create a new definition file based on example-x86_64.def that sets the plugin module name (without .py extenstion) in the cpu xxx line.

For a very simple example that uses an external plugin, see this esp8266.def file that works with the xtensa.py plugin from the ida-xtensa2 repository.

TODO/Things to decide

  • Currently uses multiple files for "database", each storing particular type of information. Switch to a single YAML file instead?
  • Add color (low priority, (unbloated!) patches welcome).
  • Few important UI commands to implement yet for comfortable work. ( All the most important commands should be there, other functionality is expected to be implemented using plugins).
  • Offer to save DB on quit if modified.
  • Git integration for DB saving.
  • Improve robustness (add exception handler at the main loop level, don't abort the application, show to user/log and continue).
  • Try to deal with code flow inconsistencies (e.g. within an instruction - low priority for intended usage) and data access inconsistencies (e.g. accessing individual bytes of previosly detected word - higher priority). (Improved in 1.4.)
  • See how to support other types of IDAPython plugins besides just processor modules.
  • Parse and use debugging information (e.g. DWARF) present in ELF (etc.) files.

FAQ

Q: What processors/architectures are supported?

A: ScratchABit doesn't support any processor architectures on its own, it is fully retargettable using IDAPython API plugins. Many plugins are available, writing a new plugin is easy. To let users test-drive ScratchABit, a simple x86 processor plugin is included in the distribution, using Pymsasid disassembler under the hood.

From version 2.0, Capstone plugin is also included, allowing access to a number of architectures, including x86, ARM, MIPS, PowerPC, SPARC, etc. (architecture support is enabled gradually based on user testing).

You can read about the plugins shipped together with ScratchABit in the README for plugins/cpu/ dir.

Q: Debugger?

A: ScratchABit is dedicated to static analysis and easy support for new CPU architectures (just code up an new CPU plugin in Python - you can get initial results in few hours). Dynamic analysis wasn't conceived to be a core feature and there're no immediate plans to implement it. Patches are welcome though.

Q: Decompiler?

A: There is a related project, called ScratchABlock for deep program analysis, transformation and decompilation. It's expected that as ScratchABlock matures, some of its functionality will be available within ScratchABit (perhaps via plugins).

Q: I'm not on Linux, how can I run ScratchABit?

A: Install Linux in an emulator/VM on your system and rejoice.

Q: Mandatory screenshot?

A: Sure:

screenshot

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].