1
0
Fork 0

DBG+GUI+BRIDGE+PROJECT: updated AStyle and formatting

This commit is contained in:
mrexodia 2017-03-16 03:32:09 +01:00
parent 033a495925
commit d5e578ee6a
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
62 changed files with 264 additions and 289 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,30 +1,5 @@
# hooks # hooks
This contains two binaries `AStyleWhore.exe` and `AStyle.dll` to format any code before you commit. They are signed with GPG. This contains two binaries `AStyleWhore.exe` and `AStyle.dll` to format any code before you commit. They are signed with the serial number `37 ba b6 0f 84 53 0e 5e e5 76 ba d2 6d 45 4b 58`.
To verify: If you are unsure about the integrity of the files, don't hesitate to contact me (mrexodia). The source code is available at [BitBucket](https://bitbucket.org/mrexodia/astylewhore). The version of `AStyle.dll` is compiled from `AStyle_2.06_windows.zip` which came from [Sourceforge](https://sourceforge.net/projects/astyle/files/astyle/astyle%202.06/AStyle_2.06_windows.zip/download).
```
gpg --verify AStyle.dll.sig AStyle.dll
gpg: Signature made 07/08/16 06:01:39 W. Europe Daylight Time using RSA key ID AA0073B4
gpg: Good signature from "Duncan Ogilvie <mr.exodia.tpodt@gmail.com>" [ultimate]
gpg --verify AStyleWhore.exe.sig AStyleWhore.exe
gpg: Signature made 07/08/16 06:01:42 W. Europe Daylight Time using RSA key ID AA0073B4
gpg: Good signature from "Duncan Ogilvie <mr.exodia.tpodt@gmail.com>" [ultimate]
```
The *key ID* should match the last 8 characters of the signature of [this commit](https://github.com/x64dbg/x64dbg/commit/c855c15fd79870312ea5b4a1fbf3cb0dd8ae6240).
Git hashes are:
```
git ls-files -s
100644 6ef20910c6ab4e94cc2270e289a5b73d712c9c50 0 AStyle.dll
100644 5ea8a5daf0580e030406cedb83fb73ca9c187138 0 AStyle.dll.sig
100644 10dd63522b059eb3a43c01b35b807a9d50b5034d 0 AStyleWhore.exe
100644 d910d7ff178703b1452bc717491e5c24b9db1945 0 AStyleWhore.exe.sig
100644 0706138f1ec594c0b5d41978900b9d45cd2d99d7 0 pre-commit
```
If you are unsure about the integrity of the files, don't hesitate to contact me (mrexodia). The source code is available at [BitBucket](https://bitbucket.org/mrexodia/astylewhore). The version of `AStyle.dll` is compiled from `AStyle_2.04_windows.zip` which came from [Sourceforge](https://sourceforge.net/projects/astyle/files/astyle/astyle%202.04/AStyle_2.04_windows.zip/download).

@ -1 +1 @@
Subproject commit c1bf5682a05836e5f54319db92248116a4a9ccc6 Subproject commit 05adc360018b6810cb0a6bbaa247de6522bdf9c5

@ -1 +1 @@
Subproject commit 90eed9913a12ef5afec007b4d91f77301b66cc76 Subproject commit d5034cf6d647e98cb01e9e1fc4efa5086f8fc6a5

View File

@ -64,7 +64,7 @@ bool ExHandlerGetSEH(std::vector<duint> & Entries)
while(addr_ExRegRecord != 0xFFFFFFFF && MAX_DEPTH) while(addr_ExRegRecord != 0xFFFFFFFF && MAX_DEPTH)
{ {
Entries.push_back(addr_ExRegRecord); Entries.push_back(addr_ExRegRecord);
if(!MemRead(addr_ExRegRecord , &sehr, sizeof(EXCEPTION_REGISTRATION_RECORD))) if(!MemRead(addr_ExRegRecord, &sehr, sizeof(EXCEPTION_REGISTRATION_RECORD)))
break; break;
addr_ExRegRecord = (duint)sehr.Next; addr_ExRegRecord = (duint)sehr.Next;
MAX_DEPTH--; MAX_DEPTH--;

View File

@ -64,7 +64,7 @@ template<class S1, class S2> struct concat;
template<unsigned... I1, unsigned... I2> template<unsigned... I1, unsigned... I2>
struct concat<seq<I1...>, seq<I2...>> struct concat<seq<I1...>, seq<I2...>>
: seq < I1..., (sizeof...(I1) + I2)... > {}; : seq < I1..., (sizeof...(I1) + I2)... > {};
template<class S1, class S2> using Concat = Invoke<concat<S1, S2>>; template<class S1, class S2> using Concat = Invoke<concat<S1, S2>>;

View File

@ -389,7 +389,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
} }
} }
} }
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, addrText); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, addrText);
} }
break; break;
@ -443,7 +443,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
} }
int charwidth = getCharWidth(); int charwidth = getCharWidth();
painter->drawText(QRect(x + funcsize, y , charwidth , h), Qt::AlignVCenter | Qt::AlignLeft, indicator); painter->drawText(QRect(x + funcsize, y, charwidth, h), Qt::AlignVCenter | Qt::AlignLeft, indicator);
funcsize += charwidth; funcsize += charwidth;
//draw jump arrows //draw jump arrows
@ -621,7 +621,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
width = w; width = w;
if(width) if(width)
painter->fillRect(QRect(x + argsize, y, width, h), QBrush(backgroundColor)); //fill comment color painter->fillRect(QRect(x + argsize, y, width, h), QBrush(backgroundColor)); //fill comment color
painter->drawText(QRect(x + argsize, y , width , h), Qt::AlignVCenter | Qt::AlignLeft, comment); painter->drawText(QRect(x + argsize, y, width, h), Qt::AlignVCenter | Qt::AlignLeft, comment);
argsize += width + 3; argsize += width + 3;
} }
else if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) // label but no comment else if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) // label but no comment
@ -659,7 +659,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
width = w; width = w;
if(width) if(width)
painter->fillRect(QRect(x + argsize, y, width, h), QBrush(mMnemonicBriefBackgroundColor)); //mnemonic brief background color painter->fillRect(QRect(x + argsize, y, width, h), QBrush(mMnemonicBriefBackgroundColor)); //mnemonic brief background color
painter->drawText(QRect(x + argsize, y , width, h), Qt::AlignVCenter | Qt::AlignLeft, mnemBrief); painter->drawText(QRect(x + argsize, y, width, h), Qt::AlignVCenter | Qt::AlignLeft, mnemBrief);
} }
break; break;
} }
@ -1130,7 +1130,7 @@ int Disassembly::paintJumpsGraphic(QPainter* painter, int x, int y, dsint addr,
{ {
QPoint wPoints[] = QPoint wPoints[] =
{ {
QPoint(x , y + halfRow + 1), QPoint(x, y + halfRow + 1),
QPoint(x + 2, y + halfRow - 1), QPoint(x + 2, y + halfRow - 1),
QPoint(x + 4, y + halfRow + 1), QPoint(x + 4, y + halfRow + 1),
}; };
@ -1141,7 +1141,7 @@ int Disassembly::paintJumpsGraphic(QPainter* painter, int x, int y, dsint addr,
{ {
QPoint wPoints[] = QPoint wPoints[] =
{ {
QPoint(x , y + halfRow - 1), QPoint(x, y + halfRow - 1),
QPoint(x + 2, y + halfRow + 1), QPoint(x + 2, y + halfRow + 1),
QPoint(x + 4, y + halfRow - 1), QPoint(x + 4, y + halfRow - 1),
}; };
@ -1363,7 +1363,7 @@ dsint Disassembly::getPreviousInstructionRVA(dsint rva, duint count)
mMemPage->read(wBuffer.data(), wBottomByteRealRVA, wBuffer.size()); mMemPage->read(wBuffer.data(), wBottomByteRealRVA, wBuffer.size());
dsint addr = mDisasm->DisassembleBack((byte_t*)wBuffer.data(), rvaToVa(wBottomByteRealRVA), wBuffer.size(), wVirtualRVA , count); dsint addr = mDisasm->DisassembleBack((byte_t*)wBuffer.data(), rvaToVa(wBottomByteRealRVA), wBuffer.size(), wVirtualRVA, count);
addr += rva - wVirtualRVA; addr += rva - wVirtualRVA;

View File

@ -263,7 +263,7 @@ QString SearchListViewTable::paintContent(QPainter* painter, dsint rowBase, int
} }
} }
} }
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, text); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, text);
text = ""; text = "";
} }
else if(highlightText.length() && text.contains(highlightText, Qt::CaseInsensitive)) else if(highlightText.length() && text.contains(highlightText, Qt::CaseInsensitive))

