This commit is contained in:
geoffrey 2026-05-01 15:18:33 +02:00
parent f3d2146af9
commit 645469e7e3
19 changed files with 220 additions and 220 deletions

Binary file not shown.

@ -40,8 +40,8 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
centralwidget.h centralwidget.cpp
parsingelf.h parsingelf.cpp
dockexplorer.h dockexplorer.cpp
dockanalizing.h dockanalizing.cpp
data.h
stylesheet.h
elfdata.h elfdata.cpp
@ -72,6 +72,7 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
elf/mdielfview.cpp
elf/mdielfview.h
dialogabout.h dialogabout.cpp
dockmenu.h dockmenu.cpp

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 12.0.2, 2026-04-29T16:12:20. -->
<!-- Written by QtCreator 12.0.2, 2026-05-01T15:14:32. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{c1ad1696-344c-4cbf-8c9b-7903590215f2}</value>
<value type="QByteArray">{7576b28b-0509-4f2e-9112-d416507c0bdd}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
@ -76,7 +76,7 @@
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">4</value>
<value type="int" key="ClangTools.ParallelJobs">2</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
@ -89,10 +89,10 @@
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.6.2 GCC 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.6.2 GCC 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.662.gcc_64_kit</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{4f4e56a4-b54b-4c8a-9576-1e917c71a3c7}</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
@ -100,16 +100,16 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/gbucchino/Documents/GIT/RElicAnalysis/build-RElicAnalysis-Desktop_Qt_6_6_2_GCC_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/geoffrey/Documents/GIT/cryptoshield/RElicAnalysis/build-RElicAnalysis-Desktop-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
@ -157,15 +157,15 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/gbucchino/Documents/GIT/RElicAnalysis/build-RElicAnalysis-Desktop_Qt_6_6_2_GCC_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/geoffrey/Documents/GIT/cryptoshield/RElicAnalysis/build-RElicAnalysis-Desktop-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
@ -175,7 +175,6 @@
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
@ -192,7 +191,6 @@
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
@ -213,15 +211,15 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/gbucchino/Documents/GIT/RElicAnalysis/build-RElicAnalysis-Desktop_Qt_6_6_2_GCC_64bit-RelWithDebInfo</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/geoffrey/Documents/GIT/cryptoshield/RElicAnalysis/build-RElicAnalysis-Desktop-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
@ -267,16 +265,16 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/gbucchino/Documents/GIT/RElicAnalysis/build-RElicAnalysis-Desktop_Qt_6_6_2_GCC_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/geoffrey/Documents/GIT/cryptoshield/RElicAnalysis/build-RElicAnalysis-Desktop-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
@ -322,15 +320,15 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/gbucchino/Documents/GIT/RElicAnalysis/build-RElicAnalysis-Desktop_Qt_6_6_2_GCC_64bit-MinSizeRel</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/geoffrey/Documents/GIT/cryptoshield/RElicAnalysis/build-RElicAnalysis-Desktop-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
@ -390,18 +388,17 @@
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="QList&lt;int&gt;" key="Analyzer.Valgrind.VisibleErrorKinds"></value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">RElicAnalysis</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.RElicAnalysis</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">RElicAnalysis</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/gbucchino/Documents/GIT/RElicAnalysis/build-RElicAnalysis-Desktop_Qt_6_6_2_GCC_64bit-Release</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>

@ -3,7 +3,6 @@
CentralWidget::CentralWidget(MainWindow *mainWindow): QMdiArea() {
m_mainWindow = mainWindow;
//m_mdiElfHandler = NULL;
setViewMode(QMdiArea::TabbedView);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setAttribute(Qt::WA_Resized);
@ -20,12 +19,6 @@ CentralWidget::CentralWidget(MainWindow *mainWindow): QMdiArea() {
*/
//this->_addWelcomeTab();
}
/*void CentralWidget::addMdiWindowElf(ProjectElf *projectElf){
// Create MdiELF project
m_mdiElfHandler = new MdiElfHandler(this, projectElf);
m_mdiElfHandler->showMdiSubWindow();
}*/
void CentralWidget::closeCurrentProject(){
}
@ -44,6 +37,4 @@ void CentralWidget::_addWelcomeTab(){
addSubWindow(window)->show();
}
CentralWidget::~CentralWidget(){
//delete m_mdiElfHandler;
}
CentralWidget::~CentralWidget(){}

@ -5,7 +5,6 @@
#include <QMdiSubWindow>
#include <QDebug>
#include <QVBoxLayout>
#include "projectelf.h"
#include "elf/mdielfhandler.h"
@ -15,13 +14,10 @@ class CentralWidget: public QMdiArea {
public:
CentralWidget(MainWindow *);
~CentralWidget();
//void addMdiWindowElf(ProjectElf *);
void closeCurrentProject();
private:
MainWindow *m_mainWindow;
//MdiElfHandler *m_mdiElfHandler;
void _addWelcomeTab();
};

@ -1,25 +1,81 @@
#include "dialogabout.h"
DialogAbout::DialogAbout(): QDialog() {
setWindowTitle("About");
setWindowTitle("About RElicAnalysis");
//setStyleSheet("QDialog::border: 1px solid #afafaf;");
QVBoxLayout *mainLayout = new QVBoxLayout;
QLabel *labelTitle = new QLabel("RElicAnalysis 0.1.0");
QFont fontTitle;
fontTitle.setPointSize(15);
fontTitle.setBold(true);
labelTitle->setFont(fontTitle);
mainLayout->addWidget(labelTitle);
QString basedOn = "Based on Qt " + QByteArray(QT_VERSION_STR);
QLabel *labelBasedOn = new QLabel(basedOn);
mainLayout->addWidget(labelBasedOn);
QLabel *labelAuthor = new QLabel("Author: Bucchino Geoffrey");
mainLayout->addWidget(labelAuthor);
QLabel *labelLicense = new QLabel("Under the licence GPL");
mainLayout->addWidget(labelLicense);
QLabel *labelWebsite = new QLabel("Visit https://cryptoshield.bucchino.org/ for more information");
mainLayout->addWidget(labelWebsite);
QHBoxLayout *layoutButtons = new QHBoxLayout;
QPushButton *buttonQuit = new QPushButton("Close");
buttonQuit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(buttonQuit, SIGNAL(clicked()), this, SLOT(close()));
layoutButtons->addWidget(buttonQuit);
layoutButtons->addStretch(1);
layoutButtons->addWidget(buttonQuit, 0, Qt::AlignRight);
setLayout(layoutButtons);
/* QHBoxLayout layoutButtons;
QPushButton buttonQuit;
buttonQuit.setText("Close");
connect(&buttonQuit, SIGNAL(clicked()), this, SLOT(close()));
layoutButtons.addWidget(&buttonQuit);
setLayout(&layoutButtons);*/
mainLayout->addLayout(layoutButtons);
mainLayout->addStretch();
setLayout(mainLayout);
}
DialogAbout::~DialogAbout(){
/*DialogAbout::DialogAbout() : QDialog() {
QVBoxLayout *layout = new QVBoxLayout;
// Informations
QGridLayout *layoutAbout = new QGridLayout;
QLabel *labelLeftName = new QLabel("Nom du programme");
QLabel *labelRightName = new QLabel("Editeur LaTex");
QLabel *labelLeftVersion = new QLabel("Version");
QLabel *labelRightVersion = new QLabel("1.0");
QLabel *labelLeftLicence = new QLabel("Licence");
QLabel *labelRightLicence = new QLabel("GPL");
QLabel *labelLeftAuthor= new QLabel("Auteur");
QLabel *labelRightAuthor = new QLabel("BUCCHINO Geoffrey");
QLabel *labelLeftURL = new QLabel("Adresse Internet");
QLabel *labelRightURL = new QLabel("www.geoffreybucchino.com");
layoutAbout->addWidget(labelLeftName, 0,0);
layoutAbout->addWidget(labelRightName, 0,1);
layoutAbout->addWidget(labelLeftVersion,1,0);
layoutAbout->addWidget(labelRightVersion,1,1);
layoutAbout->addWidget(labelLeftLicence,2,0);
layoutAbout->addWidget(labelRightLicence,2,1);
layoutAbout->addWidget(labelLeftAuthor,3,0);
layoutAbout->addWidget(labelRightAuthor, 3,1);
layoutAbout->addWidget(labelLeftURL,4,0);
layoutAbout->addWidget(labelRightURL,4,1);
// Button
QHBoxLayout *layoutButton = new QHBoxLayout;
layoutButton->setAlignment(Qt::AlignRight);
QPushButton *buttonOk = new QPushButton("Ok");
connect(buttonOk, SIGNAL(clicked()), this, SLOT(close()));
layoutButton->addWidget(buttonOk);
layout->addLayout(layoutAbout);
layout->addLayout(layoutButton);
setLayout(layout);
}*/
}

@ -6,12 +6,12 @@
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QSizePolicy>
class DialogAbout : public QDialog
{
public:
DialogAbout();
~DialogAbout();
};

@ -29,7 +29,7 @@ static int dump_asm(void *stream, const char *fmt, ...){
/*
* Cf: https://github.com/bpftrace/bpftrace/blob/master/src/bfd-disasm.cpp#L49C1-L55C2
*/
static int dump_asm_styled(void *out __attribute__((unused)), enum disassembler_style s __attribute__((unused)),
/*static int dump_asm_styled(void *out __attribute__((unused)), enum disassembler_style s __attribute__((unused)),
const char *fmt __attribute__((unused)), ...)
{
struct dataDisas *sData = (struct dataDisas*)out;
@ -54,7 +54,7 @@ static int dump_asm_styled(void *out __attribute__((unused)), enum disassembler_
memcpy(sData->s_object_asm[index].cmd, tmp, strlen(tmp));
return 0;
}
}*/
struct dataDisas *disas_asm(unsigned char *buffer, uint64_t startAddress, size_t length){
struct disassemble_info disasm_info;
@ -89,20 +89,13 @@ static int dump_asm_styled(void *out __attribute__((unused)), enum disassembler_
// TODO: Need to identify the version of the libbinutils, for old system, it's with three arguments
//qDebug() << BFD_VERSION;
//qDebug() << bfd_version_string();
/*
* $ ld --version
GNU ld (GNU Binutils for Debian) 2.35.2
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
*/
/*
* https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=600b7b26c07a070d0153daa76b3806c1e52c9e00
* https://patchwork.yoctoproject.org/project/arm/patch/20220824025819.4888-1-jon.mason@arm.com/#5104
*/
init_disassemble_info (&disasm_info, sData, dump_asm, dump_asm_styled);
//init_disassemble_info (&disasm_info, sData, dump_asm, dump_asm_styled);
init_disassemble_info (&disasm_info, sData, dump_asm);
disasm_info.arch = bfd_arch_i386;
disasm_info.mach = bfd_mach_x86_64;
disasm_info.read_memory_func = buffer_read_memory;
@ -115,7 +108,7 @@ This program has absolutely no warranty.
disas = disassembler(bfd_arch_i386, false, bfd_mach_x86_64, NULL);
if (!disas){
qDebug() << "Can't disassembled";
qDebug() << "Cannot be disassembled";
return NULL;
}

@ -1,23 +0,0 @@
#include "dockanalizing.h"
DockAnalizing::DockAnalizing(): QDockWidget() {
QWidget *widget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
setFeatures(QDockWidget::NoDockWidgetFeatures);
// Title bar
QWidget *bar = new QWidget;
bar->setMinimumHeight(20);
bar->setStyleSheet("border-bottom:1px solid #000;background-color:#656565;");
layout->addWidget(bar);
layout->setContentsMargins(QMargins(0,0,0,0)); // Remove all margins
setTitleBarWidget(new QWidget); // hide the titlebar
widget->setLayout(layout);
setWidget(widget);
}
DockAnalizing::~DockAnalizing(){
}

@ -1,14 +0,0 @@
#ifndef DOCKANALIZING_H
#define DOCKANALIZING_H
#include <QDockWidget>
#include <QVBoxLayout>
class DockAnalizing: public QDockWidget {
public:
DockAnalizing();
~DockAnalizing();
};
#endif // DOCKANALIZING_H

@ -1,34 +0,0 @@
#include "dockexplorer.h"
DockExplorer::DockExplorer(): QDockWidget() {
QWidget *widget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
setFeatures(QDockWidget::NoDockWidgetFeatures);
// Title bar
QWidget *bar = new QWidget;
bar->setMinimumHeight(20);
bar->setStyleSheet("border-bottom:1px solid #000;background-color:#656565;");
// List
m_model = new QStandardItemModel;
m_view = new QListView;
//connect(m_view, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(itemClicked(const QModelIndex&)));
//connect(m_view, SIGNAL(clicked(const QModelIndex&)), this, SLOT(selectItem(const QModelIndex&)));
m_view->setModel(m_model);
m_view->setStyleSheet("border:none;");
layout->addWidget(bar);
layout->addWidget(m_view);
layout->setContentsMargins(QMargins(0,0,0,0)); // Remove all margins
setTitleBarWidget(new QWidget); // hide the titlebar
widget->setLayout(layout);
setWidget(widget);
}
DockExplorer::~DockExplorer(){
delete m_view;
}

@ -1,19 +0,0 @@
#ifndef DOCKEXPLORER_H
#define DOCKEXPLORER_H
#include <QDockWidget>
#include <QListView>
#include <QVBoxLayout>
#include <QStandardItemModel>
class DockExplorer: public QDockWidget {
public:
DockExplorer();
~DockExplorer();
private:
QStandardItemModel *m_model;
QListView *m_view;
};
#endif // DOCKEXPLORER_H

@ -0,0 +1,56 @@
#include "dockmenu.h"
QDockMenu::QDockMenu() {
// Sidebar widget
QWidget *sidebar = new QWidget;
QVBoxLayout *layout = new QVBoxLayout(sidebar);
layout->setSpacing(10);
layout->setContentsMargins(5, 5, 5, 5);
// Create buttons
QToolButton *btnWelcome = new QToolButton;
btnWelcome->setIcon(QIcon(":/icons/welcome.png")); // your icon
btnWelcome->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
btnWelcome->setText("Welcome");
QToolButton *btnEdit = new QToolButton;
btnEdit->setIcon(QIcon(":/icons/edit.png"));
btnEdit->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
btnEdit->setText("Edit");
QToolButton *btnDesign = new QToolButton;
btnDesign->setIcon(QIcon(":/icons/design.png"));
btnDesign->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
btnDesign->setText("Design");
QToolButton *btnDebug = new QToolButton;
btnDebug->setIcon(QIcon(":/icons/debug.png"));
btnDebug->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
btnDebug->setText("Debug");
QToolButton *btnProjects = new QToolButton;
btnProjects->setIcon(QIcon(":/icons/projects.png"));
btnProjects->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
btnProjects->setText("Projects");
QToolButton *btnHelp = new QToolButton;
btnHelp->setIcon(QIcon(":/icons/help.png"));
btnHelp->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
btnHelp->setText("Help");
// Add buttons to layout
layout->addWidget(btnWelcome);
layout->addWidget(btnEdit);
layout->addWidget(btnDesign);
layout->addWidget(btnDebug);
layout->addWidget(btnProjects);
layout->addWidget(btnHelp);
layout->addStretch(); // push buttons to top
// Set sidebar as dock widget or fixed widget
//window.setCentralWidget(new QWidget); // placeholder for main area
//window.addDockWidget(Qt::LeftDockWidgetArea, new QDockWidget("Sidebar", &window));
//window.findChild<QDockWidget*>()->setWidget(sidebar);
//window.findChild<QDockWidget*>()->setFeatures(QDockWidget::NoDockWidgetFeatures); // fix it
}

15
RElicAnalysis/dockmenu.h Normal file

@ -0,0 +1,15 @@
#ifndef DOCKMENU_H
#define DOCKMENU_H
#include <QWidget>
#include <QDockWidget>
#include <QVBoxLayout>
#include <QToolButton>
class QDockMenu
{
public:
QDockMenu();
};
#endif // DOCKMENU_H

@ -237,17 +237,7 @@ MdiElf::MdiElf(ProjectElf *projectElf): QMdiSubWindow() {
layoutDockRight->addWidget(barHashTable);
layoutDockRight->addWidget(m_treeHashTable);
/**************************/
/***** Analyzing part *****/
/**************************/
m_textAnalyzing = new QTextEdit;
m_textAnalyzing->setReadOnly(true);
m_textAnalyzing->setStyleSheet("border:none;border-top:1px solid #000;");
m_textAnalyzing->setMaximumHeight(250);
layoutCentral->addLayout(layoutTextEdit);
layoutCentral->addWidget(m_textAnalyzing);
mainLayout->addLayout(layoutDockLeft);
mainLayout->addLayout(layoutCentral);

@ -5,8 +5,6 @@ MainWindow::MainWindow(): QMainWindow() {
m_handleProject = new HandleProject(this);
m_centralWidget = new CentralWidget(this);
m_menuBar = new MenuBar(m_centralWidget, m_handleProject);
//m_dockExplorer = new DockExplorer;
//m_dockAnalyzing = new DockAnalizing;
setWindowTitle("RElicAnalysis");
setWindowState(Qt::WindowMaximized);
@ -14,12 +12,7 @@ MainWindow::MainWindow(): QMainWindow() {
setCentralWidget(m_centralWidget);
setMenuBar(m_menuBar);
//addDockWidget(Qt::LeftDockWidgetArea, m_dockExplorer, Qt::Horizontal);
//addDockWidget(Qt::BottomDockWidgetArea, m_dockAnalyzing);
}
/*void MainWindow::newProject(ProjectElf *projectElf){
m_centralWidget->addMdiWindowElf(projectElf);
}*/
void MainWindow::closeCurrentProject(){
}
@ -29,8 +22,6 @@ CentralWidget *MainWindow::getCentralWidget(){
MainWindow::~MainWindow() {
delete m_centralWidget;
delete m_menuBar;
//delete m_dockExplorer;
//delete m_dockAnalyzing;
if (m_project != NULL)
delete m_project;
}

@ -4,8 +4,6 @@
#include <QMainWindow>
#include "menubar.h"
#include "centralwidget.h"
#include "dockexplorer.h"
#include "dockanalizing.h"
#include "projectelf.h"
#include "project.h"
#include "handleproject.h"
@ -17,15 +15,12 @@ class MainWindow : public QMainWindow {
public:
MainWindow();
~MainWindow();
//void newProject(ProjectElf *);
void closeCurrentProject();
CentralWidget *getCentralWidget();
private:
CentralWidget *m_centralWidget;
MenuBar *m_menuBar;
DockExplorer *m_dockExplorer;
DockAnalizing *m_dockAnalyzing;
HandleProject *m_handleProject;
Project *m_project;
ProjectElf *m_projectElf;

@ -12,15 +12,14 @@ MenuBar::MenuBar(CentralWidget *centralWidget, HandleProject *project) {
// Create menu
QMenu *menuFile = new QMenu("File");
//QMenu *menuAnalyze = new QMenu("Analyze");
QMenu *menuAbout = new QMenu("About");
// Menu file
QAction *actionOpenFile = new QAction("Open file", this);
QAction *actionOpenFile = new QAction("Open ELF file", this);
actionOpenFile->setShortcut(QKeySequence("ctrl+O"));
connect(actionOpenFile, SIGNAL(triggered()), this, SLOT(_openFile()));
QAction *actionCloseFile = new QAction("Close the file", this);
QAction *actionCloseFile = new QAction("Fermer le fichier", this);
actionCloseFile->setShortcut(QKeySequence("ctrl+W"));
connect(actionCloseFile, SIGNAL(triggered()), this, SLOT(_closeFile()));
menuFile->addSeparator();
@ -33,14 +32,6 @@ MenuBar::MenuBar(CentralWidget *centralWidget, HandleProject *project) {
menuFile->addAction(actionCloseFile);
menuFile->addAction(actionQuit);
// Menu analyze
/*QAction *actionShowBinary = new QAction("Show binary", this);
actionShowBinary->setShortcut(QKeySequence("ctrl+b"));
QAction *actionShowStrings = new QAction("Show strings", this);
menuAnalyze->addAction(actionShowBinary);
menuAnalyze->addAction(actionShowStrings);*/
// Menu about
QAction *actionAbout = new QAction("A propos", this);
connect(actionAbout, SIGNAL(triggered()), m_dialogAbout, SLOT(exec()));
@ -48,7 +39,6 @@ MenuBar::MenuBar(CentralWidget *centralWidget, HandleProject *project) {
// add menu to menuBar
addMenu(menuFile);
//addMenu(menuAnalyze);
addMenu(menuAbout);
}
/*
@ -58,7 +48,7 @@ void MenuBar::_openFile() {
// Check if we have a project open
// If yes, clean it
if (m_handleProject->projectOpened() == true){
unsigned int r = QMessageBox::question(NULL, "Open ELF file", "A file is open, you should close the file first", QMessageBox::Cancel);
unsigned int r = QMessageBox::question(NULL, "Open binary file", "A file is open, you should close the file first", QMessageBox::Cancel);
}
else {
QString path = QFileDialog::getOpenFileName(NULL, "Open binary file", "", "File (*)");
@ -68,7 +58,7 @@ void MenuBar::_openFile() {
m_handleProject->handleOpenFile(file);
}
else if(file.open(QIODevice::ReadOnly)) {
unsigned int r = QMessageBox::question(NULL, "Open ELF file", "The file is in read-only. Wish you to open it ?", QMessageBox::Yes | QMessageBox::No);
unsigned int r = QMessageBox::question(NULL, "Open binary file", "The file is in read-only. Wish you to open it ?", QMessageBox::Yes | QMessageBox::No);
if(r == QMessageBox::Yes){
m_handleProject->handleOpenFile(file);
@ -79,7 +69,6 @@ void MenuBar::_openFile() {
}
}
void MenuBar::_closeFile(){
qDebug() << "Close file";
// We can close the project
m_handleProject->handleCloseFile();
}

@ -186,7 +186,7 @@ bool elf64SectionHdr(const char *buffer, ElfData *elfData, size_t offset, quint1
elfS[i].sh_info = convertFrom32bits(shdr[i].sh_info);
elfS[i].sh_addralign = convertFrom32bits(shdr[i].sh_addralign);
elfS[i].sh_entsize = convertFrom32bits(shdr[i].sh_entsize);
qDebug() << elfS[i].sh_name << " " << elfS[i].sh_offset.toHex() << " " << elfS[i].sh_size.toHex();
elfData->setSectionHeader(&elfS[i]);
const char *shname = b + shdr[i].sh_name;
@ -201,7 +201,6 @@ bool elf64SectionHdr(const char *buffer, ElfData *elfData, size_t offset, quint1
if (shdr[i].sh_type == 0x01 && strcmp(shname, ".text") == 0){
indexTextTab = i;
//qDebug() << "Section: " << elfS[i].sh_addr.toHex() << " " << elfS[i].sh_size.toHex();
}
if (shdr[i].sh_type == 0x01 && strcmp(shname, ".fini") == 0)
@ -234,16 +233,24 @@ bool elf64SectionHdr(const char *buffer, ElfData *elfData, size_t offset, quint1
shdrtext = &shdr[indexTextTab];
shdrfini = &shdr[indexFiniTab];
/*
* Not needed to use shdrfini->sh_offset for the range of the .text
* We can add shdrtext->sh_offset + shdrtext->sh_size
*/
/*
* We can try for each symbols, to get the section .text, .data, .rodata
* getTextSections, getRodataSections, getDataSections, etc. and push to a QList
*/
// Get all symbols
res = getSymbols(buffer, elfData, shdr, indexStrTab, indexSymbolTab, shdrtext->sh_offset, shdrfini->sh_offset);
if (!res)
return false;
// Get dynsym tab
getDynSym(buffer, elfData, shdr, indexDynSymTab, indexDynStrTab, indexHashTab); // F***CK segmentation fault
getDynSym(buffer, elfData, shdr, indexDynSymTab, indexDynStrTab, indexHashTab); // Segmentation fault
// Hash table
// https://flapenguin.me/elf-dt-hash
shdrhash = &shdr[indexHashTab];
return true;
@ -251,8 +258,8 @@ bool elf64SectionHdr(const char *buffer, ElfData *elfData, size_t offset, quint1
bool getDynSym(const char *buffer, ElfData *elfData, Elf64_Shdr *shdr, int indexDynSymTab, int indexDynStrTab, int indexHashTab){
Elf64_Shdr *shdrdynsym = &shdr[indexDynSymTab];
Elf64_Shdr *shdrDynStr = &shdr[indexDynStrTab];
Elf64_Shdr *shdrhash = &shdr[indexHashTab];
size_t dynsymnum = shdrdynsym->sh_size / shdrdynsym->sh_entsize;
//Elf64_Shdr *shdrhash = &shdr[indexHashTab];
//size_t dynsymnum = shdrdynsym->sh_size / shdrdynsym->sh_entsize;
const char *b2 = buffer + shdrDynStr->sh_offset;
Elf64_Sym *symtab = (Elf64_Sym*)(buffer + shdrdynsym->sh_offset);
@ -319,6 +326,11 @@ bool getSymbols(const char *buffer, ElfData *elfData, Elf64_Shdr *shdr, int inde
if (sData == NULL){
qDebug() << "Failed to get the assembly code";
// I must freeing elfS structures
/*for (size_t i = 0; i < symtabnum; i++)
free(&elfS[i]);*/
free(elfS);
elfS = NULL;
return false;
}
@ -372,11 +384,19 @@ bool getSymbols(const char *buffer, ElfData *elfData, Elf64_Shdr *shdr, int inde
}
elfData->setSymbol(&elfS[i]);
//qDebug() << b2 + symtab[i].st_name << " " << symtab[i].st_value << " " << offsetText << " " << offsetFini;
//qDebug() << b2 + symtab[i].st_name << " " << symtab[i].st_value << " " << symtab[i].st_size;
// We check if the symbol is in the .text section
if (symtab[i].st_value >= offsetText && symtab[i].st_value <= offsetFini){
elfData->setTextSymbol(&elfS[i]);
}
/*
* We can push the symbols to the correct list
* For instance, if symtab[i].st_name == .rodata, we push to the QList
* Also, we can check with the size of the symbols
* size_t l = symtab[i].st_value + symtab[i].st_size
*/
}
return true;