1
0
Fork 0

Merge pull request #3627 from d2k2-git/use-GUI_MAX_DISASSEMBLY_SIZE

align char buffer sizes with defined limit in GuiGetDisassembly
This commit is contained in:
Duncan Ogilvie 2025-07-21 13:31:31 +02:00 committed by GitHub
commit eda7c3296b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 9 deletions

View File

@ -219,7 +219,7 @@ bool cbInstrFindAll(int argc, char* argv[])
break;
i += foundoffset + 1;
result = addr + i - 1;
char msg[deflen] = "";
char msg[GUI_MAX_DISASSEMBLY_SIZE] = "";
sprintf_s(msg, "%p", (void*)result);
GuiReferenceSetRowCount(refCount + 1);
GuiReferenceSetCellContent(refCount, 0, msg);
@ -371,7 +371,7 @@ bool cbInstrFindAllMem(int argc, char* argv[])
continue;
}
char msg[deflen] = "";
char msg[GUI_MAX_DISASSEMBLY_SIZE] = "";
sprintf_s(msg, "%p", (void*)result);
GuiReferenceSetRowCount(refCount + 1);
GuiReferenceSetCellContent(refCount, 0, msg);
@ -623,7 +623,7 @@ static bool cbRefStr(Zydis* disasm, BASIC_INSTRUCTION_INFO* basicinfo, REFINFO*
sprintf_s(strAddrText, "%p", (void*)strAddr);
GuiReferenceSetRowCount(refinfo->refcount + 1);
GuiReferenceSetCellContent(refinfo->refcount, 0, addrText);
char disassembly[4096] = "";
char disassembly[GUI_MAX_DISASSEMBLY_SIZE] = "";
if(GuiGetDisassembly((duint)disasm->Address(), disassembly))
GuiReferenceSetCellContent(refinfo->refcount, 1, disassembly);
else
@ -668,7 +668,7 @@ static bool cbRefFuncPtr(Zydis* disasm, BASIC_INSTRUCTION_INFO* basicinfo, REFIN
sprintf_s(addrText, "%p", (void*)(duint)disasm->Address());
GuiReferenceSetRowCount(refinfo->refcount + 1);
GuiReferenceSetCellContent(refinfo->refcount, 0, addrText);
char disassembly[4096] = "";
char disassembly[GUI_MAX_DISASSEMBLY_SIZE] = "";
if(GuiGetDisassembly((duint)disasm->Address(), disassembly))
GuiReferenceSetCellContent(refinfo->refcount, 1, disassembly);
else
@ -1010,7 +1010,7 @@ static bool cbGUIDFind(Zydis* disasm, BASIC_INSTRUCTION_INFO* basicinfo, REFINFO
sprintf_s(addrText, "%p", (void*)(duint)disasm->Address());
GuiReferenceSetRowCount(refinfo->refcount + 1);
GuiReferenceSetCellContent(refinfo->refcount, 0, addrText);
char disassembly[4096] = "";
char disassembly[GUI_MAX_DISASSEMBLY_SIZE] = "";
if(GuiGetDisassembly((duint)disasm->Address(), disassembly))
GuiReferenceSetCellContent(refinfo->refcount, 1, disassembly);
else