GUI: improve InfoBox for bigger memory sizes
This commit is contained in:
parent
d780df76df
commit
e11701d7c3
|
@ -8,22 +8,6 @@
|
|||
#include "memory.h"
|
||||
#include "datainst_helper.h"
|
||||
|
||||
static MEMORY_SIZE argsize2memsize(int argsize)
|
||||
{
|
||||
switch(argsize)
|
||||
{
|
||||
case 8:
|
||||
return size_byte;
|
||||
case 16:
|
||||
return size_word;
|
||||
case 32:
|
||||
return size_dword;
|
||||
case 64:
|
||||
return size_qword;
|
||||
}
|
||||
return size_byte;
|
||||
}
|
||||
|
||||
void fillbasicinfo(Zydis* cp, BASIC_INSTRUCTION_INFO* basicinfo, bool instrText)
|
||||
{
|
||||
//zero basicinfo
|
||||
|
|
|
@ -134,8 +134,8 @@ void CPUInfoBox::disasmSelectionChanged(dsint parVA)
|
|||
valText = valTextSym;
|
||||
argMnemonic = !ok ? QString("%1]=[%2").arg(argMnemonic).arg(valText) : valText;
|
||||
QString sizeName = "";
|
||||
int memsize = basicinfo.memory.size;
|
||||
switch(memsize)
|
||||
bool knownsize = true;
|
||||
switch(basicinfo.memory.size)
|
||||
{
|
||||
case size_byte:
|
||||
sizeName = "byte ptr ";
|
||||
|
@ -149,8 +149,10 @@ void CPUInfoBox::disasmSelectionChanged(dsint parVA)
|
|||
case size_qword:
|
||||
sizeName = "qword ptr ";
|
||||
break;
|
||||
default:
|
||||
knownsize = false;
|
||||
break;
|
||||
}
|
||||
sizeName.append(' ');
|
||||
|
||||
sizeName += [](SEGMENTREG seg)
|
||||
{
|
||||
|
@ -177,12 +179,38 @@ void CPUInfoBox::disasmSelectionChanged(dsint parVA)
|
|||
sizeName = sizeName.toUpper();
|
||||
|
||||
if(!DbgMemIsValidReadPtr(arg.value))
|
||||
{
|
||||
setInfoLine(j, sizeName + "[" + argMnemonic + "]=???");
|
||||
else
|
||||
}
|
||||
else if(knownsize)
|
||||
{
|
||||
QString addrText = getSymbolicNameStr(arg.memvalue);
|
||||
setInfoLine(j, sizeName + "[" + argMnemonic + "]=" + addrText);
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: properly support XMM constants
|
||||
QVector<unsigned char> data;
|
||||
data.resize(basicinfo.memory.size);
|
||||
memset(data.data(), 0, data.size());
|
||||
if(DbgMemRead(arg.value, data.data(), data.size()))
|
||||
{
|
||||
QString hex;
|
||||
hex.reserve(data.size() * 3);
|
||||
for(int k = 0; k < data.size(); k++)
|
||||
{
|
||||
if(k)
|
||||
hex.append(' ');
|
||||
hex.append(ToByteString(data[k]));
|
||||
}
|
||||
setInfoLine(j, sizeName + "[" + argMnemonic + "]=" + hex);
|
||||
}
|
||||
else
|
||||
{
|
||||
setInfoLine(j, sizeName + "[" + argMnemonic + "]=???");
|
||||
}
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "MiscUtil.h"
|
||||
#include "ldconvert.h"
|
||||
|
||||
|
||||
QString ToLongDoubleString(void* buffer)
|
||||
{
|
||||
char str[32];
|
||||
|
|
Loading…
Reference in New Issue