You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the sleighexample.cc as a starting point, I'm experimenting with libsla to do some "Capstone-like" instruction decoding. However, I'm running into an issue that has been tricky to trace to the root cause.
In this particular example, I'm attempting to decode an ARM binary, using ARM32_le.sla with RawLoadImage to load a flat binary file. Using setVariableDefault(), I've set the TMode and LRset registers to 0 (per the context register default settings in ARMt.pspec). The code then aggressively runs oneInstruction() on every valid offset (based on minimum instruction alignment) in the file.
However, when attempting to emit PCode, I eventually get a segfault in libsla at:
The resolve list is empty, yielding the segfault. I'm guessing that this has something to do with an appropriate decoding not being available, but I have yet to fully comprehend the Sleigh parsing engine. What's even more puzzling is that setting TMode to 1, the aggressive decoding seems to work just fine. Similarly, using coldfire.sla seems to work just fine too. Am I just missing some extra context configuration that needs to happen (specifically for ARM)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Using the
sleighexample.cc
as a starting point, I'm experimenting with libsla to do some "Capstone-like" instruction decoding. However, I'm running into an issue that has been tricky to trace to the root cause.In this particular example, I'm attempting to decode an ARM binary, using
ARM32_le.sla
withRawLoadImage
to load a flat binary file. UsingsetVariableDefault()
, I've set theTMode
andLRset
registers to 0 (per the context register default settings inARMt.pspec
). The code then aggressively runsoneInstruction()
on every valid offset (based on minimum instruction alignment) in the file.However, when attempting to emit PCode, I eventually get a segfault in libsla at:
ghidra/Ghidra/Features/Decompiler/src/decompile/cpp/context.hh
Line 190 in a995cfc
The
resolve
list is empty, yielding the segfault. I'm guessing that this has something to do with an appropriate decoding not being available, but I have yet to fully comprehend theSleigh
parsing engine. What's even more puzzling is that settingTMode
to 1, the aggressive decoding seems to work just fine. Similarly, usingcoldfire.sla
seems to work just fine too. Am I just missing some extra context configuration that needs to happen (specifically for ARM)?Beta Was this translation helpful? Give feedback.
All reactions