View File

@ -41,7 +41,7 @@ QString BreakpointsViewTable::paintContent(QPainter* painter, dsint rowBase, int
{ {
painter->fillRect(QRect(x, y, w, h), QBrush(mCipBackgroundColor)); painter->fillRect(QRect(x, y, w, h), QBrush(mCipBackgroundColor));
painter->setPen(QPen(mCipColor)); painter->setPen(QPen(mCipColor));
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, bpAddrStr); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, bpAddrStr);
ret = ""; ret = "";
} }
} }

View File

@ -117,7 +117,7 @@ void CPUDisassembly::mouseDoubleClickEvent(QMouseEvent* event)
void CPUDisassembly::addFollowReferenceMenuItem(QString name, dsint value, QMenu* menu, bool isReferences, bool isFollowInCPU) void CPUDisassembly::addFollowReferenceMenuItem(QString name, dsint value, QMenu* menu, bool isReferences, bool isFollowInCPU)
{ {
foreach(QAction * action, menu->actions()) //check for duplicate action foreach(QAction* action, menu->actions()) //check for duplicate action
if(action->text() == name) if(action->text() == name)
return; return;
QAction* newAction = new QAction(name, this); QAction* newAction = new QAction(name, this);
@ -488,7 +488,7 @@ void CPUDisassembly::setupRightClickContextMenu()
}; };
ENCODETYPE enctypeTable[] = {enc_code, enc_byte, enc_word, enc_dword, enc_fword, enc_qword, enc_tbyte, enc_oword, enc_middle, ENCODETYPE enctypeTable[] = {enc_code, enc_byte, enc_word, enc_dword, enc_fword, enc_qword, enc_tbyte, enc_oword, enc_middle,
enc_real4, enc_real8, enc_real10 , enc_middle, enc_real4, enc_real8, enc_real10, enc_middle,
enc_ascii, enc_unicode, enc_middle, enc_ascii, enc_unicode, enc_middle,
enc_mmword, enc_xmmword, enc_ymmword enc_mmword, enc_xmmword, enc_ymmword
}; };

