Merge pull request #23 from mrexodia/improvements

Improvements
This commit is contained in:
Hugo Teso 2017-03-30 17:12:41 +02:00 committed by GitHub
commit 3a728cbeac
9 changed files with 21 additions and 16 deletions

View File

@ -9,7 +9,7 @@ createNewDialog::createNewDialog(QWidget *parent) :
ui(new Ui::createNewDialog)
{
ui->setupUi(this);
w = new MainWindow(this);
w = new MainWindow(nullptr);
w->core = new QRCore ();
}
@ -22,7 +22,7 @@ void createNewDialog::on_pushButton_2_clicked()
{
// Close dialog and open OptionsDialog
close();
NewFileDialog* n = new NewFileDialog(this);
NewFileDialog* n = new NewFileDialog(nullptr);
n->show();
}

View File

@ -11,7 +11,7 @@ MdHighlighter::MdHighlighter(QTextDocument *parent)
keywordFormat.setFontWeight(QFont::Bold);
QStringList keywordPatterns;
keywordPatterns << "^\#{1,6}[ A-Za-z]+\\b" << "\\*\\*([^\\\\]+)\\*\\*"
keywordPatterns << "^\\#{1,6}[ A-Za-z]+\\b" << "\\*\\*([^\\\\]+)\\*\\*"
<< "\\*([^\\\\]+)\\*" << "\\_([^\\\\]+)\\_"
<< "\\_\\_([^\\\\]+)\\_\\_";

View File

@ -100,7 +100,7 @@ void NewFileDialog::on_loadFileButton_clicked()
} else {
// Close dialog and open OptionsDialog
close();
OptionsDialog* o = new OptionsDialog(this);
OptionsDialog* o = new OptionsDialog(nullptr);
o->setFilename (fname, this->strippedName(fname));
o->exec();
}
@ -145,7 +145,7 @@ void NewFileDialog::on_recentsList_itemDoubleClicked(QListWidgetItem *item)
QString sitem = data.toString();
// Close dialog and open OptionsDialog
close();
OptionsDialog* o = new OptionsDialog(this);
OptionsDialog* o = new OptionsDialog(nullptr);
o->setFilename (sitem, this->strippedName(sitem));
o->exec();
}
@ -177,7 +177,7 @@ void NewFileDialog::on_createButton_clicked()
{
// Close dialog and open create new file dialog
close();
createNewDialog* n = new createNewDialog(this);
createNewDialog* n = new createNewDialog(nullptr);
n->exec();
}

View File

@ -73,7 +73,7 @@ void OptionsDialog::on_okButton_clicked()
//ui->progressBar->setValue(5);
// Close dialog and open OptionsDialog
this->w = new MainWindow(this);
this->w = new MainWindow(nullptr);
this->w->core = this->core;
// Fill asm plugins in hexdump combo
@ -232,10 +232,10 @@ void OptionsDialog::anal_finished()
void OptionsDialog::on_cancelButton_clicked()
{
delete this->core;
this->core = NULL; // implicit by delete?
this->core = NULL;
// Close dialog and open OptionsDialog
close();
NewFileDialog* n = new NewFileDialog(this);
NewFileDialog* n = new NewFileDialog(nullptr);
n->show();
}

View File

@ -10,4 +10,5 @@ QRDisasm::QRDisasm(QRCore *core)
bool QRDisasm::disassembleAt (ut64 addr, QRDisasmOption opt, QRDisasmRow &dr) {
printf ("FUCK\n");
return false;
}

View File

@ -134,4 +134,5 @@ bool CommentsWidget::eventFilter(QObject *obj, QEvent *event) {
}
}
}
return false; //allow the event to be handled further
}

View File

@ -377,4 +377,5 @@ bool FunctionsWidget::eventFilter(QObject *obj, QEvent *event) {
}
}
}
return false; //allow the event to be handled further
}

View File

@ -1345,7 +1345,9 @@ void MemoryWidget::fillOffsetInfo( QString off) {
// Add opcode description
QStringList description = this->main->core->cmd("?d. @ " + off).split(": ");
ui->opcodeDescText->setPlainText("# " + description[0] + ":\n" + description[1]);
if(description.length() >= 2) {
ui->opcodeDescText->setPlainText("# " + description[0] + ":\n" + description[1]);
}
}
void MemoryWidget::create_graph(QString off) {
@ -1379,14 +1381,13 @@ void MemoryWidget::setFcnName(QString addr) {
// TDOD: FIX ME, ugly
if (addr.contains("0x")) {
fcn = this->main->core->functionAt(addr.toLong(&ok, 16));
if (fcn->name != "") {
fcn = this->main->core->functionAt(addr.toULongLong(&ok, 16));
if (ok && fcn && fcn->name != "") {
QString segment = this->main->core->cmd("S. @ " + addr).split(" ").last();
ui->fcnNameEdit->setText(segment.trimmed() + ":"+ fcn->name);
addr = segment.trimmed() + ":"+ fcn->name;
}
} else {
ui->fcnNameEdit->setText(addr);
}
ui->fcnNameEdit->setText(addr);
}
void MemoryWidget::on_disasTextEdit_2_cursorPositionChanged()
@ -1398,7 +1399,6 @@ void MemoryWidget::on_disasTextEdit_2_cursorPositionChanged()
QString ele = lastline.split(" ", QString::SkipEmptyParts)[0];
if (ele.contains("0x")) {
this->fillOffsetInfo(ele);
QString at = this->main->core->cmdFunctionAt(ele);
QString deco = this->main->core->getDecompiledCode(at);
@ -1579,6 +1579,7 @@ bool MemoryWidget::eventFilter(QObject *obj, QEvent *event) {
}
}
}
return false; //allow the event to be handled further
}
void MemoryWidget::on_actionXRefs_triggered()

View File

@ -113,4 +113,5 @@ bool SectionsWidget::eventFilter(QObject *obj, QEvent *event) {
}
}
}
return false; //allow the event to be handled further
}