Skip to main content

Module parse

Module parse 

Source
Expand description

Pure parser for r2ghidra pdgsd P-code text.

Independent of any live r2 process so it can be exercised with fixed fixtures and without an r2ghidra install. The grammar (observed from pdgsd N, stable SLEIGH textual P-code):

0x<hex>: <asm text>                 # instruction header (not indented)
    <out> = <OPCODE> <in0>[, <in1>] # data-flow op (indented)
    <out> = LOAD ram[<addr>]        # memory load
    STORE ram[<addr>] = <value>     # memory store
    BRANCH qword_ptr(0x<hex>)       # control flow
    CBRANCH qword_ptr(0x<hex>), <cond>

Varnode tokens: (unique,0x<hex>,<size>), a bare register name (sp, w0, x8, ZR, tmpCY, …), a hex constant (0x10), ram[<vn>], or qword_ptr(0x<hex>).

Structs§

ParseError
Structural parse failure. Open-domain (free-form reason) per the project error policy — parser reasons are inherently open.
PcodeInsn
All P-code ops emitted for one machine instruction.
PcodeOp
One P-code micro-operation.

Enums§

Varnode
A P-code varnode operand.

Functions§

parse_pcode
Parse a pdgsd dump into structured instructions.