1
0
Fork 0

GUI: fixed painting modified bytes width + fixed branch destination + fixed bug with tokenizing 'call rax' + fixed a bug with tokenizing immediate values

This commit is contained in:
Mr. eXoDia 2014-07-06 21:39:47 +02:00
parent cc1a3125e9
commit 9f15966307
3 changed files with 11 additions and 5 deletions

View File

@ -351,7 +351,7 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
richBytes.push_back(curByte);
richBytes.push_back(space);
}
RichTextPainter::paintRichText(painter, x + jumpsize + funcsize, y, getColumnWidth(col), getRowHeight(), 0, &richBytes, getCharWidth());
RichTextPainter::paintRichText(painter, x, y, getColumnWidth(col), getRowHeight(), jumpsize + funcsize, &richBytes, getCharWidth());
}
break;
@ -700,7 +700,7 @@ int Disassembly::paintJumpsGraphic(QPainter* painter, int x, int y, int_t addr)
if(branchType && branchType!=RetType && branchType!=CallType)
{
int_t destRVA = (int_t)instruction.disasm.Instruction.AddrValue;
int_t destRVA = (int_t)DbgGetBranchDestination(rvaToVa(instruction.rva));
int_t base=mMemPage->getBase();
if(destRVA >= base && destRVA < base + (int_t)mMemPage->getSize())

View File

@ -277,7 +277,7 @@ void BeaTokenizer::Argument(BeaInstructionToken* instr, const DISASM* disasm, co
}
AddToken(instr, bracketsType, "]", 0);
}
else if(disasm->Instruction.BranchType != 0 && disasm->Instruction.BranchType != RetType) //jump/call
else if(disasm->Instruction.BranchType != 0 && disasm->Instruction.BranchType != RetType && (arg->ArgType&RELATIVE_)==RELATIVE_) //jump/call
{
BeaTokenValue value;
value.size=arg->ArgSize/8;
@ -288,6 +288,11 @@ void BeaTokenizer::Argument(BeaInstructionToken* instr, const DISASM* disasm, co
{
BeaTokenValue value;
value.size=arg->ArgSize/8;
//nice little hack
LONGLONG val;
sscanf(arg->ArgMnemonic, "%llX", &val);
value.value=val;
/*
switch(value.size)
{
case 1:
@ -303,6 +308,7 @@ void BeaTokenizer::Argument(BeaInstructionToken* instr, const DISASM* disasm, co
value.value=(long long)disasm->Instruction.Immediat;
break;
}
*/
BeaTokenType type=TokenValue;
if(DbgMemIsValidReadPtr(value.value)) //pointer
type=TokenAddress;

View File

@ -72,7 +72,7 @@ bool CPUSideBar::isJump(int i) const
{
uint_t start=CodePtr->getBase();
uint_t end=start+CodePtr->getSize();
uint_t addr=InstrBuffer->at(i).disasm.Instruction.AddrValue;
uint_t addr=DbgGetBranchDestination(CodePtr->rvaToVa(InstrBuffer->at(i).rva));
return addr>=start && addr<end; //do not draw jumps that go out of the section
}
return false;
@ -117,7 +117,7 @@ void CPUSideBar::paintEvent(QPaintEvent *event)
jumpoffset++;
int_t destVA = (int_t)instr.disasm.Instruction.AddrValue;
int_t destVA = (int_t)DbgGetBranchDestination(CodePtr->rvaToVa(instr.rva));
if(instr.disasm.Instruction.Opcode == 0xFF)
continue;