rizin/subprojects/rzbochs/include/libbochs.h
Riccardo Schirone 6f40dfe493
Move remaining things from shlr/ to meson subprojects (#2126)
* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
2021-12-22 09:20:39 +08:00

73 lines
1.4 KiB
C

// SPDX-FileCopyrightText: 2016 SkUaTeR <skuater@hotmail.com>
// SPDX-License-Identifier: LGPL-3.0-only
/*! \file */
#ifndef LIBBOCHS_H
#define LIBBOCHS_H
#include <rz_util.h>
#if __WINDOWS__
#include <windows.h>
#endif
typedef struct libbochs_t {
char *data;
int punteroBuffer;
int sizeSend;
#if __WINDOWS__
HANDLE hReadPipeIn;
HANDLE hReadPipeOut;
HANDLE hWritePipeIn;
HANDLE hWritePipeOut;
HANDLE ghWriteEvent;
PROCESS_INFORMATION processInfo;
STARTUPINFO info;
#else
int hReadPipeIn;
int hReadPipeOut;
int hWritePipeIn;
int hWritePipeOut;
int pid;
#endif
bool isRunning;
} libbochs_t;
// DWORD WINAPI MyThLector_(LPVOID lpParam)
// DWORD WINAPI MyThEscritor_(LPVOID lpParam)
bool bochs_wait(libbochs_t *b);
void bochs_reset_buffer(libbochs_t *b);
bool bochs_cmd_stop(libbochs_t *b);
void bochs_send_cmd(libbochs_t *b, const char *comando, bool bWait);
int bochs_read(libbochs_t *b, ut64 addr, int count, ut8 *buf);
void bochs_close(libbochs_t *b);
bool bochs_open(libbochs_t *b, const char *rutaBochs, const char *rutaConfig);
#define ENABLE_DEBUG 0
#if ENABLE_DEBUG
#define lprintf(x, y...) \
{ \
FILE *fd; \
fd = fopen("bochs.io.log", "a"); \
if (fd) { \
fprintf(fd, x, ##y); \
fflush(fd); \
fclose(fd); \
} \
}
#else
#ifdef _MSC_VER
#define lprintf(x, ...) \
{}
#else
#define lprintf(x, y...) \
{}
#endif
#endif
/*!
int gdbr_remove_bp(libgdbr_t* g, ut64 address);
int gdbr_remove_hwbp(libgdbr_t* g, ut64 address);
*/
#endif