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
Hey. I am currently trying to use the decompiler as a library and I have a simple binary to pcode decompiler working ( following the sleigh.hh docs ).
I am currently using a simple x86:LE:64:default target with the shipped ghidra_11.0.3_PUBLIC/Ghidra/Processors/x86/data/languages/x86-64.sla SLA file (uncompressed).
I noticed that the generated pcode is complete garbage for some sample x64 code unless I specify the following defaults for my Sleigh class:
All of them are 0 by default. I am not exactly sure what those values mean and how I am supposed to set them. The header docs mention that "addrsize" == 1 means 32 bit mode, so I just set it to 2 for 64 bit.
There are quite a few more of those variables (?) present in the .SLA file, and since the defaults were not working properly I am uncertain whether the default is fine for the rest of them (bit64, protectedMode, vexMode, .. to name a few).
This seems very specific to x86-64 as well, how do I manage other targets?
Is there a good way to initialize them? Grepping through the codebase, they do not ever seem to be set by the java code. So how are they supposed to be managed?
This discussion was converted from issue #6428 on April 23, 2024 11:12.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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
-
Hey. I am currently trying to use the decompiler as a library and I have a simple binary to pcode decompiler working ( following the sleigh.hh docs ).
I am currently using a simple
x86:LE:64:default
target with the shippedghidra_11.0.3_PUBLIC/Ghidra/Processors/x86/data/languages/x86-64.sla
SLA file (uncompressed).I noticed that the generated pcode is complete garbage for some sample x64 code unless I specify the following defaults for my
Sleigh
class:All of them are
0
by default. I am not exactly sure what those values mean and how I am supposed to set them. The header docs mention that"addrsize" == 1
means 32 bit mode, so I just set it to2
for 64 bit.There are quite a few more of those variables (?) present in the .SLA file, and since the defaults were not working properly I am uncertain whether the default is fine for the rest of them (
bit64
,protectedMode
,vexMode
, .. to name a few).This seems very specific to x86-64 as well, how do I manage other targets?
Is there a good way to initialize them? Grepping through the codebase, they do not ever seem to be set by the java code. So how are they supposed to be managed?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions