diff options
Diffstat (limited to 'src/parser.c')
| -rw-r--r-- | src/parser.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/parser.c b/src/parser.c index 985543b..f6dd074 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,10 +1,9 @@ #include "parser.h" -#include <Windows.h> - #include "utils.h" #include "module.h" #include "stack_walk.h" +#include "disasm.h" extern u8 expect_single_step; extern DWORD continue_status; @@ -243,19 +242,19 @@ void run(struct ast_node* root) { if (((1ULL << index) & modules_list) == 0U) { struct module* module = &modules[index]; print("Module Name : %s\n", module->name); - print("Module Base : %xu\n", module->base_addr); - print("Module Size : %xu\n\n", module->nt_header.OptionalHeader.SizeOfImage); + print("Module Base : %x\n", module->base_addr); + print("Module Size : %x\n\n", module->nt_header.OptionalHeader.SizeOfImage); } } } else if (cur_node.token->type == TOKEN_PRINT_REG) { - print("RIP : %xu\n", ctx.Rip); - print("RCX : %xu\n", ctx.Rcx); - print("RDX : %xu\n", ctx.Rdx); - print("RBX : %xu\n", ctx.Rbx); - print("RSP : %xu\n", ctx.Rsp); - print("RBP : %xu\n", ctx.Rbp); - print("RSI : %xu\n", ctx.Rsi); - print("RDI : %xu\n", ctx.Rdi); + print("RIP : %.12x\n", ctx.Rip); + print("RCX : %.12x\n", ctx.Rcx); + print("RDX : %.12x\n", ctx.Rdx); + print("RBX : %.12x\n", ctx.Rbx); + print("RSP : %.12x\n", ctx.Rsp); + print("RBP : %.12x\n", ctx.Rbp); + print("RSI : %.12x\n", ctx.Rsi); + print("RDI : %.12x\n", ctx.Rdi); process_commands = TRUE; } else if (cur_node.token->type == TOKEN_STEP_INTO) { ctx.EFlags |= 0x100; // TRAP_FLAG @@ -279,7 +278,7 @@ void run(struct ast_node* root) { if(read_memory((const void*)addr, (void*)buf, size)) { for (u32 index = 0U; index < size; index += 8U) { - print("%xb %xb %xb %xb %xb %xb %xb %xb\n", buf[index], buf[index + 1U], buf[index + 2U], buf[index + 3U], buf[index + 4U], buf[index + 5U], buf[index + 6U], buf[index + 7U]); + print("%.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x\n", buf[index], buf[index + 1U], buf[index + 2U], buf[index + 3U], buf[index + 4U], buf[index + 5U], buf[index + 6U], buf[index + 7U]); } print("\n"); } else { @@ -309,7 +308,7 @@ void run(struct ast_node* root) { u32 end = module->functions_end[sym_index]; unassemble((u8*)module->base_addr + start, end - start); } else { - print("No symbol found at address %xu\n", ctx.Rip); + print("No symbol found at address %x\n", ctx.Rip); } } else { print("Command unknown\n"); |
