Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
QT_VERSION: [5.15.2]
QT_VERSION: [5.15.*, 6.8.*]
steps:
- name: Install Dependencies
run: sudo apt-get install -y libcapstone-dev libgraphviz-dev
Expand Down
20 changes: 19 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,25 @@ else()
endif()
endif()

find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core)
option(FORCE_QT5 "Force Building With Qt5 Even If Qt6 Is Present")
if(FORCE_QT5)
find_package(Qt5 REQUIRED COMPONENTS Core)
set(QT_VERSION_MAJOR 5)
else()
find_package(Qt6 COMPONENTS Core)
if(Qt6_FOUND)
set(QT_VERSION_MAJOR 6)
else()
find_package(Qt5 REQUIRED COMPONENTS Core)
set(QT_VERSION_MAJOR 5)
endif()
endif()

if(DEFINED QT_VERSION_MAJOR)
message("Configured With Qt ${QT_VERSION_MAJOR}")
else()
message(FATAL_ERROR "No compatible version of Qt was found")
endif()

include_directories("include")

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


edb is a cross platform AArch32/x86/x86-64 debugger. It was inspired by [Ollydbg](http://www.ollydbg.de/ "Ollydbg"),
but aims to function on AArch32, x86, and x86-64 as well as multiple OS's. Linux is the
only officially supported platform at the moment, but FreeBSD, OpenBSD, OSX and
but aims to function on AArch32, x86, and x86-64 as well as multiple OS's. **Linux is the
only officially supported platform at the moment**, but FreeBSD, OpenBSD, OSX and
Windows ports are underway with varying degrees of functionality.

![Screenshot](https://raw.githubusercontent.com/wiki/eteran/edb-debugger/img/edb_interface-2019.png)
Expand Down Expand Up @@ -39,7 +39,7 @@ depends on the following packages:
Dependency | Version Required
------------------------------------------- | ----------------
GCC/Clang | Supporting C++17
[Qt](http://www.qt.io/) | >= 5.15
[Qt](http://www.qt.io/) | >= 5.15 or >= 6.8
[Capstone](http://www.capstone-engine.org/) | >= 3.0
[Graphviz](http://www.graphviz.org/) | >= 2.38.0 (Optional)

Expand Down
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ words:
- qlonglong
- qobject
- qreal
- qsizetype
- qsnprintf
- Quadword
- quadwords
Expand Down
2 changes: 1 addition & 1 deletion include/ArchProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include "Status.h"
#include "Types.h"
#include <QObject>
#include <QStringList>

class QByteArray;
class QMenu;
class QString;
class QStringList;
class State;

class EDB_EXPORT ArchProcessor : public QObject {
Expand Down
8 changes: 8 additions & 0 deletions plugins/Analyzer/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,18 @@ QMenu *Analyzer::menu(QWidget *parent) {
menu_->addAction(tr("Show &Specified Functions"), this, &Analyzer::showSpecified);

if (edb::v1::debugger_core) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
menu_->addAction(tr("&Analyze %1's Region").arg(edb::v1::debugger_core->instructionPointer().toUpper()), QKeySequence(tr("Ctrl+A")), this, &Analyzer::doIpAnalysis);
#else
menu_->addAction(tr("&Analyze %1's Region").arg(edb::v1::debugger_core->instructionPointer().toUpper()), this, &Analyzer::doIpAnalysis, QKeySequence(tr("Ctrl+A")));
#endif
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
menu_->addAction(tr("&Analyze Viewed Region"), QKeySequence(tr("Ctrl+Shift+A")), this, &Analyzer::doViewAnalysis);
#else
menu_->addAction(tr("&Analyze Viewed Region"), this, &Analyzer::doViewAnalysis, QKeySequence(tr("Ctrl+Shift+A")));
#endif

// if we are dealing with a main window (and we are...)
// add the dock object
Expand Down
16 changes: 10 additions & 6 deletions plugins/Analyzer/AnalyzerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ AnalyzerWidget::AnalyzerWidget(QWidget *parent, Qt::WindowFlags f)
/**
* @brief Renders a proportional color-coded map of analyzed functions across the current memory region.
*
* @param event
* @param event The paint event that triggered this function.
*/
void AnalyzerWidget::paintEvent(QPaintEvent *event) {
void AnalyzerWidget::paintEvent(QPaintEvent * /*event*/) {
QElapsedTimer timer;
timer.start();

Q_UNUSED(event)

const std::shared_ptr<IRegion> region = edb::v1::current_cpu_view_region();
if (!region || region->size() == 0) {
return;
Expand All @@ -79,7 +77,7 @@ void AnalyzerWidget::paintEvent(QPaintEvent *event) {
if (!cache_ || width() != cache_->width() || height() != cache_->height() || cacheNumFuncs_ != functions.size()) {

cache_ = std::make_unique<QPixmap>(width(), height());
cacheNumFuncs_ = functions.size();
cacheNumFuncs_ = static_cast<int>(functions.size());

QPainter painter(cache_.get());
painter.fillRect(0, 0, width(), height(), QBrush(Qt::black));
Expand Down Expand Up @@ -156,7 +154,13 @@ void AnalyzerWidget::mousePressEvent(QMouseEvent *event) {
const edb::address_t start = region->start();
const edb::address_t end = region->end();

edb::address_t offset = start + static_cast<std::uint64_t>(event->x() / byte_width);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const int x = qRound(event->position().x());
#else
const int x = event->x();
#endif

edb::address_t offset = start + static_cast<std::uint64_t>(x / byte_width);

const edb::address_t address = qBound<edb::address_t>(start, offset, end - 1);
edb::v1::jump_to_address(address);
Expand Down
2 changes: 1 addition & 1 deletion plugins/Analyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ add_library(${PLUGIN_NAME} SHARED
SpecifiedFunctions.ui
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets edb)

build_plugin(${PLUGIN_NAME})
4 changes: 2 additions & 2 deletions plugins/Assembler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(PLUGIN_NAME "Assembler")

find_package(Qt${QT_VERSION_MAJOR} REQUIRED Widgets Xml)

qt5_add_resources(QRC_SOURCES
qt_add_resources(QRC_SOURCES
Assembler.qrc
)

Expand All @@ -25,6 +25,6 @@ add_library(${PLUGIN_NAME} SHARED
OptionsPage.ui
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets Qt::Xml edb)

build_plugin(${PLUGIN_NAME})
4 changes: 4 additions & 0 deletions plugins/Backtrace/Backtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ QMenu *Backtrace::menu(QWidget *parent) {
menu_ = new QMenu(tr("Call Stack"), parent);

// Ctrl + K shortcut, reminiscent of OllyDbg
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
menu_->addAction(tr("Backtrace"), QKeySequence(tr("Ctrl+K")), this, &Backtrace::showMenu);
#else
menu_->addAction(tr("Backtrace"), this, &Backtrace::showMenu, QKeySequence(tr("Ctrl+K")));
#endif
}

return menu_;
Expand Down
2 changes: 1 addition & 1 deletion plugins/Backtrace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ add_library(${PLUGIN_NAME} SHARED
DialogBacktrace.ui
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets edb)

build_plugin(${PLUGIN_NAME})
2 changes: 1 addition & 1 deletion plugins/BinaryInfo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ add_library(${PLUGIN_NAME} SHARED
symbols.h
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets PE ELF edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets PE ELF edb)

build_plugin(${PLUGIN_NAME})
1 change: 0 additions & 1 deletion plugins/BinaryInfo/ELFXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ ELFXX<ElfHeader>::ELFXX(const std::shared_ptr<IRegion> &region)
}
}


/**
* @brief Returns the size of the ELF header, including the program headers if they immediately follow the ELF header.
*
Expand Down
4 changes: 4 additions & 0 deletions plugins/BinarySearcher/BinarySearcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ QMenu *BinarySearcher::menu(QWidget *parent) {

if (!menu_) {
menu_ = new QMenu(tr("BinarySearcher"), parent);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
menu_->addAction(tr("&Binary String Search"), QKeySequence(tr("Ctrl+F")), this, &BinarySearcher::showMenu);
#else
menu_->addAction(tr("&Binary String Search"), this, &BinarySearcher::showMenu, QKeySequence(tr("Ctrl+F")));
#endif
}

return menu_;
Expand Down
2 changes: 1 addition & 1 deletion plugins/BinarySearcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ add_library(${PLUGIN_NAME} SHARED
DialogResults.ui
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets edb)

build_plugin(${PLUGIN_NAME})
4 changes: 2 additions & 2 deletions plugins/Bookmarks/BookmarkWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void BookmarkWidget::on_tableView_doubleClicked(const QModelIndex &index) {
items << tr("Code") << tr("Data") << tr("Stack");

bool ok;
const QString new_type = QInputDialog::getItem(ui.tableView, tr("Comment"), tr("Set Type:"), items, items.indexOf(old_type), false, &ok);
const QString new_type = QInputDialog::getItem(ui.tableView, tr("Comment"), tr("Set Type:"), items, static_cast<int>(items.indexOf(old_type)), false, &ok);
if (ok) {
model_->setType(index, new_type);
}
Expand Down Expand Up @@ -261,7 +261,7 @@ void BookmarkWidget::on_tableView_customContextMenuRequested(const QPoint &pos)
items << tr("Code") << tr("Data") << tr("Stack");

bool ok;
const QString new_type = QInputDialog::getItem(ui.tableView, tr("Comment"), tr("Set Type:"), items, items.indexOf(old_type), false, &ok);
const QString new_type = QInputDialog::getItem(ui.tableView, tr("Comment"), tr("Set Type:"), items, static_cast<int>(items.indexOf(old_type)), false, &ok);
if (ok) {
model_->setType(index, new_type);
}
Expand Down
16 changes: 7 additions & 9 deletions plugins/Bookmarks/BookmarksModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,20 @@ QModelIndex BookmarksModel::parent(const QModelIndex &index) const {
/**
* @brief Returns the number of bookmarks currently stored in the model.
*
* @param parent
* @return
* @param parent The parent index.
* @return The number of bookmarks in the model.
*/
int BookmarksModel::rowCount(const QModelIndex &parent) const {
Q_UNUSED(parent)
return bookmarks_.size();
int BookmarksModel::rowCount(const QModelIndex & /*parent*/) const {
return static_cast<int>(bookmarks_.size());
}

/**
* @brief Returns 3, representing the fixed Address, Type, and Comment columns.
*
* @param parent
* @return
* @param parent The parent index.
* @return The number of columns in the model.
*/
int BookmarksModel::columnCount(const QModelIndex &parent) const {
Q_UNUSED(parent)
int BookmarksModel::columnCount(const QModelIndex & /*parent*/) const {
return 3;
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/Bookmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ add_library(${PLUGIN_NAME} SHARED
BookmarkWidget.ui
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets edb)

build_plugin(${PLUGIN_NAME})
2 changes: 1 addition & 1 deletion plugins/BreakpointManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ add_library(${PLUGIN_NAME} SHARED
BreakpointManager.h
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets edb)

build_plugin(${PLUGIN_NAME})
2 changes: 1 addition & 1 deletion plugins/CheckVersion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ add_library(${PLUGIN_NAME} SHARED
OptionsPage.ui
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets Qt::Network edb)

build_plugin(${PLUGIN_NAME})
2 changes: 1 addition & 1 deletion plugins/DebuggerCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ target_include_directories(${PLUGIN_NAME} PRIVATE
${PLUGIN_INCLUDES}
)

target_link_libraries(${PLUGIN_NAME} Qt${QT_VERSION_MAJOR}::Widgets PE ELF edb)
target_link_libraries(${PLUGIN_NAME} Qt::Widgets PE ELF edb)

build_plugin(${PLUGIN_NAME})
2 changes: 1 addition & 1 deletion plugins/DebuggerCore/unix/linux/DebuggerCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ Status DebuggerCore::open(const QString &path, const QString &cwd, const QList<Q
static_assert(std::is_trivially_copyable_v<QChar>, "Can't copy string of QChar to shared memory");
#endif
QString error = status.error();
std::memcpy(sharedMem, error.constData(), std::min(sizeof(QChar) * error.size(), SharedMemSize - sizeof(QChar) /*prevent overwriting of last null*/));
std::memcpy(sharedMem, error.constData(), std::min<uint64_t>(sizeof(QChar) * error.size(), SharedMemSize - sizeof(QChar) /*prevent overwriting of last null*/));

// we should never get here!
abort();
Expand Down
Loading