View File

@ -329,7 +329,7 @@ QString CPUDump::paintContent(QPainter* painter, dsint rowBase, int rowOffset, i
} }
if(background.alpha()) if(background.alpha())
painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background color painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background color
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, makeAddrText(cur_addr)); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, makeAddrText(cur_addr));
return ""; return "";
} }
return HexDump::paintContent(painter, rowBase, rowOffset, col, x, y, w, h); return HexDump::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);

View File

@ -324,7 +324,7 @@ void CPUInfoBox::followActionSlot()
*/ */
void CPUInfoBox::addFollowMenuItem(QMenu* menu, QString name, duint value) void CPUInfoBox::addFollowMenuItem(QMenu* menu, QString name, duint value)
{ {
foreach(QAction * action, menu->actions()) //check for duplicate action foreach(QAction* action, menu->actions()) //check for duplicate action
if(action->text() == name) if(action->text() == name)
return; return;
QAction* newAction = new QAction(name, menu); QAction* newAction = new QAction(name, menu);
@ -389,7 +389,7 @@ void CPUInfoBox::setupFollowMenu(QMenu* menu, duint wVA)
*/ */
void CPUInfoBox::addWatchMenuItem(QMenu* menu, QString name, duint value) void CPUInfoBox::addWatchMenuItem(QMenu* menu, QString name, duint value)
{ {
foreach(QAction * action, menu->actions()) //check for duplicate action foreach(QAction* action, menu->actions()) //check for duplicate action
if(action->text() == name) if(action->text() == name)
return; return;
QAction* newAction = new QAction(name, menu); QAction* newAction = new QAction(name, menu);

View File

@ -432,7 +432,7 @@ QString CPUStack::paintContent(QPainter* painter, dsint rowBase, int rowOffset,
} }
if(background.alpha()) if(background.alpha())
painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background when defined painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background when defined
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, makeAddrText(wVa)); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, makeAddrText(wVa));
return QString(); return QString();
} }
else if(col == 1) // paint stack data else if(col == 1) // paint stack data

