Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_io.h>
#include <rz_lib.h>
#include <rz_types.h>
#include <rz_util.h>
#include <rz_util/rz_print.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <errno.h>
Go to the source code of this file.
Classes | |
struct | io_rzk_linux |
struct | rzk_data |
struct | rzk_kernel_map_info |
struct | rzk_kernel_maps |
struct | rzk_control_reg |
struct | rzk_proc_info |
Functions | |
int | ReadMemory (RzIO *io, RzIODesc *iodesc, int ioctl_n, size_t pid, size_t address, ut8 *buf, int len) |
int | WriteMemory (RzIO *io, RzIODesc *iodesc, int ioctl_n, size_t pid, ut64 address, const ut8 *buf, int len) |
int | run_ioctl_command (RzIO *io, RzIODesc *iodesc, const char *buf) |
Variables | |
struct io_rzk_linux | rzk_struct |
#define GET_KERNEL_MAP 0x7 |
Definition at line 94 of file io_rzk_linux.h.
#define IOCTL_GET_KERNEL_MAP _IOR(RZ_TYPE, GET_KERNEL_MAP, rzk_kernel_maps_size) |
Definition at line 116 of file io_rzk_linux.h.
#define IOCTL_PRINT_PROC_INFO _IOR(RZ_TYPE, PRINT_PROC_INFO, rzk_data_size) |
Definition at line 118 of file io_rzk_linux.h.
#define IOCTL_READ_CONTROL_REG _IOR(RZ_TYPE, READ_CONTROL_REG, rzk_control_reg_size) |
Definition at line 117 of file io_rzk_linux.h.
#define IOCTL_READ_KERNEL_MEMORY _IOR(RZ_TYPE, READ_KERNEL_MEMORY, rzk_data_size) |
Definition at line 110 of file io_rzk_linux.h.
#define IOCTL_READ_PHYSICAL_ADDR _IOR(RZ_TYPE, READ_PHYSICAL_ADDR, rzk_data_size) |
Definition at line 114 of file io_rzk_linux.h.
#define IOCTL_READ_PROCESS_ADDR _IOR(RZ_TYPE, READ_PROCESS_ADDR, rzk_data_size) |
Definition at line 112 of file io_rzk_linux.h.
#define IOCTL_WRITE_KERNEL_MEMORY _IOR(RZ_TYPE, WRITE_KERNEL_MEMORY, rzk_data_size) |
Definition at line 111 of file io_rzk_linux.h.
#define IOCTL_WRITE_PHYSICAL_ADDR _IOR(RZ_TYPE, WRITE_PHYSICAL_ADDR, rzk_data_size) |
Definition at line 115 of file io_rzk_linux.h.
#define IOCTL_WRITE_PROCESS_ADDR _IOR(RZ_TYPE, WRITE_PROCESS_ADDR, rzk_data_size) |
Definition at line 113 of file io_rzk_linux.h.
#define MAX_PHYS_ADDR 128 |
Definition at line 19 of file io_rzk_linux.h.
#define PRINT_PROC_INFO 0x9 |
Definition at line 96 of file io_rzk_linux.h.
#define READ_CONTROL_REG 0x8 |
Definition at line 95 of file io_rzk_linux.h.
#define READ_KERNEL_MEMORY 0x1 |
Definition at line 88 of file io_rzk_linux.h.
#define READ_PHYSICAL_ADDR 0x5 |
Definition at line 92 of file io_rzk_linux.h.
#define READ_PROCESS_ADDR 0x3 |
Definition at line 90 of file io_rzk_linux.h.
#define RZ_TYPE 0x69 |
Definition at line 86 of file io_rzk_linux.h.
#define rzk_control_reg_size sizeof(struct rzk_control_reg) |
Definition at line 106 of file io_rzk_linux.h.
#define rzk_data_size sizeof(struct rzk_data) |
Definition at line 104 of file io_rzk_linux.h.
#define rzk_kernel_maps_size sizeof(struct rzk_kernel_maps) |
Definition at line 105 of file io_rzk_linux.h.
#define rzk_proc_info_size sizeof(struct rzk_proc_info) |
Definition at line 107 of file io_rzk_linux.h.
#define VM_EXEC 0x4 |
Definition at line 122 of file io_rzk_linux.h.
#define VM_MAYSHARE 0x80 |
Definition at line 123 of file io_rzk_linux.h.
#define VM_READ 0x1 |
Definition at line 120 of file io_rzk_linux.h.
#define VM_WRITE 0x2 |
Definition at line 121 of file io_rzk_linux.h.
#define WRITE_KERNEL_MEMORY 0x2 |
Definition at line 89 of file io_rzk_linux.h.
#define WRITE_PHYSICAL_ADDR 0x6 |
Definition at line 93 of file io_rzk_linux.h.
#define WRITE_PROCESS_ADDR 0X4 |
Definition at line 91 of file io_rzk_linux.h.
int ReadMemory | ( | RzIO * | io, |
RzIODesc * | iodesc, | ||
int | ioctl_n, | ||
size_t | pid, | ||
size_t | address, | ||
ut8 * | buf, | ||
int | len | ||
) |
Definition at line 272 of file io_rzk_linux.c.
References rzk_data::addr, rzk_data::buff, calloc(), rz_io_t::cb_printf, rz_io_desc_t::data, free(), ioctl, len, rzk_data::len, memcpy(), memset(), pid, rzk_data::pid, and ut64().
Referenced by run_old_command(), and rzk__read().
Definition at line 842 of file io_rzk_linux.c.
References run_new_command(), run_old_command(), and rz_str_ichr().
Referenced by rzk__system().
int WriteMemory | ( | RzIO * | io, |
RzIODesc * | iodesc, | ||
int | ioctl_n, | ||
size_t | pid, | ||
ut64 | address, | ||
const ut8 * | buf, | ||
int | len | ||
) |
Definition at line 351 of file io_rzk_linux.c.
References rzk_data::addr, rzk_data::buff, calloc(), rz_io_t::cb_printf, rz_io_desc_t::data, free(), ioctl, len, rzk_data::len, memcpy(), pid, rzk_data::pid, rzk_struct, io_rzk_linux::wp, and rzk_data::wp.
Referenced by run_old_command(), and rzk__write().
|
extern |
Referenced by run_new_command(), run_old_command(), rzk__open(), rzk__read(), rzk__write(), and WriteMemory().