|
I'm reviewing some multi-threaded code which makes use of thread-local storage. I would like to be able to update all the instances in the Decompiler view where the call to Has this functionality already been developed for Ghidra? If not, what approach should I take, and is there any similar prior art I could use as a crib? |
Replies: 1 comment 1 reply
|
There is a built-in mechanism that is close to what you want: a decompiler call-site prototype override. In the UI it is the For automation I would not try to change
That gives you a localized decompiler result without lying about the prototype of The awkward part is step 4: depending on the architecture and relocation model, the argument may not be a bare constant. It may be a |
There is a built-in mechanism that is close to what you want: a decompiler call-site prototype override. In the UI it is the
Override Signatureaction. Under the hood it writes an override for one call instruction, not for the callee globally, viaHighFunctionDBUtil.writeOverride(function, callsite, functionSignature).For automation I would not try to change
__tls_get_addritself, because the return type is intentionally call-site dependent in your case. The usual shape is:DecompInterfaceand decompile each function.DecompileResults.getHighFunction().PcodeOpASTops and findCALLops whose destination resolves to__tls_get_addr.