1
0
Fork 0

GUI: Fix files from previous merge(s)

This commit is contained in:
Nukem 2015-04-04 20:44:49 -04:00
parent 0ad2701caf
commit e389edf7b9
8 changed files with 7 additions and 76 deletions

View File

@ -8,6 +8,7 @@
#include <QMouseEvent>
#include <QPainter>
#include "NewTypes.h"
#include "StringUtil.h"
//Hacky class that fixes a really annoying cursor problem
class AbstractTableScrollBar : public QScrollBar

View File

@ -1480,7 +1480,7 @@ QString Disassembly::getAddrText(int_t cur_addr, char label[MAX_LABEL_SIZE])
#endif //_WIN64
}
}
addrText += QString("%1").arg(cur_addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
addrText += AddressToString(cur_addr);
char label_[MAX_LABEL_SIZE] = "";
if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label_)) //has label
{

View File

@ -385,11 +385,6 @@ Bridge* Bridge::getBridge()
void Bridge::initBridge()
{
// The main queue handler thread should also
// be initialized. Just placing it here.
HANDLE threadHandle = CreateThread(nullptr, 0, GuiDisptacherThread, nullptr, 0, nullptr);
CloseHandle(threadHandle);
mBridge = new Bridge();
}
@ -401,70 +396,7 @@ __declspec(dllexport) int _gui_guiinit(int argc, char* argv[])
return main(argc, argv);
}
struct GUI_MESSAGE
{
GUIMSG Type;
void *Param1;
void *Param2;
concurrency::single_assignment<void *> *Trigger;
};
concurrency::unbounded_buffer<GUI_MESSAGE> FIFOCommandStack;
__declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* param2)
{
GUI_MESSAGE msg;
msg.Type = type;
msg.Param1 = param1;
msg.Param2 = param2;
msg.Trigger = new concurrency::single_assignment<void *>();
// Synchronous send
concurrency::send(FIFOCommandStack, msg);
// Wait for the message to be completed and this is notified
void *returnValue = concurrency::receive(msg.Trigger);
// Free memory
delete msg.Trigger;
// Done
return returnValue;
}
__declspec(dllexport) void _gui_sendmessageasync(GUIMSG type, void* param1, void* param2)
{
GUI_MESSAGE msg;
msg.Type = type;
msg.Param1 = param1;
msg.Param2 = param2;
msg.Trigger = nullptr;
// Asynchronous send. Return value doesn't matter.
concurrency::asend(FIFOCommandStack, msg);
}
DWORD WINAPI Bridge::GuiDisptacherThread(LPVOID Argument)
{
UNREFERENCED_PARAMETER(Argument);
while(true)
{
// Only returns when there's commands queued
GUI_MESSAGE message = concurrency::receive(FIFOCommandStack);
// Execute the GUI function
void *ret = GuiDispatchMessage(message.Type, message.Param1, message.Param2);
// See if a return value was requested (DO NOT WAIT - ASYNC)
if (message.Trigger)
concurrency::asend(message.Trigger, ret);
}
return 0;
}
void* Bridge::GuiDispatchMessage(GUIMSG type, void* param1, void* param2)
{
switch(type)
{

View File

@ -85,9 +85,6 @@ public:
void emitSymbolRefreshCurrent();
void emitLoadSourceFile(const QString path, int line = 0);
static DWORD WINAPI GuiDisptacherThread(LPVOID Argument);
static void* GuiDispatchMessage(GUIMSG type, void* param1, void* param2);
//Public variables
void* winId;
QWidget* scriptView;

View File

@ -184,7 +184,7 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA)
char section[MAX_SECTION_SIZE] = "";
if(DbgFunctions()->SectionFromAddr(parVA, section))
info += "\"" + QString(section) + "\":";
info += QString("%1").arg(parVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
info += AddressToString(parVA);
char label[MAX_LABEL_SIZE] = "";
if(DbgGetLabelAt(parVA, SEG_DEFAULT, label))
info += " <" + QString(label) + ">";

View File

@ -224,7 +224,7 @@ QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset,
#endif //_WIN64
}
}
addrText += QString("%1").arg(cur_addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
addrText += AddressToString(cur_addr);
if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) //has label
{
char module[MAX_MODULE_SIZE] = "";

View File

@ -223,7 +223,7 @@ void ThreadView::updateThreadList()
setCellContent(i, 0, "Main");
else
setCellContent(i, 0, QString("%1").arg(threadList.list[i].BasicInfo.ThreadNumber, 0, 10));
setCellContent(i, 1, QString("%1").arg(threadList.list[i].BasicInfo.dwThreadId, 0, 16).toUpper());
setCellContent(i, 1, QString("%1").arg(threadList.list[i].BasicInfo.ThreadId, 0, 16).toUpper());
setCellContent(i, 2, QString("%1").arg(threadList.list[i].BasicInfo.ThreadStartAddress, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
setCellContent(i, 3, QString("%1").arg(threadList.list[i].BasicInfo.ThreadLocalBase, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
setCellContent(i, 4, QString("%1").arg(threadList.list[i].ThreadCip, sizeof(int_t) * 2, 16, QChar('0')).toUpper());

View File

@ -159,7 +159,8 @@ HEADERS += \
Src/Gui/YaraRuleSelectionDialog.h \
Src/Gui/DataCopyDialog.h \
Src/Gui/SourceViewerManager.h \
Src/Gui/SourceView.h
Src/Gui/SourceView.h \
Src/Utils/StringUtil.h
INCLUDEPATH += \