xref: /aosp_15_r20/external/capstone/tests/README (revision 9a0e4156d50a75a99ec4f1653a0e9602a5d45c18)
1*9a0e4156SSadaf EbrahimiThis directory contains some test code to show how to use Capstone API.
2*9a0e4156SSadaf Ebrahimi
3*9a0e4156SSadaf Ebrahimi- test_basic.c
4*9a0e4156SSadaf Ebrahimi  This code shows the most simple form of API where we only want to get basic
5*9a0e4156SSadaf Ebrahimi  information out of disassembled instruction, such as address, mnemonic and
6*9a0e4156SSadaf Ebrahimi  operand string.
7*9a0e4156SSadaf Ebrahimi
8*9a0e4156SSadaf Ebrahimi- test_detail.c:
9*9a0e4156SSadaf Ebrahimi  This code shows how to access to architecture-neutral information in disassembled
10*9a0e4156SSadaf Ebrahimi  instructions, such as implicit registers read/written, or groups of instructions
11*9a0e4156SSadaf Ebrahimi  that this instruction belong to.
12*9a0e4156SSadaf Ebrahimi
13*9a0e4156SSadaf Ebrahimi- test_skipdata.c:
14*9a0e4156SSadaf Ebrahimi  This code shows how to use SKIPDATA option to skip broken instructions (most likely
15*9a0e4156SSadaf Ebrahimi  some data mixed with instructions) and continue to decode at the next legitimate
16*9a0e4156SSadaf Ebrahimi  instructions.
17*9a0e4156SSadaf Ebrahimi
18*9a0e4156SSadaf Ebrahimi- test_iter.c:
19*9a0e4156SSadaf Ebrahimi  This code shows how to use the API cs_disasm_iter() to decode one instruction at
20*9a0e4156SSadaf Ebrahimi  a time inside a loop.
21*9a0e4156SSadaf Ebrahimi
22*9a0e4156SSadaf Ebrahimi- test_customized_mnem.c:
23*9a0e4156SSadaf Ebrahimi  This code shows how to use MNEMONIC option to customize instruction mnemonic
24*9a0e4156SSadaf Ebrahimi  at run-time, and then how to reset the engine to use the default mnemonic.
25*9a0e4156SSadaf Ebrahimi
26*9a0e4156SSadaf Ebrahimi- test_<arch>.c
27*9a0e4156SSadaf Ebrahimi  These code show how to access architecture-specific information for each
28*9a0e4156SSadaf Ebrahimi  architecture.
29*9a0e4156SSadaf Ebrahimi
30*9a0e4156SSadaf Ebrahimi- test_winkernel.cpp
31*9a0e4156SSadaf Ebrahimi  This code shows how to use Capstone from a Windows driver.
32