I've been using Ghidra a lot recently and have developed a nice workflow, but I'm trying to get back into r2.

I'm wondering if there's a way to set the data type at a given address. For example, when I run pdg to get the Ghidra decompiled output for a function, I get the following line:

uVar5 = (*_reloc.objc_msgSend)(_reloc.NSTask, *(undefined8 *)0x10173df00);

Since this is Objective-C, I'd like to cast the second parameter to be a string pointer; however, this address is not referenced through any stack variables or arguments.

In Ghidra, I could do this by setting the type for that address to pointer, but I can't figure out how to do this in r2. Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.