22 if (
d &&
d->plugin &&
d->plugin->name) {
23 if (!strcmp(
"bochs",
d->plugin->name)) {
27 eprintf(
"error: the iodesc data is not bochs friendly\n");
59 if (!strncmp(
desc->
data,
"Num Type", 8)) {
75 }
while (
desc->
data[
i] !=
'<' &&
i < lenRec - 4);
78 snprintf(bufcmd,
sizeof(bufcmd),
"d %i",
n);
91 int i = 0,
pos = 0, lenRec = 0;
106 while (
desc->
data[
i] != 0 &&
i < lenRec - 4) {
110 strncpy(&strReg[2], &
desc->
data[
i + 5], 8);
111 strncpy(&strReg[10], &
desc->
data[
i + 14], 8);
120 if (!strncmp(
regname,
"rip", 3)) {
135 }
else if (strstr(
desc->
data,
"PC_80")) {
138 }
else if (strstr(
desc->
data,
"PC_64")) {
165 char *
s[] = {
"es:0x",
"cs:0x",
"ss:0x",
"ds:0x",
"fs:0x",
"gs:0x", 0 };
168 for (
n = 0;
s[
n] != 0;
n++) {
170 strncpy(&strReg[0],
x + 3, 7);
175 if ((
x = strstr(
x,
"base="))) {
176 strncpy(strBase,
x + 5, 10);
178 if ((
x = strstr(
x,
"limit="))) {
179 strncpy(strLimit,
x + 6, 10);
187 if (!strncmp(
regname,
"cs", 2)) {
188 valRIP += (
val * 0x10);
266 eprintf(
"bochs_debug_break: Sending break...\n");
278 char *ini = 0, *fin = 0;
312 if ((
x = strstr(
desc->
data,
"Next at"))) {
313 if ((ini = strstr(
x,
"[0x"))) {
314 if ((fin = strchr(ini,
']'))) {
315 int len = fin - ini - 1;
316 strncpy(strIP, ini + 1,
len);
340 if (
d &&
d->plugin &&
d->plugin->name &&
d->data) {
341 if (!strcmp(
"bochs",
d->plugin->name)) {
345 if ((
desc = &
g->desc)) {
376 "seg es 2 0x038 0 \n"
377 "seg cs 2 0x03A 0 \n"
378 "seg ss 2 0x03C 0 \n"
379 "seg ds 2 0x03E 0 \n"
380 "seg fs 2 0x040 0 \n"
381 "seg gs 2 0x042 0 \n"
383 "gpr rax 8 0x078 0 \n"
384 "gpr eax 4 0x078 0 \n"
385 "gpr ax 2 0x078 0 \n"
386 "gpr al 1 0x078 0 \n"
387 "gpr rcx 8 0x080 0 \n"
388 "gpr ecx 4 0x080 0 \n"
389 "gpr cx 2 0x080 0 \n"
390 "gpr cl 1 0x078 0 \n"
391 "gpr rdx 8 0x088 0 \n"
392 "gpr edx 4 0x088 0 \n"
393 "gpr dx 2 0x088 0 \n"
394 "gpr dl 1 0x088 0 \n"
395 "gpr rbx 8 0x090 0 \n"
396 "gpr ebx 4 0x090 0 \n"
397 "gpr bx 2 0x090 0 \n"
398 "gpr bl 1 0x090 0 \n"
399 "gpr rsp 8 0x098 0 \n"
400 "gpr esp 4 0x098 0 \n"
401 "gpr sp 2 0x098 0 \n"
402 "gpr spl 1 0x098 0 \n"
403 "gpr rbp 8 0x0A0 0 \n"
404 "gpr ebp 4 0x0A0 0 \n"
405 "gpr bp 2 0x0A0 0 \n"
406 "gpr bpl 1 0x0A0 0 \n"
407 "gpr rsi 8 0x0A8 0 \n"
408 "gpr esi 4 0x0A8 0 \n"
409 "gpr si 2 0x0A8 0 \n"
410 "gpr sil 1 0x0A8 0 \n"
411 "gpr rdi 8 0x0B0 0 \n"
412 "gpr edi 4 0x0B0 0 \n"
413 "gpr di 2 0x0B0 0 \n"
414 "gpr dil 1 0x0B0 0 \n"
415 "gpr r8 8 0x0B8 0 \n"
416 "gpr r8d 4 0x0B8 0 \n"
417 "gpr r8w 2 0x0B8 0 \n"
418 "gpr r8b 1 0x0B8 0 \n"
419 "gpr r9 8 0x0C0 0 \n"
420 "gpr r9d 4 0x0C0 0 \n"
421 "gpr r9w 2 0x0C0 0 \n"
422 "gpr r9b 1 0x0C0 0 \n"
423 "gpr r10 8 0x0C8 0 \n"
424 "gpr r10d 4 0x0C8 0 \n"
425 "gpr r10w 2 0x0C8 0 \n"
426 "gpr r10b 1 0x0C8 0 \n"
427 "gpr r11 8 0x0D0 0 \n"
428 "gpr r11d 4 0x0D0 0 \n"
429 "gpr r11w 2 0x0D0 0 \n"
430 "gpr r11b 1 0x0D0 0 \n"
431 "gpr r12 8 0x0D8 0 \n"
432 "gpr r12d 4 0x0D8 0 \n"
433 "gpr r12w 2 0x0D8 0 \n"
434 "gpr r12b 1 0x0D8 0 \n"
435 "gpr r13 8 0x0E0 0 \n"
436 "gpr r13d 4 0x0E0 0 \n"
437 "gpr r13w 2 0x0E0 0 \n"
438 "gpr r13b 1 0x0E0 0 \n"
439 "gpr r14 8 0x0E8 0 \n"
440 "gpr r14d 4 0x0E8 0 \n"
441 "gpr r14w 2 0x0E8 0 \n"
442 "gpr r14b 1 0x0E8 0 \n"
443 "gpr r15 8 0x0F0 0 \n"
444 "gpr r15d 4 0x0F0 0 \n"
445 "gpr r15w 2 0x0F0 0 \n"
446 "gpr r15b 1 0x0F0 0 \n"
447 "gpr rip 8 0x0F8 0 \n"
448 "gpr eip 4 0x0F8 0 \n"
449 "gpr csip 8 0x000 0 \n"
564 #ifndef RZ_PLUGIN_INCORE
int bits(struct state *s, int need)
static int mr(RzAnalysisEsil *esil, ut64 addr, ut8 *buf, int len)
RZ_API void rz_cons_break_pop(void)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
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 cmd
static int rz_debug_bochs_continue(RzDebug *dbg, int pid, int tid, int sig)
static int rz_debug_bochs_breakpoint(RzBreakpoint *bp, RzBreakpointItem *b, bool set)
static void bochs_debug_break(void *u)
static const char * rz_debug_bochs_reg_profile(RzDebug *dbg)
static RzList * rz_debug_bochs_map_get(RzDebug *dbg)
RZ_API RzLibStruct rizin_plugin
static bool isBochs(RzDebug *dbg)
static int rz_debug_bochs_detach(RzDebug *dbg, int pid)
void map_free(RzDebugMap *map)
static int rz_debug_bochs_attach(RzDebug *dbg, int pid)
static int rz_debug_bochs_step(RzDebug *dbg)
static int rz_debug_bochs_reg_read(RzDebug *dbg, int type, ut8 *buf, int size)
RzDebugPlugin rz_debug_plugin_bochs
static int rz_debug_bochs_reg_write(RzDebug *dbg, int type, const ut8 *buf, int size)
static int rz_debug_bochs_stop(RzDebug *dbg)
static RzDebugReasonType rz_debug_bochs_wait(RzDebug *dbg, int pid)
size_t map(int syms, int left, int len)
RZ_API void Ht_() free(HtName_(Ht) *ht)
bool bochs_wait(libbochs_t *b)
void bochs_send_cmd(libbochs_t *b, const char *comando, bool bWait)
bool bochs_cmd_stop(libbochs_t *b)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc pid
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
void(* RzListFree)(void *ptr)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
struct rz_io_desc_t * desc
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static char * regname(int reg)