Is there any way to convert pcode into C pseudocode in UI? #8560
Unanswered
Nicholas-wei
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wondering if there’s a way to convert high-level p-code into C-like pseudocode within Ghidra scripts, similar to how the UI highlights it.
While ClangStatement and ClangLine are somewhat helpful, they don’t resolve symbol names or string representations.
For example, the two snippets below correspond to the same instruction but appear quite differently:
Format 1 (UI view): iVar4 = strcmp(__s1, "root")
Format 2 (from DecompileResults): iVar5 = (*strcmp)(pcVar4, PTR_PTR_s_static_000217c8 + -0x3d48)
Using CppExporter only outputs the full decompiled text, without preserving address mappings (e.g., which p-code corresponds to which line in the pseudocode).
If it were possible to generate Format 1 programmatically, it could greatly improve how LLMs interpret decompiled code. Has anyone found a way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions