Work environment
| Questions |
Answers |
| System Capstone runs on OS/arch/bits |
Debian |
| Capstone module affected |
x86 |
| Source of Capstone |
git clone |
| Version/git commit |
v6, (next) |
Expected behavior
If you leverage the Java binding for disassembling, you successfully receive the assembly
Actual behavior
The Java binding fails at the very beginning due to an illegal array index access on the Java binding-side
Steps to reproduce the behavior
I've attached a very simple Portable Executable: example-portable-executable.zip
inline-strings.pe: the original Portable Executable created with Flat Assembler
inline-strings.hex: only the opcodes to be disassembled in hex notation
inline-strings.asm: the original assembly used in Flat Assembler
Capstone disassembler = new Capstone(Capstone.CS_ARCH_X86, Capstone.CS_MODE_32);
disassembler.disasm(bytesToDisassemble, 4198400);
See: Example.java
Additional Logs, screenshots, source code, configuration dump, ...
It's eye-catching that the C header file Capstone.h specifies this constant:
#define MAX_IMPL_R_REGS 20
But the corresponding Java binding Capstone.java specifies an old size from before the refactoring:
public short[] regs_read = new short[16];
Work environment
git cloneExpected behavior
If you leverage the Java binding for disassembling, you successfully receive the assembly
Actual behavior
The Java binding fails at the very beginning due to an illegal array index access on the Java binding-side
Steps to reproduce the behavior
I've attached a very simple Portable Executable: example-portable-executable.zip
inline-strings.pe: the original Portable Executable created with Flat Assemblerinline-strings.hex: only the opcodes to be disassembled in hex notationinline-strings.asm: the original assembly used in Flat AssemblerSee: Example.java
Additional Logs, screenshots, source code, configuration dump, ...
It's eye-catching that the C header file
Capstone.hspecifies this constant:But the corresponding Java binding
Capstone.javaspecifies an old size from before the refactoring: