C++ DLL의 소스 코드가 있습니다. 이 DLL은 응용 프로그램의 일부입니다. 다른 DLL에 의해 메모리에로드 된 함수를 연결하여 원래 함수 대신 다른 DLL에 의해 호출 된 함수를 호출하려고합니다. 난 내 코드에서이 코드를 넣어 :DLL의 소스 코드 안에 C++ 함수 후크가 있습니다.
#include <windows.h>
#include "detours.h"
#pragma comment(lib, "detours.lib")
//Function prototype
int (__stdcall* OriginalFunction)();
//Our hook function
int FunctionHook()
{
//Return the real function
return OriginalFunction();
}
//On attach set the hooks
OriginalFunction = (int (__stdcall*)())DetourFunction((PBYTE)0x0100344C, (PBYTE)FunctionHook);
질문 : 내가가 ONE DLL에서 검색하면 잘못된되지 않은 오프셋 (나는 그것이 내가이기 때문에 더 복잡한 생각 오프셋 (offset)에 의해 기능을 패치 다른 DLL에 있고 모든 DLL의 함수를 후크하고 싶습니까?) 그런데 누군가 IDA PRO에서 표준 (fx. 0x0100344C) 오프셋을 얻을 수있는 방법을 알고 있습니까?
모든 DLL은 한 번 진행되며 DedicatedServer.exe입니다. 메모리 덮어 쓰기로 함수를 후킹하는 방법? –
여기 [http://xulrunner-1.9.2.sourcearchive.com/documentation/1.9.2.13plus-pbuild1plus-pnobinonly/nsWindowsDllInterceptor_8h-source.html]을 참조 할 수 있습니다. 이것은 "trampline hook"을 사용하는 모질라 소스 코드입니다. . 그러나 Detour를 사용할 수 있다면 코드를 해킹하지 않는 것이 좋습니다. – winterTTr
이 참조는 구문 강조 [https://bitbucket.org/MeeGoAdmin/mozilla-central/src/ace9b0ca623c/toolkit/xre/nsWindowsDllInterceptor.h]와 함께 더 명확 해 보입니다. – winterTTr