capstone
Capstone integration
capstone_decode_block(block)
Decode a basic block with capstone
Decode an block and retry for ARM to check if the Thumb mode was activated
The decoding logic is done by the inner method _decode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inst
|
Block to translate |
required |
Returns:
| Type | Description |
|---|---|
list[CsInsn]
|
A list of capstone instructions if they have been decoded |
Source code in bindings/python/quokka/backends/capstone.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
capstone_decode_instruction(inst)
Decode an instruction with capstone
Decode an instruction and retry for ARM to check if the Thumb mode was activated
The decoding logic is done by the inner method _decode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inst
|
Instruction
|
Instruction to translate |
required |
Returns:
| Type | Description |
|---|---|
CsInsn | None
|
A capstone instruction if it has been decoded |
Source code in bindings/python/quokka/backends/capstone.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
get_capstone_context(arch, endian=Endianness.LITTLE_ENDIAN)
Compute the capstone context for the program
The Capstone context is used to decode instructions afterwards. Since we are interested in most of the details, we already set the details to True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arch
|
Type[QuokkaArch]
|
Quokka program architecture |
required |
Returns:
| Type | Description |
|---|---|
Cs
|
A capstone Cs instance |
Source code in bindings/python/quokka/backends/capstone.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |