Skip to content

Commit c09bba8

Browse files
committed
skip bndb in triage file picker
1 parent 9f9cf3a commit c09bba8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

examples/triage/files.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <QtWidgets/QVBoxLayout>
22
#include <QtWidgets/QMessageBox>
33
#include <QtCore/QSettings>
4+
#include "binaryninjaapi.h"
45
#include "files.h"
56

67

@@ -70,8 +71,19 @@ void TriageFilePicker::openSelectedFiles()
7071
SettingsRef settings = BinaryNinja::Settings::Instance();
7172

7273
for (auto& index : m_tree->selectionModel()->selectedIndexes())
74+
{
75+
if (index.column() != 0)
76+
continue;
77+
7378
if (m_model->fileInfo(index).isFile())
74-
files.insert(m_model->fileInfo(index).absoluteFilePath());
79+
{
80+
QString filepath = m_model->fileInfo(index).absoluteFilePath();
81+
if (filepath.toLower().endsWith(".bndb"))
82+
BinaryNinja::LogWarn("Skipping .bndb file in triage mode: %s", filepath.toStdString().c_str());
83+
else
84+
files.insert(filepath);
85+
}
86+
}
7587

7688
for (auto& filename : files)
7789
{

0 commit comments

Comments
 (0)