Open nogitsune-youkai opened 5 months ago
You'll need to define for the emulator what the LOCK
pcode userop means. See https://github.com/NationalSecurityAgency/ghidra/blob/master/GhidraDocs/GhidraClass/Debugger/B4-Modeling.md. That tutorial goes into quite a bit more than you need, but essentialy, create a custom userop library that defines LOCK
, then use a script to install an emulator with that library into the UI.
Essentially, the same solution as found here, but for a different processor: https://github.com/NationalSecurityAgency/ghidra/issues/6089. It's very possible your definition is effectively a NOP.
Ok. Thank you, i'll look into it
Essentially, the same solution as found here, but for a different processor: #6089. It's very possible your definition is effectively a NOP.
It's all great, but it will be really easy if it's just open "jython" window of active emulation tool and do something like:
def useropNOP():
pass
and then do something like:
getCurrentEmulator().registerSimpleUserOp("LOCK", useropNOP)
and continue emulation process instead of diving into java and Ghidra developing for hours, because simple LOCK/UNLOCK has no simple "nop" implementation and implementing it is really hard way, especially you do not have much time for it.
Maybe if it's not really possible to make easy way, then just bundle example script which will add nopped LOCK/UNLCOK with graphical launch(or how to do this?) of emulator? Or script which will implement NOP for LOCK/UNLOCK on the fly in active graphical emulation?
Or may be just add "SKIP unknown" option for emulator?
P.s. after of 5 hours of trying to implement this things such stupid way I give up and go will look for just patch emulator to skip it.
Describe the bug When emulating software which runs in VM, ghidra apparently can't emulate properly LOCK instruction. Is it a bug or i'm doing something wrong?
To Reproduce Steps to reproduce the behavior:
Expected behavior LOCK instruction should be emulated without issues.
Environment (please complete the following information):
Additional context Full error log: