| 17 | #include <binaryninjacore.h> |
| 18 | |
| 19 | TriageView::TriageView(QWidget* parent, BinaryViewRef data) : QScrollArea(parent) |
| 20 | { |
| 21 | setupView(this); |
| 22 | m_data = data; |
| 23 | m_currentOffset = m_data->GetEntryPoint(); |
| 24 | |
| 25 | QWidget* container = new QWidget(this); |
| 26 | QVBoxLayout* layout = new QVBoxLayout(); |
| 27 | |
| 28 | QGroupBox* entropyGroup = new QGroupBox("Entropy", container); |
| 29 | QVBoxLayout* entropyLayout = new QVBoxLayout(); |
| 30 | entropyLayout->addWidget(new EntropyWidget(entropyGroup, this, m_data)); |
| 31 | entropyGroup->setLayout(entropyLayout); |
| 32 | layout->addWidget(entropyGroup); |
| 33 | |
| 34 | QGroupBox* fileInfoGroup = new QGroupBox("File Info", container); |
| 35 | QVBoxLayout* fileInfoLayout = new QVBoxLayout(); |
| 36 | fileInfoLayout->addWidget(new FileInfoWidget(fileInfoGroup, m_data)); |
| 37 | fileInfoGroup->setLayout(fileInfoLayout); |
| 38 | layout->addWidget(fileInfoGroup); |
| 39 | |
| 40 | Headers* hdr = nullptr; |
| 41 | if (m_data->GetTypeName() == "PE") |
| 42 | hdr = new PEHeaders(m_data); |
| 43 | else if (m_data->GetTypeName() != "Raw") |
| 44 | hdr = new GenericHeaders(m_data); |
| 45 | |
| 46 | if (hdr) |
| 47 | { |
| 48 | QGroupBox* headerGroup = new QGroupBox("Headers", container); |
| 49 | QVBoxLayout* headerLayout = new QVBoxLayout(); |
| 50 | HeaderWidget* headerWidget = new HeaderWidget(headerGroup, *hdr); |
| 51 | headerLayout->addWidget(headerWidget); |
| 52 | headerGroup->setLayout(headerLayout); |
| 53 | layout->addWidget(headerGroup); |
| 54 | delete hdr; |
| 55 | } |
| 56 | |
| 57 | auto fileMetadata = m_data->GetFile(); |
| 58 | if (m_data == fileMetadata->GetViewOfType("Raw") || m_data == fileMetadata->GetViewOfType("Mapped")) |
| 59 | { |
| 60 | QGroupBox* baseDetectionGroup = new QGroupBox("Base Address Detection", container); |
| 61 | QVBoxLayout* baseDetectionLayout = new QVBoxLayout(); |
| 62 | baseDetectionLayout->addWidget(new BaseAddressDetectionWidget(this, data)); |
| 63 | baseDetectionGroup->setLayout(baseDetectionLayout); |
| 64 | layout->addWidget(baseDetectionGroup); |
| 65 | } |
| 66 | |
| 67 | QGroupBox* librariesGroup = new QGroupBox("Libraries", container); |
| 68 | QVBoxLayout* librariesLayout = new QVBoxLayout(); |
| 69 | librariesLayout->addWidget(new LibrariesWidget(this, data)); |
| 70 | librariesGroup->setLayout(librariesLayout); |
| 71 | layout->addWidget(librariesGroup); |
| 72 | |
| 73 | if (m_data->IsExecutable()) |
| 74 | { |
| 75 | QSplitter* importExportSplitter = new QSplitter(Qt::Horizontal); |
| 76 |
nothing calls this directly
no test coverage detected