1
0
Fork 0

format spaces

This commit is contained in:
Mr. eXoDia 2015-04-06 03:39:13 +02:00
parent 5b8c17e81e
commit 2001eec1c4
20 changed files with 187 additions and 185 deletions

2
formatting_regexes.txt Normal file
View File

@ -0,0 +1,2 @@
# this file is only for the people who have serious mental issues
/\s*([+-])?\s*=\s*/ -> / \1= /

View File

@ -50,7 +50,7 @@ void* emalloc(size_t size, const char* reason)
memset(a, 0, size);
emalloc_count++;
/*
FILE* file=fopen(alloctrace, "a+");
FILE* file = fopen(alloctrace, "a+");
fprintf(file, "DBG%.5d: alloc:"fhex":%s:"fhex"\n", emalloc_count, a, reason, size);
fclose(file);
*/
@ -76,7 +76,7 @@ void* erealloc(void* ptr, size_t size, const char* reason)
}
memset(a, 0, size);
/*
FILE* file=fopen(alloctrace, "a+");
FILE* file = fopen(alloctrace, "a+");
fprintf(file, "DBG%.5d:realloc:"fhex":%s:"fhex"\n", emalloc_count, a, reason, size);
fclose(file);
*/
@ -92,7 +92,7 @@ void efree(void* ptr, const char* reason)
{
emalloc_count--;
/*
FILE* file=fopen(alloctrace, "a+");
FILE* file = fopen(alloctrace, "a+");
fprintf(file, "DBG%.5d: free:"fhex":%s\n", emalloc_count, ptr, reason);
fclose(file);
*/

View File

@ -72,8 +72,8 @@ void dbload()
WString databasePathW = StringUtils::Utf8ToUtf16(dbpath);
// Decompress the file if compression was enabled
bool useCompression = !settingboolget("Engine", "DisableCompression");
LZ4_STATUS lzmaStatus = LZ4_INVALID_ARCHIVE;
bool useCompression = !settingboolget("Engine", "DisableCompression");
LZ4_STATUS lzmaStatus = LZ4_INVALID_ARCHIVE;
{
lzmaStatus = LZ4_decompress_fileW(databasePathW.c_str(), databasePathW.c_str());
@ -86,8 +86,8 @@ void dbload()
}
// Open the file for reading by the JSON parser
FILE* jsonFile = nullptr;
long jsonFileSize = 0;
FILE* jsonFile = nullptr;
long jsonFileSize = 0;
if(_wfopen_s(&jsonFile, databasePathW.c_str(), L"rb"))
{

View File

@ -18,7 +18,7 @@ bool BookmarkSet(uint Address, bool Manual)
BOOKMARKSINFO bookmark;
ModNameFromAddr(Address, bookmark.mod, true);
bookmark.addr = Address - ModBaseFromAddr(Address);
bookmark.addr = Address - ModBaseFromAddr(Address);
bookmark.manual = Manual;
// Exclusive lock to insert new data
@ -72,8 +72,8 @@ void BookmarkDelRange(uint Start, uint End)
return;
// Virtual -> relative offset
Start -= moduleBase;
End -= moduleBase;
Start -= moduleBase;
End -= moduleBase;
EXCLUSIVE_ACQUIRE(LockBookmarks);
for(auto itr = bookmarks.begin(); itr != bookmarks.end();)
@ -98,8 +98,8 @@ void BookmarkCacheSave(JSON Root)
{
EXCLUSIVE_ACQUIRE(LockBookmarks);
const JSON jsonBookmarks = json_array();
const JSON jsonAutoBookmarks = json_array();
const JSON jsonBookmarks = json_array();
const JSON jsonAutoBookmarks = json_array();
// Save to the JSON root
for(auto & itr : bookmarks)
@ -149,7 +149,7 @@ void BookmarkCacheLoad(JSON Root)
bookmarkInfo.mod[0] = '\0';
// Load address and set auto-generated flag
bookmarkInfo.addr = (uint)json_hex_value(json_object_get(value, "address"));
bookmarkInfo.addr = (uint)json_hex_value(json_object_get(value, "address"));
bookmarkInfo.manual = Manual;
const uint key = ModHashFromName(bookmarkInfo.mod) + bookmarkInfo.addr;
@ -160,8 +160,8 @@ void BookmarkCacheLoad(JSON Root)
// Remove existing entries
bookmarks.clear();
const JSON jsonBookmarks = json_object_get(Root, "bookmarks");
const JSON jsonAutoBookmarks = json_object_get(Root, "autobookmarks");
const JSON jsonBookmarks = json_object_get(Root, "bookmarks");
const JSON jsonAutoBookmarks = json_object_get(Root, "autobookmarks");
// Load user-set bookmarks
if(jsonBookmarks)
@ -192,8 +192,8 @@ bool BookmarkEnum(BOOKMARKSINFO* List, size_t* Size)
// Copy struct and adjust the relative offset to a virtual address
for(auto & itr : bookmarks)
{
*List = itr.second;
List->addr += ModBaseFromName(List->mod);
*List = itr.second;
List->addr += ModBaseFromName(List->mod);
}
return true;

View File

@ -44,9 +44,9 @@ int BpGetList(std::vector<BREAKPOINT>* List)
// offset to a virtual address
for(auto & i : breakpoints)
{
BREAKPOINT currentBp = i.second;
currentBp.addr += ModBaseFromName(currentBp.mod);
currentBp.active = MemIsValidReadPtr(currentBp.addr);
BREAKPOINT currentBp = i.second;
currentBp.addr += ModBaseFromName(currentBp.mod);
currentBp.active = MemIsValidReadPtr(currentBp.addr);
List->push_back(currentBp);
}
@ -79,13 +79,13 @@ bool BpNew(uint Address, bool Enable, bool Singleshot, short OldBytes, BP_TYPE T
ModNameFromAddr(Address, bp.mod, true);
strcpy_s(bp.name, Name);
bp.active = true;
bp.addr = Address - ModBaseFromAddr(Address);
bp.enabled = Enable;
bp.oldbytes = OldBytes;
bp.singleshoot = Singleshot;
bp.titantype = TitanType;
bp.type = Type;
bp.active = true;
bp.addr = Address - ModBaseFromAddr(Address);
bp.enabled = Enable;
bp.oldbytes = OldBytes;
bp.singleshoot = Singleshot;
bp.titantype = TitanType;
bp.type = Type;
// Insert new entry to the global list
EXCLUSIVE_ACQUIRE(LockBreakpoints);
@ -115,9 +115,9 @@ bool BpGet(uint Address, BP_TYPE Type, const char* Name, BREAKPOINT* Bp)
if(!Bp)
return true;
*Bp = *bpInfo;
Bp->addr += ModBaseFromAddr(Address);
Bp->active = MemIsValidReadPtr(Bp->addr);
*Bp = *bpInfo;
Bp->addr += ModBaseFromAddr(Address);
Bp->active = MemIsValidReadPtr(Bp->addr);
return true;
}
@ -131,9 +131,9 @@ bool BpGet(uint Address, BP_TYPE Type, const char* Name, BREAKPOINT* Bp)
// Fill out the optional user buffer
if(Bp)
{
*Bp = i.second;
Bp->addr += ModBaseFromAddr(Address);
Bp->active = MemIsValidReadPtr(Bp->addr);
*Bp = i.second;
Bp->addr += ModBaseFromAddr(Address);
Bp->active = MemIsValidReadPtr(Bp->addr);
}
// Return true if the name was found at all
@ -232,9 +232,9 @@ bool BpEnumAll(BPENUMCALLBACK EnumCallback, const char* Module)
continue;
}
BREAKPOINT bpInfo = i.second;
bpInfo.addr += ModBaseFromName(bpInfo.mod);
bpInfo.active = MemIsValidReadPtr(bpInfo.addr);
BREAKPOINT bpInfo = i.second;
bpInfo.addr += ModBaseFromName(bpInfo.mod);
bpInfo.active = MemIsValidReadPtr(bpInfo.addr);
// Execute the callback
if(!EnumCallback(&bpInfo))
@ -286,10 +286,10 @@ void BpToBridge(const BREAKPOINT* Bp, BRIDGEBP* BridgeBp)
strcpy_s(BridgeBp->mod, Bp->mod);
strcpy_s(BridgeBp->name, Bp->name);
BridgeBp->active = Bp->active;
BridgeBp->addr = Bp->addr;
BridgeBp->enabled = Bp->enabled;
BridgeBp->singleshoot = Bp->singleshoot;
BridgeBp->active = Bp->active;
BridgeBp->addr = Bp->addr;
BridgeBp->enabled = Bp->enabled;
BridgeBp->singleshoot = Bp->singleshoot;
switch(Bp->type)
{
@ -369,10 +369,10 @@ void BpCacheLoad(JSON Root)
if(breakpoint.type == BPNORMAL)
breakpoint.oldbytes = (short)json_hex_value(json_object_get(value, "oldbytes"));
breakpoint.type = (BP_TYPE)json_integer_value(json_object_get(value, "type"));
breakpoint.addr = (uint)json_hex_value(json_object_get(value, "address"));
breakpoint.enabled = json_boolean_value(json_object_get(value, "enabled"));
breakpoint.titantype = (DWORD)json_hex_value(json_object_get(value, "titantype"));
breakpoint.type = (BP_TYPE)json_integer_value(json_object_get(value, "type"));
breakpoint.addr = (uint)json_hex_value(json_object_get(value, "address"));
breakpoint.enabled = json_boolean_value(json_object_get(value, "enabled"));
breakpoint.titantype = (DWORD)json_hex_value(json_object_get(value, "titantype"));
// Name
const char* name = json_string_value(json_object_get(value, "name"));

View File

@ -29,8 +29,8 @@ bool CommentSet(uint Address, const char* Text, bool Manual)
strcpy_s(comment.text, Text);
ModNameFromAddr(Address, comment.mod, true);
comment.manual = Manual;
comment.addr = Address - ModBaseFromAddr(Address);
comment.manual = Manual;
comment.addr = Address - ModBaseFromAddr(Address);
// Insert into list
const uint key = ModHashFromAddr(Address);
@ -95,8 +95,8 @@ void CommentDelRange(uint Start, uint End)
return;
// Virtual -> relative offset
Start -= moduleBase;
End -= moduleBase;
Start -= moduleBase;
End -= moduleBase;
EXCLUSIVE_ACQUIRE(LockComments);
for(auto itr = comments.begin(); itr != comments.end();)
@ -121,7 +121,7 @@ void CommentCacheSave(JSON Root)
{
EXCLUSIVE_ACQUIRE(LockComments);
const JSON jsonComments = json_array();
const JSON jsonComments = json_array();
const JSON jsonAutoComments = json_array();
// Build the JSON array
@ -174,8 +174,8 @@ void CommentCacheLoad(JSON Root)
commentInfo.mod[0] = '\0';
// Address/Manual
commentInfo.addr = (uint)json_hex_value(json_object_get(value, "address"));
commentInfo.manual = Manual;
commentInfo.addr = (uint)json_hex_value(json_object_get(value, "address"));
commentInfo.manual = Manual;
// String value
const char* text = json_string_value(json_object_get(value, "text"));
@ -196,7 +196,7 @@ void CommentCacheLoad(JSON Root)
// Remove existing entries
comments.clear();
const JSON jsonComments = json_object_get(Root, "comments");
const JSON jsonComments = json_object_get(Root, "comments");
const JSON jsonAutoComments = json_object_get(Root, "autocomments");
// Load user-set comments
@ -232,8 +232,8 @@ bool CommentEnum(COMMENTSINFO* List, size_t* Size)
// Populate the returned array
for(auto & itr : comments)
{
*List = itr.second;
List->addr += ModBaseFromName(List->mod);
*List = itr.second;
List->addr += ModBaseFromName(List->mod);
List++;
}

View File

@ -1549,7 +1549,7 @@ bool dbgpagerightstostring(DWORD protect, char* rights)
static uint dbggetpageligned(uint addr)
{
#ifdef _WIN64
addr &= 0xFFFFFFFFFFFFF000;
addr &= 0xFFFFFFFFFFFFF000;
#else // _WIN32
addr &= 0xFFFFF000;
#endif // _WIN64
@ -1862,7 +1862,7 @@ bool dbgsetcmdline(const char* cmd_line, cmdline_error_t* cmd_line_error)
command_line_addr = cmd_line_error->addr;
SIZE_T cmd_line_size = strlen(cmd_line);
SIZE_T cmd_line_size = strlen(cmd_line);
new_command_line.Length = (USHORT)(strlen(cmd_line) + 1) * sizeof(WCHAR);
new_command_line.MaximumLength = new_command_line.Length;

View File

@ -10,16 +10,16 @@ public:
//
Memory(const char* Reason = "Memory:???")
{
m_Ptr = nullptr;
m_Size = 0;
m_Reason = Reason;
m_Ptr = nullptr;
m_Size = 0;
m_Reason = Reason;
}
Memory(size_t Size, const char* Reason = "Memory:???")
{
m_Ptr = reinterpret_cast<T>(emalloc(Size));
m_Size = Size;
m_Reason = Reason;
m_Ptr = reinterpret_cast<T>(emalloc(Size));
m_Size = Size;
m_Reason = Reason;
memset(m_Ptr, 0, Size);
}
@ -32,9 +32,9 @@ public:
T realloc(size_t Size, const char* Reason = "Memory:???")
{
m_Ptr = reinterpret_cast<T>(erealloc(m_Ptr, Size));
m_Size = Size;
m_Reason = Reason;
m_Ptr = reinterpret_cast<T>(erealloc(m_Ptr, Size));
m_Size = Size;
m_Reason = Reason;
return (T)memset(m_Ptr, 0, m_Size);
}

View File

@ -28,8 +28,8 @@ bool FunctionAdd(uint Start, uint End, bool Manual)
FUNCTIONSINFO function;
ModNameFromAddr(Start, function.mod, true);
function.start = Start - moduleBase;
function.end = End - moduleBase;
function.start = Start - moduleBase;
function.end = End - moduleBase;
function.manual = Manual;
// Insert to global table
@ -115,8 +115,8 @@ void FunctionDelRange(uint Start, uint End)
return;
// Convert these to a relative offset
Start -= moduleBase;
End -= moduleBase;
Start -= moduleBase;
End -= moduleBase;
EXCLUSIVE_ACQUIRE(LockFunctions);
for(auto itr = functions.begin(); itr != functions.end();)
@ -142,8 +142,8 @@ void FunctionCacheSave(JSON Root)
EXCLUSIVE_ACQUIRE(LockFunctions);
// Allocate JSON object array
const JSON jsonFunctions = json_array();
const JSON jsonAutoFunctions = json_array();
const JSON jsonFunctions = json_array();
const JSON jsonAutoFunctions = json_array();
for(auto & i : functions)
{
@ -196,8 +196,8 @@ void FunctionCacheLoad(JSON Root)
functionInfo.mod[0] = '\0';
// Function address
functionInfo.start = (uint)json_hex_value(json_object_get(value, "start"));
functionInfo.end = (uint)json_hex_value(json_object_get(value, "end"));
functionInfo.start = (uint)json_hex_value(json_object_get(value, "start"));
functionInfo.end = (uint)json_hex_value(json_object_get(value, "end"));
functionInfo.manual = Manual;
// Sanity check
@ -209,8 +209,8 @@ void FunctionCacheLoad(JSON Root)
}
};
const JSON jsonFunctions = json_object_get(Root, "functions");
const JSON jsonAutoFunctions = json_object_get(Root, "autofunctions");
const JSON jsonFunctions = json_object_get(Root, "functions");
const JSON jsonAutoFunctions = json_object_get(Root, "autofunctions");
// Manual
if(jsonFunctions)
@ -248,9 +248,9 @@ bool FunctionEnum(FUNCTIONSINFO* List, size_t* Size)
// Adjust for relative to virtual addresses
uint moduleBase = ModBaseFromName(itr.second.mod);
*List = itr.second;
List->start += moduleBase;
List->end += moduleBase;
*List = itr.second;
List->start += moduleBase;
List->end += moduleBase;
List++;
}

View File

@ -30,8 +30,8 @@ bool LabelSet(uint Address, const char* Text, bool Manual)
// Fill out the structure data
LABELSINFO labelInfo;
labelInfo.manual = Manual;
labelInfo.addr = Address - ModBaseFromAddr(Address);
labelInfo.manual = Manual;
labelInfo.addr = Address - ModBaseFromAddr(Address);
strcpy_s(labelInfo.text, Text);
ModNameFromAddr(Address, labelInfo.mod, true);
@ -146,8 +146,8 @@ void LabelCacheSave(JSON Root)
EXCLUSIVE_ACQUIRE(LockLabels);
// Create the sub-root structures in memory
const JSON jsonLabels = json_array();
const JSON jsonAutoLabels = json_array();
const JSON jsonLabels = json_array();
const JSON jsonAutoLabels = json_array();
// Iterator each label
for(auto & itr : labels)
@ -199,8 +199,8 @@ void LabelCacheLoad(JSON Root)
labelInfo.mod[0] = '\0';
// Address/Manual
labelInfo.addr = (uint)json_hex_value(json_object_get(value, "address"));
labelInfo.manual = Manual;
labelInfo.addr = (uint)json_hex_value(json_object_get(value, "address"));
labelInfo.manual = Manual;
// Text string
const char* text = json_string_value(json_object_get(value, "text"));
@ -230,8 +230,8 @@ void LabelCacheLoad(JSON Root)
// Remove previous data
labels.clear();
const JSON jsonLabels = json_object_get(Root, "labels");
const JSON jsonAutoLabels = json_object_get(Root, "autolabels");
const JSON jsonLabels = json_object_get(Root, "labels");
const JSON jsonAutoLabels = json_object_get(Root, "autolabels");
// Load user-set labels
if(jsonLabels)
@ -267,8 +267,8 @@ bool LabelEnum(LABELSINFO* List, size_t* Size)
// to a virtual address
for(auto & itr : labels)
{
*List = itr.second;
List->addr += ModBaseFromName(itr.second.mod);
*List = itr.second;
List->addr += ModBaseFromName(itr.second.mod);
List++;
}

View File

@ -34,9 +34,9 @@ bool LoopAdd(uint Start, uint End, bool Manual)
// Fill out loop information structure
LOOPSINFO loopInfo;
loopInfo.start = Start - moduleBase;
loopInfo.end = End - moduleBase;
loopInfo.depth = finalDepth;
loopInfo.start = Start - moduleBase;
loopInfo.end = End - moduleBase;
loopInfo.depth = finalDepth;
loopInfo.manual = Manual;
ModNameFromAddr(Start, loopInfo.mod, true);
@ -93,11 +93,11 @@ bool LoopOverlaps(int Depth, uint Start, uint End, int* FinalDepth)
return false;
// Determine module addresses and lookup keys
const uint moduleBase = ModBaseFromAddr(Start);
const uint key = ModHashFromAddr(moduleBase);
const uint moduleBase = ModBaseFromAddr(Start);
const uint key = ModHashFromAddr(moduleBase);
uint curStart = Start - moduleBase;
uint curEnd = End - moduleBase;
uint curStart = Start - moduleBase;
uint curEnd = End - moduleBase;
SHARED_ACQUIRE(LockLoops);
@ -149,14 +149,14 @@ void LoopCacheSave(JSON Root)
EXCLUSIVE_ACQUIRE(LockLoops);
// Create the root JSON objects
const JSON jsonLoops = json_array();
const JSON jsonAutoLoops = json_array();
const JSON jsonLoops = json_array();
const JSON jsonAutoLoops = json_array();
// Write all entries
for(auto & itr : loops)
{
const LOOPSINFO & currentLoop = itr.second;
JSON currentJson = json_object();
const LOOPSINFO & currentLoop = itr.second;
JSON currentJson = json_object();
json_object_set_new(currentJson, "module", json_string(currentLoop.mod));
json_object_set_new(currentJson, "start", json_hex(currentLoop.start));
@ -206,9 +206,9 @@ void LoopCacheLoad(JSON Root)
loopInfo.mod[0] = '\0';
// All other variables
loopInfo.start = (uint)json_hex_value(json_object_get(value, "start"));
loopInfo.end = (uint)json_hex_value(json_object_get(value, "end"));
loopInfo.depth = (int)json_integer_value(json_object_get(value, "depth"));
loopInfo.start = (uint)json_hex_value(json_object_get(value, "start"));
loopInfo.end = (uint)json_hex_value(json_object_get(value, "end"));
loopInfo.depth = (int)json_integer_value(json_object_get(value, "depth"));
loopInfo.parent = (uint)json_hex_value(json_object_get(value, "parent"));
loopInfo.manual = Manual;
@ -224,8 +224,8 @@ void LoopCacheLoad(JSON Root)
// Remove existing entries
loops.clear();
const JSON jsonLoops = json_object_get(Root, "loops");
const JSON jsonAutoLoops = json_object_get(Root, "autoloops");
const JSON jsonLoops = json_object_get(Root, "loops");
const JSON jsonAutoLoops = json_object_get(Root, "autoloops");
// Load user-set loops
if(jsonLoops)
@ -258,9 +258,9 @@ bool LoopEnum(LOOPSINFO* List, size_t* Size)
*List = itr.second;
// Adjust the offset to a real virtual address
uint modbase = ModBaseFromName(List->mod);
List->start += modbase;
List->end += modbase;
uint modbase = ModBaseFromName(List->mod);
List->start += modbase;
List->end += modbase;
List++;
}

View File

@ -185,9 +185,9 @@ bool MemRead(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytes
if(pageCount > 1)
{
// Determine the number of bytes between ADDRESS and the next page
uint offset = 0;
uint readBase = (uint)BaseAddress;
uint readSize = ROUND_TO_PAGES(readBase) - readBase;
uint offset = 0;
uint readBase = (uint)BaseAddress;
uint readSize = ROUND_TO_PAGES(readBase) - readBase;
// Reset the bytes read count
*NumberOfBytesRead = 0;
@ -199,11 +199,11 @@ bool MemRead(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytes
if(MemoryReadSafe(fdProcessInfo->hProcess, (PVOID)readBase, ((PBYTE)Buffer + offset), readSize, &bytesRead))
*NumberOfBytesRead += bytesRead;
offset += readSize;
readBase += readSize;
offset += readSize;
readBase += readSize;
Size -= readSize;
readSize = (Size > PAGE_SIZE) ? PAGE_SIZE : Size;
Size -= readSize;
readSize = (Size > PAGE_SIZE) ? PAGE_SIZE : Size;
}
}
@ -240,9 +240,9 @@ bool MemWrite(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfByte
if(pageCount > 1)
{
// Determine the number of bytes between ADDRESS and the next page
uint offset = 0;
uint writeBase = (uint)BaseAddress;
uint writeSize = ROUND_TO_PAGES(writeBase) - writeBase;
uint offset = 0;
uint writeBase = (uint)BaseAddress;
uint writeSize = ROUND_TO_PAGES(writeBase) - writeBase;
// Reset the bytes read count
*NumberOfBytesWritten = 0;
@ -254,11 +254,11 @@ bool MemWrite(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfByte
if(MemoryWriteSafe(fdProcessInfo->hProcess, (PVOID)writeBase, ((PBYTE)Buffer + offset), writeSize, &bytesWritten))
*NumberOfBytesWritten += bytesWritten;
offset += writeSize;
writeBase += writeSize;
offset += writeSize;
writeBase += writeSize;
Size -= writeSize;
writeSize = (Size > PAGE_SIZE) ? PAGE_SIZE : Size;
Size -= writeSize;
writeSize = (Size > PAGE_SIZE) ? PAGE_SIZE : Size;
}
}

View File

@ -62,9 +62,9 @@ bool ModLoad(uint Base, uint Size, const char* FullPath)
{
MODSECTIONINFO curSection;
curSection.addr = GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONVIRTUALOFFSET) + info.base;
curSection.size = GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONVIRTUALSIZE);
const char* sectionName = (const char*)GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONNAME);
curSection.addr = GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONVIRTUALOFFSET) + info.base;
curSection.size = GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONVIRTUALSIZE);
const char* sectionName = (const char*)GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONNAME);
// Escape section name when needed
strcpy_s(curSection.name, StringUtils::Escape(sectionName).c_str());

