From 708485a5ce6b21a5b89696bc1078b0ff1cbd4588 Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Tue, 11 Mar 2014 15:36:57 +0100 Subject: [PATCH] - renamed EngineGetAPIAddressRemote & EngineGetAPIAddressLocal - updated .def file --- TitanEngine/Global.Engine.Importer.cpp | 16 ++++++++-------- TitanEngine/Global.Engine.Importer.h | 4 ++-- TitanEngine/TitanEngine.Importer.cpp | 6 +++--- TitanEngine/TitanEngine.def | 2 ++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/TitanEngine/Global.Engine.Importer.cpp b/TitanEngine/Global.Engine.Importer.cpp index eff9145..0dc6354 100644 --- a/TitanEngine/Global.Engine.Importer.cpp +++ b/TitanEngine/Global.Engine.Importer.cpp @@ -148,9 +148,9 @@ ULONG_PTR EngineGetModuleBaseRemote(HANDLE hProcess, const char* szDLLName) } } -ULONG_PTR EngineGetAPIAddressRemote(HANDLE hProcess, ULONG_PTR APIAddress) +ULONG_PTR EngineGetAddressRemote(HANDLE hProcess, ULONG_PTR Address) { - HMODULE localModuleBase=(HMODULE)EngineGetModuleBaseRemote(GetCurrentProcess(), APIAddress); + HMODULE localModuleBase=(HMODULE)EngineGetModuleBaseRemote(GetCurrentProcess(), Address); if(localModuleBase) { wchar_t szModuleName[MAX_PATH]=L""; @@ -163,8 +163,8 @@ ULONG_PTR EngineGetAPIAddressRemote(HANDLE hProcess, ULONG_PTR APIAddress) ULONG_PTR remoteModuleBase=EngineGetModuleBaseRemote(hProcess, dllName); if(remoteModuleBase) { - APIAddress-=(ULONG_PTR)localModuleBase; //rva - return APIAddress+remoteModuleBase; + Address-=(ULONG_PTR)localModuleBase; //rva + return Address+remoteModuleBase; } } } @@ -172,9 +172,9 @@ ULONG_PTR EngineGetAPIAddressRemote(HANDLE hProcess, ULONG_PTR APIAddress) return 0; } -ULONG_PTR EngineGetAPIAddressLocal(HANDLE hProcess, ULONG_PTR APIAddress) +ULONG_PTR EngineGetAddressLocal(HANDLE hProcess, ULONG_PTR Address) { - HMODULE remoteModuleBase=(HMODULE)EngineGetModuleBaseRemote(hProcess, APIAddress); + HMODULE remoteModuleBase=(HMODULE)EngineGetModuleBaseRemote(hProcess, Address); if(remoteModuleBase) { wchar_t szModuleName[MAX_PATH]=L""; @@ -187,8 +187,8 @@ ULONG_PTR EngineGetAPIAddressLocal(HANDLE hProcess, ULONG_PTR APIAddress) ULONG_PTR localModuleBase=EngineGetModuleBaseRemote(GetCurrentProcess(), dllName); if(localModuleBase) { - APIAddress-=(ULONG_PTR)remoteModuleBase; //rva - return APIAddress+localModuleBase; + Address-=(ULONG_PTR)remoteModuleBase; //rva + return Address+localModuleBase; } } } diff --git a/TitanEngine/Global.Engine.Importer.h b/TitanEngine/Global.Engine.Importer.h index 86f8f86..38aac80 100644 --- a/TitanEngine/Global.Engine.Importer.h +++ b/TitanEngine/Global.Engine.Importer.h @@ -7,7 +7,7 @@ ULONG_PTR EngineGetProcAddressRemote(HANDLE hProcess, const char* szDLLName, con ULONG_PTR EngineGetModuleBaseRemote(HANDLE hProcess, ULONG_PTR APIAddress); ULONG_PTR EngineGetModuleBaseRemote(HANDLE hProcess, const wchar_t* szDLLName); ULONG_PTR EngineGetModuleBaseRemote(HANDLE hProcess, const char* szDLLName); -ULONG_PTR EngineGetAPIAddressRemote(HANDLE hProcess, ULONG_PTR APIAddress); -ULONG_PTR EngineGetAPIAddressLocal(HANDLE hProcess, ULONG_PTR APIAddress); +ULONG_PTR EngineGetAddressRemote(HANDLE hProcess, ULONG_PTR APIAddress); +ULONG_PTR EngineGetAddressLocal(HANDLE hProcess, ULONG_PTR APIAddress); #endif //_GLOBAL_ENGINE_IMPORTER_H \ No newline at end of file diff --git a/TitanEngine/TitanEngine.Importer.cpp b/TitanEngine/TitanEngine.Importer.cpp index 879eefe..e4a3c66 100644 --- a/TitanEngine/TitanEngine.Importer.cpp +++ b/TitanEngine/TitanEngine.Importer.cpp @@ -104,7 +104,7 @@ __declspec(dllexport) void* TITCALL ImporterGetDLLNameW(ULONG_PTR APIAddress) __declspec(dllexport) long long TITCALL ImporterGetRemoteAPIAddress(HANDLE hProcess, ULONG_PTR APIAddress) { - return EngineGetAPIAddressRemote(hProcess, APIAddress); + return EngineGetAddressRemote(hProcess, APIAddress); } __declspec(dllexport) long long TITCALL ImporterGetRemoteAPIAddressEx(char* szDLLName, char* szAPIName) @@ -114,7 +114,7 @@ __declspec(dllexport) long long TITCALL ImporterGetRemoteAPIAddressEx(char* szDL __declspec(dllexport) long long TITCALL ImporterGetLocalAPIAddress(HANDLE hProcess, ULONG_PTR APIAddress) { - return EngineGetAPIAddressLocal(hProcess, APIAddress); + return EngineGetAddressLocal(hProcess, APIAddress); } __declspec(dllexport) void* TITCALL ImporterGetDLLNameFromDebugee(HANDLE hProcess, ULONG_PTR APIAddress) @@ -153,7 +153,7 @@ __declspec(dllexport) long long TITCALL ImporterGetRemoteDLLBaseEx(HANDLE hProce __declspec(dllexport) long long TITCALL ImporterGetRemoteDLLBase(HANDLE hProcess, HMODULE LocalModuleBase) { - return EngineGetAPIAddressRemote(hProcess, (ULONG_PTR)LocalModuleBase); + return EngineGetAddressRemote(hProcess, (ULONG_PTR)LocalModuleBase); } __declspec(dllexport) void* TITCALL ImporterGetAPIName(ULONG_PTR APIAddress) diff --git a/TitanEngine/TitanEngine.def b/TitanEngine/TitanEngine.def index a524268..8171706 100644 --- a/TitanEngine/TitanEngine.def +++ b/TitanEngine/TitanEngine.def @@ -173,6 +173,7 @@ ImporterFindOrdinalAPIWriteLocation ImporterFindAPIByWriteLocation ImporterFindDLLByWriteLocation ImporterGetDLLName +ImporterGetDLLNameW ImporterGetAPIName ImporterGetAPINameEx ImporterGetAPIOrdinalNumber @@ -180,6 +181,7 @@ ImporterGetRemoteAPIAddress ImporterGetRemoteAPIAddressEx ImporterGetLocalAPIAddress ImporterGetDLLNameFromDebugee +ImporterGetDLLNameFromDebugeeW ImporterGetAPINameFromDebugee ImporterGetAPIOrdinalNumberFromDebugee ImporterGetDLLIndexEx