Replies: 3 comments 4 replies
-
Thank you for your work in this area. Currently the P-Code docs could use a bit of love, and the situation isn't helped when the implementation's behavior diverges from the spec laid out in the docs. I haven't read the paper in its entirety yet but I have some questions after skimming through some sections:
Again, thank you for this work and your time. |
Beta Was this translation helpful? Give feedback.
-
Could you show where this discussion with the Ghidra team is? I would love to understand P-Code better, but am having trouble finding this in the github issues. |
Beta Was this translation helpful? Give feedback.
-
@niconaus Thank you for initiating this discussion! There are a number of issues to consider, both those mentioned above and those in the issues you've submitted. I think the first one to discuss involves the As an example, consider the 64-bit variant of the You can make a simple function (with the default x64 linux calling convention) using this instruction with the bytes In the high pcode for this function you should see a Hopefully that's at least somewhat helpful; please let me know if I've misunderstood the issue you raised. |
Beta Was this translation helpful? Give feedback.
-
Recent efforts by Virginia Tech and Open University of The Netherlands on a DAPRA funded project have resulted in the formalization of Ghidra's high P-Code. The work was presented at VSTTE 2022, and springer has just now published the open-access paper associated with this work.
A Formal Semantics for High P-Code by Nico Naus, Freek Verbeek, Dale Walker & Binoy Ravindran
This work might be interesting for anyone doing analysis on or processing of Ghidra's High P-Code output. The paper gives a formal description of its semantics. These semantics have also been implemented as an interpreter in Haskell, which can be found here.
During the development of the formal semantics, several issues have been uncovered in Ghidra, P-Code and Ghidra's documentation. These are described in Section 6 of the paper, but where appropriate, I will open/have opened separate issues on Ghidra's GitHub page: #4947 #4946 #4945
The formal semantics and issues uncovered have been disclosed to the Ghidra team at NSA, several months ago. I'm really interested in discussing the results we found with the community here on GitHub too.
Beta Was this translation helpful? Give feedback.
All reactions