Skip to content

About

A Ghidra script that exports decompiled pseudocode of all functions from an open program to a text file

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Ghidra Pseudocode Export

A Ghidra script that exports decompiled pseudocode of all functions from an open program to a text file.

Description

This script automatically iterates through all functions in a loaded Ghidra program, decompiles them, and saves the pseudocode to a specified file. Useful for analyzing large binary files and creating documentation.

Features

  • Export all functions from the current program
  • Decompilation to C pseudocode
  • Save with function name and entry point address
  • Decompilation error handling
  • Formatted output with separators

Installation

  1. Copy the func_export.py file to your Ghidra scripts directory:

    • Windows: %USERPROFILE%\ghidra_scripts
    • Linux/Mac: ~/ghidra_scripts
  2. Restart Ghidra or refresh the script list via Window → Script Manager

Usage

  1. Open a binary file in Ghidra
  2. Run the script via Window → Script Manager
  3. Choose the path to save the pseudocode file
  4. Wait for the export to complete

Output Format

Each function is exported in the following format:

================================================================================
Function: main at 00401000
================================================================================
[Function pseudocode]

Requirements

  • Ghidra 9.x or higher
  • Jython (built into Ghidra)

Notes

  • Decompilation timeout is set to 30 seconds per function
  • Functions that fail to decompile will be marked in the output file
  • The script works with the currently open program in Ghidra

Author

ivblz

License

Free to use

About

A Ghidra script that exports decompiled pseudocode of all functions from an open program to a text file

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages