Remove redundant typedefs
This commit is contained in:
parent
c1115bb203
commit
0ad2701caf
|
@ -54,11 +54,17 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
memmap->count = pagecount;
|
||||
if(!pagecount)
|
||||
return true;
|
||||
|
||||
// Allocate memory that is already zeroed
|
||||
memmap->page = (MEMPAGE*)BridgeAlloc(sizeof(MEMPAGE) * pagecount);
|
||||
memset(memmap->page, 0, sizeof(MEMPAGE)*pagecount);
|
||||
int j = 0;
|
||||
for(MemoryMap::iterator i = memoryPages.begin(); i != memoryPages.end(); ++i, j++)
|
||||
memcpy(&memmap->page[j], &i->second, sizeof(MEMPAGE));
|
||||
|
||||
// Copy all elements over
|
||||
int i = 0;
|
||||
|
||||
for (auto& itr : memoryPages)
|
||||
memcpy(&memmap->page[i++], &itr.second, sizeof(MEMPAGE));
|
||||
|
||||
// Done
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "debugger.h"
|
||||
#include "memory.h"
|
||||
|
||||
typedef std::unordered_map<uint, BOOKMARKSINFO> BookmarksInfo;
|
||||
|
||||
static BookmarksInfo bookmarks;
|
||||
std::unordered_map<uint, BOOKMARKSINFO> bookmarks;
|
||||
|
||||
bool BookmarkSet(uint Address, bool Manual)
|
||||
{
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
#include "module.h"
|
||||
|
||||
typedef std::pair<BP_TYPE, uint> BreakpointKey;
|
||||
typedef std::map<BreakpointKey, BREAKPOINT> BreakpointsInfo;
|
||||
|
||||
static BreakpointsInfo breakpoints;
|
||||
std::map<BreakpointKey, BREAKPOINT> breakpoints;
|
||||
|
||||
BREAKPOINT* BpInfoFromAddr(BP_TYPE Type, uint Address)
|
||||
{
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "debugger.h"
|
||||
#include "memory.h"
|
||||
|
||||
typedef std::unordered_map<uint, COMMENTSINFO> CommentsInfo;
|
||||
|
||||
static CommentsInfo comments;
|
||||
std::unordered_map<uint, COMMENTSINFO> comments;
|
||||
|
||||
bool CommentSet(uint Address, const char* Text, bool Manual)
|
||||
{
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "memory.h"
|
||||
#include "threading.h"
|
||||
|
||||
typedef std::map<ModuleRange, FUNCTIONSINFO, ModuleRangeCompare> FunctionsInfo;
|
||||
|
||||
static FunctionsInfo functions;
|
||||
std::map<ModuleRange, FUNCTIONSINFO, ModuleRangeCompare> functions;
|
||||
|
||||
bool FunctionAdd(uint Start, uint End, bool Manual)
|
||||
{
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "memory.h"
|
||||
#include "debugger.h"
|
||||
|
||||
typedef std::unordered_map<uint, LABELSINFO> LabelsInfo;
|
||||
|
||||
static LabelsInfo labels;
|
||||
std::unordered_map<uint, LABELSINFO> labels;
|
||||
|
||||
bool LabelSet(uint Address, const char* Text, bool Manual)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#define BYTES_TO_PAGES(Size) (((Size) >> PAGE_SHIFT) + (((Size) & (PAGE_SIZE - 1)) != 0))
|
||||
#define ROUND_TO_PAGES(Size) (((ULONG_PTR)(Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
|
||||
|
||||
MemoryMap memoryPages;
|
||||
std::map<Range, MEMPAGE, RangeCompare> memoryPages;
|
||||
bool bListAllPages = false;
|
||||
|
||||
void MemUpdateMap(HANDLE hProcess)
|
||||
|
@ -135,16 +135,16 @@ void MemUpdateMap(HANDLE hProcess)
|
|||
}
|
||||
}
|
||||
|
||||
uint MemFindBaseAddr(uint addr, uint* Size, bool refresh)
|
||||
uint MemFindBaseAddr(uint Address, uint* Size, bool Refresh)
|
||||
{
|
||||
// Update the memory map if needed
|
||||
if(refresh)
|
||||
if(Refresh)
|
||||
MemUpdateMap(fdProcessInfo->hProcess);
|
||||
|
||||
SHARED_ACQUIRE(LockMemoryPages);
|
||||
|
||||
// Search for the memory page address
|
||||
auto found = memoryPages.find(std::make_pair(addr, addr));
|
||||
auto found = memoryPages.find(std::make_pair(Address, Address));
|
||||
|
||||
if(found == memoryPages.end())
|
||||
return 0;
|
||||
|
|
|
@ -3,13 +3,11 @@
|
|||
#include "_global.h"
|
||||
#include "addrinfo.h"
|
||||
|
||||
typedef std::map<Range, MEMPAGE, RangeCompare> MemoryMap;
|
||||
|
||||
extern MemoryMap memoryPages;
|
||||
extern std::map<Range, MEMPAGE, RangeCompare> memoryPages;
|
||||
extern bool bListAllPages;
|
||||
|
||||
void MemUpdateMap(HANDLE hProcess);
|
||||
uint MemFindBaseAddr(uint addr, uint* Size, bool refresh = false);
|
||||
uint MemFindBaseAddr(uint Address, uint* Size, bool Refresh = false);
|
||||
bool MemRead(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesRead);
|
||||
bool MemWrite(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesWritten);
|
||||
bool MemPatch(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesWritten);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "symbolinfo.h"
|
||||
#include "murmurhash.h"
|
||||
|
||||
static ModulesInfo modinfo;
|
||||
std::map<Range, MODINFO, RangeCompare> modinfo;
|
||||
|
||||
bool ModLoad(uint Base, uint Size, const char* FullPath)
|
||||
{
|
||||
|
|
|
@ -29,8 +29,6 @@ struct MODINFO
|
|||
std::vector<MODSECTIONINFO> sections;
|
||||
};
|
||||
|
||||
typedef std::map<Range, MODINFO, RangeCompare> ModulesInfo;
|
||||
|
||||
bool ModLoad(uint Base, uint Size, const char* FullPath);
|
||||
bool ModUnload(uint Base);
|
||||
void ModClear();
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
#include "threading.h"
|
||||
#include "module.h"
|
||||
|
||||
typedef std::unordered_map<uint, PATCHINFO> PatchesInfo;
|
||||
|
||||
static PatchesInfo patches;
|
||||
std::unordered_map<uint, PATCHINFO> patches;
|
||||
|
||||
bool PatchSet(uint Address, unsigned char OldByte, unsigned char NewByte)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue