From ff41cbc3305115ffabe8557dc198c44ad59c144c Mon Sep 17 00:00:00 2001 From: warmCabin Date: Fri, 25 Jun 2021 01:24:14 -0400 Subject: [PATCH] refine the logic so it still writes the raw bytes --- src/drivers/win/debugger.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index 947a3616..0c488b04 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -682,19 +682,20 @@ void Dump(FILE *fout, unsigned int startAddr, unsigned int endAddr) } break; } + Name* node; for (int j = 0; j < size; j++) { + // Write the raw bytes of this instruction swprintf(chr, L"%02X ", opcode[j] = GetMem(addr++)); - Name* node; + // wcscat(debug_wstr, chr); + fprintf(fout, "%ls", chr); if (j != size - 1 && (node = findNode(getNamesPointerForAddress(addr), addr))) { // We were treating this as an operand, but it's named! printf("$%04X - We were treating this as an operand, but it's named %s!\n", addr, node->name); - fprintf(fout, "XXXX\n"); - goto continueAddrLoop; // I don't care! YOU refactor it! + size = j + 1; + break; } - // wcscat(debug_wstr, chr); - fprintf(fout, "%ls", chr); } while (size < 3) { @@ -702,6 +703,11 @@ void Dump(FILE *fout, unsigned int startAddr, unsigned int endAddr) fprintf(fout, "%ls", L" "); size++; } + if (node) + { + fprintf(fout, " INTERRUPTED\n"); + goto continueAddrLoop; // I don't care! YOU refactor it! + } static char bufferForDisassemblyWithPlentyOfStuff[64 + NL_MAX_NAME_LEN * 10]; //"plenty" char* _a = Disassemble(addr, opcode);