1
0
Fork 0

GUI: improvements to the DisassemblyPopup

This commit is contained in:
mrexodia 2016-10-17 12:46:02 +02:00 committed by Mr. eXoDia
parent 90b74dc764
commit 11d6d9a636
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 13 additions and 3 deletions

View File

@ -103,14 +103,24 @@ void DisassemblyPopup::setAddress(duint Address)
QList<dsint> rvaList;
dsint nextRva = rva;
bool hadBranch = false;
duint bestBranch = 0;
do
{
rvaList.append(nextRva);
Instruction_t instruction = parent->DisassembleAt(nextRva);
if(!hadBranch && instruction.tokens.tokens[0].text.toLower() == "ret")
break;
if(instruction.branchDestination)
if(!hadBranch || bestBranch <= instruction.rva + base)
{
if(instruction.instStr.contains("ret"))
break;
if(instruction.instStr.contains("jmp") && instruction.instStr.contains("["))
break;
}
if(instruction.branchDestination && !instruction.instStr.contains("call"))
{
hadBranch = true;
if(instruction.branchDestination > bestBranch)
bestBranch = instruction.branchDestination;
}
auto nextRva2 = nextRva + instruction.length;
if(nextRva2 == nextRva)
break;