Added hex flag option #2932

This commit is contained in:
Rohan-Sagar 2024-02-14 12:44:01 -05:00
parent 330803db99
commit 51761961fe
4 changed files with 0 additions and 17 deletions

View File

@ -1,13 +1,11 @@
#include "CommentsDialog.h"
#include "ui_CommentsDialog.h"
#include <iostream>
#include <QErrorMessage>
#include "core/Cutter.h"
CommentsDialog::CommentsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CommentsDialog)
{
std::cout << "Comments dialog parent object name" << " " << parent->objectName().toStdString() << std::endl;
ui->setupUi(this);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));

View File

@ -1,21 +1,15 @@
#include "FlagDialog.h"
#include "ui_FlagDialog.h"
#include <QIntValidator>
#include <iostream>
#include "core/Cutter.h"
FlagDialog::FlagDialog(RVA offset, QWidget *parent)
: QDialog(parent), ui(new Ui::FlagDialog), offset(offset), flagName(""), flagOffset(RVA_INVALID)
{
std::cout << "offset" << " " << offset << std::endl;
std::cout << "parent" << " " << parent << std::endl;
std::cout << "parentObjectName" << " " << parent->objectName().toStdString() << std::endl;
// Setup UI
ui->setupUi(this);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
RzFlagItem *flag = rz_flag_get_i(Core()->core()->flags, offset);
std::cout << "flag" << " " << flag << std::endl;
if (flag) {
flagName = QString(flag->name);
flagOffset = flag->offset;
@ -28,7 +22,6 @@ FlagDialog::FlagDialog(RVA offset, QWidget *parent)
ui->nameEdit->setText(flag->name);
ui->labelAction->setText(tr("Edit flag at %1").arg(RzAddressString(offset)));
} else {
std::cout << "offset in if condition" << " " << offset << std::endl;
ui->labelAction->setText(tr("Add flag at %1").arg(RzAddressString(offset)));
}
@ -43,7 +36,6 @@ void FlagDialog::buttonBoxAccepted()
{
RVA size = ui->sizeEdit->text().toULongLong();
QString name = ui->nameEdit->text();
std::cout << "name" << " " << name.toStdString() << std::endl;
if (name.isEmpty()) {
if (flagOffset != RVA_INVALID) {
@ -59,7 +51,6 @@ void FlagDialog::buttonBoxAccepted()
} else {
// Name provided and flag does not exist -> create the flag
Core()->addFlag(offset, name, size);
std::cout << "Adding flag" << std::endl;
}
}
close();

View File

@ -11,7 +11,6 @@
#include "dialogs/EditStringDialog.h"
#include "dialogs/BreakpointsDialog.h"
#include "MainWindow.h"
#include <iostream>
#include <QtCore>
#include <QShortcut>
#include <QJsonArray>

View File

@ -4,8 +4,6 @@
#include "dialogs/WriteCommandsDialogs.h"
#include "dialogs/CommentsDialog.h"
#include "dialogs/FlagDialog.h"
#include <iostream>
#include <QPainter>
#include <QPaintEvent>
#include <QResizeEvent>
@ -1182,14 +1180,12 @@ void HexWidget::contextMenuEvent(QContextMenuEvent *event)
}
QString flag = Core()->flagAt(cursor.address);
std::cout << "Flag at " << std::hex << cursor.address << " is " << flag.toStdString() << std::endl;
if (flag.isNull() || flag.isEmpty()) {
actionDeleteFlag->setVisible(false);
actionFlag->setText(tr("Add Flag"));
} else {
actionDeleteFlag->setVisible(true);
actionFlag->setText(tr("Edit Flag"));
}
if (!ioModesController.canWrite()) {
@ -1268,7 +1264,6 @@ void HexWidget::onActionAddCommentTriggered()
void HexWidget::onActionAddFlagTriggered()
{
uint64_t addr = cursor.address;
std::cout << "Add flag at " << std::hex << addr << std::endl;
FlagDialog dialog(addr, this);
dialog.exec();
}