Type of array to keep the list of registers
User-defined callback function for SKIPDATA option. See tests/test_skipdata.c for sample code demonstrating this API.
Common instruction operand access types - to be consistent across all architectures. It is possible to combine access types, for example: CS_AC_READ | CS_AC_WRITE
Architecture type
All type of errors encountered by Capstone API. These are values returned by cs_errno()
Common instruction groups - to be consistent across all architectures.
Mode type
Common instruction operand types - to be consistent across all architectures.
Runtime option for the disassembled engine
Runtime option value (associated with option type above)
Calculate the offset of a disassembled instruction in its buffer, given its position in its array of disassembled insn NOTE: this macro works with position (>=1), not index
Macro to create combined version which can be compared to result of cs_version() API.
Close CS handle: MUST do to release the handle when it is not used anymore. NOTE: this must be only called when there is no longer usage of Capstone, not even access to cs_insn array. The reason is the this API releases some cached memory, thus access to any Capstone API after cs_close() might crash your application.
Disassemble binary code, given the code buffer, size, address and number of instructions to be decoded. This API dynamically allocate memory to contain disassembled instruction. Resulting instructions will be put into @*insn
Deprecated function - to be retired in the next version! Use cs_disasm() instead of cs_disasm_ex()
Fast API to disassemble binary code, given the code buffer, size, address and number of instructions to be decoded. This API puts the resulting instruction into a given cache in @insn. See tests/test_iter.c for sample code demonstrating this API.
Report the last error number when some API function fail. Like glibc's errno, cs_errno might not retain its old value once accessed.
Free memory allocated by cs_malloc() or cs_disasm() (argument @insn)
Return friendly name of a group id (that an instruction can belong to) Find the group id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
Check if a disassembled instruction belong to a particular group. Find the group id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...) Internally, this simply verifies if @group_id matches any member of insn->groups array.
Return friendly name of an instruction in a string. Find the instruction id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
Allocate memory for 1 instruction to be used by cs_disasm_iter().
Count the number of operands of a given type. Find the operand type in header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
Retrieve the position of operand of given type in <arch>.operands[] array. Later, the operand can be accessed using the returned position. Find the operand type in header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
Initialize CS handle: this must be done before any usage of CS.
Set option for disassembling engine at runtime
Return friendly name of register in a string. Find the instruction id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...)
Check if a disassembled instruction IMPLICITLY used a particular register. Find the register id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...) Internally, this simply verifies if @reg_id matches any member of insn->regs_read array.
Check if a disassembled instruction IMPLICITLY modified a particular register. Find the register id from header file of corresponding architecture (arm.h for ARM, x86.h for X86, ...) Internally, this simply verifies if @reg_id matches any member of insn->regs_write array.
Retrieve all the registers accessed by an instruction, either explicitly or implicitly.
Return a string describing given error code.
This API can be used to either ask for archs supported by this library, or check to see if the library was compile with 'diet' option (or called in 'diet' mode).
Return combined API version & major and minor version numbers.
Maximum size of an instruction mnemonic string.
NOTE: All information in cs_detail is only available when CS_OPT_DETAIL = CS_OPT_ON Initialized as memset(., 0, offsetof(cs_detail, ARCH)+sizeof(cs_ARCH)) by ARCH_getInstruction in arch/ARCH/ARCHDisassembler.c if cs_detail changes, in particular if a field is added after the union, then update arch/ARCH/ARCHDisassembler.c accordingly
Detail information of disassembled instruction
User-defined dynamic memory related functions: malloc/calloc/realloc/free/vsnprintf() By default, Capstone uses system's malloc(), calloc(), realloc(), free() & vsnprintf().
Customize mnemonic for instructions with alternative name. To reset existing customized instruction to its default mnemonic, call cs_option(CS_OPT_MNEMONIC) again with the same @id and NULL value for @mnemonic.
User-customized setup for SKIPDATA option