ghidra
ghidra copied to clipboard
[Sleigh, Decompiler (Java)] Maximum number of operands is 8
My sleigh implementation has pseudo opcodes with 8 and more operands. Decompiler can't deal with that and prints an error:
ERROR Pcode error at ram:00002754: Index 8 out of bounds for length 8 (SleighInstructionPrototype)
Problematic line is here: https://github.com/NationalSecurityAgency/ghidra/blob/master/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/PcodeEmit.java#L133
This could probably just be changed to an ArrayList
.
~~Unfortunately this seems to be more involved than just changing it to a List
. Maybe it has something to do with all the magic numbers in PcodeEmitPacked
and this area of code in general?~~
~~I might have missed something that would cause (SleighInstructionPrototype) Pcode error at 1400ec540: Index 0 out of bounds for length 0
. I'll probably look again this weekend.~~
Edit: I think I found the problem now that I'm looking at it with a clearer head. I was using List<E>.set(int, E)
instead ofList<E>.add(int, E)
which would cause an index out of bounds error. I'll fix it and retest tonight since I have a long drive this morning.
Edit edit: that was it.
Any updates? I see many useful solutions, but no one is merged yet!