Structuring our hook
Now we know what our original function looks like and is structured like. Let's start on our hook.
Setting up the headers:
#define ENGINE_API __declspec(dllimport)
#include <windows.h>
#include <math.h>
#include <stdio.h>
#pragma comment(lib, "Core")
#pragma comment(lib, "Engine")
#include "Core.h"
#include "Engine.h"
#include "UnRender.h" // FSceneNode is defined here.
#include <detours.h> // Microsoft's detour library
Alright now it is time to typedef your detoured function.
typedef void(__stdcall *typedef_PostRender) (class FSceneNode *);
typedef_PostRender original_PostRender = NULL; // making a declaration of the original function.
Now let's make our detoured function. You'll be editing this later down the line We are going to edit the IAT and “detour†the original function to this function in our dll.
void WINAPI xPostRender (class FSceneNode*
Unreal Engine Hooking
于 2022-05-16 16:07:58 首次发布