Skip to content

Commit

Permalink
[FEATURE] Show MsgBox about PE anomalies only single load (otherwise:…
Browse files Browse the repository at this point in the history
… on status bar) - Issue #11
  • Loading branch information
hasherezade committed Feb 21, 2023
1 parent 8f6cbf4 commit 3135c44
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pe-bear/gui/windows/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,9 @@ void MainWindow::onExeHandlerAdded(PeHandler* hndl)
{
if (hndl == NULL) return;

const QString loadInfo = "Loaded: "+ hndl->getFullName();
const QString loadInfo = "Loaded: " + hndl->getFullName();
this->statusBar.showMessage(loadInfo);
this->loadTagsForPe(hndl);

// show warnings:
QStringList peInfo;
if (hndl->isPeAtypical(&peInfo)) {
QMessageBox::warning(this, "Warning", hndl->getFullName() + ":\n" + peInfo.join("\n"));
}
}

int MainWindow::openMultiplePEs(QStringList fNames)
Expand Down Expand Up @@ -914,6 +908,12 @@ PeHandler* MainWindow::loadPE(QString fName, const bool showAlert)
QString alert = "The file: \n " + fName + "\n is too big and was loaded truncated!";
QMessageBox::StandardButton res = QMessageBox::warning(this, "Too big file!", alert, QMessageBox::Ok);
}
// show warnings:
QStringList peInfo;
if (hndl->isPeAtypical(&peInfo)) {
this->statusBar.showMessage("WARNING: " + hndl->getFullName() + ": " + peInfo.join(";"));
if (showAlert) QMessageBox::warning(this, "Warning", hndl->getFullName() + ":\n" + peInfo.join("\n"));
}
return hndl;
}

Expand Down

0 comments on commit 3135c44

Please sign in to comment.