From da7988c71f884dc3501807e544ba899267a0a054 Mon Sep 17 00:00:00 2001 From: mrexodia Date: Sun, 10 Jan 2016 22:34:18 +0100 Subject: [PATCH] renamed some shit --- GleeBug/Debugger.Dll.cpp | 2 +- GleeBug/Debugger.Dll.h | 4 +-- GleeBug/Debugger.Global.h | 12 ++++---- GleeBug/Debugger.Loop.Dll.cpp | 4 +-- GleeBug/Debugger.Loop.Process.cpp | 6 ++-- GleeBug/Debugger.Loop.Thread.cpp | 4 +-- GleeBug/Debugger.Process.Breakpoint.cpp | 16 +++++------ GleeBug/Debugger.Process.Memory.cpp | 10 +++---- GleeBug/Debugger.Process.cpp | 2 +- GleeBug/Debugger.Process.h | 12 ++++---- .../Debugger.Thread.HardwareBreakpoint.cpp | 4 +-- GleeBug/Debugger.Thread.cpp | 16 +++++------ GleeBug/Debugger.Thread.h | 10 +++---- GleeBug/Debugger.h | 28 +++++++++---------- MyDebugger/MyDebugger.h | 12 ++++---- TitanEngineEmulator/Emulator.h | 16 +++++------ 16 files changed, 79 insertions(+), 79 deletions(-) diff --git a/GleeBug/Debugger.Dll.cpp b/GleeBug/Debugger.Dll.cpp index 0ba5ffd..a64d250 100644 --- a/GleeBug/Debugger.Dll.cpp +++ b/GleeBug/Debugger.Dll.cpp @@ -2,7 +2,7 @@ namespace GleeBug { - DllInfo::DllInfo(LPVOID lpBaseOfDll, ptr sizeOfImage, LPVOID entryPoint) : + Dll::Dll(LPVOID lpBaseOfDll, ptr sizeOfImage, LPVOID entryPoint) : lpBaseOfDll(ptr(lpBaseOfDll)), sizeOfImage(sizeOfImage), entryPoint(ptr(entryPoint)) diff --git a/GleeBug/Debugger.Dll.h b/GleeBug/Debugger.Dll.h index 1bc4e9d..7296bf2 100644 --- a/GleeBug/Debugger.Dll.h +++ b/GleeBug/Debugger.Dll.h @@ -8,7 +8,7 @@ namespace GleeBug /** \brief DLL information structure. */ - class DllInfo + class Dll { public: ptr lpBaseOfDll; @@ -21,7 +21,7 @@ namespace GleeBug \param sizeOfImage Size of the image. \param entryPoint The entry point. */ - explicit DllInfo(LPVOID lpBaseOfDll, ptr sizeOfImage, LPVOID entryPoint); + explicit Dll(LPVOID lpBaseOfDll, ptr sizeOfImage, LPVOID entryPoint); }; }; diff --git a/GleeBug/Debugger.Global.h b/GleeBug/Debugger.Global.h index 6611829..7c0e86f 100644 --- a/GleeBug/Debugger.Global.h +++ b/GleeBug/Debugger.Global.h @@ -10,9 +10,9 @@ namespace GleeBug { //forward declarations class Debugger; - class ProcessInfo; - class DllInfo; - class ThreadInfo; + class Process; + class Dll; + class Thread; enum class BreakpointType; struct BreakpointInfo; @@ -27,9 +27,9 @@ namespace GleeBug typedef std::function BreakpointCallback; //map typedefs - typedef std::map ProcessMap; - typedef std::map DllMap; - typedef std::map ThreadMap; + typedef std::map ProcessMap; + typedef std::map DllMap; + typedef std::map ThreadMap; typedef std::map BreakpointMap; typedef std::map BreakpointCallbackMap; typedef std::unordered_map SoftwareBreakpointMap; diff --git a/GleeBug/Debugger.Loop.Dll.cpp b/GleeBug/Debugger.Loop.Dll.cpp index c2ba50a..38e968f 100644 --- a/GleeBug/Debugger.Loop.Dll.cpp +++ b/GleeBug/Debugger.Loop.Dll.cpp @@ -11,7 +11,7 @@ namespace GleeBug HMODULE(loadDll.lpBaseOfDll), &modinfo, sizeof(MODULEINFO)); - DllInfo dll(loadDll.lpBaseOfDll, modinfo.SizeOfImage, modinfo.EntryPoint); + Dll dll(loadDll.lpBaseOfDll, modinfo.SizeOfImage, modinfo.EntryPoint); mProcess->dlls.insert({ Range(dll.lpBaseOfDll, dll.lpBaseOfDll + dll.sizeOfImage - 1), dll }); //call the debug event callback @@ -29,7 +29,7 @@ namespace GleeBug if (dll != mProcess->dlls.end()) cbUnloadDllEvent(unloadDll, dll->second); else - cbUnloadDllEvent(unloadDll, DllInfo(unloadDll.lpBaseOfDll, 0, nullptr)); + cbUnloadDllEvent(unloadDll, Dll(unloadDll.lpBaseOfDll, 0, nullptr)); //DLL housekeeping if (dll != mProcess->dlls.end()) diff --git a/GleeBug/Debugger.Loop.Process.cpp b/GleeBug/Debugger.Loop.Process.cpp index 2c5f3b3..3e84b92 100644 --- a/GleeBug/Debugger.Loop.Process.cpp +++ b/GleeBug/Debugger.Loop.Process.cpp @@ -6,14 +6,14 @@ namespace GleeBug { //process housekeeping mProcesses.insert({ mDebugEvent.dwProcessId, - ProcessInfo(createProcess.hProcess, + Process(createProcess.hProcess, mDebugEvent.dwProcessId, mDebugEvent.dwThreadId) }); mProcess = &mProcesses.find(mDebugEvent.dwProcessId)->second; //thread housekeeping (main thread is created implicitly) mProcess->threads.insert({ mDebugEvent.dwThreadId, - ThreadInfo(createProcess.hThread, + Thread(createProcess.hThread, mDebugEvent.dwThreadId, createProcess.lpThreadLocalBase, createProcess.lpStartAddress) }); @@ -22,7 +22,7 @@ namespace GleeBug //read thread context from main thread if (!mThread->RegReadContext()) - cbInternalError("ThreadInfo::RegReadContext() failed!"); + cbInternalError("Thread::RegReadContext() failed!"); //call the debug event callback cbCreateProcessEvent(createProcess, *mProcess); diff --git a/GleeBug/Debugger.Loop.Thread.cpp b/GleeBug/Debugger.Loop.Thread.cpp index f556b33..6344107 100644 --- a/GleeBug/Debugger.Loop.Thread.cpp +++ b/GleeBug/Debugger.Loop.Thread.cpp @@ -6,7 +6,7 @@ namespace GleeBug { //thread housekeeping mProcess->threads.insert({ mDebugEvent.dwThreadId, - ThreadInfo(createThread.hThread, + Thread(createThread.hThread, mDebugEvent.dwThreadId, createThread.lpThreadLocalBase, createThread.lpStartAddress) }); @@ -15,7 +15,7 @@ namespace GleeBug mThread = mProcess->thread = &mProcess->threads.find(mDebugEvent.dwThreadId)->second; mRegisters = &mThread->registers; if (!mThread->RegReadContext()) - cbInternalError("ThreadInfo::RegReadContext() failed!"); + cbInternalError("Thread::RegReadContext() failed!"); //call the debug event callback cbCreateThreadEvent(createThread, *mThread); diff --git a/GleeBug/Debugger.Process.Breakpoint.cpp b/GleeBug/Debugger.Process.Breakpoint.cpp index 3b384a1..25f615a 100644 --- a/GleeBug/Debugger.Process.Breakpoint.cpp +++ b/GleeBug/Debugger.Process.Breakpoint.cpp @@ -2,7 +2,7 @@ namespace GleeBug { - bool ProcessInfo::SetBreakpoint(ptr address, bool singleshoot, SoftwareType type) + bool Process::SetBreakpoint(ptr address, bool singleshoot, SoftwareType type) { //check the address if (!MemIsValidPtr(address) || @@ -43,7 +43,7 @@ namespace GleeBug return true; } - bool ProcessInfo::SetBreakpoint(ptr address, const BreakpointCallback & cbBreakpoint, bool singleshoot, SoftwareType type) + bool Process::SetBreakpoint(ptr address, const BreakpointCallback & cbBreakpoint, bool singleshoot, SoftwareType type) { //check if a callback on this address was already found if (breakpointCallbacks.find({ BreakpointType::Software, address }) != breakpointCallbacks.end()) @@ -56,7 +56,7 @@ namespace GleeBug return true; } - bool ProcessInfo::DeleteBreakpoint(ptr address) + bool Process::DeleteBreakpoint(ptr address) { //find the breakpoint auto found = breakpoints.find({ BreakpointType::Software, address }); @@ -79,7 +79,7 @@ namespace GleeBug return true; } - bool ProcessInfo::GetFreeHardwareBreakpointSlot(HardwareSlot & slot) const + bool Process::GetFreeHardwareBreakpointSlot(HardwareSlot & slot) const { //find a free hardware breakpoint slot for (int i = 0; i < HWBP_COUNT; i++) @@ -93,7 +93,7 @@ namespace GleeBug return false; } - bool ProcessInfo::SetHardwareBreakpoint(ptr address, HardwareSlot slot, HardwareType type, HardwareSize size, bool singleshoot) + bool Process::SetHardwareBreakpoint(ptr address, HardwareSlot slot, HardwareType type, HardwareSize size, bool singleshoot) { //check the address if (!MemIsValidPtr(address) || @@ -138,7 +138,7 @@ namespace GleeBug return true; } - bool ProcessInfo::SetHardwareBreakpoint(ptr address, HardwareSlot slot, const BreakpointCallback & cbBreakpoint, HardwareType type, HardwareSize size, bool singleshoot) + bool Process::SetHardwareBreakpoint(ptr address, HardwareSlot slot, const BreakpointCallback & cbBreakpoint, HardwareType type, HardwareSize size, bool singleshoot) { //check if a callback on this address was already found if (breakpointCallbacks.find({ BreakpointType::Hardware, address }) != breakpointCallbacks.end()) @@ -151,7 +151,7 @@ namespace GleeBug return true; } - bool ProcessInfo::DeleteHardwareBreakpoint(ptr address) + bool Process::DeleteHardwareBreakpoint(ptr address) { //find the hardware breakpoint auto found = breakpoints.find({ BreakpointType::Hardware, address }); @@ -176,7 +176,7 @@ namespace GleeBug return success; } - bool ProcessInfo::DeleteGenericBreakpoint(const BreakpointInfo & info) + bool Process::DeleteGenericBreakpoint(const BreakpointInfo & info) { switch (info.type) { diff --git a/GleeBug/Debugger.Process.Memory.cpp b/GleeBug/Debugger.Process.Memory.cpp index cb21f84..6b1ccff 100644 --- a/GleeBug/Debugger.Process.Memory.cpp +++ b/GleeBug/Debugger.Process.Memory.cpp @@ -2,7 +2,7 @@ namespace GleeBug { - bool ProcessInfo::MemRead(ptr address, void* buffer, ptr size, ptr* bytesRead) const + bool Process::MemRead(ptr address, void* buffer, ptr size, ptr* bytesRead) const { ptr read; if (!bytesRead) @@ -10,7 +10,7 @@ namespace GleeBug return !!ReadProcessMemory(this->hProcess, reinterpret_cast(address), buffer, size, (SIZE_T*)bytesRead); } - bool ProcessInfo::MemReadSafe(ptr address, void* buffer, ptr size, ptr* bytesRead) const + bool Process::MemReadSafe(ptr address, void* buffer, ptr size, ptr* bytesRead) const { if (!MemRead(address, buffer, size, bytesRead)) return false; @@ -54,7 +54,7 @@ namespace GleeBug return true; } - bool ProcessInfo::MemWrite(ptr address, const void* buffer, ptr size, ptr* bytesWritten) + bool Process::MemWrite(ptr address, const void* buffer, ptr size, ptr* bytesWritten) { ptr written; if (!bytesWritten) @@ -62,12 +62,12 @@ namespace GleeBug return !!WriteProcessMemory(this->hProcess, reinterpret_cast(address), buffer, size, (SIZE_T*)bytesWritten); } - bool ProcessInfo::MemWriteSafe(ptr address, const void* buffer, ptr size, ptr* bytesWritten) + bool Process::MemWriteSafe(ptr address, const void* buffer, ptr size, ptr* bytesWritten) { return false; } - bool ProcessInfo::MemIsValidPtr(ptr address) const + bool Process::MemIsValidPtr(ptr address) const { uint8 byte; return MemRead(address, &byte, sizeof(byte)); diff --git a/GleeBug/Debugger.Process.cpp b/GleeBug/Debugger.Process.cpp index b93b04b..f88f5bc 100644 --- a/GleeBug/Debugger.Process.cpp +++ b/GleeBug/Debugger.Process.cpp @@ -2,7 +2,7 @@ namespace GleeBug { - ProcessInfo::ProcessInfo(HANDLE hProcess, uint32 dwProcessId, uint32 dwMainThreadId) : + Process::Process(HANDLE hProcess, uint32 dwProcessId, uint32 dwMainThreadId) : hProcess(hProcess), dwProcessId(dwProcessId), dwMainThreadId(dwMainThreadId), diff --git a/GleeBug/Debugger.Process.h b/GleeBug/Debugger.Process.h index 0692031..adbcd1a 100644 --- a/GleeBug/Debugger.Process.h +++ b/GleeBug/Debugger.Process.h @@ -11,14 +11,14 @@ namespace GleeBug /** \brief Process information structure. */ - class ProcessInfo + class Process { public: HANDLE hProcess; uint32 dwProcessId; uint32 dwMainThreadId; - ThreadInfo* thread; + Thread* thread; bool systemBreakpoint; ThreadMap threads; //DO NOT COPY THESE OBJECTS! @@ -34,7 +34,7 @@ namespace GleeBug \param dwProcessId Identifier for the process. \param dwMainThreadId Identifier for the main thread. */ - explicit ProcessInfo(HANDLE hProcess, uint32 dwProcessId, uint32 dwMainThreadId); + explicit Process(HANDLE hProcess, uint32 dwProcessId, uint32 dwMainThreadId); /** \brief Read memory from the process. @@ -136,7 +136,7 @@ namespace GleeBug /** \brief Sets a hardware breakpoint. \param address The address to set the hardware breakpoint on. - \param slot The hardware breakpoint register slot. Use ProcessInfo::GetFreeHardwareBreakpointSlot. + \param slot The hardware breakpoint register slot. Use Process::GetFreeHardwareBreakpointSlot. \param type (Optional) The hardware breakpoint type. \param size (Optional) The hardware breakpoint size. \param singleshoot (Optional) True to remove the breakpoint after the first hit. @@ -147,7 +147,7 @@ namespace GleeBug /** \brief Sets a hardware breakpoint. \param address The address to set the hardware breakpoint on. - \param slot The hardware breakpoint register slot. Use ProcessInfo::GetFreeHardwareBreakpointSlot. + \param slot The hardware breakpoint register slot. Use Process::GetFreeHardwareBreakpointSlot. \param cbBreakpoint The breakpoint callback. Can be written using BIND1(this, MyDebugger::cb). \param type (Optional) The hardware breakpoint type. \param size (Optional) The hardware breakpoint size. @@ -160,7 +160,7 @@ namespace GleeBug \brief Sets a hardware breakpoint. \tparam T Generic type parameter. Must be a subclass of Debugger. \param address The address to set the hardware breakpoint on. - \param slot The hardware breakpoint register slot. Use ProcessInfo::GetFreeHardwareBreakpointSlot. + \param slot The hardware breakpoint register slot. Use Process::GetFreeHardwareBreakpointSlot. \param debugger This pointer to a subclass of Debugger. \param callback Pointer to the callback. Written like: &MyDebugger::cb \param type (Optional) The hardware breakpoint type. diff --git a/GleeBug/Debugger.Thread.HardwareBreakpoint.cpp b/GleeBug/Debugger.Thread.HardwareBreakpoint.cpp index f260abb..c3aaa08 100644 --- a/GleeBug/Debugger.Thread.HardwareBreakpoint.cpp +++ b/GleeBug/Debugger.Thread.HardwareBreakpoint.cpp @@ -180,7 +180,7 @@ namespace GleeBug } } - bool ThreadInfo::SetHardwareBreakpoint(ptr address, HardwareSlot slot, HardwareType type, HardwareSize size) + bool Thread::SetHardwareBreakpoint(ptr address, HardwareSlot slot, HardwareType type, HardwareSize size) { //check if the alignment is correct if ((address % int(size) != 0)) @@ -216,7 +216,7 @@ namespace GleeBug return true; } - bool ThreadInfo::DeleteHardwareBreakpoint(HardwareSlot slot) + bool Thread::DeleteHardwareBreakpoint(HardwareSlot slot) { //zero the address register switch (slot) diff --git a/GleeBug/Debugger.Thread.cpp b/GleeBug/Debugger.Thread.cpp index f8d25c2..970bea9 100644 --- a/GleeBug/Debugger.Thread.cpp +++ b/GleeBug/Debugger.Thread.cpp @@ -2,7 +2,7 @@ namespace GleeBug { - ThreadInfo::ThreadInfo(HANDLE hThread, uint32 dwThreadId, LPVOID lpThreadLocalBase, LPVOID lpStartAddress) : + Thread::Thread(HANDLE hThread, uint32 dwThreadId, LPVOID lpThreadLocalBase, LPVOID lpStartAddress) : hThread(hThread), dwThreadId(dwThreadId), lpThreadLocalBase(ptr(lpThreadLocalBase)), @@ -13,7 +13,7 @@ namespace GleeBug { } - ThreadInfo::ThreadInfo(const ThreadInfo & other) : + Thread::Thread(const Thread & other) : hThread(other.hThread), dwThreadId(other.dwThreadId), lpThreadLocalBase(other.lpThreadLocalBase), @@ -26,7 +26,7 @@ namespace GleeBug { } - ThreadInfo & ThreadInfo::operator=(const ThreadInfo& other) + Thread & Thread::operator=(const Thread& other) { hThread = other.hThread; dwThreadId = other.dwThreadId; @@ -40,7 +40,7 @@ namespace GleeBug return *this; } - bool ThreadInfo::RegReadContext() + bool Thread::RegReadContext() { SuspendThread(this->hThread); memset(&this->mOldContext, 0, sizeof(CONTEXT)); @@ -55,7 +55,7 @@ namespace GleeBug return bReturn; } - bool ThreadInfo::RegWriteContext() const + bool Thread::RegWriteContext() const { //check if something actually changed if (memcmp(&this->mOldContext, this->registers.GetContext(), sizeof(CONTEXT)) == 0) @@ -67,13 +67,13 @@ namespace GleeBug return bReturn; } - void ThreadInfo::StepInto() + void Thread::StepInto() { registers.TrapFlag.Set(); isSingleStepping = true; } - void ThreadInfo::StepInto(const StepCallback & cbStep) + void Thread::StepInto(const StepCallback & cbStep) { StepInto(); @@ -89,7 +89,7 @@ namespace GleeBug stepCallbacks.push_back(cbStep); } - void ThreadInfo::StepInternal(const StepCallback & cbStep) + void Thread::StepInternal(const StepCallback & cbStep) { registers.TrapFlag.Set(); isInternalStepping = true; diff --git a/GleeBug/Debugger.Thread.h b/GleeBug/Debugger.Thread.h index 082c3e7..4a1b153 100644 --- a/GleeBug/Debugger.Thread.h +++ b/GleeBug/Debugger.Thread.h @@ -10,7 +10,7 @@ namespace GleeBug /** \brief Thread information structure. */ - class ThreadInfo + class Thread { public: HANDLE hThread; @@ -31,19 +31,19 @@ namespace GleeBug \param lpThreadLocalBase The thread local base. \param lpStartAddress The start address. */ - explicit ThreadInfo(HANDLE hThread, uint32 dwThreadId, LPVOID lpThreadLocalBase, LPVOID lpStartAddress); + explicit Thread(HANDLE hThread, uint32 dwThreadId, LPVOID lpThreadLocalBase, LPVOID lpStartAddress); /** \brief Copy constructor. */ - ThreadInfo(const ThreadInfo & other); + Thread(const Thread & other); /** \brief Assignment operator. \param other The other object. \return A shallow copy of this object. */ - ThreadInfo & operator=(const ThreadInfo & other); + Thread & operator=(const Thread & other); /** \brief Read the register context from the thread. This fills the RegistersInfo member. @@ -103,7 +103,7 @@ namespace GleeBug /** \brief Sets a hardware breakpoint. \param address The address to set the hardware breakpoint on. - \param slot The hardware breakpoint register slot. Use ProcessInfo::GetFreeHardwareBreakpointSlot. + \param slot The hardware breakpoint register slot. Use Process::GetFreeHardwareBreakpointSlot. \param type The hardware breakpoint type. \param size The hardware breakpoint size. \return true if the hardware breakpoint was set, false otherwise. diff --git a/GleeBug/Debugger.h b/GleeBug/Debugger.h index 92b2b70..44e56d9 100644 --- a/GleeBug/Debugger.h +++ b/GleeBug/Debugger.h @@ -67,44 +67,44 @@ namespace GleeBug /** \brief Process creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback. \param createProcess Information about the process created. - \param process ProcessInfo of the created process. + \param process Process of the created process. */ - virtual void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const ProcessInfo & process) {}; + virtual void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const Process & process) {}; /** \brief Process termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback. \param exitProcess Information about the process terminated. - \param process ProcessInfo of the terminated process. + \param process Process of the terminated process. */ - virtual void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const ProcessInfo & process) {}; + virtual void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const Process & process) {}; /** \brief Thread creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback. \param createThread Information about the thread created. - \param thread ThreadInfo of the created thread. + \param thread Thread of the created thread. */ - virtual void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const ThreadInfo & thread) {}; + virtual void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const Thread & thread) {}; /** \brief Thread termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback. \param exitThread Information about the thread terminated. - \param thread ThreadInfo of the terminated thread. + \param thread Thread of the terminated thread. */ - virtual void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const ThreadInfo & thread) {}; + virtual void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const Thread & thread) {}; /** \brief DLL load debug event callback. Called after event is internally processed. Provide an implementation to use this callback. \param loadDll Information about the DLL loaded. - \param dll DllInfo of the loaded DLL. + \param dll Dll of the loaded DLL. */ - virtual void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const DllInfo & dll) {}; + virtual void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const Dll & dll) {}; /** \brief DLL unload debug event callback. Called before event is internally processed. Provide an implementation to use this callback. \param unloadDll Information about the DLL unloaded. - \param dll DllInfo of the unloaded DLL. + \param dll Dll of the unloaded DLL. */ - virtual void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const DllInfo & dll) {}; + virtual void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const Dll & dll) {}; /** \brief Exception debug event callback. Called before the event is internally processed. Provide an implementation to use this callback. @@ -254,12 +254,12 @@ namespace GleeBug /** \brief The current process (can be null in some cases). */ - ProcessInfo* mProcess = nullptr; + Process* mProcess = nullptr; /** \brief The current thread (can be null in some cases). Should be a copy of mProcess->thread. */ - ThreadInfo* mThread = nullptr; + Thread* mThread = nullptr; /** \brief The current thread registers (can be null in some cases). Should be a copy of mThread->registers. diff --git a/MyDebugger/MyDebugger.h b/MyDebugger/MyDebugger.h index f97ca90..00c0b93 100644 --- a/MyDebugger/MyDebugger.h +++ b/MyDebugger/MyDebugger.h @@ -44,7 +44,7 @@ protected: mRegisters->Gip()); } - void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const ProcessInfo & process) override + void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const Process & process) override { ptr entry = ptr(createProcess.lpStartAddress); printf("Process %d created with entry 0x%p\n", @@ -79,34 +79,34 @@ protected: puts(""); } - void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const ProcessInfo & process) override + void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const Process & process) override { printf("Process %u terminated with exit code 0x%08X\n", mDebugEvent.dwProcessId, exitProcess.dwExitCode); } - void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const ThreadInfo & thread) override + void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const Thread & thread) override { printf("Thread %u created with entry 0x%p\n", mDebugEvent.dwThreadId, createThread.lpStartAddress); } - void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const ThreadInfo & thread) override + void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const Thread & thread) override { printf("Thread %u terminated with exit code 0x%08X\n", mDebugEvent.dwThreadId, exitThread.dwExitCode); } - void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const DllInfo & dll) override + void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const Dll & dll) override { printf("DLL loaded at 0x%p\n", loadDll.lpBaseOfDll); } - void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const DllInfo & dll) override + void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const Dll & dll) override { printf("DLL 0x%p unloaded\n", unloadDll.lpBaseOfDll); diff --git a/TitanEngineEmulator/Emulator.h b/TitanEngineEmulator/Emulator.h index e682b7a..477df2f 100644 --- a/TitanEngineEmulator/Emulator.h +++ b/TitanEngineEmulator/Emulator.h @@ -463,37 +463,37 @@ public: } protected: - void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const ProcessInfo & process) override + void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const Process & process) override { if (mCbCREATEPROCESS) mCbCREATEPROCESS(&createProcess); } - void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const ProcessInfo & process) override + void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const Process & process) override { if (mCbEXITPROCESS) mCbEXITPROCESS(&exitProcess); } - void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const ThreadInfo & thread) override + void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const Thread & thread) override { if (mCbCREATETHREAD) mCbCREATETHREAD(&createThread); } - void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const ThreadInfo & thread) override + void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const Thread & thread) override { if (mCbEXITTHREAD) mCbEXITTHREAD(&exitThread); } - void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const DllInfo & dll) override + void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const Dll & dll) override { if (mCbLOADDLL) mCbLOADDLL(&loadDll); } - void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const DllInfo & dll) override + void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const Dll & dll) override { if (mCbUNLOADDLL) mCbUNLOADDLL(&unloadDll); @@ -571,13 +571,13 @@ private: //functions } } - ThreadInfo* threadFromHandle(HANDLE hThread) const + Thread* threadFromHandle(HANDLE hThread) const { //TODO: properly implement this return mThread; } - ProcessInfo* processFromHandle(HANDLE hProcess) const + Process* processFromHandle(HANDLE hProcess) const { //TODO: properly implement this return mProcess;