Commit Graph

6 Commits

Author SHA1 Message Date
73b246c7df capstone: debug stuff, cleanup
Change-Id: Ia831c20097e86d1f178efb09884a60caa542f12a
2020-05-23 22:52:00 +02:00
1dd929aad5 capstone: only use insn.detail if it's not NULL
Capstone NULLs the detail field when it encounters a bad/invalid opcode.

Change-Id: I421386903756e03049e950f09b8a500b54fe4a73
2020-05-23 22:52:00 +02:00
0c38fd7345 capstone: disassemble .text also for STT_NOTYPE
Symbol type FUNC (STT_FUNC, "code object") seems not to suffice when parts
of the disassembled binary come from assembler source files.  We try to
disassemble STT_NOTYPE (symbol type "unspecified") as well now.

Change-Id: I582190900e66d6af0779dfaf3b569f0e157e9ce7
2020-05-23 22:52:00 +02:00
b94ef2acec capstone: deal properly with symbols outside .text section
Especially for dynamically linked ELF binaries (such as those in the
testing/ subdirectory), symbols with a start address outside the .text
section may exist.  This change skips any symbol that is not fully within
this section (and assigns a reasonable size to a zero-sized last symbol
within the symbol table), and turns green all Capstone-related test cases.

Change-Id: I2b51d0f21f325e6052ebc36d9533621bdf9aa38d
2020-03-16 18:49:44 +01:00
63b3a5772a capstone: compile-time version check
This version check could (and probably should) also be done in the cmake
scripts.  However, this check in CapstoneDisassembler.cpp catches another
failure mode: When a cmake script is missing a include_directories()
directive pointing to capstone.h -- resulting in a missing -I parameter to
gcc -- accidentally a system-wide 3.x capstone.h may get #included,
providing the wrong definitions and prototypes to some translation units.

Change-Id: Id30f77a47e38f4e892b92189bcce9119bf03918c
2020-03-16 18:49:44 +01:00
d04afaac54 (capstone) feat: add capstone disassembler files 2020-03-16 18:49:44 +01:00