The Sleigh engine is the core of ghidra decompiler. It can deal with the binary stream, disassemble it into instructions and lift it into IRs.
However, its restriction is that it can only deal with the binary stream instead of text streams.
Sometimes we are given the text streams, and we know the underlining semantic of each text instruction. To deal with such situation, the usage of sleigh engine is hard.
A possible solution of this is to write a tool (possibly in Python?) that could generate the binary according to the text instructions and a sleigh specification that could further translate the binary back to the text format.
This allows the sleigh engine to be bypassed and let the ghidra do the rest of the job as it is.
What we need:
[ ] API design
[ ] instruction choice algorithm (choose the binary format of each instruction when instructions are fed into the API)
The Sleigh engine is the core of ghidra decompiler. It can deal with the binary stream, disassemble it into instructions and lift it into IRs.
However, its restriction is that it can only deal with the binary stream instead of text streams. Sometimes we are given the text streams, and we know the underlining semantic of each text instruction. To deal with such situation, the usage of sleigh engine is hard.
A possible solution of this is to write a tool (possibly in Python?) that could generate the binary according to the text instructions and a sleigh specification that could further translate the binary back to the text format.
This allows the sleigh engine to be bypassed and let the ghidra do the rest of the job as it is.
What we need: