Merge branch 'flowgraph' of https://bitbucket.org/mrexodia/x64_dbg into flowgraph
Conflicts: x64_dbg_dbg/Analysis/AnalysisRunner.cpp x64_dbg_dbg/Analysis/ClientApiResolver.cpp x64_dbg_dbg/Analysis/ClientFunctionFinder.cpp x64_dbg_dbg/Analysis/FlowGraph.cpp x64_dbg_dbg/Analysis/FlowGraph.h x64_dbg_dbg/Analysis/Meta.h x64_dbg_dbg/Analysis/Node_t.cpp x64_dbg_dbg/Analysis/Node_t.h
This commit is contained in:
commit
26d53fdb7f
|
@ -52,7 +52,7 @@ del /Q *.exp
|
||||||
del /Q *.a
|
del /Q *.a
|
||||||
del /Q *.lib
|
del /Q *.lib
|
||||||
del /Q *.def
|
del /Q *.def
|
||||||
del /Q launcher.exe
|
del /Q x96_dbg.exe
|
||||||
cd..
|
cd..
|
||||||
echo cleaning bin\x32...
|
echo cleaning bin\x32...
|
||||||
cd bin\x32
|
cd bin\x32
|
||||||
|
|
|
@ -46,7 +46,7 @@ mkdir %RELEASEDIR%\release
|
||||||
mkdir %RELEASEDIR%\release\x32
|
mkdir %RELEASEDIR%\release\x32
|
||||||
mkdir %RELEASEDIR%\release\x64
|
mkdir %RELEASEDIR%\release\x64
|
||||||
|
|
||||||
copy bin\launcher.exe %RELEASEDIR%\release\launcher.exe
|
copy bin\x96_dbg.exe %RELEASEDIR%\release\x96_dbg.exe
|
||||||
copy bin\x32\x32_bridge.dll %RELEASEDIR%\release\x32\x32_bridge.dll
|
copy bin\x32\x32_bridge.dll %RELEASEDIR%\release\x32\x32_bridge.dll
|
||||||
copy bin\x32\x32_dbg.dll %RELEASEDIR%\release\x32\x32_dbg.dll
|
copy bin\x32\x32_dbg.dll %RELEASEDIR%\release\x32\x32_dbg.dll
|
||||||
copy bin\x32\x32_dbg.exe %RELEASEDIR%\release\x32\x32_dbg.exe
|
copy bin\x32\x32_dbg.exe %RELEASEDIR%\release\x32\x32_dbg.exe
|
||||||
|
|
|
@ -112,6 +112,26 @@ static bool _getjitauto(bool* jit_auto)
|
||||||
return dbggetjitauto(jit_auto, notfound, NULL, NULL);
|
return dbggetjitauto(jit_auto, notfound, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool _isprocesselevated(void)
|
||||||
|
{
|
||||||
|
return IsProcessElevated();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool _getpagerights(uint* addr, char* rights)
|
||||||
|
{
|
||||||
|
return dbggetpagerights(addr, rights);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool _pagerightstostring(DWORD protect, char* rights)
|
||||||
|
{
|
||||||
|
return dbgpagerightstostring(protect, rights);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool _setpagerights(uint* addr, char* rights)
|
||||||
|
{
|
||||||
|
return dbgsetpagerights(addr, rights);
|
||||||
|
}
|
||||||
|
|
||||||
static bool _getjit(char* jit, bool jit64)
|
static bool _getjit(char* jit, bool jit64)
|
||||||
{
|
{
|
||||||
arch dummy;
|
arch dummy;
|
||||||
|
@ -180,4 +200,8 @@ void dbgfunctionsinit()
|
||||||
_dbgfunctions.GetJitAuto = _getjitauto;
|
_dbgfunctions.GetJitAuto = _getjitauto;
|
||||||
_dbgfunctions.GetDefJit = dbggetdefjit;
|
_dbgfunctions.GetDefJit = dbggetdefjit;
|
||||||
_dbgfunctions.GetProcessList = _getprocesslist;
|
_dbgfunctions.GetProcessList = _getprocesslist;
|
||||||
|
_dbgfunctions.GetPageRights = _getpagerights;
|
||||||
|
_dbgfunctions.SetPageRights = _setpagerights;
|
||||||
|
_dbgfunctions.PageRightsToString = _pagerightstostring;
|
||||||
|
_dbgfunctions.IsProcessElevated = _isprocesselevated;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,10 @@ typedef bool (*GETJIT)(char* jit, bool x64);
|
||||||
typedef bool (*GETJITAUTO)(bool*);
|
typedef bool (*GETJITAUTO)(bool*);
|
||||||
typedef bool (*GETDEFJIT)(char*);
|
typedef bool (*GETDEFJIT)(char*);
|
||||||
typedef bool (*GETPROCESSLIST)(DBGPROCESSINFO** entries, int* count);
|
typedef bool (*GETPROCESSLIST)(DBGPROCESSINFO** entries, int* count);
|
||||||
|
typedef bool (*GETPAGERIGHTS)(duint*, char*);
|
||||||
|
typedef bool (*SETPAGERIGHTS)(duint*, char*);
|
||||||
|
typedef bool (*PAGERIGHTSTOSTRING)(DWORD, char*);
|
||||||
|
typedef bool (*ISPROCESSELEVATED)(void);
|
||||||
|
|
||||||
typedef struct DBGFUNCTIONS_
|
typedef struct DBGFUNCTIONS_
|
||||||
{
|
{
|
||||||
|
@ -84,6 +88,10 @@ typedef struct DBGFUNCTIONS_
|
||||||
GETJIT GetJit;
|
GETJIT GetJit;
|
||||||
GETDEFJIT GetDefJit;
|
GETDEFJIT GetDefJit;
|
||||||
GETPROCESSLIST GetProcessList;
|
GETPROCESSLIST GetProcessList;
|
||||||
|
GETPAGERIGHTS GetPageRights;
|
||||||
|
SETPAGERIGHTS SetPageRights;
|
||||||
|
PAGERIGHTSTOSTRING PageRightsToString;
|
||||||
|
ISPROCESSELEVATED IsProcessElevated;
|
||||||
} DBGFUNCTIONS;
|
} DBGFUNCTIONS;
|
||||||
|
|
||||||
#ifdef BUILD_DBG
|
#ifdef BUILD_DBG
|
||||||
|
|
|
@ -99,6 +99,7 @@ bool modload(uint base, uint size, const char* fullpath)
|
||||||
while(name[len] != '.' and len)
|
while(name[len] != '.' and len)
|
||||||
len--;
|
len--;
|
||||||
MODINFO info;
|
MODINFO info;
|
||||||
|
memset(&info, 0, sizeof(MODINFO));
|
||||||
info.sections.clear();
|
info.sections.clear();
|
||||||
info.hash = modhashfromname(name);
|
info.hash = modhashfromname(name);
|
||||||
if(len)
|
if(len)
|
||||||
|
@ -117,6 +118,7 @@ bool modload(uint base, uint size, const char* fullpath)
|
||||||
ULONG_PTR FileMapVA;
|
ULONG_PTR FileMapVA;
|
||||||
if(StaticFileLoad((char*)fullpath, UE_ACCESS_READ, false, &FileHandle, &LoadedSize, &FileMap, &FileMapVA))
|
if(StaticFileLoad((char*)fullpath, UE_ACCESS_READ, false, &FileHandle, &LoadedSize, &FileMap, &FileMapVA))
|
||||||
{
|
{
|
||||||
|
info.entry = GetPE32DataFromMappedFile(FileMapVA, 0, UE_OEP) + info.base; //get entry point
|
||||||
int SectionCount = (int)GetPE32DataFromMappedFile(FileMapVA, 0, UE_SECTIONNUMBER);
|
int SectionCount = (int)GetPE32DataFromMappedFile(FileMapVA, 0, UE_SECTIONNUMBER);
|
||||||
if(SectionCount > 0)
|
if(SectionCount > 0)
|
||||||
{
|
{
|
||||||
|
@ -268,6 +270,14 @@ bool modsectionsfromaddr(uint addr, std::vector<MODSECTIONINFO>* sections)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint modentryfromaddr(uint addr)
|
||||||
|
{
|
||||||
|
const ModulesInfo::iterator found = modinfo.find(Range(addr, addr));
|
||||||
|
if(found == modinfo.end()) //not found
|
||||||
|
return 0;
|
||||||
|
return found->second.entry;
|
||||||
|
}
|
||||||
|
|
||||||
///api functions
|
///api functions
|
||||||
bool apienumexports(uint base, EXPORTENUMCALLBACK cbEnum)
|
bool apienumexports(uint base, EXPORTENUMCALLBACK cbEnum)
|
||||||
{
|
{
|
||||||
|
@ -1019,6 +1029,7 @@ bool loopadd(uint start, uint end, bool manual)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get the start/end of a loop at a certain depth and addr
|
||||||
bool loopget(int depth, uint addr, uint* start, uint* end)
|
bool loopget(int depth, uint addr, uint* start, uint* end)
|
||||||
{
|
{
|
||||||
if(!DbgIsDebugging())
|
if(!DbgIsDebugging())
|
||||||
|
@ -1070,6 +1081,7 @@ bool loopoverlaps(int depth, uint start, uint end, int* finaldepth)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//this should delete a loop and all sub-loops that matches a certain addr
|
||||||
bool loopdel(int depth, uint addr)
|
bool loopdel(int depth, uint addr)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -65,6 +65,7 @@ struct MODINFO
|
||||||
uint base; //module base
|
uint base; //module base
|
||||||
uint size; //module size
|
uint size; //module size
|
||||||
uint hash; //full module name hash
|
uint hash; //full module name hash
|
||||||
|
uint entry; //entry point
|
||||||
char name[MAX_MODULE_SIZE]; //module name (without extension)
|
char name[MAX_MODULE_SIZE]; //module name (without extension)
|
||||||
char extension[MAX_MODULE_SIZE]; //file extension
|
char extension[MAX_MODULE_SIZE]; //file extension
|
||||||
std::vector<MODSECTIONINFO> sections;
|
std::vector<MODSECTIONINFO> sections;
|
||||||
|
@ -134,6 +135,7 @@ uint modhashfromname(const char* mod);
|
||||||
uint modbasefromname(const char* modname);
|
uint modbasefromname(const char* modname);
|
||||||
uint modsizefromaddr(uint addr);
|
uint modsizefromaddr(uint addr);
|
||||||
bool modsectionsfromaddr(uint addr, std::vector<MODSECTIONINFO>* sections);
|
bool modsectionsfromaddr(uint addr, std::vector<MODSECTIONINFO>* sections);
|
||||||
|
uint modentryfromaddr(uint addr);
|
||||||
|
|
||||||
bool apienumexports(uint base, EXPORTENUMCALLBACK cbEnum);
|
bool apienumexports(uint base, EXPORTENUMCALLBACK cbEnum);
|
||||||
|
|
||||||
|
|
|
@ -1480,6 +1480,22 @@ void cbDetach()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool IsProcessElevated()
|
||||||
|
{
|
||||||
|
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
|
||||||
|
PSID SecurityIdentifier;
|
||||||
|
if(!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &SecurityIdentifier))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
BOOL IsAdminMember;
|
||||||
|
if(!CheckTokenMembership(NULL, SecurityIdentifier, &IsAdminMember))
|
||||||
|
IsAdminMember = FALSE;
|
||||||
|
|
||||||
|
FreeSid(SecurityIdentifier);
|
||||||
|
return IsAdminMember ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
bool _readwritejitkey(char* jit_key_value, DWORD* jit_key_vale_size, char* key, arch arch_in, arch* arch_out, readwritejitkey_error_t* error, bool write)
|
bool _readwritejitkey(char* jit_key_value, DWORD* jit_key_vale_size, char* key, arch arch_in, arch* arch_out, readwritejitkey_error_t* error, bool write)
|
||||||
{
|
{
|
||||||
DWORD key_flags;
|
DWORD key_flags;
|
||||||
|
@ -1491,7 +1507,15 @@ bool _readwritejitkey(char* jit_key_value, DWORD* jit_key_vale_size, char* key,
|
||||||
* error = ERROR_RW;
|
* error = ERROR_RW;
|
||||||
|
|
||||||
if(write)
|
if(write)
|
||||||
|
{
|
||||||
|
if(!IsProcessElevated())
|
||||||
|
{
|
||||||
|
if(error != NULL)
|
||||||
|
* error = ERROR_RW_NOTADMIN;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
key_flags = KEY_WRITE;
|
key_flags = KEY_WRITE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
key_flags = KEY_READ;
|
key_flags = KEY_READ;
|
||||||
|
|
||||||
|
@ -1512,7 +1536,7 @@ bool _readwritejitkey(char* jit_key_value, DWORD* jit_key_vale_size, char* key,
|
||||||
|
|
||||||
if(arch_in == x64)
|
if(arch_in == x64)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef _WIN64
|
||||||
if(!IsWow64())
|
if(!IsWow64())
|
||||||
{
|
{
|
||||||
if(error != NULL)
|
if(error != NULL)
|
||||||
|
@ -1562,6 +1586,118 @@ bool _readwritejitkey(char* jit_key_value, DWORD* jit_key_vale_size, char* key,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dbgpagerightstostring(DWORD protect, char* rights)
|
||||||
|
{
|
||||||
|
memset(rights, 0, RIGHTS_STRING);
|
||||||
|
|
||||||
|
switch(protect & 0xFF)
|
||||||
|
{
|
||||||
|
case PAGE_EXECUTE:
|
||||||
|
strcpy(rights, "E---");
|
||||||
|
break;
|
||||||
|
case PAGE_EXECUTE_READ:
|
||||||
|
strcpy(rights, "ER--");
|
||||||
|
break;
|
||||||
|
case PAGE_EXECUTE_READWRITE:
|
||||||
|
strcpy(rights, "ERW-");
|
||||||
|
break;
|
||||||
|
case PAGE_EXECUTE_WRITECOPY:
|
||||||
|
strcpy(rights, "ERWC");
|
||||||
|
break;
|
||||||
|
case PAGE_NOACCESS:
|
||||||
|
strcpy(rights, "----");
|
||||||
|
break;
|
||||||
|
case PAGE_READONLY:
|
||||||
|
strcpy(rights, "-R--");
|
||||||
|
break;
|
||||||
|
case PAGE_READWRITE:
|
||||||
|
strcpy(rights, "-RW-");
|
||||||
|
break;
|
||||||
|
case PAGE_WRITECOPY:
|
||||||
|
strcpy(rights, "-RWC");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(protect & PAGE_GUARD)
|
||||||
|
strcat(rights, "G");
|
||||||
|
else
|
||||||
|
strcat(rights, "-");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dbggetpageligned(uint* addr)
|
||||||
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
|
* addr &= 0xFFFFFFFFFFFFF000;
|
||||||
|
#else // _WIN32
|
||||||
|
* addr &= 0xFFFFF000;
|
||||||
|
#endif // _WIN64
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool dbgpagerightsfromstring(DWORD* protect, char* rights_string)
|
||||||
|
{
|
||||||
|
if(strlen(rights_string) < 2)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
* protect = 0;
|
||||||
|
if(rights_string[0] == 'G' || rights_string[0] == 'g')
|
||||||
|
{
|
||||||
|
* protect |= PAGE_GUARD;
|
||||||
|
rights_string++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_strcmpi(rights_string, "Execute") == 0)
|
||||||
|
* protect |= PAGE_EXECUTE;
|
||||||
|
else if(_strcmpi(rights_string, "ExecuteRead") == 0)
|
||||||
|
* protect |= PAGE_EXECUTE_READ;
|
||||||
|
else if(_strcmpi(rights_string, "ExecuteReadWrite") == 0)
|
||||||
|
* protect |= PAGE_EXECUTE_READWRITE;
|
||||||
|
else if(_strcmpi(rights_string, "ExecuteWriteCopy") == 0)
|
||||||
|
* protect |= PAGE_EXECUTE_WRITECOPY;
|
||||||
|
else if(_strcmpi(rights_string, "NoAccess") == 0)
|
||||||
|
* protect |= PAGE_NOACCESS;
|
||||||
|
else if(_strcmpi(rights_string, "ReadOnly") == 0)
|
||||||
|
* protect |= PAGE_READONLY;
|
||||||
|
else if(_strcmpi(rights_string, "ReadWrite") == 0)
|
||||||
|
* protect |= PAGE_READWRITE;
|
||||||
|
else if(_strcmpi(rights_string, "WriteCopy") == 0)
|
||||||
|
* protect |= PAGE_WRITECOPY;
|
||||||
|
|
||||||
|
if(* protect == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool dbgsetpagerights(uint* addr, char* rights_string)
|
||||||
|
{
|
||||||
|
DWORD protect;
|
||||||
|
DWORD old_protect;
|
||||||
|
|
||||||
|
dbggetpageligned(addr);
|
||||||
|
|
||||||
|
if(!dbgpagerightsfromstring(& protect, rights_string))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(VirtualProtectEx(fdProcessInfo->hProcess, (void*)*addr, PAGE_SIZE, protect, & old_protect) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool dbggetpagerights(uint* addr, char* rights)
|
||||||
|
{
|
||||||
|
dbggetpageligned(addr);
|
||||||
|
|
||||||
|
MEMORY_BASIC_INFORMATION mbi;
|
||||||
|
if(VirtualQueryEx(fdProcessInfo->hProcess, (const void*)*addr, &mbi, sizeof(mbi)) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return dbgpagerightstostring(mbi.Protect, rights);
|
||||||
|
}
|
||||||
|
|
||||||
bool dbggetjitauto(bool* auto_on, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out)
|
bool dbggetjitauto(bool* auto_on, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out)
|
||||||
{
|
{
|
||||||
char jit_entry[4];
|
char jit_entry[4];
|
||||||
|
|
|
@ -10,12 +10,14 @@
|
||||||
#define JIT_ENTRY_DEF_SIZE (MAX_PATH + sizeof(ATTACH_CMD_LINE) + 2)
|
#define JIT_ENTRY_DEF_SIZE (MAX_PATH + sizeof(ATTACH_CMD_LINE) + 2)
|
||||||
#define JIT_ENTRY_MAX_SIZE 512
|
#define JIT_ENTRY_MAX_SIZE 512
|
||||||
#define JIT_REG_KEY TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug")
|
#define JIT_REG_KEY TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug")
|
||||||
|
#define RIGHTS_STRING (sizeof("ERWCG") + 1)
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ERROR_RW = 0,
|
ERROR_RW = 0,
|
||||||
ERROR_RW_FILE_NOT_FOUND,
|
ERROR_RW_FILE_NOT_FOUND,
|
||||||
ERROR_RW_NOTWOW64
|
ERROR_RW_NOTWOW64,
|
||||||
|
ERROR_RW_NOTADMIN
|
||||||
} readwritejitkey_error_t;
|
} readwritejitkey_error_t;
|
||||||
|
|
||||||
//structures
|
//structures
|
||||||
|
@ -62,12 +64,18 @@ bool dbgisignoredexception(unsigned int exception);
|
||||||
bool dbgcmdnew(const char* name, CBCOMMAND cbCommand, bool debugonly);
|
bool dbgcmdnew(const char* name, CBCOMMAND cbCommand, bool debugonly);
|
||||||
bool dbgcmddel(const char* name);
|
bool dbgcmddel(const char* name);
|
||||||
bool dbggetjit(char jit_entry[JIT_ENTRY_MAX_SIZE], arch arch_in, arch* arch_out, readwritejitkey_error_t*);
|
bool dbggetjit(char jit_entry[JIT_ENTRY_MAX_SIZE], arch arch_in, arch* arch_out, readwritejitkey_error_t*);
|
||||||
|
bool dbggetpagerights(uint*, char*);
|
||||||
|
bool dbgpagerightstostring(DWORD, char*);
|
||||||
|
void dbggetpageligned(uint*);
|
||||||
|
bool dbgpagerightsfromstring(DWORD*, char*);
|
||||||
|
bool dbgsetpagerights(uint*, char*);
|
||||||
bool dbgsetjit(char* jit_cmd, arch arch_in, arch* arch_out, readwritejitkey_error_t*);
|
bool dbgsetjit(char* jit_cmd, arch arch_in, arch* arch_out, readwritejitkey_error_t*);
|
||||||
bool dbggetdefjit(char* jit_entry);
|
bool dbggetdefjit(char* jit_entry);
|
||||||
bool _readwritejitkey(char*, DWORD*, char*, arch, arch*, readwritejitkey_error_t*, bool);
|
bool _readwritejitkey(char*, DWORD*, char*, arch, arch*, readwritejitkey_error_t*, bool);
|
||||||
bool dbggetjitauto(bool*, arch, arch*, readwritejitkey_error_t*);
|
bool dbggetjitauto(bool*, arch, arch*, readwritejitkey_error_t*);
|
||||||
bool dbgsetjitauto(bool, arch, arch*, readwritejitkey_error_t*);
|
bool dbgsetjitauto(bool, arch, arch*, readwritejitkey_error_t*);
|
||||||
bool dbglistprocesses(std::vector<PROCESSENTRY32>* list);
|
bool dbglistprocesses(std::vector<PROCESSENTRY32>* list);
|
||||||
|
bool IsProcessElevated();
|
||||||
|
|
||||||
void cbStep();
|
void cbStep();
|
||||||
void cbRtrStep();
|
void cbRtrStep();
|
||||||
|
|
|
@ -1001,6 +1001,9 @@ CMDRESULT cbDebugAnalyse(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
dputs("init analysis");
|
dputs("init analysis");
|
||||||
uint cipAddr = GetContextData(UE_CIP);
|
uint cipAddr = GetContextData(UE_CIP);
|
||||||
|
uint oep = modentryfromaddr(cipAddr);
|
||||||
|
if(!oep)
|
||||||
|
oep = cipAddr;
|
||||||
|
|
||||||
uint size;
|
uint size;
|
||||||
uint base = memfindbaseaddr(cipAddr, &size);
|
uint base = memfindbaseaddr(cipAddr, &size);
|
||||||
|
@ -1010,7 +1013,7 @@ CMDRESULT cbDebugAnalyse(int argc, char* argv[])
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf("start analysis, assuming oep="fhex", baseaddr="fhex", size="fhex"!\n", cipAddr, base, size);
|
dprintf("start analysis, assuming oep="fhex", baseaddr="fhex", size="fhex"!\n", oep, base, size);
|
||||||
|
|
||||||
|
|
||||||
// tr4ce::ApiDB* db = new tr4ce::ApiDB();
|
// tr4ce::ApiDB* db = new tr4ce::ApiDB();
|
||||||
|
@ -1465,6 +1468,11 @@ CMDRESULT cbDebugSetJITAuto(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
arch actual_arch;
|
arch actual_arch;
|
||||||
bool set_jit_auto;
|
bool set_jit_auto;
|
||||||
|
if(!IsProcessElevated())
|
||||||
|
{
|
||||||
|
dprintf("Error run the debugger as Admin to setjitauto\n");
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
{
|
{
|
||||||
dprintf("Error setting JIT Auto. Use ON:1 or OFF:0 arg or x64/x32, ON:1 or OFF:0.\n");
|
dprintf("Error setting JIT Auto. Use ON:1 or OFF:0 arg or x64/x32, ON:1 or OFF:0.\n");
|
||||||
|
@ -1540,6 +1548,11 @@ CMDRESULT cbDebugSetJIT(int argc, char* argv[])
|
||||||
arch actual_arch;
|
arch actual_arch;
|
||||||
char* jit_debugger_cmd;
|
char* jit_debugger_cmd;
|
||||||
char oldjit[MAX_SETTING_SIZE] = "";
|
char oldjit[MAX_SETTING_SIZE] = "";
|
||||||
|
if(!IsProcessElevated())
|
||||||
|
{
|
||||||
|
dprintf("Error run the debugger as Admin to setjit\n");
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
{
|
{
|
||||||
char path[JIT_ENTRY_DEF_SIZE];
|
char path[JIT_ENTRY_DEF_SIZE];
|
||||||
|
@ -1647,7 +1660,7 @@ CMDRESULT cbDebugSetJIT(int argc, char* argv[])
|
||||||
if(rw_error == ERROR_RW_NOTWOW64)
|
if(rw_error == ERROR_RW_NOTWOW64)
|
||||||
dprintf("Error using x64 arg. The debugger is not a WOW64 process\n");
|
dprintf("Error using x64 arg. The debugger is not a WOW64 process\n");
|
||||||
else
|
else
|
||||||
dprintf("Error getting JIT %s\n", (actual_arch == x64) ? "x64" : "x32");
|
dprintf("Error setting JIT %s\n", (actual_arch == x64) ? "x64" : "x32");
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1716,3 +1729,53 @@ CMDRESULT cbDebugGetJIT(int argc, char* argv[])
|
||||||
|
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CMDRESULT cbDebugGetPageRights(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
uint addr = 0;
|
||||||
|
char rights[RIGHTS_STRING];
|
||||||
|
|
||||||
|
if(argc != 2 || !valfromstring(argv[1], &addr))
|
||||||
|
{
|
||||||
|
dprintf("Error: using an address as arg1\n");
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!dbggetpagerights(&addr, rights))
|
||||||
|
{
|
||||||
|
dprintf("Error getting rights of page: %s\n", argv[1]);
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
dprintf("Page: "fhex", Rights: %s\n", addr, rights);
|
||||||
|
|
||||||
|
return STATUS_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMDRESULT cbDebugSetPageRights(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
uint addr = 0;
|
||||||
|
char rights[RIGHTS_STRING];
|
||||||
|
|
||||||
|
if(argc != 3 || !valfromstring(argv[1], &addr))
|
||||||
|
{
|
||||||
|
dprintf("Error: using an address as arg1 and as arg2: Execute, ExecuteRead, ExecuteReadWrite, ExecuteWriteCopy, NoAccess, ReadOnly, ReadWrite, WriteCopy. You can add a G at first for add PAGE GUARD, example: GReadOnly\n");
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!dbgsetpagerights(&addr, argv[2]))
|
||||||
|
{
|
||||||
|
dprintf("Error: Set rights of "fhex" with Rights: %s\n", addr, argv[2]);
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!dbggetpagerights(&addr, rights))
|
||||||
|
{
|
||||||
|
dprintf("Error getting rights of page: %s\n", argv[1]);
|
||||||
|
return STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
dprintf("New rights of "fhex": %s\n", addr, rights);
|
||||||
|
|
||||||
|
return STATUS_CONTINUE;
|
||||||
|
}
|
|
@ -56,5 +56,7 @@ CMDRESULT cbDebugEnableMemoryBreakpoint(int argc, char* argv[]);
|
||||||
CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]);
|
CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]);
|
||||||
CMDRESULT cbDebugDownloadSymbol(int argc, char* argv[]);
|
CMDRESULT cbDebugDownloadSymbol(int argc, char* argv[]);
|
||||||
CMDRESULT cbDebugAnalyse(int argc, char* argv[]);
|
CMDRESULT cbDebugAnalyse(int argc, char* argv[]);
|
||||||
|
CMDRESULT cbDebugGetPageRights(int argc, char* argv[]);
|
||||||
|
CMDRESULT cbDebugSetPageRights(int argc, char* argv[]);
|
||||||
|
|
||||||
#endif //_DEBUGGER_COMMANDS_H
|
#endif //_DEBUGGER_COMMANDS_H
|
|
@ -352,11 +352,8 @@ static CMDRESULT scriptinternalcmdexec(const char* cmd)
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
CMDRESULT res = cmddirectexec(dbggetcommandlist(), command);
|
CMDRESULT res = cmddirectexec(dbggetcommandlist(), command);
|
||||||
if(DbgIsDebugging())
|
while(DbgIsDebugging() && !waitislocked(WAITID_RUN)) //while not locked (NOTE: possible deadlock)
|
||||||
{
|
|
||||||
while(!waitislocked(WAITID_RUN)) //while not locked (NOTE: possible deadlock)
|
|
||||||
Sleep(10);
|
Sleep(10);
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,8 @@ static void registercommands()
|
||||||
dbgcmdnew("alloc", cbDebugAlloc, true); //allocate memory
|
dbgcmdnew("alloc", cbDebugAlloc, true); //allocate memory
|
||||||
dbgcmdnew("free", cbDebugFree, true); //free memory
|
dbgcmdnew("free", cbDebugFree, true); //free memory
|
||||||
dbgcmdnew("Fill\1memset", cbDebugMemset, true); //memset
|
dbgcmdnew("Fill\1memset", cbDebugMemset, true); //memset
|
||||||
|
dbgcmdnew("getpagerights\1getrightspage", cbDebugGetPageRights, true);
|
||||||
|
dbgcmdnew("setpagerights\1setrightspage", cbDebugSetPageRights, true);
|
||||||
|
|
||||||
//plugins
|
//plugins
|
||||||
dbgcmdnew("StartScylla\1scylla\1imprec", cbDebugStartScylla, false); //start scylla
|
dbgcmdnew("StartScylla\1scylla\1imprec", cbDebugStartScylla, false); //start scylla
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
<Filter Include="Header Files\lz4">
|
<Filter Include="Header Files\lz4">
|
||||||
<UniqueIdentifier>{6a8d58f0-1417-4bff-aecd-0f9f5e0641f9}</UniqueIdentifier>
|
<UniqueIdentifier>{6a8d58f0-1417-4bff-aecd-0f9f5e0641f9}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Source Files\Analysis">
|
<Filter Include="Header Files\Analysis">
|
||||||
<UniqueIdentifier>{68e04c31-9f66-4c9a-ae1d-54b2f6cf2d1c}</UniqueIdentifier>
|
<UniqueIdentifier>{4e0317ac-ab94-4f10-9c11-e685d7a9842b}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Header Files\fa">
|
<Filter Include="Source Files\Analysis">
|
||||||
<UniqueIdentifier>{70e48ca5-7813-4da6-95c8-3717ace25093}</UniqueIdentifier>
|
<UniqueIdentifier>{336c8da2-0baf-4af3-a0d6-71cc5bce296e}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -135,35 +135,35 @@
|
||||||
<ClCompile Include="debugger_commands.cpp">
|
<ClCompile Include="debugger_commands.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Analysis\Node_t.cpp">
|
<ClCompile Include="Analysis\StackEmulator.cpp">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Source Files\Analysis</Filter>
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Analysis\Edge_t.cpp">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Analysis\AnalysisRunner.cpp">
|
<ClCompile Include="Analysis\AnalysisRunner.cpp">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Source Files\Analysis</Filter>
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Analysis\StackEmulator.cpp">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Analysis\FlowGraph.cpp">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Analysis\RegisterEmulator.cpp">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Analysis\ClientApiResolver.cpp">
|
<ClCompile Include="Analysis\ClientApiResolver.cpp">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Source Files\Analysis</Filter>
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Analysis\ClientInterface.cpp">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Analysis\FunctionInfo.cpp">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Analysis\ClientFunctionFinder.cpp">
|
<ClCompile Include="Analysis\ClientFunctionFinder.cpp">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Source Files\Analysis</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Analysis\ClientInterface.cpp">
|
||||||
|
<Filter>Source Files\Analysis</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Analysis\Edge_t.cpp">
|
||||||
|
<Filter>Source Files\Analysis</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Analysis\FlowGraph.cpp">
|
||||||
|
<Filter>Source Files\Analysis</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Analysis\FunctionInfo.cpp">
|
||||||
|
<Filter>Source Files\Analysis</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Analysis\Node_t.cpp">
|
||||||
|
<Filter>Source Files\Analysis</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Analysis\RegisterEmulator.cpp">
|
||||||
|
<Filter>Source Files\Analysis</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -312,37 +312,37 @@
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Analysis\AnalysisRunner.h">
|
<ClInclude Include="Analysis\AnalysisRunner.h">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Header Files\Analysis</Filter>
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\StackEmulator.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\RegisterEmulator.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\FlowGraph.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\Meta.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\Node_t.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\Edge_t.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Analysis\ClientApiResolver.h">
|
<ClInclude Include="Analysis\ClientApiResolver.h">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Header Files\Analysis</Filter>
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\ClientInterface.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="Analysis\FunctionInfo.h">
|
|
||||||
<Filter>Header Files\fa</Filter>
|
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Analysis\ClientFunctionFinder.h">
|
<ClInclude Include="Analysis\ClientFunctionFinder.h">
|
||||||
<Filter>Header Files\fa</Filter>
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\ClientInterface.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\Edge_t.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\FlowGraph.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\FunctionInfo.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\Meta.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\Node_t.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\RegisterEmulator.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Analysis\StackEmulator.h">
|
||||||
|
<Filter>Header Files\Analysis</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -1,4 +1,5 @@
|
||||||
#include "AbstractTableView.h"
|
#include "AbstractTableView.h"
|
||||||
|
#include <QStyleOptionButton>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
|
||||||
AbstractTableView::AbstractTableView(QWidget* parent) : QAbstractScrollArea(parent)
|
AbstractTableView::AbstractTableView(QWidget* parent) : QAbstractScrollArea(parent)
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
#ifndef ABSTRACTTABLEVIEW_H
|
#ifndef ABSTRACTTABLEVIEW_H
|
||||||
#define ABSTRACTTABLEVIEW_H
|
#define ABSTRACTTABLEVIEW_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QScrollBar>
|
||||||
#include <QAbstractScrollArea>
|
#include <QAbstractScrollArea>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QStyleOptionButton>
|
#include <QApplication>
|
||||||
#include <QStyle>
|
#include <QMouseEvent>
|
||||||
#include <QScrollBar>
|
#include <QPainter>
|
||||||
#include <qdebug.h>
|
#include "NewTypes.h"
|
||||||
#include <NewTypes.h>
|
|
||||||
|
|
||||||
//Hacky class that fixes a really annoying cursor problem
|
//Hacky class that fixes a really annoying cursor problem
|
||||||
class AbstractTableScrollBar : public QScrollBar
|
class AbstractTableScrollBar : public QScrollBar
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "Disassembly.h"
|
#include "Disassembly.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
Disassembly::Disassembly(QWidget* parent) : AbstractTableView(parent)
|
Disassembly::Disassembly(QWidget* parent) : AbstractTableView(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
#ifndef DISASSEMBLY_H
|
#ifndef DISASSEMBLY_H
|
||||||
#define DISASSEMBLY_H
|
#define DISASSEMBLY_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QtDebug>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "AbstractTableView.h"
|
#include "AbstractTableView.h"
|
||||||
#include "QBeaEngine.h"
|
#include "QBeaEngine.h"
|
||||||
#include "RichTextPainter.h"
|
|
||||||
#include "BeaTokenizer.h"
|
|
||||||
#include "MemoryPage.h"
|
#include "MemoryPage.h"
|
||||||
|
|
||||||
class Disassembly : public AbstractTableView
|
class Disassembly : public AbstractTableView
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "HexDump.h"
|
#include "HexDump.h"
|
||||||
|
#include <sstream>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
HexDump::HexDump(QWidget* parent) : AbstractTableView(parent)
|
HexDump::HexDump(QWidget* parent) : AbstractTableView(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
#ifndef _HEXDUMP_H
|
#ifndef _HEXDUMP_H
|
||||||
#define _HEXDUMP_H
|
#define _HEXDUMP_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QtDebug>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "AbstractTableView.h"
|
#include "AbstractTableView.h"
|
||||||
#include "MemoryPage.h"
|
|
||||||
#include "QBeaEngine.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include <sstream>
|
|
||||||
#include "RichTextPainter.h"
|
#include "RichTextPainter.h"
|
||||||
|
#include "MemoryPage.h"
|
||||||
|
|
||||||
class HexDump : public AbstractTableView
|
class HexDump : public AbstractTableView
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include "HistoryLineEdit.h"
|
#include "HistoryLineEdit.h"
|
||||||
#include "Bridge.h"
|
|
||||||
|
|
||||||
HistoryLineEdit::HistoryLineEdit(QWidget* parent) : QLineEdit(parent)
|
HistoryLineEdit::HistoryLineEdit(QWidget* parent) : QLineEdit(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef HISTORYLINEEDIT_H
|
#ifndef HISTORYLINEEDIT_H
|
||||||
#define HISTORYLINEEDIT_H
|
#define HISTORYLINEEDIT_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
class HistoryLineEdit : public QLineEdit
|
class HistoryLineEdit : public QLineEdit
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "ReferenceView.h"
|
#include "ReferenceView.h"
|
||||||
|
#include <QMessageBox>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
ReferenceView::ReferenceView()
|
ReferenceView::ReferenceView()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
#define REFERENCEVIEW_H
|
#define REFERENCEVIEW_H
|
||||||
|
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
#include <QAction>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "SearchListView.h"
|
#include "SearchListView.h"
|
||||||
#include "Bridge.h"
|
|
||||||
|
|
||||||
class ReferenceView : public SearchListView
|
class ReferenceView : public SearchListView
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define SEARCHLISTVIEW_H
|
#define SEARCHLISTVIEW_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QMenu>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include "SearchListViewTable.h"
|
#include "SearchListViewTable.h"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "SearchListViewTable.h"
|
#include "SearchListViewTable.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "RichTextPainter.h"
|
||||||
|
|
||||||
SearchListViewTable::SearchListViewTable(StdTable* parent) : StdTable(parent)
|
SearchListViewTable::SearchListViewTable(StdTable* parent) : StdTable(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include "ShortcutEdit.h"
|
#include "ShortcutEdit.h"
|
||||||
#include <QKeyEvent>
|
|
||||||
|
|
||||||
ShortcutEdit::ShortcutEdit(QWidget* parent) : QLineEdit(parent)
|
ShortcutEdit::ShortcutEdit(QWidget* parent) : QLineEdit(parent)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +56,7 @@ void ShortcutEdit::keyPressEvent(QKeyEvent* event)
|
||||||
QString KeyText = QKeySequence(keyInt).toString(QKeySequence::NativeText) ;
|
QString KeyText = QKeySequence(keyInt).toString(QKeySequence::NativeText) ;
|
||||||
for(int i = 0; i < KeyText.length(); i++)
|
for(int i = 0; i < KeyText.length(); i++)
|
||||||
{
|
{
|
||||||
if(KeyText[i].toAscii() == 0)
|
if(KeyText[i].toLatin1() == 0)
|
||||||
{
|
{
|
||||||
setText("");
|
setText("");
|
||||||
keyInt = -1;
|
keyInt = -1;
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#define SHORTCUTEDIT_H
|
#define SHORTCUTEDIT_H
|
||||||
|
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QKeySequence>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
class ShortcutEdit : public QLineEdit
|
class ShortcutEdit : public QLineEdit
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#ifndef STDTABLE_H
|
#ifndef STDTABLE_H
|
||||||
#define STDTABLE_H
|
#define STDTABLE_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "AbstractTableView.h"
|
#include "AbstractTableView.h"
|
||||||
|
|
||||||
class StdTable : public AbstractTableView
|
class StdTable : public AbstractTableView
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
#include "Bridge.h"
|
#include "Bridge.h"
|
||||||
|
#include <QClipboard>
|
||||||
|
#include "QBeaEngine.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "Exports.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
Global Variables
|
Global Variables
|
||||||
|
|
|
@ -2,16 +2,10 @@
|
||||||
#define BRIDGE_H
|
#define BRIDGE_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtGui>
|
#include <QMutex>
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "ReferenceView.h"
|
|
||||||
#include "BeaTokenizer.h"
|
|
||||||
#include "QBeaEngine.h"
|
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
#include "Exports.h"
|
|
||||||
#include "Imports.h"
|
#include "Imports.h"
|
||||||
|
#include "NewTypes.h"
|
||||||
|
#include "SearchListView.h"
|
||||||
|
|
||||||
class Bridge : public QObject
|
class Bridge : public QObject
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
#ifndef BEATOKENIZER_H
|
#ifndef BEATOKENIZER_H
|
||||||
#define BEATOKENIZER_H
|
#define BEATOKENIZER_H
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QRect>
|
|
||||||
#include <QString>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
#include <QSet>
|
||||||
|
#include "RichTextPainter.h"
|
||||||
#include "BeaEngine.h"
|
#include "BeaEngine.h"
|
||||||
#include "NewTypes.h"
|
#include "NewTypes.h"
|
||||||
#include "RichTextPainter.h"
|
|
||||||
|
|
||||||
class BeaTokenizer : RichTextPainter
|
class BeaTokenizer : RichTextPainter
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "QBeaEngine.h"
|
#include "QBeaEngine.h"
|
||||||
|
|
||||||
|
|
||||||
QBeaEngine::QBeaEngine()
|
QBeaEngine::QBeaEngine()
|
||||||
{
|
{
|
||||||
// Reset the Disasm structure
|
// Reset the Disasm structure
|
||||||
|
@ -8,7 +7,6 @@ QBeaEngine::QBeaEngine()
|
||||||
BeaTokenizer::Init();
|
BeaTokenizer::Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the address of the nth instruction before the instruction pointed by ip. @n
|
* @brief Return the address of the nth instruction before the instruction pointed by ip. @n
|
||||||
* This function has been grabbed from OllyDbg ("Disassembleback" in asmserv.c)
|
* This function has been grabbed from OllyDbg ("Disassembleback" in asmserv.c)
|
||||||
|
@ -88,7 +86,6 @@ ulong QBeaEngine::DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t
|
||||||
return abuf[(i - n + max_instructions) % max_instructions];
|
return abuf[(i - n + max_instructions) % max_instructions];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the address of the nth instruction after the instruction pointed by ip. @n
|
* @brief Return the address of the nth instruction after the instruction pointed by ip. @n
|
||||||
* This function has been grabbed from OllyDbg ("Disassembleforward" in asmserv.c)
|
* This function has been grabbed from OllyDbg ("Disassembleforward" in asmserv.c)
|
||||||
|
@ -144,7 +141,6 @@ ulong QBeaEngine::DisassembleNext(byte_t* data, uint_t base, uint_t size, uint_t
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disassemble the instruction at the given ip RVA.
|
* @brief Disassemble the instruction at the given ip RVA.
|
||||||
*
|
*
|
||||||
|
@ -190,6 +186,3 @@ Instruction_t QBeaEngine::DisassembleAt(byte_t* data, uint_t size, uint_t instIn
|
||||||
|
|
||||||
return wInst;
|
return wInst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#ifndef QBEAENGINE_H
|
#ifndef QBEAENGINE_H
|
||||||
#define QBEAENGINE_H
|
#define QBEAENGINE_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QString>
|
||||||
|
|
||||||
#include "BeaEngine.h"
|
|
||||||
#include "NewTypes.h"
|
#include "NewTypes.h"
|
||||||
#include "BeaTokenizer.h"
|
#include "BeaTokenizer.h"
|
||||||
|
|
||||||
|
@ -19,21 +17,14 @@ typedef struct _Instruction_t
|
||||||
|
|
||||||
class QBeaEngine
|
class QBeaEngine
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QBeaEngine();
|
explicit QBeaEngine();
|
||||||
|
|
||||||
ulong DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t ip, int n);
|
ulong DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t ip, int n);
|
||||||
ulong DisassembleNext(byte_t* data, uint_t base, uint_t size, uint_t ip, int n);
|
ulong DisassembleNext(byte_t* data, uint_t base, uint_t size, uint_t ip, int n);
|
||||||
Instruction_t DisassembleAt(byte_t* data, uint_t size, uint_t instIndex, uint_t origBase, uint_t origInstRVA);
|
Instruction_t DisassembleAt(byte_t* data, uint_t size, uint_t instIndex, uint_t origBase, uint_t origInstRVA);
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISASM mDisasmStruct;
|
DISASM mDisasmStruct;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QBEAENGINE_H
|
#endif // QBEAENGINE_H
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#include "AppearanceDialog.h"
|
#include "AppearanceDialog.h"
|
||||||
#include "ui_AppearanceDialog.h"
|
#include "ui_AppearanceDialog.h"
|
||||||
#include "Bridge.h"
|
#include <QColorDialog>
|
||||||
#include "Configuration.h"
|
|
||||||
#include <QFontDialog>
|
#include <QFontDialog>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include "Configuration.h"
|
||||||
|
|
||||||
AppearanceDialog::AppearanceDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AppearanceDialog)
|
AppearanceDialog::AppearanceDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AppearanceDialog)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#define APPEARANCEDIALOG_H
|
#define APPEARANCEDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QColorDialog>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "AttachDialog.h"
|
#include "AttachDialog.h"
|
||||||
#include "ui_AttachDialog.h"
|
#include "ui_AttachDialog.h"
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
AttachDialog::AttachDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AttachDialog)
|
AttachDialog::AttachDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AttachDialog)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "BreakpointsView.h"
|
#include "BreakpointsView.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "Breakpoints.h"
|
||||||
|
|
||||||
BreakpointsView::BreakpointsView(QWidget* parent) : QWidget(parent)
|
BreakpointsView::BreakpointsView(QWidget* parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#ifndef BREAKPOINTSVIEW_H
|
#ifndef BREAKPOINTSVIEW_H
|
||||||
#define BREAKPOINTSVIEW_H
|
#define BREAKPOINTSVIEW_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QWidget>
|
||||||
#include "StdTable.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "Breakpoints.h"
|
|
||||||
#include <QSplitter>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QSplitter>
|
||||||
|
#include "StdTable.h"
|
||||||
|
|
||||||
class BreakpointsView : public QWidget
|
class BreakpointsView : public QWidget
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#include "CPUDisassembly.h"
|
#include "CPUDisassembly.h"
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QClipboard>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "LineEditDialog.h"
|
||||||
|
#include "WordEditDialog.h"
|
||||||
#include "HexEditDialog.h"
|
#include "HexEditDialog.h"
|
||||||
|
|
||||||
CPUDisassembly::CPUDisassembly(QWidget* parent) : Disassembly(parent)
|
CPUDisassembly::CPUDisassembly(QWidget* parent) : Disassembly(parent)
|
||||||
|
@ -477,6 +482,7 @@ void CPUDisassembly::setupRightClickContextMenu()
|
||||||
mSearchCommand->setShortcutContext(Qt::WidgetShortcut);
|
mSearchCommand->setShortcutContext(Qt::WidgetShortcut);
|
||||||
this->addAction(mSearchCommand);
|
this->addAction(mSearchCommand);
|
||||||
connect(mSearchCommand, SIGNAL(triggered()), this, SLOT(findCommand()));
|
connect(mSearchCommand, SIGNAL(triggered()), this, SLOT(findCommand()));
|
||||||
|
mSearchMenu->addAction(mSearchCommand);
|
||||||
|
|
||||||
// Constant
|
// Constant
|
||||||
mSearchConstant = new QAction("&Constant", this);
|
mSearchConstant = new QAction("&Constant", this);
|
||||||
|
|
|
@ -1,18 +1,8 @@
|
||||||
#ifndef CPUDISASSEMBLY_H
|
#ifndef CPUDISASSEMBLY_H
|
||||||
#define CPUDISASSEMBLY_H
|
#define CPUDISASSEMBLY_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QtDebug>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "Disassembly.h"
|
#include "Disassembly.h"
|
||||||
#include "Bridge.h"
|
|
||||||
#include "LineEditDialog.h"
|
|
||||||
#include "QBeaEngine.h"
|
|
||||||
#include "GotoDialog.h"
|
#include "GotoDialog.h"
|
||||||
#include <QAction>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "WordEditDialog.h"
|
|
||||||
|
|
||||||
class CPUDisassembly : public Disassembly
|
class CPUDisassembly : public Disassembly
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "CPUDump.h"
|
#include "CPUDump.h"
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QClipboard>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "LineEditDialog.h"
|
||||||
#include "HexEditDialog.h"
|
#include "HexEditDialog.h"
|
||||||
|
|
||||||
CPUDump::CPUDump(QWidget* parent) : HexDump(parent)
|
CPUDump::CPUDump(QWidget* parent) : HexDump(parent)
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
#ifndef CPUDUMP_H
|
#ifndef CPUDUMP_H
|
||||||
#define CPUDUMP_H
|
#define CPUDUMP_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QtDebug>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "LineEditDialog.h"
|
|
||||||
#include "HexDump.h"
|
#include "HexDump.h"
|
||||||
#include "Bridge.h"
|
|
||||||
#include "GotoDialog.h"
|
#include "GotoDialog.h"
|
||||||
|
|
||||||
class CPUDump : public HexDump
|
class CPUDump : public HexDump
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#include "CPUInfoBox.h"
|
#include "CPUInfoBox.h"
|
||||||
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
CPUInfoBox::CPUInfoBox(StdTable* parent) : StdTable(parent)
|
CPUInfoBox::CPUInfoBox(StdTable* parent) : StdTable(parent)
|
||||||
{
|
{
|
||||||
|
@ -81,7 +83,7 @@ QString CPUInfoBox::getSymbolicName(int_t addr)
|
||||||
}
|
}
|
||||||
return finalText;
|
return finalText;
|
||||||
}
|
}
|
||||||
#include "Configuration.h"
|
|
||||||
void CPUInfoBox::disasmSelectionChanged(int_t parVA)
|
void CPUInfoBox::disasmSelectionChanged(int_t parVA)
|
||||||
{
|
{
|
||||||
curAddr = parVA;
|
curAddr = parVA;
|
||||||
|
@ -90,8 +92,10 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA)
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
DISASM_INSTR instr;
|
DISASM_INSTR instr;
|
||||||
|
memset(&instr, 0, sizeof(instr));
|
||||||
DbgDisasmAt(parVA, &instr);
|
DbgDisasmAt(parVA, &instr);
|
||||||
BASIC_INSTRUCTION_INFO basicinfo;
|
BASIC_INSTRUCTION_INFO basicinfo;
|
||||||
|
memset(&basicinfo, 0, sizeof(basicinfo));
|
||||||
DbgDisasmFastAt(parVA, &basicinfo);
|
DbgDisasmFastAt(parVA, &basicinfo);
|
||||||
|
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
#ifndef INFOBOX_H
|
#ifndef INFOBOX_H
|
||||||
#define INFOBOX_H
|
#define INFOBOX_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include "StdTable.h"
|
#include "StdTable.h"
|
||||||
#include "Bridge.h"
|
|
||||||
#include "CPUDisassembly.h"
|
|
||||||
|
|
||||||
class CPUInfoBox : public StdTable
|
class CPUInfoBox : public StdTable
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
#ifndef CPUSIDEBAR_H
|
#ifndef CPUSIDEBAR_H
|
||||||
#define CPUSIDEBAR_H
|
#define CPUSIDEBAR_H
|
||||||
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "CPUDisassembly.h"
|
|
||||||
#include <QAbstractScrollArea>
|
#include <QAbstractScrollArea>
|
||||||
|
#include "CPUDisassembly.h"
|
||||||
|
|
||||||
class CPUSideBar : public QAbstractScrollArea
|
class CPUSideBar : public QAbstractScrollArea
|
||||||
{
|
{
|
||||||
|
@ -32,7 +29,6 @@ protected:
|
||||||
bool isJump(int i) const;
|
bool isJump(int i) const;
|
||||||
void drawJump(QPainter* painter, int startLine, int endLine, int jumpoffset, bool conditional, bool isexecute, bool isactive);
|
void drawJump(QPainter* painter, int startLine, int endLine, int jumpoffset, bool conditional, bool isexecute, bool isactive);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int_t topVA;
|
int_t topVA;
|
||||||
int_t selectedVA;
|
int_t selectedVA;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "CPUStack.h"
|
#include "CPUStack.h"
|
||||||
|
#include <QClipboard>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
#include "HexEditDialog.h"
|
#include "HexEditDialog.h"
|
||||||
#include "WordEditDialog.h"
|
#include "WordEditDialog.h"
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
#ifndef CPUSTACK_H
|
#ifndef CPUSTACK_H
|
||||||
#define CPUSTACK_H
|
#define CPUSTACK_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QtDebug>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "HexDump.h"
|
#include "HexDump.h"
|
||||||
#include "Bridge.h"
|
|
||||||
#include "GotoDialog.h"
|
#include "GotoDialog.h"
|
||||||
|
|
||||||
class CPUStack : public HexDump
|
class CPUStack : public HexDump
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
#ifndef CPUWIDGET_H
|
#ifndef CPUWIDGET_H
|
||||||
#define CPUWIDGET_H
|
#define CPUWIDGET_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QWidget>
|
||||||
#include <QVBoxLayout>
|
#include <QTabWidget>
|
||||||
#include <QTableWidget>
|
#include "CPUSideBar.h"
|
||||||
#include "CPUDisassembly.h"
|
#include "CPUDisassembly.h"
|
||||||
#include "CPUDump.h"
|
#include "CPUDump.h"
|
||||||
#include "CPUStack.h"
|
#include "CPUStack.h"
|
||||||
#include "RegistersView.h"
|
#include "RegistersView.h"
|
||||||
#include "CPUInfoBox.h"
|
#include "CPUInfoBox.h"
|
||||||
#include "CPUSideBar.h"
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "CalculatorDialog.h"
|
#include "CalculatorDialog.h"
|
||||||
#include "ui_CalculatorDialog.h"
|
#include "ui_CalculatorDialog.h"
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
CalculatorDialog::CalculatorDialog(QWidget* parent) : QDialog(parent), ui(new Ui::CalculatorDialog)
|
CalculatorDialog::CalculatorDialog(QWidget* parent) : QDialog(parent), ui(new Ui::CalculatorDialog)
|
||||||
{
|
{
|
||||||
|
@ -222,7 +221,7 @@ void CalculatorDialog::on_txtAscii_textEdited(const QString & arg1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ui->txtAscii->setStyleSheet("");
|
ui->txtAscii->setStyleSheet("");
|
||||||
ui->txtExpression->setText(QString().sprintf("%X", text[0].toAscii()));
|
ui->txtExpression->setText(QString().sprintf("%X", text[0].toLatin1()));
|
||||||
ui->txtAscii->setCursorPosition(1);
|
ui->txtAscii->setCursorPosition(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include "Bridge.h"
|
#include "NewTypes.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#include "CloseDialog.h"
|
#include "CloseDialog.h"
|
||||||
#include "ui_CloseDialog.h"
|
#include "ui_CloseDialog.h"
|
||||||
|
|
||||||
CloseDialog::CloseDialog(QWidget* parent) :
|
CloseDialog::CloseDialog(QWidget* parent) : QDialog(parent), ui(new Ui::CloseDialog)
|
||||||
QDialog(parent),
|
|
||||||
ui(new Ui::CloseDialog)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#include "CommandHelpView.h"
|
#include "CommandHelpView.h"
|
||||||
#include "ui_CommandHelpView.h"
|
#include "ui_CommandHelpView.h"
|
||||||
|
|
||||||
CommandHelpView::CommandHelpView(QWidget* parent) :
|
CommandHelpView::CommandHelpView(QWidget* parent) : QWidget(parent), ui(new Ui::CommandHelpView)
|
||||||
QWidget(parent),
|
|
||||||
ui(new Ui::CommandHelpView)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QList>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "StdTable.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "SearchListView.h"
|
#include "SearchListView.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#include "CommandLineEdit.h"
|
#include "CommandLineEdit.h"
|
||||||
|
#include <QStringListModel>
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
CommandLineEdit::CommandLineEdit(QWidget* parent) : HistoryLineEdit(parent)
|
CommandLineEdit::CommandLineEdit(QWidget* parent) : HistoryLineEdit(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define COMMANDLINEEDIT_H
|
#define COMMANDLINEEDIT_H
|
||||||
|
|
||||||
#include "HistoryLineEdit.h"
|
#include "HistoryLineEdit.h"
|
||||||
#include "Bridge.h"
|
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
|
|
||||||
class CommandLineEdit : public HistoryLineEdit
|
class CommandLineEdit : public HistoryLineEdit
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#define GOTODIALOG_H
|
#define GOTODIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QPalette>
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include "Bridge.h"
|
#include "NewTypes.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
#include "HexEditDialog.h"
|
#include "HexEditDialog.h"
|
||||||
#include "ui_HexEditDialog.h"
|
#include "ui_HexEditDialog.h"
|
||||||
#include "QHexEdit/QHexEdit.h"
|
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
HexEditDialog::HexEditDialog(QWidget* parent) :
|
HexEditDialog::HexEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::HexEditDialog)
|
||||||
QDialog(parent),
|
|
||||||
ui(new Ui::HexEditDialog)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -68,7 +66,7 @@ void HexEditDialog::on_btnAscii2Hex_clicked()
|
||||||
QString text = ui->lineEditAscii->text();
|
QString text = ui->lineEditAscii->text();
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
for(int i = 0; i < text.length(); i++)
|
for(int i = 0; i < text.length(); i++)
|
||||||
data.append(text[i].toAscii());
|
data.append(text[i].toLatin1());
|
||||||
if(ui->chkKeepSize->isChecked()) //keep size
|
if(ui->chkKeepSize->isChecked()) //keep size
|
||||||
{
|
{
|
||||||
int dataSize = mHexEdit->data().size();
|
int dataSize = mHexEdit->data().size();
|
||||||
|
@ -107,7 +105,7 @@ void HexEditDialog::dataChangedSlot()
|
||||||
{
|
{
|
||||||
QChar ch(data.constData()[i]);
|
QChar ch(data.constData()[i]);
|
||||||
if(ch.isPrint())
|
if(ch.isPrint())
|
||||||
ascii += ch.toAscii();
|
ascii += ch.toLatin1();
|
||||||
else
|
else
|
||||||
ascii += '.';
|
ascii += '.';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "LineEditDialog.h"
|
#include "LineEditDialog.h"
|
||||||
#include "ui_LineEditDialog.h"
|
#include "ui_LineEditDialog.h"
|
||||||
#include "Bridge.h"
|
|
||||||
|
|
||||||
LineEditDialog::LineEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::LineEditDialog)
|
LineEditDialog::LineEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::LineEditDialog)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "LogView.h"
|
#include "LogView.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
LogView::LogView(QWidget* parent) : QTextEdit(parent)
|
LogView::LogView(QWidget* parent) : QTextEdit(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#ifndef LOGVIEW_H
|
#ifndef LOGVIEW_H
|
||||||
#define LOGVIEW_H
|
#define LOGVIEW_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include "Bridge.h"
|
|
||||||
|
|
||||||
class LogView : public QTextEdit
|
class LogView : public QTextEdit
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "ui_MainWindow.h"
|
#include "ui_MainWindow.h"
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QMimeData>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include "Configuration.h"
|
||||||
|
#include "SettingsDialog.h"
|
||||||
|
#include "AppearanceDialog.h"
|
||||||
|
#include "ShortcutsDialog.h"
|
||||||
|
#include "AttachDialog.h"
|
||||||
|
#include "LineEditDialog.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow)
|
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,31 +2,23 @@
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QtGui>
|
#include <QDragEnterEvent>
|
||||||
#include <QFileDialog>
|
#include "CloseDialog.h"
|
||||||
#include <QMdiArea>
|
|
||||||
#include <QMdiSubWindow>
|
|
||||||
#include "CPUWidget.h"
|
|
||||||
#include "CommandLineEdit.h"
|
#include "CommandLineEdit.h"
|
||||||
|
#include "TabWidget.h"
|
||||||
|
#include "CPUWidget.h"
|
||||||
#include "MemoryMapView.h"
|
#include "MemoryMapView.h"
|
||||||
|
#include "CallStackView.h"
|
||||||
#include "LogView.h"
|
#include "LogView.h"
|
||||||
#include "StatusLabel.h"
|
#include "SymbolView.h"
|
||||||
#include "BreakpointsView.h"
|
#include "BreakpointsView.h"
|
||||||
#include "ScriptView.h"
|
#include "ScriptView.h"
|
||||||
#include "SymbolView.h"
|
|
||||||
#include "ReferenceView.h"
|
#include "ReferenceView.h"
|
||||||
#include "ThreadView.h"
|
#include "ThreadView.h"
|
||||||
#include "SettingsDialog.h"
|
|
||||||
#include "tabwidget.h"
|
|
||||||
#include "Configuration.h"
|
|
||||||
#include "AppearanceDialog.h"
|
|
||||||
#include "ShortcutsDialog.h"
|
|
||||||
#include "CloseDialog.h"
|
|
||||||
#include "PatchDialog.h"
|
#include "PatchDialog.h"
|
||||||
#include "UpdateChecker.h"
|
|
||||||
#include "CallStackView.h"
|
|
||||||
#include "CalculatorDialog.h"
|
#include "CalculatorDialog.h"
|
||||||
#include "AttachDialog.h"
|
#include "StatusLabel.h"
|
||||||
|
#include "UpdateChecker.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
@ -101,7 +93,6 @@ public slots:
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow* ui;
|
Ui::MainWindow* ui;
|
||||||
CloseDialog* mCloseDialog;
|
CloseDialog* mCloseDialog;
|
||||||
|
|
||||||
CommandLineEdit* mCmdLineEdit;
|
CommandLineEdit* mCmdLineEdit;
|
||||||
MHTabWidget* mTabWidget;
|
MHTabWidget* mTabWidget;
|
||||||
CPUWidget* mCpuWidget;
|
CPUWidget* mCpuWidget;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "MemoryMapView.h"
|
#include "MemoryMapView.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "PageMemoryRights.h"
|
||||||
|
|
||||||
MemoryMapView::MemoryMapView(StdTable* parent) : StdTable(parent)
|
MemoryMapView::MemoryMapView(StdTable* parent) : StdTable(parent)
|
||||||
{
|
{
|
||||||
|
@ -34,6 +36,10 @@ void MemoryMapView::setupContextMenu()
|
||||||
connect(mFollowDisassembly, SIGNAL(triggered()), this, SLOT(followDisassemblerSlot()));
|
connect(mFollowDisassembly, SIGNAL(triggered()), this, SLOT(followDisassemblerSlot()));
|
||||||
connect(this, SIGNAL(enterPressedSignal()), this, SLOT(followDisassemblerSlot()));
|
connect(this, SIGNAL(enterPressedSignal()), this, SLOT(followDisassemblerSlot()));
|
||||||
|
|
||||||
|
//Set PageMemory Rights
|
||||||
|
mPageMemoryRights = new QAction("Set Page Memory Rights", this);
|
||||||
|
connect(mPageMemoryRights, SIGNAL(triggered()), this, SLOT(pageMemoryRights()));
|
||||||
|
|
||||||
//Switch View
|
//Switch View
|
||||||
mSwitchView = new QAction("&Switch View", this);
|
mSwitchView = new QAction("&Switch View", this);
|
||||||
connect(mSwitchView, SIGNAL(triggered()), this, SLOT(switchView()));
|
connect(mSwitchView, SIGNAL(triggered()), this, SLOT(switchView()));
|
||||||
|
@ -104,6 +110,8 @@ void MemoryMapView::contextMenuSlot(const QPoint & pos)
|
||||||
wMenu->addAction(mFollowDump);
|
wMenu->addAction(mFollowDump);
|
||||||
wMenu->addAction(mSwitchView);
|
wMenu->addAction(mSwitchView);
|
||||||
wMenu->addSeparator();
|
wMenu->addSeparator();
|
||||||
|
wMenu->addAction(mPageMemoryRights);
|
||||||
|
wMenu->addSeparator();
|
||||||
wMenu->addMenu(mBreakpointMenu);
|
wMenu->addMenu(mBreakpointMenu);
|
||||||
QMenu wCopyMenu("&Copy", this);
|
QMenu wCopyMenu("&Copy", this);
|
||||||
setupCopyMenu(&wCopyMenu);
|
setupCopyMenu(&wCopyMenu);
|
||||||
|
@ -139,39 +147,13 @@ void MemoryMapView::contextMenuSlot(const QPoint & pos)
|
||||||
|
|
||||||
QString MemoryMapView::getProtectionString(DWORD Protect)
|
QString MemoryMapView::getProtectionString(DWORD Protect)
|
||||||
{
|
{
|
||||||
QString wS;
|
#define RIGHTS_STRING (sizeof("ERWCG") + 1)
|
||||||
switch(Protect & 0xFF)
|
char rights[RIGHTS_STRING];
|
||||||
{
|
|
||||||
case PAGE_EXECUTE:
|
if(!DbgFunctions()->PageRightsToString(Protect, rights))
|
||||||
wS = QString("E---");
|
return "bad";
|
||||||
break;
|
|
||||||
case PAGE_EXECUTE_READ:
|
return QString(rights);
|
||||||
wS = QString("ER--");
|
|
||||||
break;
|
|
||||||
case PAGE_EXECUTE_READWRITE:
|
|
||||||
wS = QString("ERW-");
|
|
||||||
break;
|
|
||||||
case PAGE_EXECUTE_WRITECOPY:
|
|
||||||
wS = QString("ERWC");
|
|
||||||
break;
|
|
||||||
case PAGE_NOACCESS:
|
|
||||||
wS = QString("----");
|
|
||||||
break;
|
|
||||||
case PAGE_READONLY:
|
|
||||||
wS = QString("-R--");
|
|
||||||
break;
|
|
||||||
case PAGE_READWRITE:
|
|
||||||
wS = QString("-RW-");
|
|
||||||
break;
|
|
||||||
case PAGE_WRITECOPY:
|
|
||||||
wS = QString("-RWC");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(Protect & PAGE_GUARD)
|
|
||||||
wS += QString("G");
|
|
||||||
else
|
|
||||||
wS += QString("-");
|
|
||||||
return wS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MemoryMapView::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
QString MemoryMapView::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||||
|
@ -221,10 +203,8 @@ QString MemoryMapView::paintContent(QPainter* painter, int_t rowBase, int rowOff
|
||||||
return StdTable::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
return StdTable::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryMapView::stateChangedSlot(DBGSTATE state)
|
void MemoryMapView::refreshMap()
|
||||||
{
|
{
|
||||||
if(state == paused)
|
|
||||||
{
|
|
||||||
MEMMAP wMemMapStruct;
|
MEMMAP wMemMapStruct;
|
||||||
int wI;
|
int wI;
|
||||||
|
|
||||||
|
@ -298,7 +278,12 @@ void MemoryMapView::stateChangedSlot(DBGSTATE state)
|
||||||
if(wMemMapStruct.page != 0)
|
if(wMemMapStruct.page != 0)
|
||||||
BridgeFree(wMemMapStruct.page);
|
BridgeFree(wMemMapStruct.page);
|
||||||
reloadData(); //refresh memory map
|
reloadData(); //refresh memory map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MemoryMapView::stateChangedSlot(DBGSTATE state)
|
||||||
|
{
|
||||||
|
if(state == paused)
|
||||||
|
refreshMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryMapView::followDumpSlot()
|
void MemoryMapView::followDumpSlot()
|
||||||
|
@ -371,6 +356,15 @@ void MemoryMapView::memoryExecuteSingleshootToggleSlot()
|
||||||
memoryExecuteSingleshootSlot();
|
memoryExecuteSingleshootSlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MemoryMapView::pageMemoryRights()
|
||||||
|
{
|
||||||
|
PageMemoryRights PageMemoryRightsDialog(this);
|
||||||
|
connect(&PageMemoryRightsDialog, SIGNAL(refreshMemoryMap()), this, SLOT(refreshMap()));
|
||||||
|
uint_t addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||||
|
uint_t size = getCellContent(getInitialSelection(), 1).toULongLong(0, 16);
|
||||||
|
PageMemoryRightsDialog.RunAddrSize(addr, size, getCellContent(getInitialSelection(), 3));
|
||||||
|
}
|
||||||
|
|
||||||
void MemoryMapView::switchView()
|
void MemoryMapView::switchView()
|
||||||
{
|
{
|
||||||
duint setting = 0;
|
duint setting = 0;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#ifndef MEMORYMAPVIEW_H
|
#ifndef MEMORYMAPVIEW_H
|
||||||
#define MEMORYMAPVIEW_H
|
#define MEMORYMAPVIEW_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include "StdTable.h"
|
#include "StdTable.h"
|
||||||
#include "Bridge.h"
|
|
||||||
|
|
||||||
class MemoryMapView : public StdTable
|
class MemoryMapView : public StdTable
|
||||||
{
|
{
|
||||||
|
@ -31,6 +29,8 @@ public slots:
|
||||||
void memoryExecuteSingleshootToggleSlot();
|
void memoryExecuteSingleshootToggleSlot();
|
||||||
void contextMenuSlot(const QPoint & pos);
|
void contextMenuSlot(const QPoint & pos);
|
||||||
void switchView();
|
void switchView();
|
||||||
|
void pageMemoryRights();
|
||||||
|
void refreshMap();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString getProtectionString(DWORD Protect);
|
QString getProtectionString(DWORD Protect);
|
||||||
|
@ -38,6 +38,7 @@ private:
|
||||||
QAction* mFollowDump;
|
QAction* mFollowDump;
|
||||||
QAction* mFollowDisassembly;
|
QAction* mFollowDisassembly;
|
||||||
QAction* mSwitchView;
|
QAction* mSwitchView;
|
||||||
|
QAction* mPageMemoryRights;
|
||||||
|
|
||||||
QMenu* mBreakpointMenu;
|
QMenu* mBreakpointMenu;
|
||||||
QMenu* mMemoryAccessMenu;
|
QMenu* mMemoryAccessMenu;
|
||||||
|
|
|
@ -0,0 +1,126 @@
|
||||||
|
#include "PageMemoryRights.h"
|
||||||
|
#include "ui_PageMemoryRights.h"
|
||||||
|
|
||||||
|
PageMemoryRights::PageMemoryRights(QWidget* parent) : QDialog(parent), ui(new Ui::PageMemoryRights)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
//set window flags
|
||||||
|
setModal(true);
|
||||||
|
setWindowFlags(Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageMemoryRights::~PageMemoryRights()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageMemoryRights::RunAddrSize(uint_t addrin, uint_t sizein, QString pagetypein)
|
||||||
|
{
|
||||||
|
addr = addrin;
|
||||||
|
size = sizein;
|
||||||
|
pagetype = pagetypein;
|
||||||
|
|
||||||
|
QTableWidget* tableWidget = ui->pagetableWidget;
|
||||||
|
tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
uint_t nr_pages = size / PAGE_SIZE;
|
||||||
|
tableWidget->setColumnCount(2);
|
||||||
|
tableWidget->setRowCount(nr_pages);
|
||||||
|
tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(QString("Address")));
|
||||||
|
tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(QString("Rights")));
|
||||||
|
|
||||||
|
#define RIGHTS_STRING (sizeof("ERWCG") + 1)
|
||||||
|
duint actual_addr;
|
||||||
|
char rights[RIGHTS_STRING];
|
||||||
|
for(uint_t i = 0; i < nr_pages; i++)
|
||||||
|
{
|
||||||
|
actual_addr = addr + (i * PAGE_SIZE);
|
||||||
|
tableWidget->setItem(i, 0, new QTableWidgetItem(QString("%1").arg(actual_addr, sizeof(uint_t) * 2, 16, QChar('0')).toUpper()));
|
||||||
|
if(DbgFunctions()->GetPageRights(& actual_addr, rights))
|
||||||
|
tableWidget->setItem(i, 1, new QTableWidgetItem(QString(rights)));
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex idx = (ui->pagetableWidget->model()->index(0, 0));
|
||||||
|
ui->pagetableWidget->selectionModel()->select(idx, QItemSelectionModel::Select);
|
||||||
|
idx = (ui->pagetableWidget->model()->index(0, 1));
|
||||||
|
ui->pagetableWidget->selectionModel()->select(idx, QItemSelectionModel::Select);
|
||||||
|
|
||||||
|
ui->radioFullaccess->setChecked(true);
|
||||||
|
ui->chkPageguard->setCheckable(true);
|
||||||
|
exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageMemoryRights::on_btnSelectall_clicked()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < ui->pagetableWidget->rowCount(); i++)
|
||||||
|
{
|
||||||
|
for(int j = 0; j < ui->pagetableWidget->columnCount(); j++)
|
||||||
|
{
|
||||||
|
QModelIndex idx = (ui->pagetableWidget->model()->index(i, j));
|
||||||
|
ui->pagetableWidget->selectionModel()->select(idx, QItemSelectionModel::Select);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageMemoryRights::on_btnDeselectall_clicked()
|
||||||
|
{
|
||||||
|
QModelIndexList indexList = ui->pagetableWidget->selectionModel()->selectedIndexes();
|
||||||
|
foreach(QModelIndex index, indexList)
|
||||||
|
{
|
||||||
|
ui->pagetableWidget->selectionModel()->select(index, QItemSelectionModel::Deselect);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageMemoryRights::on_btnSetrights_clicked()
|
||||||
|
{
|
||||||
|
duint actual_addr;
|
||||||
|
QString rights;
|
||||||
|
char newrights[RIGHTS_STRING];
|
||||||
|
bool one_right_changed = false;
|
||||||
|
|
||||||
|
if(ui->radioExecute->isChecked())
|
||||||
|
rights = "Execute";
|
||||||
|
else if(ui->radioExecuteread->isChecked())
|
||||||
|
rights = "ExecuteRead";
|
||||||
|
else if(ui->radioNoaccess->isChecked())
|
||||||
|
rights = "NoAccess";
|
||||||
|
else if(ui->radioFullaccess ->isChecked())
|
||||||
|
rights = "ExecuteReadWrite";
|
||||||
|
else if(ui->radioReadonly->isChecked())
|
||||||
|
rights = "ReadOnly";
|
||||||
|
else if(ui->radioReadwrite->isChecked())
|
||||||
|
rights = "ReadWrite";
|
||||||
|
else if(ui->radioWritecopy->isChecked())
|
||||||
|
rights = "WriteCopy";
|
||||||
|
else if(ui->radioExecutewritecopy->isChecked())
|
||||||
|
rights = "ExecuteWriteCopy";
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(ui->chkPageguard->isChecked())
|
||||||
|
rights = "G" + rights;
|
||||||
|
|
||||||
|
QModelIndexList indexList = ui->pagetableWidget->selectionModel()->selectedIndexes();
|
||||||
|
foreach(QModelIndex index, indexList)
|
||||||
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
|
actual_addr = ui->pagetableWidget->item(index.row(), 0)->text().toULongLong(0, 16);
|
||||||
|
#else //x86
|
||||||
|
actual_addr = ui->pagetableWidget->item(index.row(), 0)->text().toULong(0, 16);
|
||||||
|
#endif //_WIN64
|
||||||
|
if(DbgFunctions()->SetPageRights(& actual_addr, (char*) rights.toUtf8().constData()))
|
||||||
|
{
|
||||||
|
one_right_changed = true;
|
||||||
|
if(DbgFunctions()->GetPageRights(& actual_addr, newrights))
|
||||||
|
ui->pagetableWidget->setItem(index.row(), 1, new QTableWidgetItem(QString(newrights)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DbgFunctions()->MemUpdateMap();
|
||||||
|
emit refreshMemoryMap();
|
||||||
|
|
||||||
|
if(one_right_changed)
|
||||||
|
ui->LnEdStatus->setText("Pages Rights Changed to: " + rights);
|
||||||
|
else
|
||||||
|
ui->LnEdStatus->setText("Error setting rights, read the MSDN to learn the valid rights of: " + pagetype);
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
#ifndef PAGEMEMORYRIGHTS_H
|
||||||
|
#define PAGEMEMORYRIGHTS_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "NewTypes.h"
|
||||||
|
|
||||||
|
#define PAGE_SIZE 0x1000
|
||||||
|
|
||||||
|
namespace Ui
|
||||||
|
{
|
||||||
|
class PageMemoryRights;
|
||||||
|
}
|
||||||
|
|
||||||
|
class PageMemoryRights : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PageMemoryRights(QWidget* parent = 0);
|
||||||
|
void RunAddrSize(uint_t, uint_t, QString);
|
||||||
|
~PageMemoryRights();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_btnSelectall_clicked();
|
||||||
|
void on_btnDeselectall_clicked();
|
||||||
|
void on_btnSetrights_clicked();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void refreshMemoryMap();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::PageMemoryRights* ui;
|
||||||
|
uint_t addr;
|
||||||
|
uint_t size;
|
||||||
|
QString pagetype;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PAGEMEMORYRIGHTS_H
|
|
@ -0,0 +1,261 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>PageMemoryRights</class>
|
||||||
|
<widget class="QDialog" name="PageMemoryRights">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>510</width>
|
||||||
|
<height>346</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Set Page Memory Rights</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../resource.qrc">
|
||||||
|
<normaloff>:/icons/images/memory-map.png</normaloff>:/icons/images/memory-map.png</iconset>
|
||||||
|
</property>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>350</x>
|
||||||
|
<y>310</y>
|
||||||
|
<width>121</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTableWidget" name="pagetableWidget">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>11</y>
|
||||||
|
<width>291</width>
|
||||||
|
<height>241</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="autoScroll">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
|
</property>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="layoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>330</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>161</width>
|
||||||
|
<height>242</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Rights</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioNoaccess">
|
||||||
|
<property name="text">
|
||||||
|
<string>NO ACCESS</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioReadonly">
|
||||||
|
<property name="text">
|
||||||
|
<string>READ ONLY</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioReadwrite">
|
||||||
|
<property name="text">
|
||||||
|
<string>READ WRITE</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioExecute">
|
||||||
|
<property name="text">
|
||||||
|
<string>EXECUTE</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioExecuteread">
|
||||||
|
<property name="text">
|
||||||
|
<string>EXECUTE READ</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioFullaccess">
|
||||||
|
<property name="text">
|
||||||
|
<string>FULL ACCESS</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioWritecopy">
|
||||||
|
<property name="text">
|
||||||
|
<string>WRITE COPY</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioExecutewritecopy">
|
||||||
|
<property name="text">
|
||||||
|
<string>EXECUTE WRITE COPY</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnSetrights">
|
||||||
|
<property name="text">
|
||||||
|
<string>Set Rights</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="layoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>260</y>
|
||||||
|
<width>230</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnSelectall">
|
||||||
|
<property name="text">
|
||||||
|
<string>Select ALL</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnDeselectall">
|
||||||
|
<property name="text">
|
||||||
|
<string>Deselect ALL</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" name="LnEdStatus">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>310</y>
|
||||||
|
<width>371</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>260</x>
|
||||||
|
<y>280</y>
|
||||||
|
<width>241</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Press CTRL or SHIFT key to select multiple pages</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="chkPageguard">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>400</x>
|
||||||
|
<y>260</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PAGE GUARD</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<zorder>layoutWidget</zorder>
|
||||||
|
<zorder>layoutWidget</zorder>
|
||||||
|
<zorder>buttonBox</zorder>
|
||||||
|
<zorder>LnEdStatus</zorder>
|
||||||
|
<zorder>pagetableWidget</zorder>
|
||||||
|
<zorder>label</zorder>
|
||||||
|
<zorder>chkPageguard</zorder>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../resource.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>PageMemoryRights</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>PageMemoryRights</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
|
@ -1,5 +1,10 @@
|
||||||
#include "PatchDialog.h"
|
#include "PatchDialog.h"
|
||||||
#include "ui_PatchDialog.h"
|
#include "ui_PatchDialog.h"
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
PatchDialog::PatchDialog(QWidget* parent) :
|
PatchDialog::PatchDialog(QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
#define PATCHDIALOG_H
|
#define PATCHDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "Bridge.h"
|
#include <QListWidgetItem>
|
||||||
#include "PatchDialogGroupSelector.h"
|
#include "PatchDialogGroupSelector.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "RegistersView.h"
|
#include "RegistersView.h"
|
||||||
|
#include <QClipboard>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "WordEditDialog.h"
|
||||||
|
|
||||||
RegistersView::RegistersView(QWidget* parent) : QAbstractScrollArea(parent), mVScrollOffset(0)
|
RegistersView::RegistersView(QWidget* parent) : QAbstractScrollArea(parent), mVScrollOffset(0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
#ifndef REGISTERSVIEW_H
|
#ifndef REGISTERSVIEW_H
|
||||||
#define REGISTERSVIEW_H
|
#define REGISTERSVIEW_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QSet>
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "WordEditDialog.h"
|
|
||||||
#include "LineEditDialog.h"
|
|
||||||
#include <QAbstractScrollArea>
|
#include <QAbstractScrollArea>
|
||||||
|
#include <QSet>
|
||||||
|
#include <QMap>
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
#define IsCharacterRegister(x) ((x>=CAX && x<CIP))
|
#define IsCharacterRegister(x) ((x>=CAX && x<CIP))
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#include "ScriptView.h"
|
#include "ScriptView.h"
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QFileDialog>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "RichTextPainter.h"
|
||||||
|
#include "LineEditDialog.h"
|
||||||
|
|
||||||
ScriptView::ScriptView(StdTable* parent) : StdTable(parent)
|
ScriptView::ScriptView(StdTable* parent) : StdTable(parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
#ifndef SCRIPTVIEW_H
|
#ifndef SCRIPTVIEW_H
|
||||||
#define SCRIPTVIEW_H
|
#define SCRIPTVIEW_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "StdTable.h"
|
#include "StdTable.h"
|
||||||
#include "Bridge.h"
|
|
||||||
#include "LineEditDialog.h"
|
|
||||||
|
|
||||||
class ScriptView : public StdTable
|
class ScriptView : public StdTable
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#include "SettingsDialog.h"
|
#include "SettingsDialog.h"
|
||||||
#include "ui_SettingsDialog.h"
|
#include "ui_SettingsDialog.h"
|
||||||
|
#include <QMessageBox>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "ExceptionRangeDialog.h"
|
||||||
|
|
||||||
SettingsDialog::SettingsDialog(QWidget* parent) :
|
SettingsDialog::SettingsDialog(QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
|
@ -191,6 +194,13 @@ void SettingsDialog::LoadSettings()
|
||||||
|
|
||||||
ui->chkConfirmBeforeAtt->setCheckState(bool2check(settings.miscSetJITAuto));
|
ui->chkConfirmBeforeAtt->setCheckState(bool2check(settings.miscSetJITAuto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!DbgFunctions()->IsProcessElevated())
|
||||||
|
{
|
||||||
|
ui->chkSetJIT->setDisabled(true);
|
||||||
|
ui->chkConfirmBeforeAtt->setDisabled(true);
|
||||||
|
ui->lbladminwarning->setText(QString("Warning: Run the debugger as Admin to enable JIT."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bJitOld = settings.miscSetJIT;
|
bJitOld = settings.miscSetJIT;
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
#define SETTINGSDIALOG_H
|
#define SETTINGSDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMessageBox>
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "ExceptionRangeDialog.h"
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -516,6 +516,19 @@
|
||||||
<string>Confirm before attaching</string>
|
<string>Confirm before attaching</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="lbladminwarning">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>271</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="btnSave">
|
<widget class="QPushButton" name="btnSave">
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
#define SHORTCUTSDIALOG_H
|
#define SHORTCUTSDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QTableWidget>
|
#include <QHeaderView>
|
||||||
#include "ShortcutEdit.h"
|
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "SymbolView.h"
|
#include "SymbolView.h"
|
||||||
#include "ui_SymbolView.h"
|
#include "ui_SymbolView.h"
|
||||||
|
#include <QMessageBox>
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
|
|
||||||
SymbolView::SymbolView(QWidget* parent) : QWidget(parent), ui(new Ui::SymbolView)
|
SymbolView::SymbolView(QWidget* parent) : QWidget(parent), ui(new Ui::SymbolView)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,12 +2,7 @@
|
||||||
#define SYMBOLVIEW_H
|
#define SYMBOLVIEW_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QList>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "StdTable.h"
|
|
||||||
#include "Bridge.h"
|
#include "Bridge.h"
|
||||||
#include "SearchListView.h"
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#include "ThreadView.h"
|
#include "ThreadView.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "Bridge.h"
|
||||||
// Dreg code x86_64dbg GPLv3
|
|
||||||
|
|
||||||
void ThreadView::contextMenuSlot(const QPoint & pos)
|
void ThreadView::contextMenuSlot(const QPoint & pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define THREADVIEW_H
|
#define THREADVIEW_H
|
||||||
|
|
||||||
#include "StdTable.h"
|
#include "StdTable.h"
|
||||||
#include "Bridge.h"
|
#include <QMenu>
|
||||||
|
|
||||||
class ThreadView : public StdTable
|
class ThreadView : public StdTable
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#ifndef WORDEDITDIALOG_H
|
#ifndef WORDEDITDIALOG_H
|
||||||
#define WORDEDITDIALOG_H
|
#define WORDEDITDIALOG_H
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include "Bridge.h"
|
#include "NewTypes.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,130 +0,0 @@
|
||||||
#include "MapViewOfMem.h"
|
|
||||||
|
|
||||||
|
|
||||||
MapViewOfMem::MapViewOfMem()
|
|
||||||
{
|
|
||||||
mSelectedData.fromIndex = -1;
|
|
||||||
mSelectedData.toIndex = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
MapViewOfMem::MapViewOfMem(QString file)
|
|
||||||
{
|
|
||||||
MemDataCacheStruct_t data;
|
|
||||||
memset(&data, 0, sizeof(MemDataCacheStruct_t));
|
|
||||||
data.memDataCachePtr = new QVector<byte_t>(0);
|
|
||||||
mGuiMemDataCache = data;
|
|
||||||
|
|
||||||
mSelectedData.fromIndex = -1;
|
|
||||||
mSelectedData.toIndex = -1;
|
|
||||||
|
|
||||||
//qDebug() << "MapViewOfMem() Load data from file.";
|
|
||||||
|
|
||||||
QFile wFile(file);
|
|
||||||
|
|
||||||
if(wFile.open(QIODevice::ReadOnly) == false)
|
|
||||||
//qDebug() << "File has not been opened.";
|
|
||||||
|
|
||||||
mData = wFile.readAll();
|
|
||||||
//qDebug() << "Size: " << mData.size();
|
|
||||||
|
|
||||||
if(mData.size() == 0)
|
|
||||||
{
|
|
||||||
//qDebug() << "No Data";
|
|
||||||
}
|
|
||||||
|
|
||||||
mSize = mData.size();
|
|
||||||
mBase = 0x00401000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MapViewOfMem::MapViewOfMem(uint_t startAddress , uint_t size)
|
|
||||||
{
|
|
||||||
mStartAddress = startAddress;
|
|
||||||
mEndAddress = startAddress + size - 1;
|
|
||||||
mSize = size;
|
|
||||||
}
|
|
||||||
|
|
||||||
MapViewOfMem::~MapViewOfMem()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
byte_t MapViewOfMem::readByte(uint_t rva)
|
|
||||||
{
|
|
||||||
return mData.data()[rva];
|
|
||||||
}
|
|
||||||
|
|
||||||
uint_t MapViewOfMem::size()
|
|
||||||
{
|
|
||||||
return mSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char* MapViewOfMem::data()
|
|
||||||
{
|
|
||||||
return (unsigned char*)(mData.data());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Selection_t MapViewOfMem::getSelection()
|
|
||||||
{
|
|
||||||
return mSelectedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MapViewOfMem::setSelection(Selection_t sel)
|
|
||||||
{
|
|
||||||
mSelectedData = sel;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint_t MapViewOfMem::getBase()
|
|
||||||
{
|
|
||||||
return mBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
byte_t* MapViewOfMem::getDataPtrForGui(uint_t rva, uint_t maxNbrOfBytesToRead, uint_t newCacheSize)
|
|
||||||
{
|
|
||||||
byte_t* wBytePtr = 0;
|
|
||||||
|
|
||||||
if(maxNbrOfBytesToRead > 0)
|
|
||||||
{
|
|
||||||
// Bound maxNbrOfBytesToRead to the max value it can take
|
|
||||||
if(maxNbrOfBytesToRead > (this->size() - rva))
|
|
||||||
maxNbrOfBytesToRead = this->size() - rva;
|
|
||||||
|
|
||||||
if((mGuiMemDataCache.isInit == true) && (rva >= mGuiMemDataCache.rva) && ((rva + (uint_t)maxNbrOfBytesToRead) <= (mGuiMemDataCache.rva + (uint_t)mGuiMemDataCache.memDataCacheSize)))
|
|
||||||
{
|
|
||||||
// Cache Success
|
|
||||||
wBytePtr = mGuiMemDataCache.memDataCachePtr->data() + (rva - mGuiMemDataCache.rva);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Cache Miss
|
|
||||||
mGuiMemDataCache.memDataCacheSize = newCacheSize;
|
|
||||||
mGuiMemDataCache.memDataCachePtr->resize(newCacheSize);
|
|
||||||
mGuiMemDataCache.rva = rva;
|
|
||||||
wBytePtr = mGuiMemDataCache.memDataCachePtr->data();
|
|
||||||
// TODO: Fill cache
|
|
||||||
for(uint_t wI = 0; wI < newCacheSize; wI++)
|
|
||||||
{
|
|
||||||
wBytePtr[wI] = readByte(rva + (uint_t)wI);
|
|
||||||
}
|
|
||||||
mGuiMemDataCache.isInit = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return wBytePtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
#ifndef MAPVIEWOFMEM_H
|
|
||||||
#define MAPVIEWOFMEM_H
|
|
||||||
|
|
||||||
#include <QtGui>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _Selection_t
|
|
||||||
{
|
|
||||||
int firstSelectedIndex;
|
|
||||||
int fromIndex;
|
|
||||||
int toIndex;
|
|
||||||
} Selection_t;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MapViewOfMem
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
MapViewOfMem();
|
|
||||||
explicit MapViewOfMem(QString file);
|
|
||||||
explicit MapViewOfMem(uint_t startAddress , uint_t size);
|
|
||||||
~MapViewOfMem();
|
|
||||||
byte_t readByte(uint_t rva);
|
|
||||||
uint_t size();
|
|
||||||
unsigned char* data();
|
|
||||||
|
|
||||||
Selection_t getSelection();
|
|
||||||
void setSelection(Selection_t sel);
|
|
||||||
|
|
||||||
uint_t getBase();
|
|
||||||
byte_t* getDataPtrForGui(uint_t rva, uint_t maxNbrOfBytesToRead, uint_t newCacheSize);
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef struct _MemDataCacheStruct_t
|
|
||||||
{
|
|
||||||
QVector<byte_t>* memDataCachePtr;
|
|
||||||
uint_t memDataCacheSize;
|
|
||||||
uint_t rva;
|
|
||||||
bool isInit;
|
|
||||||
} MemDataCacheStruct_t;
|
|
||||||
|
|
||||||
|
|
||||||
uint_t mBase;
|
|
||||||
unsigned long mStartAddress;
|
|
||||||
unsigned long mEndAddress;
|
|
||||||
unsigned long mSize;
|
|
||||||
|
|
||||||
QByteArray mData;
|
|
||||||
|
|
||||||
Selection_t mSelectedData;
|
|
||||||
|
|
||||||
MemDataCacheStruct_t mGuiMemDataCache;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MAPVIEWOFMEM_H
|
|
||||||
|
|
|
@ -2,11 +2,7 @@
|
||||||
#define MEMORYPAGE_H
|
#define MEMORYPAGE_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtGui>
|
|
||||||
#include "NewTypes.h"
|
#include "NewTypes.h"
|
||||||
#include "windows.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
|
|
||||||
class MemoryPage : public QObject
|
class MemoryPage : public QObject
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,217 +0,0 @@
|
||||||
#include "ProcessMemoryMap.h"
|
|
||||||
|
|
||||||
|
|
||||||
ProcessMemoryMap::ProcessMemoryMap(QString fileName, QObject* parent) : QObject(parent)
|
|
||||||
{
|
|
||||||
Q_UNUSED(fileName);
|
|
||||||
STARTUPINFO si;
|
|
||||||
memset(&si, 0, sizeof(STARTUPINFO));
|
|
||||||
si.cb = sizeof(si);
|
|
||||||
|
|
||||||
PROCESS_INFORMATION pi;
|
|
||||||
memset(&pi, 0, sizeof(PROCESS_INFORMATION));
|
|
||||||
|
|
||||||
LPCTSTR target = TEXT("UnPackMe.exe");
|
|
||||||
|
|
||||||
if(!CreateProcess((LPCTSTR)target, 0, NULL, NULL, 0, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi))
|
|
||||||
{
|
|
||||||
//qDebug() << "CreateProcess failed (" << GetLastError() << ").\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mhProcess = pi.hProcess;
|
|
||||||
|
|
||||||
QWidget* widget = new QWidget();
|
|
||||||
widget->show();
|
|
||||||
|
|
||||||
Sleep(800);
|
|
||||||
|
|
||||||
printVirtualMemoryMap(BruteForceProcessMemory());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QList<MEMORY_BASIC_INFORMATION> ProcessMemoryMap::BruteForceProcessMemory()
|
|
||||||
{
|
|
||||||
QList<MEMORY_BASIC_INFORMATION> wMemoryRegionsList;
|
|
||||||
MEMORY_BASIC_INFORMATION wMemInfo;
|
|
||||||
uint_t wVirtualAddress = 0;
|
|
||||||
uint_t wUpperLimit = 0x80000000;//0x000007FFFFFFFFFF; // x64 User Space Limit
|
|
||||||
SIZE_T wErr;
|
|
||||||
|
|
||||||
// For each page in memory
|
|
||||||
while(wVirtualAddress <= wUpperLimit)
|
|
||||||
{
|
|
||||||
// Query the page
|
|
||||||
wErr = VirtualQueryEx(mhProcess, (LPCVOID)wVirtualAddress, &wMemInfo, sizeof(wMemInfo));
|
|
||||||
|
|
||||||
// If VirtualQueryEx failed, try the next region
|
|
||||||
|
|
||||||
if(wErr == 0)
|
|
||||||
{
|
|
||||||
wVirtualAddress += 0x1000;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wMemoryRegionsList.append(wMemInfo);
|
|
||||||
wVirtualAddress += wMemInfo.RegionSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return wMemoryRegionsList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ProcessMemoryMap::printVirtualMemoryMap(QList<MEMORY_BASIC_INFORMATION> parList)
|
|
||||||
{
|
|
||||||
int wI;
|
|
||||||
QString wStr = "";
|
|
||||||
QString wTmpStr = "";
|
|
||||||
MEMORY_BASIC_INFORMATION wMemInfo;
|
|
||||||
|
|
||||||
// Header
|
|
||||||
wTmpStr = "Address";
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(20 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
wTmpStr = "Size";
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(20 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
wTmpStr = "State";
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(10 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
wTmpStr = "Access";
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(30 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
wTmpStr = "Type";
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(10 - wTmpStr.length());
|
|
||||||
|
|
||||||
//qDebug() << wStr;
|
|
||||||
|
|
||||||
wStr = "-------------------------------------------------------------------------------------------------";
|
|
||||||
//qDebug() << wStr;
|
|
||||||
|
|
||||||
|
|
||||||
for(wI = 0; wI < parList.size(); wI++)
|
|
||||||
{
|
|
||||||
wStr = "";
|
|
||||||
wMemInfo = parList.at(wI);
|
|
||||||
|
|
||||||
// Base address
|
|
||||||
wTmpStr = "0x" + QString("%1").arg((uint_t)wMemInfo.BaseAddress, 16, 16, QChar('0')).toUpper();
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(20 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
// Size
|
|
||||||
wTmpStr = "0x" + QString("%1").arg((uint_t)wMemInfo.RegionSize, 16, 16, QChar('0')).toUpper();
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(20 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
// State
|
|
||||||
switch(wMemInfo.State)
|
|
||||||
{
|
|
||||||
case MEM_FREE:
|
|
||||||
wTmpStr = QString("Free");
|
|
||||||
break;
|
|
||||||
case MEM_COMMIT:
|
|
||||||
wTmpStr = QString("Commited");
|
|
||||||
break;
|
|
||||||
case MEM_RESERVE:
|
|
||||||
wTmpStr = QString("Reserved");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wTmpStr = QString("N/A");
|
|
||||||
}
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(10 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
|
|
||||||
// Access
|
|
||||||
if(wMemInfo.State != MEM_COMMIT)
|
|
||||||
{
|
|
||||||
wTmpStr = QString("N/A");
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(30 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch(wMemInfo.Protect & 0xFF)
|
|
||||||
{
|
|
||||||
case PAGE_EXECUTE:
|
|
||||||
wTmpStr = QString("Execute");
|
|
||||||
break;
|
|
||||||
case PAGE_EXECUTE_READ:
|
|
||||||
wTmpStr = QString("Execute/Read");
|
|
||||||
break;
|
|
||||||
case PAGE_EXECUTE_READWRITE:
|
|
||||||
wTmpStr = QString("Execute/Read/Write");
|
|
||||||
break;
|
|
||||||
case PAGE_NOACCESS:
|
|
||||||
wTmpStr = QString("No Access");
|
|
||||||
break;
|
|
||||||
case PAGE_READONLY:
|
|
||||||
wTmpStr = QString("Read");
|
|
||||||
break;
|
|
||||||
case PAGE_READWRITE:
|
|
||||||
wTmpStr = QString("Read/Write");
|
|
||||||
break;
|
|
||||||
case PAGE_WRITECOPY:
|
|
||||||
wTmpStr = QString("Copy on Write");
|
|
||||||
break;
|
|
||||||
case PAGE_EXECUTE_WRITECOPY:
|
|
||||||
wTmpStr = QString("Execute/Copy on Write");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(wMemInfo.Protect & 0xFF00)
|
|
||||||
{
|
|
||||||
case PAGE_GUARD:
|
|
||||||
wTmpStr += QString(" + Guard");
|
|
||||||
}
|
|
||||||
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(30 - wTmpStr.length());
|
|
||||||
wStr += " | ";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type
|
|
||||||
switch(wMemInfo.Type)
|
|
||||||
{
|
|
||||||
case MEM_IMAGE:
|
|
||||||
wTmpStr = QString("Image");
|
|
||||||
break;
|
|
||||||
case MEM_MAPPED:
|
|
||||||
wTmpStr = QString("Mapped");
|
|
||||||
break;
|
|
||||||
case MEM_PRIVATE:
|
|
||||||
wTmpStr = QString("Private");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wTmpStr = QString("N/A");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
wStr += wTmpStr + QString(" ").repeated(10 - wTmpStr.length());
|
|
||||||
|
|
||||||
|
|
||||||
//qDebug() << wStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
#ifndef MEMORYMAP_H
|
|
||||||
#define MEMORYMAP_H
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QtGui>
|
|
||||||
#include <QWidget>
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "windows.h"
|
|
||||||
|
|
||||||
class ProcessMemoryMap : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit ProcessMemoryMap(QString fileName, QObject* parent = 0);
|
|
||||||
QList<MEMORY_BASIC_INFORMATION> BruteForceProcessMemory();
|
|
||||||
void printVirtualMemoryMap(QList<MEMORY_BASIC_INFORMATION> parList);
|
|
||||||
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
|
||||||
HANDLE mhProcess;
|
|
||||||
|
|
||||||
QByteArray mData;
|
|
||||||
|
|
||||||
QList<QByteArray> mMemoryRegionsDataList;
|
|
||||||
QList<MEMORY_BASIC_INFORMATION> mMemoryRegionsList;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MEMORYMAP_H
|
|
|
@ -63,7 +63,7 @@ void QHexEdit::fill(int index, const QString & pattern)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data[i] = convert[i].toAscii();
|
data[i] = convert[i].toLatin1();
|
||||||
mask[i] = '0';
|
mask[i] = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ void QHexEdit::setData(const QString & pattern)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data[i] = convert[i].toAscii();
|
data[i] = convert[i].toLatin1();
|
||||||
mask[i] = '0';
|
mask[i] = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#ifndef QHEXEDIT_H
|
#ifndef QHEXEDIT_H
|
||||||
#define QHEXEDIT_H
|
#define QHEXEDIT_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QScrollArea>
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include "QHexEditPrivate.h"
|
#include "QHexEditPrivate.h"
|
||||||
|
|
||||||
class QHexEdit : public QScrollArea
|
class QHexEdit : public QScrollArea
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <QtGui>
|
|
||||||
|
|
||||||
#include "QHexEditPrivate.h"
|
#include "QHexEditPrivate.h"
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
|
#include <QPainter>
|
||||||
#include "ArrayCommand.h"
|
#include "ArrayCommand.h"
|
||||||
|
|
||||||
const int HEXCHARS_IN_LINE = 47;
|
const int HEXCHARS_IN_LINE = 47;
|
||||||
|
@ -422,7 +423,7 @@ void QHexEditPrivate::keyPressEvent(QKeyEvent* event)
|
||||||
/* Edit Commands */
|
/* Edit Commands */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Hex input */
|
/* Hex input */
|
||||||
int key = int(event->text().toLower()[0].toAscii());
|
int key = int(event->text().toLower()[0].toLatin1());
|
||||||
if((key >= '0' && key <= '9') || (key >= 'a' && key <= 'f') || (_wildcardEnabled && key == '?'))
|
if((key >= '0' && key <= '9') || (key >= 'a' && key <= 'f') || (_wildcardEnabled && key == '?'))
|
||||||
{
|
{
|
||||||
if(getSelectionBegin() != getSelectionEnd())
|
if(getSelectionBegin() != getSelectionEnd())
|
||||||
|
@ -528,7 +529,7 @@ void QHexEditPrivate::keyPressEvent(QKeyEvent* event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data[i] = convert[i].toAscii();
|
data[i] = convert[i].toLatin1();
|
||||||
mask[i] = '0';
|
mask[i] = '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
#ifndef QHEXEDITPRIVATE_H
|
#ifndef QHEXEDITPRIVATE_H
|
||||||
#define QHEXEDITPRIVATE_H
|
#define QHEXEDITPRIVATE_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QWidget>
|
||||||
|
#include <QScrollArea>
|
||||||
|
#include <QUndoStack>
|
||||||
|
#include <QKeyEvent>
|
||||||
#include "XByteArray.h"
|
#include "XByteArray.h"
|
||||||
|
|
||||||
class QHexEditPrivate : public QWidget
|
class QHexEditPrivate : public QWidget
|
||||||
|
|
|
@ -47,7 +47,6 @@ void Breakpoints::setBP(BPXTYPE type, uint_t va)
|
||||||
DbgCmdExec(wCmd.toUtf8().constData());
|
DbgCmdExec(wCmd.toUtf8().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable breakpoint according to the given breakpoint descriptor.
|
* @brief Enable breakpoint according to the given breakpoint descriptor.
|
||||||
*
|
*
|
||||||
|
@ -378,7 +377,4 @@ void Breakpoints::toggleBPByRemoving(BPXTYPE type, uint_t va)
|
||||||
{
|
{
|
||||||
setBP(bp_hardware, va);
|
setBP(bp_hardware, va);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,29 +16,17 @@ class Breakpoints : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Breakpoints(QObject* parent = 0);
|
explicit Breakpoints(QObject* parent = 0);
|
||||||
|
|
||||||
static void setBP(BPXTYPE type, uint_t va);
|
static void setBP(BPXTYPE type, uint_t va);
|
||||||
|
|
||||||
static void enableBP(BRIDGEBP bp);
|
static void enableBP(BRIDGEBP bp);
|
||||||
static void enableBP(BPXTYPE type, uint_t va);
|
static void enableBP(BPXTYPE type, uint_t va);
|
||||||
|
|
||||||
static void disableBP(BRIDGEBP bp);
|
static void disableBP(BRIDGEBP bp);
|
||||||
static void disableBP(BPXTYPE type, uint_t va);
|
static void disableBP(BPXTYPE type, uint_t va);
|
||||||
|
|
||||||
static void removeBP(BRIDGEBP bp);
|
static void removeBP(BRIDGEBP bp);
|
||||||
static void removeBP(BPXTYPE type, uint_t va);
|
static void removeBP(BPXTYPE type, uint_t va);
|
||||||
|
|
||||||
static void toggleBPByDisabling(BRIDGEBP bp);
|
static void toggleBPByDisabling(BRIDGEBP bp);
|
||||||
static void toggleBPByDisabling(BPXTYPE type, uint_t va);
|
static void toggleBPByDisabling(BPXTYPE type, uint_t va);
|
||||||
|
|
||||||
static void toggleBPByRemoving(BPXTYPE type, uint_t va);
|
static void toggleBPByRemoving(BPXTYPE type, uint_t va);
|
||||||
|
|
||||||
static BPXSTATE BPState(BPXTYPE type, uint_t va);
|
static BPXSTATE BPState(BPXTYPE type, uint_t va);
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Bridge.h"
|
#include <QApplication>
|
||||||
|
#include <QFontInfo>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
Configuration* Configuration::mPtr = NULL;
|
Configuration* Configuration::mPtr = NULL;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#ifndef CONFIGURATION_H
|
#ifndef CONFIGURATION_H
|
||||||
#define CONFIGURATION_H
|
#define CONFIGURATION_H
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
#include <QString>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QMap>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include "Bridge.h"
|
#include <QMap>
|
||||||
|
#include <QColor>
|
||||||
|
#include <QFont>
|
||||||
|
#include "NewTypes.h"
|
||||||
|
|
||||||
#define Config() (Configuration::instance())
|
#define Config() (Configuration::instance())
|
||||||
#define ConfigColor(x) (Config()->getColor(x))
|
#define ConfigColor(x) (Config()->getColor(x))
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#ifndef RICHTEXTPAINTER_H
|
#ifndef RICHTEXTPAINTER_H
|
||||||
#define RICHTEXTPAINTER_H
|
#define RICHTEXTPAINTER_H
|
||||||
|
|
||||||
#include <QList>
|
#include <QString>
|
||||||
|
#include <QColor>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
class RichTextPainter
|
class RichTextPainter
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "UpdateChecker.h"
|
#include "UpdateChecker.h"
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QNetworkRequest>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QIcon>
|
||||||
#include "Bridge.h"
|
#include "Bridge.h"
|
||||||
|
|
||||||
UpdateChecker::UpdateChecker(QWidget* parent)
|
UpdateChecker::UpdateChecker(QWidget* parent)
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#ifndef UPDATECHECKER_H
|
#ifndef UPDATECHECKER_H
|
||||||
#define UPDATECHECKER_H
|
#define UPDATECHECKER_H
|
||||||
|
|
||||||
#include <QtNetwork>
|
#include <QNetworkAccessManager>
|
||||||
#include <QtGui>
|
|
||||||
|
|
||||||
class UpdateChecker : public QNetworkAccessManager
|
class UpdateChecker : public QNetworkAccessManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include <QtGui>
|
|
||||||
#include "MainWindow.h"
|
|
||||||
#include "NewTypes.h"
|
|
||||||
#include "Bridge.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <QAbstractEventDispatcher>
|
#include <QAbstractEventDispatcher>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include "Bridge.h"
|
||||||
|
#include "Configuration.h"
|
||||||
|
#include "MainWindow.h"
|
||||||
|
|
||||||
MyApplication::MyApplication(int & argc, char** argv) : QApplication(argc, argv)
|
MyApplication::MyApplication(int & argc, char** argv) : QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,9 +36,7 @@ SOURCES += \
|
||||||
Src/BasicView/HexDump.cpp \
|
Src/BasicView/HexDump.cpp \
|
||||||
Src/BasicView/AbstractTableView.cpp \
|
Src/BasicView/AbstractTableView.cpp \
|
||||||
Src/Disassembler/QBeaEngine.cpp \
|
Src/Disassembler/QBeaEngine.cpp \
|
||||||
Src/Memory/ProcessMemoryMap.cpp \
|
|
||||||
Src/Memory/MemoryPage.cpp \
|
Src/Memory/MemoryPage.cpp \
|
||||||
Src/Memory/MapViewOfMem.cpp \
|
|
||||||
Src/Bridge/Bridge.cpp \
|
Src/Bridge/Bridge.cpp \
|
||||||
Src/BasicView/StdTable.cpp \
|
Src/BasicView/StdTable.cpp \
|
||||||
Src/Gui/MemoryMapView.cpp \
|
Src/Gui/MemoryMapView.cpp \
|
||||||
|
@ -84,7 +82,8 @@ SOURCES += \
|
||||||
Src/Gui/ShortcutsDialog.cpp \
|
Src/Gui/ShortcutsDialog.cpp \
|
||||||
Src/BasicView/ShortcutEdit.cpp \
|
Src/BasicView/ShortcutEdit.cpp \
|
||||||
Src/Gui/CalculatorDialog.cpp \
|
Src/Gui/CalculatorDialog.cpp \
|
||||||
Src/Gui/AttachDialog.cpp
|
Src/Gui/AttachDialog.cpp \
|
||||||
|
Src/Gui/PageMemoryRights.cpp
|
||||||
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
@ -96,9 +95,7 @@ HEADERS += \
|
||||||
Src/BasicView/HexDump.h \
|
Src/BasicView/HexDump.h \
|
||||||
Src/BasicView/AbstractTableView.h \
|
Src/BasicView/AbstractTableView.h \
|
||||||
Src/Disassembler/QBeaEngine.h \
|
Src/Disassembler/QBeaEngine.h \
|
||||||
Src/Memory/ProcessMemoryMap.h \
|
|
||||||
Src/Memory/MemoryPage.h \
|
Src/Memory/MemoryPage.h \
|
||||||
Src/Memory/MapViewOfMem.h \
|
|
||||||
Src/Bridge/Bridge.h \
|
Src/Bridge/Bridge.h \
|
||||||
Src/Global/NewTypes.h \
|
Src/Global/NewTypes.h \
|
||||||
Src/Exports.h \
|
Src/Exports.h \
|
||||||
|
@ -147,7 +144,8 @@ HEADERS += \
|
||||||
Src/Gui/ShortcutsDialog.h \
|
Src/Gui/ShortcutsDialog.h \
|
||||||
Src/BasicView/ShortcutEdit.h \
|
Src/BasicView/ShortcutEdit.h \
|
||||||
Src/Gui/CalculatorDialog.h \
|
Src/Gui/CalculatorDialog.h \
|
||||||
Src/Gui/AttachDialog.h
|
Src/Gui/AttachDialog.h \
|
||||||
|
Src/Gui/PageMemoryRights.h
|
||||||
|
|
||||||
|
|
||||||
INCLUDEPATH += \
|
INCLUDEPATH += \
|
||||||
|
@ -180,7 +178,8 @@ FORMS += \
|
||||||
Src/Gui/PatchDialogGroupSelector.ui \
|
Src/Gui/PatchDialogGroupSelector.ui \
|
||||||
Src/Gui/ShortcutsDialog.ui \
|
Src/Gui/ShortcutsDialog.ui \
|
||||||
Src/Gui/CalculatorDialog.ui \
|
Src/Gui/CalculatorDialog.ui \
|
||||||
Src/Gui/AttachDialog.ui
|
Src/Gui/AttachDialog.ui \
|
||||||
|
Src/Gui/PageMemoryRights.ui
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/Src/Bridge
|
INCLUDEPATH += $$PWD/Src/Bridge
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue