All Projects → kohnakagawa → gdt_helper

kohnakagawa / gdt_helper

Licence: Apache-2.0 license
Ghidra Data Type (GDT) Helper

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to gdt helper

Ghidra
Ghidra is a software reverse engineering (SRE) framework
Stars: ✭ 30,371 (+126445.83%)
Mutual labels:  disassembler, software-analysis
sleigh
Unofficial CMake build for Ghidra SLEIGH
Stars: ✭ 54 (+125%)
Mutual labels:  disassembler, ghidra
Fhex
A Full-Featured HexEditor compatible with Linux/Windows/MacOS
Stars: ✭ 225 (+837.5%)
Mutual labels:  disassembler
JGeckoU
Wii U RAM TCP Debugger Client/Cheat Code Manager
Stars: ✭ 54 (+125%)
Mutual labels:  disassembler
windfish
A tracing disassembler & UI for Gameboy ROMs — integrated with Sameboy for emulation & debugging.
Stars: ✭ 68 (+183.33%)
Mutual labels:  disassembler
Wasm
WebAssembly decoder & disassembler library
Stars: ✭ 230 (+858.33%)
Mutual labels:  disassembler
libmem
Advanced Game Hacking Library for C/C++, Rust and Python (Windows/Linux/FreeBSD) (Process/Memory Hacking) (Hooking/Detouring) (Cross Platform) (x86/x64/ARM/ARM64) (DLL/SO Injection) (Internal/External)
Stars: ✭ 336 (+1300%)
Mutual labels:  disassembler
Il2cppspy
Unity IL2CPP Disassembler (for apk)
Stars: ✭ 213 (+787.5%)
Mutual labels:  disassembler
ghidra-r2web
Ghidra plugin to start an r2 webserver to let r2 interact with it
Stars: ✭ 38 (+58.33%)
Mutual labels:  ghidra
UTBotCpp
Tool that generates unit test by C/C++ source code, trying to reach all branches and maximize code coverage
Stars: ✭ 59 (+145.83%)
Mutual labels:  software-analysis
ghidra2dwarf
🐉 Export ghidra decompiled code to dwarf sections inside ELF binary
Stars: ✭ 135 (+462.5%)
Mutual labels:  ghidra
ghidra-65816
WDC 65816 processor module for Ghidra
Stars: ✭ 19 (-20.83%)
Mutual labels:  ghidra
Android Disassembler
Disassemble ANY files including .so (NDK, JNI), Windows PE(EXE, DLL, SYS, etc), linux binaries, libraries, and any other files such as pictures, audios, etc(for fun)files on Android. Capstone-based disassembler application on android. 안드로이드 NDK 공유 라이브러리, Windows 바이너리, etc,... 리버싱 앱
Stars: ✭ 250 (+941.67%)
Mutual labels:  disassembler
bmod
bmod parses binaries for modification/patching and disassembles machine code sections.
Stars: ✭ 12 (-50%)
Mutual labels:  disassembler
Radare2
UNIX-like reverse engineering framework and command-line toolset
Stars: ✭ 15,412 (+64116.67%)
Mutual labels:  disassembler
Azote
Fast and lightweight AArch64 disassembler.
Stars: ✭ 24 (+0%)
Mutual labels:  disassembler
Miasm
Reverse engineering framework in Python
Stars: ✭ 2,649 (+10937.5%)
Mutual labels:  disassembler
ghidraal
A Ghidra extension for scripting with GraalVM languages, including Javascript, Python3, R, and Ruby.
Stars: ✭ 48 (+100%)
Mutual labels:  ghidra
asm2cfg
Python command-line tool and GDB extension to view and save x86, ARM and objdump assembly files as control-flow graph (CFG) pdf files
Stars: ✭ 42 (+75%)
Mutual labels:  disassembler
emerald
Import DynamoRIO drcov code coverage data into Ghidra
Stars: ✭ 30 (+25%)
Mutual labels:  ghidra

Gdt helper

Ghidra has "Parse C Source" feature to add new structs or function types to "Data Type Manager." Using this feature, we can add the types to "Data Type Manager" by writing C header file.

However, this is not easily performed as expected. Without setting "Parse Configuration" properly, Ghidra cannot parse a relatively simple C header file. Although several "Parse Configurations" are provided by default, this does not work properly :(.

Gdt helper solves this problem. It makes "Parse Configurations" for your environment.

Prepare to use

Before use this script, you need to install poetry and Python (3.8) to resolve its dependencies. Then, you can install all dependencies for running gdt_helper script in the following commands.

$ poetry shell
$ poetry update
$ poetry install

How to use

  1. Make "Parse Options" and paste it.
# Specify a compiler as an input argument. clang/gcc/x86_64-w64-mingw32-gcc/i686-w64-mingw32-gcc are supported.
$ python gdt_helper.py make-parse-options clang
Please past the following output to "Parse Options"

-I/usr/local/include
-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include
-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
-DCONST="const"
-D__restrict__=""
-D__always_inline__="inline"
-D__gnu_inline__="inline"
-D__builtin_va_list="void *"
-DOBJC_NEW_PROPERTIES="1"
-D_LP64="1"
-D__APPLE_CC__="6000"
-D__APPLE__="1"
...

Parse Options

  1. Make a source file to parse and select this file as "Source files to parse." You can also specify additional include directories.
$ python gdt_helper.py make-file-to-parse clang example/osx/mac_system.h --additional-includes /Library/Developer/CommandLineTools/SDKs/MacOSX10.16.sdk/usr/include
Please add "./example/osx/mac_system.h.out" to "Source files to parse"

You also have specified additional includes as arguments
So, please add the following header includes to "Parse configuration"
-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.16.sdk/usr/include
  1. Select "Parse to Program" (for importing data types to current project) or "Parse to File" (for creating gdt files)

See also example.

Tested

  • Ubuntu 20.04
  • macOS Catalina

Windows is not supported. If you want to create some data types of Windows headers, you can do it via MinGW on Linux. For more details, see Windows example.

Special thanks

The implementation of this script heavily relies on https://github.com/0x6d696368/ghidra-data/blob/master/typeinfo/README.md.

License

Apache-2.0

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].