Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | kd_ioc_t |
Macros | |
#define | KD_PACKET_UNUSED 0x00000000 |
#define | KD_PACKET_DATA 0x30303030 |
#define | KD_PACKET_CTRL 0x69696969 |
#define | KD_INITIAL_PACKET_ID 0x80800000 |
#define | KD_MAX_PAYLOAD 0x480 |
#define | KD_PACKET_MAX_SIZE 4000 |
#define | KD_RET_OK 0x00000000 |
#define | KD_RET_ERR 0xC0000001 |
#define | KD_RET_ENOENT 0xC000000F |
#define | KD_MACH_I386 0x014C |
#define | KD_MACH_IA64 0x0200 |
#define | KD_MACH_AMD64 0x8664 |
#define | KD_MACH_ARM 0x01c0 |
#define | KD_MACH_EBC 0x0EBC |
#define | DBGKD_VERS_FLAG_DATA 0x0002 |
#define | DBGKD_VERS_FLAG_PTR64 0x0004 |
#define | KD_EXC_BKPT 0x80000003 |
#define | KDNET_MAGIC 0x4d444247 |
#define | KDNET_HMACKEY_SIZE 32 |
#define | KDNET_HMAC_SIZE 16 |
#define | KDNET_PACKET_TYPE_DATA 0 |
#define | KDNET_PACKET_TYPE_CONTROL 1 |
#define | KDNET_DATA_SIZE 8 |
#define | KDNET_DATA_DIRECTION_MASK 0x80 |
#define | KDNET_DATA_PADSIZE_MASK 0x7F |
#define | KDNET_DATA_SEQNO_MASK 0xFFFFFF00 |
#define | ASSERT_CONCAT_(a, b) a##b |
#define | ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b) |
#define | ct_assert(e) enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (!!(e)) } |
Typedefs | |
typedef struct kd_ioc_t | kd_ioc_t |
Functions | |
RZ_PACKED (typedef struct kd_req_t { ut32 req;ut16 cpu_level;ut16 cpu;ut32 ret;ut32 pad;union { RZ_PACKED(struct { ut64 addr;ut32 length;ut32 read;}) rz_mem;RZ_PACKED(struct { ut16 major;ut16 minor;ut8 proto_major;ut8 proto_minor;ut16 flags;ut16 machine;ut8 misc[6];ut64 kernel_base;ut64 mod_addr;ut64 dbg_addr;}) rz_ver;struct { ut32 reason;ut32 tf;ut32 dr7;ut32 css;ut32 cse;} rz_cont;struct { ut64 addr;ut32 handle;} rz_set_bp;struct { ut32 handle;} rz_del_bp;struct { ut64 addr;ut32 flags;} rz_set_ibp;struct { ut64 addr;ut32 flags;ut32 calls;} rz_get_ibp;struct { ut32 flags;} rz_ctx;struct { ut32 offset;ut32 count;ut32 copied;} rz_ctx_ex;struct { ut64 addr;ut64 reserved;ut32 address_space;ut32 flags;} rz_query_mem;ut8 raw[40];};ut8 data[];}) kd_req_t | |
RZ_PACKED (typedef struct kd_stc_64 { ut32 state;ut16 cpu_level;ut16 cpu;ut32 cpu_count;ut32 pad1;ut64 kthread;ut64 pc;union { RZ_PACKED(struct { ut32 code;ut32 flags;ut64 ex_record;ut64 ex_addr;}) exception;RZ_PACKED(struct { ut64 pathsize;ut64 base;ut64 pid;ut32 checksum;ut32 size;ut8 unload;}) load_symbols;};}) kd_stc_64 | |
RZ_PACKED (typedef struct kd_packet_t { ut32 leader;ut16 type;ut16 length;ut32 id;ut32 checksum;ut8 data[];}) kd_packet_t | |
RZ_PACKED (typedef struct kdnet_packet_t { ut32 magic;ut8 version;ut8 type;}) kdnet_packet_t | |
ct_assert (sizeof(kd_packet_t)==16) | |
ct_assert (sizeof(kd_req_t)==56) | |
ct_assert (sizeof(kd_ioc_t)==64) | |
int | kd_send_ctrl_packet (io_desc_t *desc, const ut32 type, const ut32 id) |
int | kd_send_data_packet (io_desc_t *desc, const ut32 type, const ut32 id, const ut8 *req, const int req_len, const ut8 *buf, const ut32 buf_len) |
int | kd_read_packet (io_desc_t *desc, kd_packet_t **p) |
bool | kd_packet_is_valid (const kd_packet_t *p) |
int | kd_packet_is_ack (const kd_packet_t *p) |
ut32 | kd_data_checksum (const ut8 *buf, const ut64 buf_len) |
#define ct_assert | ( | e | ) | enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1 / (!!(e)) } |
anonymous enum |
Definition at line 41 of file kd.h.
enum KD_PACKET_TYPE |
Definition at line 18 of file kd.h.
ct_assert | ( | sizeof(kd_ioc_t) | = =64 | ) |
ct_assert | ( | sizeof(kd_packet_t) | = =16 | ) |
ct_assert | ( | sizeof(kd_req_t) | = =56 | ) |
Definition at line 154 of file kd.c.
References KD_PACKET_CTRL, KD_PACKET_DATA, KD_PACKET_UNUSED, and p.
Referenced by kd_read_packet().
Definition at line 80 of file kd.c.
References desc, eprintf, free(), iob_read(), kd_data_checksum(), KD_DBG, KD_E_IOERR, KD_E_MALFORMED, KD_E_OK, KD_IO_PIPE, KD_PACKET_DATA, kd_packet_is_valid(), KD_PACKET_TYPE_ACKNOWLEDGE, KD_PACKET_TYPE_RESEND, kd_send_ctrl_packet(), malloc(), memcpy(), NULL, and p.
Referenced by winkd_sync(), and winkd_wait_packet().
Definition at line 25 of file kd.c.
References desc, id, iob_write(), KD_E_IOERR, KD_E_OK, KD_PACKET_CTRL, and type.
Referenced by kd_read_packet(), and winkd_sync().
int kd_send_data_packet | ( | io_desc_t * | desc, |
const ut32 | type, | ||
const ut32 | id, | ||
const ut8 * | req, | ||
const int | req_len, | ||
const ut8 * | buf, | ||
const ut32 | buf_len | ||
) |
Definition at line 41 of file kd.c.
References buf_len, desc, id, iob_write(), kd_data_checksum(), KD_E_IOERR, KD_E_MALFORMED, KD_E_OK, KD_IO_PIPE, KD_MAX_PAYLOAD, KD_PACKET_DATA, PFMT32x, req, RZ_LOG_DEBUG, and type.
Referenced by do_io_reply(), winkd_continue(), and winkd_send_state_manipulate_req().
RZ_PACKED | ( | typedef struct kd_req_t { ut32 req;ut16 cpu_level;ut16 cpu;ut32 ret;ut32 pad;union { RZ_PACKED(struct { ut64 addr;ut32 length;ut32 read;}) rz_mem;RZ_PACKED(struct { ut16 major;ut16 minor;ut8 proto_major;ut8 proto_minor;ut16 flags;ut16 machine;ut8 misc[6];ut64 kernel_base;ut64 mod_addr;ut64 dbg_addr;}) rz_ver;struct { ut32 reason;ut32 tf;ut32 dr7;ut32 css;ut32 cse;} rz_cont;struct { ut64 addr;ut32 handle;} rz_set_bp;struct { ut32 handle;} rz_del_bp;struct { ut64 addr;ut32 flags;} rz_set_ibp;struct { ut64 addr;ut32 flags;ut32 calls;} rz_get_ibp;struct { ut32 flags;} rz_ctx;struct { ut32 offset;ut32 count;ut32 copied;} rz_ctx_ex;struct { ut64 addr;ut64 reserved;ut32 address_space;ut32 flags;} rz_query_mem;ut8 raw[40];};ut8 data[];} | ) |
RZ_PACKED | ( | typedef struct kd_stc_64 { ut32 state;ut16 cpu_level;ut16 cpu;ut32 cpu_count;ut32 pad1;ut64 kthread;ut64 pc;union { RZ_PACKED(struct { ut32 code;ut32 flags;ut64 ex_record;ut64 ex_addr;}) exception;RZ_PACKED(struct { ut64 pathsize;ut64 base;ut64 pid;ut32 checksum;ut32 size;ut8 unload;}) load_symbols;};} | ) |