View File

@ -33,9 +33,9 @@ void MsgFreeStack(MESSAGE_STACK* Stack)
bool MsgSend(MESSAGE_STACK* Stack, int Msg, uint Param1, uint Param2)
{
MESSAGE messageInfo;
messageInfo.msg = Msg;
messageInfo.param1 = Param1;
messageInfo.param2 = Param2;
messageInfo.msg = Msg;
messageInfo.param1 = Param1;
messageInfo.param2 = Param2;
// Asynchronous send. Return value doesn't matter.
concurrency::asend(Stack->FIFOStack, messageInfo);

View File

@ -306,7 +306,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
uint32_t k4 = getblock32(blocks, i * 4 + 3);
k1 *= c1;
k1 = ROTL32(k1, 15);
k1 = ROTL32(k1, 15);
k1 *= c2;
h1 ^= k1;
@ -315,7 +315,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
h1 = h1 * 5 + 0x561ccd1b;
k2 *= c2;
k2 = ROTL32(k2, 16);
k2 = ROTL32(k2, 16);
k2 *= c3;
h2 ^= k2;
@ -324,7 +324,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
h2 = h2 * 5 + 0x0bcaa747;
k3 *= c3;
k3 = ROTL32(k3, 17);
k3 = ROTL32(k3, 17);
k3 *= c4;
h3 ^= k3;
@ -333,7 +333,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
h3 = h3 * 5 + 0x96cd1c35;
k4 *= c4;
k4 = ROTL32(k4, 18);
k4 = ROTL32(k4, 18);
k4 *= c1;
h4 ^= k4;
@ -361,7 +361,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
case 13:
k4 ^= tail[12] << 0;
k4 *= c4;
k4 = ROTL32(k4, 18);
k4 = ROTL32(k4, 18);
k4 *= c1;
h4 ^= k4;
@ -374,7 +374,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
case 9:
k3 ^= tail[ 8] << 0;
k3 *= c3;
k3 = ROTL32(k3, 17);
k3 = ROTL32(k3, 17);
k3 *= c4;
h3 ^= k3;
@ -387,7 +387,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
case 5:
k2 ^= tail[ 4] << 0;
k2 *= c2;
k2 = ROTL32(k2, 16);
k2 = ROTL32(k2, 16);
k2 *= c3;
h2 ^= k2;
@ -400,7 +400,7 @@ void MurmurHash3_x86_128(const void* key, const int len,
case 1:
k1 ^= tail[ 0] << 0;
k1 *= c1;
k1 = ROTL32(k1, 15);
k1 = ROTL32(k1, 15);
k1 *= c2;
h1 ^= k1;
};
@ -474,7 +474,7 @@ void MurmurHash3_x64_128(const void* key, const int len,
uint64_t k2 = getblock64(blocks, i * 2 + 1);
k1 *= c1;
k1 = ROTL64(k1, 31);
k1 = ROTL64(k1, 31);
k1 *= c2;
h1 ^= k1;
@ -483,7 +483,7 @@ void MurmurHash3_x64_128(const void* key, const int len,
h1 = h1 * 5 + 0x52dce729;
k2 *= c2;
k2 = ROTL64(k2, 33);
k2 = ROTL64(k2, 33);
k2 *= c1;
h2 ^= k2;
@ -517,7 +517,7 @@ void MurmurHash3_x64_128(const void* key, const int len,
case 9:
k2 ^= ((uint64_t)tail[ 8]) << 0;
k2 *= c2;
k2 = ROTL64(k2, 33);
k2 = ROTL64(k2, 33);
k2 *= c1;
h2 ^= k2;
@ -538,7 +538,7 @@ void MurmurHash3_x64_128(const void* key, const int len,
case 1:
k1 ^= ((uint64_t)tail[ 0]) << 0;
k1 *= c1;
k1 = ROTL64(k1, 31);
k1 = ROTL64(k1, 31);
k1 *= c2;
h1 ^= k1;
};

View File

@ -29,9 +29,9 @@ bool PatchSet(uint Address, unsigned char OldByte, unsigned char NewByte)
return true;
PATCHINFO newPatch;
newPatch.addr = Address - ModBaseFromAddr(Address);
newPatch.oldbyte = OldByte;
newPatch.newbyte = NewByte;
newPatch.addr = Address - ModBaseFromAddr(Address);
newPatch.oldbyte = OldByte;
newPatch.newbyte = NewByte;
ModNameFromAddr(Address, newPatch.mod, true);
// Generate a key for this address
@ -53,8 +53,8 @@ bool PatchSet(uint Address, unsigned char OldByte, unsigned char NewByte)
else
{
// Keep the original byte from the previous patch
newPatch.oldbyte = found->second.oldbyte;
found->second = newPatch;
newPatch.oldbyte = found->second.oldbyte;
found->second = newPatch;
}
}
else
@ -83,7 +83,7 @@ bool PatchGet(uint Address, PATCHINFO* Patch)
// Did the user request an output buffer?
if(Patch)
{
*Patch = found->second;
*Patch = found->second;
Patch->addr += ModBaseFromAddr(Address);
}
@ -136,8 +136,8 @@ void PatchDelRange(uint Start, uint End, bool Restore)
return;
// VA to RVA in module
Start -= moduleBase;
End -= moduleBase;
Start -= moduleBase;
End -= moduleBase;
EXCLUSIVE_ACQUIRE(LockPatches);
for(auto itr = patches.begin(); itr != patches.end();)
@ -181,8 +181,8 @@ bool PatchEnum(PATCHINFO* List, size_t* Size)
// Copy each vector entry to a C-style array
for(auto & itr : patches)
{
*List = itr.second;
List->addr += ModBaseFromName(itr.second.mod);;
*List = itr.second;
List->addr += ModBaseFromName(itr.second.mod);;
List++;
}

View File

@ -25,8 +25,8 @@ int RefFind(uint Address, uint Size, CBREF Callback, void* UserData, bool Silent
}
// Assume the entire range is used
uint scanStart = regionBase;
uint scanSize = regionSize;
uint scanStart = regionBase;
uint scanSize = regionSize;
// Otherwise use custom boundaries if size was supplied
if(Size)
@ -34,8 +34,8 @@ int RefFind(uint Address, uint Size, CBREF Callback, void* UserData, bool Silent
uint maxsize = Size - (Address - regionBase);
// Make sure the size fits in one page
scanStart = Address;
scanSize = min(Size, maxsize);
scanStart = Address;
scanSize = min(Size, maxsize);
}
// Allocate and read a buffer from the remote process
@ -65,14 +65,14 @@ int RefFind(uint Address, uint Size, CBREF Callback, void* UserData, bool Silent
#ifdef _WIN64
disasm.Archi = 64;
#endif // _WIN64
disasm.EIP = (UIntPtr)data;
disasm.VirtualAddr = (UInt64)scanStart;
disasm.EIP = (UIntPtr)data;
disasm.VirtualAddr = (UInt64)scanStart;
// Allow an "initialization" notice
REFINFO refInfo;
refInfo.refcount = 0;
refInfo.userinfo = UserData;
refInfo.name = fullName;
refInfo.refcount = 0;
refInfo.userinfo = UserData;
refInfo.name = fullName;
Callback(0, 0, &refInfo);
@ -107,9 +107,9 @@ int RefFind(uint Address, uint Size, CBREF Callback, void* UserData, bool Silent
len = 1;
}
disasm.EIP += len;
disasm.VirtualAddr += len;
i += len;
disasm.EIP += len;
disasm.VirtualAddr += len;
i += len;
}
GuiReferenceSetProgress(100);

View File

@ -22,8 +22,8 @@ static BOOL CALLBACK EnumSymbols(PSYMBOL_INFO SymInfo, ULONG SymbolSize, PVOID U
SYMBOLINFO curSymbol;
memset(&curSymbol, 0, sizeof(SYMBOLINFO));
curSymbol.addr = (duint)SymInfo->Address;
curSymbol.decoratedSymbol = (char*)BridgeAlloc(strlen(SymInfo->Name) + 1);
curSymbol.addr = (duint)SymInfo->Address;
curSymbol.decoratedSymbol = (char*)BridgeAlloc(strlen(SymInfo->Name) + 1);
curSymbol.undecoratedSymbol = (char*)BridgeAlloc(MAX_SYM_NAME);
strcpy_s(curSymbol.decoratedSymbol, strlen(SymInfo->Name) + 1, SymInfo->Name);
@ -55,8 +55,8 @@ static BOOL CALLBACK EnumSymbols(PSYMBOL_INFO SymInfo, ULONG SymbolSize, PVOID U
void SymEnum(uint Base, CBSYMBOLENUM EnumCallback, void* UserData)
{
SYMBOLCBDATA symbolCbData;
symbolCbData.cbSymbolEnum = EnumCallback;
symbolCbData.user = UserData;
symbolCbData.cbSymbolEnum = EnumCallback;
symbolCbData.user = UserData;
// Enumerate every single symbol for the module in 'base'
if(!SafeSymEnumSymbols(fdProcessInfo->hProcess, Base, "*", EnumSymbols, &symbolCbData))
@ -100,8 +100,8 @@ void SymUpdateModuleList()
return;
// Create a new array to be sent to the GUI thread
size_t moduleCount = modList.size();
SYMBOLMODULEINFO* data = (SYMBOLMODULEINFO*)BridgeAlloc(moduleCount * sizeof(SYMBOLMODULEINFO));
size_t moduleCount = modList.size();
SYMBOLMODULEINFO* data = (SYMBOLMODULEINFO*)BridgeAlloc(moduleCount * sizeof(SYMBOLMODULEINFO));
// Direct copy from std::vector data
memcpy(data, modList.data(), moduleCount * sizeof(SYMBOLMODULEINFO));
@ -191,9 +191,9 @@ bool SymAddrFromName(const char* Name, uint* Address)
// Note that the total size of the data is the SizeOfStruct + (MaxNameLen - 1) * sizeof(TCHAR)
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)];
PSYMBOL_INFO symbol = (PSYMBOL_INFO)&buffer;
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
symbol->MaxNameLen = MAX_LABEL_SIZE;
PSYMBOL_INFO symbol = (PSYMBOL_INFO)&buffer;
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
symbol->MaxNameLen = MAX_LABEL_SIZE;
if(!SafeSymFromName(fdProcessInfo->hProcess, Name, symbol))
return false;
@ -216,9 +216,9 @@ const char* SymGetSymbolicName(uint Address)
{
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)];
PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
symbol->MaxNameLen = MAX_LABEL_SIZE;
PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
symbol->MaxNameLen = MAX_LABEL_SIZE;
// Perform a symbol lookup
DWORD64 displacement = 0;

View File

@ -1755,7 +1755,7 @@ static void setfpuvalue(const char* string, uint value)
i <<= 13;
flags &= ~i;
value <<= 13;
flags |= value;
flags |= value;
SetContextDataEx(hActiveThread, UE_MXCSR, flags);
}
else
@ -1803,7 +1803,7 @@ static void setfpuvalue(const char* string, uint value)
i <<= 11;
flags &= ~i;
value <<= 11;
flags |= value;
flags |= value;
SetContextDataEx(hActiveThread, UE_X87_STATUSWORD, flags);
}
else
@ -1826,7 +1826,7 @@ static void setfpuvalue(const char* string, uint value)
i <<= 10;
flags &= ~i;
value <<= 10;
flags |= value;
flags |= value;
SetContextDataEx(hActiveThread, UE_X87_CONTROLWORD, flags);
}
else if(StrNCmpI(string + STRLEN_USING_SIZEOF(x87CW_PRE_FIELD_STRING), "PC", (int) strlen("PC")) == 0)
@ -1836,7 +1836,7 @@ static void setfpuvalue(const char* string, uint value)
i <<= 8;
flags &= ~i;
value <<= 8;
flags |= value;
flags |= value;
SetContextDataEx(hActiveThread, UE_X87_CONTROLWORD, flags);
}
else

