1
0
Fork 0

DBG+GUI: formatting

This commit is contained in:
Mr. eXoDia 2015-04-02 21:49:48 +02:00
parent 4e1821cd43
commit 74087d1cca
5 changed files with 14 additions and 13 deletions

View File

@ -1666,8 +1666,8 @@ CMDRESULT cbInstrYara(int argc, char* argv[])
size = 0;
if(!size)
addr = memfindbaseaddr(addr, &size);
uint base=addr;
dprintf("%p[%p]\n",base,size);
uint base = addr;
dprintf("%p[%p]\n", base, size);
Memory<uint8_t*> data(size);
if(!memread(fdProcessInfo->hProcess, (const void*)base, data(), size, 0))
{
@ -1760,7 +1760,7 @@ CMDRESULT cbInstrYaramod(int argc, char* argv[])
return STATUS_ERROR;
}
uint size = modsizefromaddr(base);
char newcmd[deflen]="";
char newcmd[deflen] = "";
sprintf_s(newcmd, "yara \"%s\",%p,%p", argv[1], base, size);
return cmddirectexec(dbggetcommandlist(), newcmd);
}
}

View File

@ -227,4 +227,4 @@ void* memalloc(HANDLE hProcess, uint addr, SIZE_T size, DWORD fdProtect)
void memfree(HANDLE hProcess, uint addr)
{
VirtualFreeEx(hProcess, (void*)addr, 0, MEM_RELEASE);
}
}

View File

@ -296,7 +296,7 @@ void PatchDialog::on_listPatches_itemChanged(QListWidgetItem* item) //checkbox c
if(curPatchList.at(i).second.group == patch.second.group)
{
//change the patch state
curPatchList[i].second.checked = checked;
curPatchList[i].second.checked = checked;
ui->listPatches->item(i)->setCheckState(item->checkState());
//change the byte to reflect the change for the user (cypherpunk reported this)
unsigned char writebyte = curPatchList[i].second.checked ? curPatchList[i].first.newbyte : curPatchList[i].first.oldbyte;

View File

@ -6,7 +6,7 @@
#include <QDirIterator>
#include "Imports.h"
YaraRuleSelectionDialog::YaraRuleSelectionDialog(QWidget *parent) :
YaraRuleSelectionDialog::YaraRuleSelectionDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::YaraRuleSelectionDialog)
{
@ -16,7 +16,7 @@ YaraRuleSelectionDialog::YaraRuleSelectionDialog(QWidget *parent) :
#endif
setFixedSize(this->size()); //fixed size
char setting[MAX_SETTING_SIZE]="";
char setting[MAX_SETTING_SIZE] = "";
if(BridgeSettingGet("Misc", "YaraRulesDirectory", setting))
{
rulesDirectory = QString(setting);
@ -55,7 +55,7 @@ void YaraRuleSelectionDialog::on_buttonFile_clicked()
void YaraRuleSelectionDialog::on_buttonSelect_clicked()
{
int selectedIndex=ui->listRules->row(ui->listRules->selectedItems().at(0));
int selectedIndex = ui->listRules->row(ui->listRules->selectedItems().at(0));
selectedFile = ruleFiles.at(selectedIndex).first;
this->accept();
}
@ -68,7 +68,7 @@ void YaraRuleSelectionDialog::enumRulesDirectory()
while(it.hasNext())
{
it.next();
ruleFiles.append(QPair<QString,QString>(QDir::toNativeSeparators(it.filePath()), it.fileName()));
ruleFiles.append(QPair<QString, QString>(QDir::toNativeSeparators(it.filePath()), it.fileName()));
ui->listRules->addItem(it.fileName());
}
ui->listRules->setCurrentRow(0);

View File

@ -3,7 +3,8 @@
#include <QDialog>
namespace Ui {
namespace Ui
{
class YaraRuleSelectionDialog;
}
@ -12,7 +13,7 @@ class YaraRuleSelectionDialog : public QDialog
Q_OBJECT
public:
explicit YaraRuleSelectionDialog(QWidget *parent = 0);
explicit YaraRuleSelectionDialog(QWidget* parent = 0);
~YaraRuleSelectionDialog();
QString getSelectedFile();
@ -22,7 +23,7 @@ private slots:
void on_buttonSelect_clicked();
private:
Ui::YaraRuleSelectionDialog *ui;
Ui::YaraRuleSelectionDialog* ui;
QList<QPair<QString, QString>> ruleFiles;
QString rulesDirectory;
QString selectedFile;