Skip to content

Getting value value from unique address space #3711

Answered by yaspoon
elbiazo asked this question in Q&A
Discussion options

You must be logged in to vote

Okay I figured it out in the end by reading followToParam in https://github.com/NationalSecurityAgency/ghidra/blob/master/Ghidra/Features/Decompiler/ghidra_scripts/ShowConstantUse.java

So when you have a unique you want to 'walk' the varnode def tree to find the actual value it was made from. In my case it's made from a single pointer which ends up up being a ram address I can then read in the listing. So I only need to go up 1 in the tree

Some example code of what I'm doing:

Varnode[] inputs = pcode.getInputs();
Varnode node = inputs[2]; //Node that should be a string
if(node.isUnique()) { //Must `walk` the def tree
    PcodeOp def = node.getDef();
    Varnode[] uniq_inputs = def.getInpu…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@yaspoon
Comment options

Comment options

You must be logged in to vote
2 replies
@elbiazo
Comment options

@sakiodre
Comment options

Answer selected by elbiazo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants