Rizin
unix-like reverse engineering framework and cli tools
io_rzk_windows.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2016 skuater <skuater@hotmail.com>
2 // SPDX-FileCopyrightText: 2016 Rakholiya Jenish
3 // SPDX-FileCopyrightText: 2017 Jose Diaz <josediazplay@gmail.com>
4 // SPDX-License-Identifier: LGPL-3.0-only
5 
6 #ifndef __IO_RZK_WINDOWS_H__
7 #define __IO_RZK_WINDOWS_H__
8 #include <rz_windows.h>
9 
10 #include <rz_io.h>
11 #include <rz_lib.h>
12 #include <rz_types.h>
13 #include <rz_util.h>
14 #include <sys/types.h>
15 
16 typedef struct {
18 } RzIOW32;
19 typedef struct _PPA {
20  LARGE_INTEGER address;
22  unsigned char buffer;
23 } PA, *PPA;
24 
33  USHORT LoadCount;
35  UCHAR FullPathName[256];
37 
38 typedef struct _RTL_PROCESS_MODULES {
42 
43 #define RZK_DEVICE "\\\\.\\rzk\\"
44 
45 #define IOCTL_CODE(DeviceType, Function, Method, Access) \
46  (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
47 #if 0
48 FILE_DEVICE_UNKNOWN 0x22
51 #endif
52 #define CLOSE_DRIVER IOCTL_CODE(0x22, 0x803, 0, 1 | 2)
53 #define IOCTL_READ_PHYS_MEM IOCTL_CODE(0x22, 0x807, 0, 1 | 2)
54 #define IOCTL_READ_KERNEL_MEM IOCTL_CODE(0x22, 0x804, 0, 1 | 2)
55 #define IOCTL_WRITE_KERNEL_MEM IOCTL_CODE(0x22, 0x805, 0, 1 | 2)
56 #define IOCTL_GET_PHYSADDR IOCTL_CODE(0x22, 0x809, 0, 1 | 2)
57 #define IOCTL_WRITE_PHYS_MEM IOCTL_CODE(0x22, 0x808, 0, 1 | 2)
58 #define IOCTL_GET_SYSTEM_MODULES IOCTL_CODE(0x22, 0x80a, 0, 1 | 2)
59 
60 extern HANDLE gHandleDriver;
61 
62 BOOL StartStopService(LPCTSTR lpServiceName, BOOL bStop);
63 int GetSystemModules(RzIO *io);
64 int ReadKernelMemory(ut64 address, ut8 *buf, int len);
65 int WriteKernelMemory(ut64 address, const ut8 *buf, int len);
66 int Init(const char *driverPath);
67 
68 #endif
size_t len
Definition: 6502dis.c:15
struct _PPA PA
HANDLE gHandleDriver
Definition: io_rzk_windows.c:8
struct _RTL_PROCESS_MODULES RTL_PROCESS_MODULES
int GetSystemModules(RzIO *io)
struct _RTL_PROCESS_MODULES * PRTL_PROCESS_MODULES
struct _RTL_PROCESS_MODULE_INFORMATION RTL_PROCESS_MODULE_INFORMATION
int ReadKernelMemory(ut64 address, ut8 *buf, int len)
struct _PPA * PPA
BOOL StartStopService(LPCTSTR lpServiceName, BOOL bStop)
int WriteKernelMemory(ut64 address, const ut8 *buf, int len)
struct _RTL_PROCESS_MODULE_INFORMATION * PRTL_PROCESS_MODULE_INFORMATION
int Init(const char *driverPath)
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
HANDLE hnd
LARGE_INTEGER address
DWORD len
unsigned char buffer
RTL_PROCESS_MODULE_INFORMATION Modules[1]
Definition: rz_io.h:59
#define FILE_WRITE_ACCESS
Definition: winapi.h:4492
#define FILE_READ_ACCESS
Definition: winapi.h:4488
DWORD * HANDLE
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
ULONG
PVOID
DWORD