Rizin
unix-like reverse engineering framework and cli tools
libbochs.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2016 SkUaTeR <skuater@hotmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
5 #ifndef LIBBOCHS_H
6 #define LIBBOCHS_H
7 
8 #include <rz_util.h>
9 
10 #if __WINDOWS__
11 #include <windows.h>
12 #endif
13 
14 typedef struct libbochs_t {
15  char *data;
17  int sizeSend;
18 #if __WINDOWS__
23  HANDLE ghWriteEvent;
24  PROCESS_INFORMATION processInfo;
25  STARTUPINFO info;
26 #else
31  int pid;
32 
33 #endif
34  bool isRunning;
36 
37 // DWORD WINAPI MyThLector_(LPVOID lpParam)
38 // DWORD WINAPI MyThEscritor_(LPVOID lpParam)
39 bool bochs_wait(libbochs_t *b);
42 void bochs_send_cmd(libbochs_t *b, const char *comando, bool bWait);
43 int bochs_read(libbochs_t *b, ut64 addr, int count, ut8 *buf);
44 void bochs_close(libbochs_t *b);
45 bool bochs_open(libbochs_t *b, const char *rutaBochs, const char *rutaConfig);
46 
47 #define ENABLE_DEBUG 0
48 #if ENABLE_DEBUG
49 #define lprintf(x, y...) \
50  { \
51  FILE *fd; \
52  fd = fopen("bochs.io.log", "a"); \
53  if (fd) { \
54  fprintf(fd, x, ##y); \
55  fflush(fd); \
56  fclose(fd); \
57  } \
58  }
59 #else
60 #ifdef _MSC_VER
61 #define lprintf(x, ...) \
62  {}
63 #else
64 #define lprintf(x, y...) \
65  {}
66 #endif
67 #endif
68 
73 #endif
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
Definition: sflib.h:98
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
int bochs_read(libbochs_t *b, ut64 addr, int count, ut8 *buf)
Definition: libbochs.c:136
bool bochs_wait(libbochs_t *b)
Definition: libbochs.c:70
void bochs_send_cmd(libbochs_t *b, const char *comando, bool bWait)
Definition: libbochs.c:117
bool bochs_open(libbochs_t *b, const char *rutaBochs, const char *rutaConfig)
Definition: libbochs.c:188
void bochs_close(libbochs_t *b)
Definition: libbochs.c:168
struct libbochs_t libbochs_t
void bochs_reset_buffer(libbochs_t *b)
Definition: libbochs.c:40
bool bochs_cmd_stop(libbochs_t *b)
Definition: libbochs.c:45
#define b(i)
Definition: sha256.c:42
int hWritePipeOut
Definition: libbochs.h:30
int hReadPipeIn
Definition: libbochs.h:27
int sizeSend
Definition: libbochs.h:17
int pid
Definition: libbochs.h:31
int hWritePipeIn
Definition: libbochs.h:29
bool isRunning
Definition: libbochs.h:34
int hReadPipeOut
Definition: libbochs.h:28
char * data
Definition: libbochs.h:15
int punteroBuffer
Definition: libbochs.h:16
DWORD * HANDLE
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58