Giter Site home page Giter Site logo

pcode-emulator's Introduction

Description

This is a PCode emulator for Ghidra.

Apologies

Listen - this is kinda rough. It works though! I'm a little embarrased about the quality of documentation and completeness at the time of release. This currently works best on x64, x86, and ARM architectures in Ghidra. It's not tough to add other architectures, I need to implement the initial function call environment for each though and haven't done it. There are some PCode opcodes not yet implemented - most notably the float operations. If you needed that I'm sorry, it's on the list of stuff to do. It needs a testing framework and documentation building.

So, you know, I'm a pro. This bugs me. But the day of the talk is here and therefore the time to publish this code is now.

Installation

From the source directory here...

mkdir "$HOME/ghidra_scripts"
ln -s "$PWD" "$HOME/ghidra_scripts/ghidra_pcode_interpreter"
ln -s "$PWD/pcode_interpreter.py" "$HOME/ghidra_scripts/pcode_interpreter.py"
ln -s "$PWD/pcode_inspector.py" "$HOME/ghidra_scripts/pcode_inspector.py"

Usage

Refresh your script list in Ghidra. Scroll down to the PCode category. Select the function you want to execute in the decompiler or program listing window. Make sure you've committed your function prototype (right click in the decompiler and click "Commit Params/Return"). Then double click the pcode_interpreter.py script.

Logging currently gets output both to your Ghidra console, but also /tmp/pcode_interpret.log. If you're on a multiuser system please be aware of this temp logging location... Also, the temp log is a debug log, so it can grow quite large. It's overwritten each run.

More Info

My Saintcon 2019 talk on this is at https://github.com/kc0bfv/Saintcon2019GhidraTalk

pcode-emulator's People

Contributors

kc0bfv avatar

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.