Code Monkey home page Code Monkey logo

ghidra-r2web's Introduction

ghidra-r2web

This repository contains integration scripts to interop Ghidra and radare2.

It's just an Ghidra plugin that starts an http server to let r2 talk to it.

Features

  • Decompile current function
  • Load the decompiler output as comments
  • List functions found by Ghidra ('afl')
  • List symbols 'is' from Ghidra bin parser
  • Import comments from Ghidra into r2
  • Read/Write ghidra's session remote memory contents

Usage

  • Install Ghidra using r2pm

    $ r2pm -i ghidra

  • Symlink the R2GhidraServer.java into the ghidra plugins directory

    $ make install

  • Start ghidra and doubleclick the script to get the http server

    $ r2pm -r ghidraRun

  • Attach r2 to the ghidra session

    $ r2 r2web://localhost:8002/cmd

  • Run commands into the ghidra server from r2 or the shell

Sample session

$ r2 r2web://localhost:9191/cmd
[0x00000000]> \?
Usage: [ghidra-r2web-command .. args]
?             - show this help message
?V            - show Ghidra Version information
?p [vaddr]    - get physical address for given virtual address
f [name]      - set flag to the current offset inside ghidra (label)
i             - show program information (arch/bits/hash..)
/ [string]    - search for given string (which may contain \x hex)
s ([addr])    - check or set current seek address
b ([bsize])   - get or set blocksize
CC [comment]  - add or replace comment in current offset
Cs            - define a string in the current address
Cd            - define a dword in the current address
aa            - analyze all the program
af            - analyze function in current address
afi           - get current function information
afl           - list all functions analyzed by Ghidra
px            - print Hexdump
pdd           - print decompilation of current function
pdd*          - decompile current function as comments for r2
q             - quit the ghidra-r2web script
[0x00000000]> \?V
9.0.4
[0x00000000]>

--pancake

ghidra-r2web's People

Contributors

brainstorm avatar lowlyw avatar radare 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

heruix

ghidra-r2web's Issues

Does not seem to work w/ Ghidra 9.2 & r2 5.1.0?

With Ghidra 9.2 from September 2020 I'm getting the following issue after installing via r2pm -i ghidra-r2webserver:

$ r2 -version
radare2 5.1.0 26409 @ darwin-x86-64 git.4.1.1
commit: 35731c185c92c4f680dbf221b808a54a488ba95d build: 2021-02-01__23:44:57
$ r2pm -r ghidraRun
$ r2 r2web://localhost:8002/cmd
Could not resolve address 'localhost' or failed to connect
Cannot connect to localhost:8002
Error: Try http://localhost:9090/cmd/[r] Cannot open 'r2web://localhost:8002/cmd'

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.