Skip to content

Commit

Permalink
Merge f75c4fd into bba369d
Browse files Browse the repository at this point in the history
  • Loading branch information
torusrxxx committed Oct 2, 2023
2 parents bba369d + f75c4fd commit ca0b06d
Show file tree
Hide file tree
Showing 28 changed files with 2,895 additions and 419 deletions.
7 changes: 5 additions & 2 deletions src/gui/Src/BasicView/HexDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static int dwordStringMaxLength(HexDump::DwordViewMode mode);
static int qwordStringMaxLength(HexDump::QwordViewMode mode);
static int twordStringMaxLength(HexDump::TwordViewMode mode);

HexDump::HexDump(Architecture* architecture, QWidget* parent)
HexDump::HexDump(Architecture* architecture, QWidget* parent, MemoryPage* memPage)
: AbstractTableView(parent),
mArchitecture(architecture)
{
Expand All @@ -27,7 +27,10 @@ HexDump::HexDump(Architecture* architecture, QWidget* parent)

setRowCount(0);

mMemPage = new MemoryPage(0, 0);
if(!memPage)
mMemPage = new MemoryPage(0, 0, this);
else
mMemPage = memPage;
mForceColumn = -1;

clearDescriptors();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/Src/BasicView/HexDump.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class HexDump : public AbstractTableView
std::function<void()> columnSwitch;
};

HexDump(Architecture* architecture, QWidget* parent = nullptr);
explicit HexDump(Architecture* architecture, QWidget* parent = nullptr, MemoryPage* memPage = nullptr);
~HexDump() override;

// Configuration
Expand Down Expand Up @@ -127,7 +127,7 @@ class HexDump : public AbstractTableView
void appendResetDescriptor(int width, QString title, bool clickable, ColumnDescriptor descriptor);
void clearDescriptors();

void printDumpAt(duint parVA, bool select, bool repaint = true, bool updateTableOffset = true);
virtual void printDumpAt(duint parVA, bool select, bool repaint = true, bool updateTableOffset = true);
duint rvaToVa(duint rva) const;

duint getTableOffsetRva() const;
Expand Down
5 changes: 3 additions & 2 deletions src/gui/Src/Gui/CPUDisassembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class CPUDisassembly : public Disassembly

// Context menu management
void setupRightClickContextMenu();
void addFollowReferenceMenuItem(QString name, duint value, QMenu* menu, bool isReferences, bool isFollowInCPU);
void setupFollowReferenceMenu(duint va, QMenu* menu, bool isReferences, bool isFollowInCPU);
void copySelectionSlot(bool copyBytes);
void copySelectionToFileSlot(bool copyBytes);
void setSideBar(CPUSideBar* sideBar);
Expand Down Expand Up @@ -116,6 +114,9 @@ public slots:

void pushSelectionInto(bool copyBytes, QTextStream & stream, QTextStream* htmlStream = nullptr);

void addFollowReferenceMenuItem(QString name, duint value, QMenu* menu, bool isReferences, bool isFollowInCPU);
void setupFollowReferenceMenu(duint va, QMenu* menu, bool isReferences, bool isFollowInCPU);

// Menus
QMenu* mHwSlotSelectMenu;
QMenu* mPluginMenu = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/Src/Gui/CustomizeMenuDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ CustomizeMenuDialog::CustomizeMenuDialog(QWidget* parent) :
viewName = tr("View");
else if(id == "TraceBrowser")
viewName = tr("Trace disassembler");
else if(id == "TraceDump")
viewName = tr("Trace dump");
else
continue;
// Add Parent Node
Expand Down
10 changes: 5 additions & 5 deletions src/gui/Src/Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
#include "MRUList.h"
#include "AboutDialog.h"
#include "UpdateChecker.h"
#include "Tracer/TraceBrowser.h"
#include "Tracer/TraceWidget.h"
#include "Tracer/TraceManager.h"
//#include "Tracer/TraceWidget.h"
#include "Utils/MethodInvoker.h"

MainWindow::MainWindow(QWidget* parent)
Expand Down Expand Up @@ -226,11 +226,11 @@ MainWindow::MainWindow(QWidget* parent)
mHandlesView->setWindowIcon(DIcon("handles"));

// Trace view
mTraceWidget = new TraceWidget(this);
mTraceWidget = new TraceManager(this);
mTraceWidget->setWindowTitle(tr("Trace"));
mTraceWidget->setWindowIcon(DIcon("trace"));
connect(mTraceWidget->getTraceBrowser(), SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
connect(mTraceWidget->getTraceBrowser(), SIGNAL(displayLogWidget()), this, SLOT(displayLogWidget()));
//connect(mTraceWidget->getTraceBrowser(), SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
//connect(mTraceWidget->getTraceBrowser(), SIGNAL(displayLogWidget()), this, SLOT(displayLogWidget()));

mTabWidget = new MHTabWidget(this, true, true);

Expand Down
4 changes: 2 additions & 2 deletions src/gui/Src/Gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SettingsDialog;
class SimpleTraceDialog;
class MRUList;
class UpdateChecker;
class TraceWidget;
class TraceManager;

namespace Ui
{
Expand Down Expand Up @@ -174,7 +174,7 @@ public slots:
CalculatorDialog* mCalculatorDialog;
HandlesView* mHandlesView;
NotesManager* mNotesManager;
TraceWidget* mTraceWidget;
TraceManager* mTraceWidget;
SimpleTraceDialog* mSimpleTraceDialog;
UpdateChecker* mUpdateChecker;
DebugStatusLabel* mStatusLabel;
Expand Down
6 changes: 3 additions & 3 deletions src/gui/Src/Memory/MemoryPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class MemoryPage : public QObject
public:
explicit MemoryPage(duint parBase, duint parSize, QObject* parent = nullptr);

bool read(void* parDest, dsint parRVA, duint parSize) const;
bool write(const void* parDest, dsint parRVA, duint parSize);
virtual bool read(void* parDest, dsint parRVA, duint parSize) const;
virtual bool write(const void* parDest, dsint parRVA, duint parSize);
duint getSize() const;
duint getBase() const;
duint va(dsint rva) const;
void setAttributes(duint base, duint size);
bool inRange(duint va) const;

private:
protected:
duint mBase;
duint mSize;
};

0 comments on commit ca0b06d

Please sign in to comment.