let goto file offset dialog has a init value of current selected address
This commit is contained in:
parent
dbb6e7e322
commit
e5cd1813ef
|
|
@ -1003,6 +1003,17 @@ void CPUDisassembly::gotoFileOffsetSlot()
|
|||
mGotoOffset->fileOffset = true;
|
||||
mGotoOffset->modName = QString(modname);
|
||||
mGotoOffset->setWindowTitle(tr("Goto File Offset in ") + QString(modname));
|
||||
QString offsetOfSelected;
|
||||
prepareDataRange(getSelectionStart(), getSelectionEnd(), [&](int, const Instruction_t & inst)
|
||||
{
|
||||
duint addr = rvaToVa(inst.rva);
|
||||
duint offset = DbgFunctions()->VaToFileOffset(addr);
|
||||
if(offset)
|
||||
offsetOfSelected = ToHexString(offset);
|
||||
return false;
|
||||
});
|
||||
if(!offsetOfSelected.isEmpty())
|
||||
mGotoOffset->setInitialExpression(offsetOfSelected);
|
||||
if(mGotoOffset->exec() != QDialog::Accepted)
|
||||
return;
|
||||
duint value = DbgValFromString(mGotoOffset->expressionText.toUtf8().constData());
|
||||
|
|
|
|||
|
|
@ -585,6 +585,10 @@ void CPUDump::gotoFileOffsetSlot()
|
|||
mGotoOffset->fileOffset = true;
|
||||
mGotoOffset->modName = QString(modname);
|
||||
mGotoOffset->setWindowTitle(tr("Goto File Offset in %1").arg(QString(modname)));
|
||||
duint addr = rvaToVa(getInitialSelection());
|
||||
duint offset = DbgFunctions()->VaToFileOffset(addr);
|
||||
if(offset)
|
||||
mGotoOffset->setInitialExpression(ToHexString(offset));
|
||||
if(mGotoOffset->exec() != QDialog::Accepted)
|
||||
return;
|
||||
duint value = DbgValFromString(mGotoOffset->expressionText.toUtf8().constData());
|
||||
|
|
|
|||
Loading…
Reference in New Issue