Rizin
unix-like reverse engineering framework and cli tools
|
#include <errno.h>
#include <rz_crypto.h>
#include <rz_hash.h>
#include <rz_socket.h>
#include <rz_util.h>
#include "kd.h"
#include "transport.h"
Go to the source code of this file.
Classes | |
struct | iobnet_t |
Macros | |
#define | BUF_SIZE 4096 |
Typedefs | |
typedef struct iobnet_t | iobnet_t |
Functions | |
static ut64 | base36_decode (const char *str) |
static bool | _initializeDatakey (iobnet_t *obj, ut8 *resbuf, int size) |
static void * | iob_net_open (const char *path) |
static bool | iob_net_close (void *p) |
static bool | _encrypt (iobnet_t *obj, ut8 *buf, int size, int type) |
static ut8 * | _createKDNetPacket (iobnet_t *obj, const ut8 *buf, int size, int *osize, ut64 seqno, ut8 type) |
static bool | _decrypt (iobnet_t *obj, ut8 *buf, int size, int type) |
static bool | _sendResponsePacket (iobnet_t *obj, const ut8 *pokedata) |
static bool | _processControlPacket (iobnet_t *obj, const ut8 *ctrlbuf, int size) |
bool | _verifyhmac (iobnet_t *obj) |
static int | iob_net_read (void *p, uint8_t *obuf, const uint64_t count, const int timeout) |
static int | iob_net_write (void *p, const uint8_t *buf, const uint64_t count, const int timeout) |
Variables | |
static const char | d32 [] = "[\\]^_`abcd$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$efghijklmnopqrstuvwxyz{|}~" |
static const ut64 | pow36 [] |
io_backend_t | iob_net |
|
static |
Definition at line 241 of file iob_net.c.
References _encrypt(), calloc(), free(), iobnet_t::hash, iobnet_t::hmackey, KDNET_DATA_SIZE, KDNET_HMAC_SIZE, KDNET_HMACKEY_SIZE, KDNET_MAGIC, benchmark::md, memcpy(), NULL, off, rz_hash_cfg_final(), rz_hash_cfg_free(), rz_hash_cfg_get_result(), rz_hash_cfg_new_with_algo(), rz_hash_cfg_update(), rz_write_at_be32(), rz_write_at_be64(), rz_write_at_be8(), type, and iobnet_t::version.
Referenced by _sendResponsePacket(), and iob_net_write().
Definition at line 298 of file iob_net.c.
References iobnet_t::datakey, test_evm::end, KDNET_HMAC_SIZE, KDNET_PACKET_TYPE_CONTROL, KDNET_PACKET_TYPE_DATA, iobnet_t::key, memcpy(), rz_crypto_final(), rz_crypto_free(), rz_crypto_get_output(), rz_crypto_new(), rz_crypto_set_iv(), rz_crypto_set_key(), rz_crypto_use(), and type.
Referenced by iob_net_read().
Definition at line 182 of file iob_net.c.
References iobnet_t::datakey, test_evm::end, KDNET_HMAC_SIZE, KDNET_PACKET_TYPE_CONTROL, KDNET_PACKET_TYPE_DATA, iobnet_t::key, memcpy(), rz_crypto_final(), rz_crypto_free(), rz_crypto_get_output(), rz_crypto_new(), rz_crypto_set_iv(), rz_crypto_set_key(), rz_crypto_use(), and type.
Referenced by _createKDNetPacket().
Definition at line 88 of file iob_net.c.
References iobnet_t::datakey, iobnet_t::hash, iobnet_t::key, benchmark::md, memcpy(), NULL, rz_hash_cfg_final(), rz_hash_cfg_free(), rz_hash_cfg_get_result(), and rz_hash_cfg_update().
Referenced by _sendResponsePacket().
Definition at line 400 of file iob_net.c.
References _sendResponsePacket(), eprintf, iobnet_t::hasDatakey, rz_read_be64(), and ut64().
Referenced by iob_net_read().
Definition at line 352 of file iob_net.c.
References _createKDNetPacket(), _initializeDatakey(), calloc(), free(), iobnet_t::hasDatakey, i, iobnet_t::key_lock, memcpy(), rz_num_rand(), rz_read_be64(), rz_socket_write(), rz_th_lock_enter(), rz_th_lock_leave(), iobnet_t::sock, and ut64().
Referenced by _processControlPacket().
Definition at line 420 of file iob_net.c.
References iobnet_t::hash, iobnet_t::hmackey, KDNET_HMAC_SIZE, KDNET_HMACKEY_SIZE, benchmark::md, NULL, iobnet_t::read_buf, iobnet_t::read_size, rz_hash_cfg_final(), rz_hash_cfg_free(), rz_hash_cfg_get_result(), rz_hash_cfg_new_with_algo(), and rz_hash_cfg_update().
Referenced by iob_net_read().
Definition at line 48 of file iob_net.c.
References c, d32, eprintf, i, len, pow36, printf(), cmd_descs_generate::str, ut64(), UT64_ADD_OVFCHK, and v.
Referenced by iob_net_open().
|
static |
Definition at line 168 of file iob_net.c.
References free(), iobnet_t::hash, p, rz_hash_free(), rz_socket_close(), rz_socket_free(), and iobnet_t::sock.
|
static |
Definition at line 111 of file iob_net.c.
References base36_decode(), free(), iobnet_t::hash, iobnet_t::hmackey, i, key, iobnet_t::key, iobnet_t::key_lock, NULL, path, rz_hash_new(), RZ_NEW0, rz_socket_connect_udp, rz_socket_new(), RZ_STR_ISEMPTY, rz_th_lock_new(), rz_write_le64(), iobnet_t::sock, and strdup().
|
static |
Definition at line 440 of file iob_net.c.
References _decrypt(), _processControlPacket(), _verifyhmac(), BUF_SIZE, c, count, EINTR, eprintf, fail, KD_PACKET_TYPE_UNUSED, KDNET_DATA_SIZE, KDNET_HMAC_SIZE, KDNET_MAGIC, KDNET_PACKET_TYPE_CONTROL, memcpy(), obuf, p, iobnet_t::read_buf, iobnet_t::read_off, iobnet_t::read_size, RZ_MIN, rz_read_at_be16(), rz_read_at_be64(), rz_read_be32(), rz_socket_read(), iobnet_t::sock, and iobnet_t::version.
|
static |
Definition at line 519 of file iob_net.c.
References _createKDNetPacket(), count, free(), iobnet_t::key_lock, memcpy(), p, rz_socket_write(), rz_th_lock_enter(), rz_th_lock_leave(), iobnet_t::sock, ut64(), iobnet_t::write_buf, iobnet_t::write_off, and iobnet_t::write_size.
|
static |
Definition at line 42 of file iob_net.c.
Referenced by base36_decode().
io_backend_t iob_net |
Definition at line 564 of file iob_net.c.
Referenced by __open().
Definition at line 44 of file iob_net.c.
Referenced by base36_decode().