View File

@ -85,8 +85,8 @@ void varinit()
// Read-only variables
varnew("$lastalloc", 0, VAR_READONLY); // Last memory allocation
varnew("$_EZ_FLAG", 0, VAR_READONLY); // Equal/zero flag for internal use (1=equal, 0=unequal)
varnew("$_BS_FLAG", 0, VAR_READONLY); // Bigger/smaller flag for internal use (1=bigger, 0=smaller)
varnew("$_EZ_FLAG", 0, VAR_READONLY); // Equal/zero flag for internal use (1 = equal, 0 = unequal)
varnew("$_BS_FLAG", 0, VAR_READONLY); // Bigger/smaller flag for internal use (1 = bigger, 0 = smaller)
}
/**
@ -241,9 +241,9 @@ bool varset(const char* Name, uint Value, bool ReadOnly)
{
// Insert variable as an unsigned integer
VAR_VALUE varValue;
varValue.size = sizeof(uint);
varValue.type = VAR_UINT;
varValue.u.value = Value;
varValue.size = sizeof(uint);
varValue.type = VAR_UINT;
varValue.u.value = Value;
return varset(Name, &varValue, ReadOnly);
}
@ -258,9 +258,9 @@ bool varset(const char* Name, uint Value, bool ReadOnly)
bool varset(const char* Name, const char* Value, bool ReadOnly)
{
VAR_VALUE varValue;
int stringLen = (int)strlen(Value);
varValue.size = stringLen;
varValue.type = VAR_STRING;
int stringLen = (int)strlen(Value);
varValue.size = stringLen;
varValue.type = VAR_STRING;
varValue.u.data = new std::vector<unsigned char>;
// Allocate space for the string