View File

@ -186,7 +186,7 @@ void DisassemblerGraphView::paintNormal(QPainter & p, QRect & viewportRect, int
} }
//Ignore blocks that are not in view //Ignore blocks that are not in view
if(viewportRect.intersects(QRect(block.x + this->charWidth , block.y + this->charWidth, if(viewportRect.intersects(QRect(block.x + this->charWidth, block.y + this->charWidth,
block.width - (2 * this->charWidth), block.height - (2 * this->charWidth)))) block.width - (2 * this->charWidth), block.height - (2 * this->charWidth))))
{ {
//Render shadow //Render shadow
@ -1405,7 +1405,7 @@ void DisassemblerGraphView::show_cur_instr(bool force)
QRect viewportRect = this->viewport()->rect(); QRect viewportRect = this->viewport()->rect();
QPoint translation(this->renderXOfs - xofs, this->renderYOfs - yofs); QPoint translation(this->renderXOfs - xofs, this->renderYOfs - yofs);
viewportRect.translate(-translation.x(), -translation.y()); viewportRect.translate(-translation.x(), -translation.y());
if(force || !viewportRect.contains(QRect(block.x + this->charWidth , block.y + this->charWidth, if(force || !viewportRect.contains(QRect(block.x + this->charWidth, block.y + this->charWidth,
block.width - (2 * this->charWidth), block.height - (2 * this->charWidth)))) block.width - (2 * this->charWidth), block.height - (2 * this->charWidth))))
{ {
auto x = block.x + int(block.width / 2); auto x = block.x + int(block.width / 2);

View File

@ -57,9 +57,9 @@ void RegistersView::InitMappings()
offset++; offset++;
mRegisterMapping.insert(R8, "R8"); mRegisterMapping.insert(R8, "R8");
mRegisterPlaces.insert(R8 , Register_Position(offset++, 0, 6, sizeof(duint) * 2)); mRegisterPlaces.insert(R8, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
mRegisterMapping.insert(R9, "R9"); mRegisterMapping.insert(R9, "R9");
mRegisterPlaces.insert(R9 , Register_Position(offset++, 0, 6, sizeof(duint) * 2)); mRegisterPlaces.insert(R9, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
mRegisterMapping.insert(R10, "R10"); mRegisterMapping.insert(R10, "R10");
mRegisterPlaces.insert(R10, Register_Position(offset++, 0, 6, sizeof(duint) * 2)); mRegisterPlaces.insert(R10, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
mRegisterMapping.insert(R11, "R11"); mRegisterMapping.insert(R11, "R11");
@ -1746,7 +1746,7 @@ void RegistersView::keyPressEvent(QKeyEvent* event)
QSize RegistersView::sizeHint() const QSize RegistersView::sizeHint() const
{ {
// 32 character width // 32 character width
return QSize(32 * mCharWidth , this->viewport()->height()); return QSize(32 * mCharWidth, this->viewport()->height());
} }
void* RegistersView::operator new(size_t size) void* RegistersView::operator new(size_t size)
@ -2681,7 +2681,7 @@ void RegistersView::onPushAction()
duint regVal = 0; duint regVal = 0;
regVal = * ((duint*) registerValue(&wRegDumpStruct, mSelected)); regVal = * ((duint*) registerValue(&wRegDumpStruct, mSelected));
setRegister(CSP, csp); setRegister(CSP, csp);
DbgMemWrite(csp, (const unsigned char*)&regVal , sizeof(void*)); DbgMemWrite(csp, (const unsigned char*)&regVal, sizeof(void*));
} }
void RegistersView::onPopAction() void RegistersView::onPopAction()

View File

@ -191,7 +191,7 @@ protected slots:
QString getRegisterLabel(REGISTER_NAME); QString getRegisterLabel(REGISTER_NAME);
int CompareRegisters(const REGISTER_NAME reg_name, REGDUMP* regdump1, REGDUMP* regdump2); int CompareRegisters(const REGISTER_NAME reg_name, REGDUMP* regdump1, REGDUMP* regdump2);
SIZE_T GetSizeRegister(const REGISTER_NAME reg_name); SIZE_T GetSizeRegister(const REGISTER_NAME reg_name);
QString GetRegStringValueFromValue(REGISTER_NAME reg , const char* value); QString GetRegStringValueFromValue(REGISTER_NAME reg, const char* value);
QString GetTagWordStateString(unsigned short); QString GetTagWordStateString(unsigned short);
//unsigned int GetTagWordValueFromString(const char* string); //unsigned int GetTagWordValueFromString(const char* string);
QString GetControlWordPCStateString(unsigned short); QString GetControlWordPCStateString(unsigned short);

View File

@ -109,7 +109,7 @@ QString ScriptView::paintContent(QPainter* painter, dsint rowBase, int rowOffset
if(background.alpha()) if(background.alpha())
painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background painter->fillRect(QRect(x, y, w, h), QBrush(background)); //fill background
} }
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, returnString); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, returnString);
returnString = ""; returnString = "";
} }
break; break;

View File

@ -366,7 +366,7 @@ QString ThreadView::paintContent(QPainter* painter, dsint rowBase, int rowOffset
{ {
painter->fillRect(QRect(x, y, w, h), QBrush(ConfigColor("ThreadCurrentBackgroundColor"))); painter->fillRect(QRect(x, y, w, h), QBrush(ConfigColor("ThreadCurrentBackgroundColor")));
painter->setPen(QPen(ConfigColor("ThreadCurrentColor"))); //white text painter->setPen(QPen(ConfigColor("ThreadCurrentColor"))); //white text
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, ret); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, ret);
ret = ""; ret = "";
} }
return ret; return ret;

View File

@ -178,7 +178,7 @@ QString WatchView::paintContent(QPainter* painter, dsint rowBase, int rowOffset,
{ {
painter->fillRect(QRect(x, y, w, h), mWatchTriggeredBackgroundColor); painter->fillRect(QRect(x, y, w, h), mWatchTriggeredBackgroundColor);
painter->setPen(mWatchTriggeredColor); //white text painter->setPen(mWatchTriggeredColor); //white text
painter->drawText(QRect(x + 4, y , w - 4 , h), Qt::AlignVCenter | Qt::AlignLeft, ret); painter->drawText(QRect(x + 4, y, w - 4, h), Qt::AlignVCenter | Qt::AlignLeft, ret);
return ""; return "";
} }
else else

View File

@ -1324,7 +1324,7 @@ std::string dd_real::to_string(std::streamsize precision, std::streamsize width,
{ {
// fix the string if it's been computed incorrectly // fix the string if it's been computed incorrectly
// round here in the decimal string if required // round here in the decimal string if required
round_string(t, d + 1 , &off); round_string(t, d + 1, &off);
if(off > 0) if(off > 0)
{ {

View File

@ -408,7 +408,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultShortcuts.insert("OptionsAppearance", Shortcut(tr("Options -> Appearance"), "", true)); defaultShortcuts.insert("OptionsAppearance", Shortcut(tr("Options -> Appearance"), "", true));
defaultShortcuts.insert("OptionsShortcuts", Shortcut(tr("Options -> Shortcuts"), "", true)); defaultShortcuts.insert("OptionsShortcuts", Shortcut(tr("Options -> Shortcuts"), "", true));
defaultShortcuts.insert("OptionsTopmost", Shortcut(tr("Options -> Topmost"), "Ctrl+F5", true)); defaultShortcuts.insert("OptionsTopmost", Shortcut(tr("Options -> Topmost"), "Ctrl+F5", true));
defaultShortcuts.insert("OptionsReloadStylesheet", Shortcut(tr("Options -> Reload style.css") , "", true)); defaultShortcuts.insert("OptionsReloadStylesheet", Shortcut(tr("Options -> Reload style.css"), "", true));
defaultShortcuts.insert("HelpAbout", Shortcut(tr("Help -> About"), "", true)); defaultShortcuts.insert("HelpAbout", Shortcut(tr("Help -> About"), "", true));
defaultShortcuts.insert("HelpBlog", Shortcut(tr("Help -> Blog"), "", true)); defaultShortcuts.insert("HelpBlog", Shortcut(tr("Help -> Blog"), "", true));