Rizin
unix-like reverse engineering framework and cli tools
|
#include "hexagon.h"
Go to the source code of this file.
Classes | |
struct | HexReversedOpcode |
Pointer to the rizin structs for disassembled and analysed instructions. More... | |
Macros | |
#define | HEX_PKT_UNK "? " |
#define | HEX_PKT_SINGLE "[ " |
#define | HEX_PKT_SINGLE_UTF8 "[ " |
#define | HEX_PKT_FIRST_UTF8 "┌ " |
#define | HEX_PKT_MID_UTF8 "│ " |
#define | HEX_PKT_LAST_UTF8 "└ " |
#define | HEX_PKT_FIRST_SDK "{ " |
#define | HEX_PKT_SDK_PADDING " " |
#define | HEX_PKT_LAST_SDK " }" |
#define | HEX_PKT_FIRST "/ " |
#define | HEX_PKT_MID "| " |
#define | HEX_PKT_LAST "\\ " |
#define | HEX_PKT_ELOOP_01_UTF8 " ∎ endloop01" |
#define | HEX_PKT_ELOOP_1_UTF8 " ∎ endloop1" |
#define | HEX_PKT_ELOOP_0_UTF8 " ∎ endloop0" |
#define | HEX_PKT_ELOOP_01 " < endloop01" |
#define | HEX_PKT_ELOOP_1 " < endloop1" |
#define | HEX_PKT_ELOOP_0 " < endloop0" |
#define | HEX_PKT_ELOOP_01_SDK ":endloop01" |
#define | HEX_PKT_ELOOP_1_SDK ":endloop1" |
#define | HEX_PKT_ELOOP_0_SDK ":endloop0" |
Enumerations | |
enum | HexPktSyntaxIndicator { SINGLE_IN_PKT , FIRST_IN_PKT , MID_IN_PKT , LAST_IN_PKT , ELOOP_0_PKT , ELOOP_1_PKT , ELOOP_01_PKT } |
enum | HexReverseAction { HEXAGON_ANALYSIS , HEXAGON_DISAS } |
Functions | |
RZ_API void | hex_insn_free (HexInsn *i) |
RZ_API void | hex_const_ext_free (HexConstExt *ce) |
RZ_API HexState * | hexagon_get_state () |
Initializes each packet of the state once. More... | |
RZ_API void | hexagon_reverse_opcode (const RzAsm *rz_asm, HexReversedOpcode *rz_reverse, const ut8 *buf, const ut64 addr) |
Reverses a given opcode and copies the result into one of the rizin structs in rz_reverse. More... | |
RZ_API ut8 | hexagon_get_pkt_index_of_addr (const ut32 addr, const HexPkt *p) |
Returns the index of an addr in a given packet. More... | |
RZ_API HexLoopAttr | hex_get_loop_flag (const HexPkt *p) |
Returns the loop type of a packet. Though only if this packet is the last packet in last packet in a hardware loop. Otherwise it returns HEX_NO_LOOP. More... | |
#define HEX_PKT_ELOOP_0 " < endloop0" |
Definition at line 60 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_01 " < endloop01" |
Definition at line 58 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_01_SDK ":endloop01" |
Definition at line 61 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_01_UTF8 " ∎ endloop01" |
Definition at line 55 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_0_SDK ":endloop0" |
Definition at line 63 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_0_UTF8 " ∎ endloop0" |
Definition at line 57 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_1 " < endloop1" |
Definition at line 59 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_1_SDK ":endloop1" |
Definition at line 62 of file hexagon_arch.h.
#define HEX_PKT_ELOOP_1_UTF8 " ∎ endloop1" |
Definition at line 56 of file hexagon_arch.h.
#define HEX_PKT_FIRST "/ " |
Definition at line 52 of file hexagon_arch.h.
#define HEX_PKT_FIRST_SDK "{ " |
Definition at line 49 of file hexagon_arch.h.
#define HEX_PKT_FIRST_UTF8 "┌ " |
Definition at line 46 of file hexagon_arch.h.
#define HEX_PKT_LAST "\\ " |
Definition at line 54 of file hexagon_arch.h.
#define HEX_PKT_LAST_SDK " }" |
Definition at line 51 of file hexagon_arch.h.
#define HEX_PKT_LAST_UTF8 "└ " |
Definition at line 48 of file hexagon_arch.h.
#define HEX_PKT_MID "| " |
Definition at line 53 of file hexagon_arch.h.
#define HEX_PKT_MID_UTF8 "│ " |
Definition at line 47 of file hexagon_arch.h.
#define HEX_PKT_SDK_PADDING " " |
Definition at line 50 of file hexagon_arch.h.
#define HEX_PKT_SINGLE "[ " |
Definition at line 44 of file hexagon_arch.h.
#define HEX_PKT_SINGLE_UTF8 "[ " |
Definition at line 45 of file hexagon_arch.h.
#define HEX_PKT_UNK "? " |
Definition at line 43 of file hexagon_arch.h.
Enumerator | |
---|---|
SINGLE_IN_PKT | |
FIRST_IN_PKT | |
MID_IN_PKT | |
LAST_IN_PKT | |
ELOOP_0_PKT | |
ELOOP_1_PKT | |
ELOOP_01_PKT |
Definition at line 17 of file hexagon_arch.h.
enum HexReverseAction |
RZ_API void hex_const_ext_free | ( | HexConstExt * | ce | ) |
RZ_API HexLoopAttr hex_get_loop_flag | ( | const HexPkt * | p | ) |
Returns the loop type of a packet. Though only if this packet is the last packet in last packet in a hardware loop. Otherwise it returns HEX_NO_LOOP.
p | The instruction packet. |
Definition at line 446 of file hexagon_arch.c.
References HEX_LOOP_0, HEX_LOOP_01, HEX_LOOP_1, HEX_NO_LOOP, is_endloop01_pkt(), is_endloop0_pkt(), is_endloop1_pkt(), is_undoc_endloop0_pkt(), p, rz_list_get_n(), rz_list_length(), and RZ_LOG_VERBOSE.
Referenced by hex_set_pkt_info(), and hexagon_disasm_instruction().
Returns the index of an addr in a given packet.
addr | Address of an instruction. |
p | The packet. to search in. |
Definition at line 103 of file hexagon_arch.c.
References addr, hi(), i, NULL, p, rz_return_val_if_fail, and UT8_MAX.
Referenced by resolve_n_register().
Initializes each packet of the state once.
Definition at line 217 of file hexagon_arch.c.
References calloc(), hex_clear_pkt(), hex_const_ext_free(), hex_insn_free(), HEXAGON_STATE_PKTS, i, NULL, rz_list_newf(), and RZ_LOG_FATAL.
Referenced by hex_set_pkt_info(), and hexagon_reverse_opcode().
RZ_API void hexagon_reverse_opcode | ( | const RzAsm * | rz_asm, |
HexReversedOpcode * | rz_reverse, | ||
const ut8 * | buf, | ||
const ut64 | addr | ||
) |
Reverses a given opcode and copies the result into one of the rizin structs in rz_reverse.
rz_reverse | Rizin core structs which store asm and analysis information. |
buf | The buffer which stores the current opcode. |
addr | The address of the current opcode. |
Definition at line 772 of file hexagon_arch.c.
References HexReversedOpcode::action, addr, HexReversedOpcode::ana_op, HexReversedOpcode::asm_op, rz_asm_op_t::asm_toks, rz_asm_op_t::buf_asm, hex_add_instr_to_state(), hex_get_instr_at_addr(), hex_get_pkt(), HEXAGON_ANALYSIS, HEXAGON_DISAS, hexagon_disasm_instruction(), hexagon_get_state(), hi(), memcpy(), RzAsmTokenString::op_type, p, rz_asm_tokenize_asm_regex(), RZ_LOG_FATAL, rz_read_le32(), rz_strbuf_set(), and setup_new_instr().
Referenced by hexagon_v6_op().