A Ghidra script to export information to a x64dbg database.
- Exports functions, function names (as labels), and function prototypes (as comments)
- Exports labels for global variables
- Exports bookmarks
- Exports some (see Limitations) decompiled C statements (as comments)
Copy ExportToX64dbg.py
to your Ghidra scripts directory (the Script Manager has a button to show you all directories where Ghidra is looking for scripts).
If the script is not shown in the Script Manager, try the 'Refresh Script List` button.
- Run the script
- Select a filename for the database (matching suffix will be appended automatically)
- In x64dbg: Import the database (
File -> Import database
)
- Not the full decompiled source code gets exported as comments
At the moment the source code export is limited to elements that appear as ClangStatement
in the ClangTokenGroup
returned by getCCodeMarkup()
.
This works fine for most variable assignments and function calls, but excludes most control flow altering constructs (like if
, for
or while
).