geode/loader/dobby/source/InterceptRouting/Routing/FunctionWrapper/function-wrapper.h
2022-07-30 19:24:03 +03:00

40 lines
847 B
C++

#ifndef FUNCTION_WRAPPER_H
#define FUNCTION_WRAPPER_H
#include "dobby_internal.h"
#include "TrampolineBridge/ClosureTrampolineBridge/AssemblyClosureTrampoline.h"
#include "InterceptRouting/InterceptRouting.h"
#include "Interceptor.h"
#if TARGET_ARCH_IA32
#elif TARGET_ARCH_X64
#include "InterceptRouting/x64/X64InterceptRouting.h"
#elif TARGET_ARCH_ARM64
#include "InterceptRouting/arm64/ARM64InterceptRouting.h"
#elif TARGET_ARCH_ARM
#else
#error "unsupported architecture"
#endif
class FunctionWrapperRouting : public InterceptRouting {
public:
FunctionWrapperRouting(HookEntry *entry) : InterceptRouting(entry) {
}
void DispatchRouting();
void *GetTrampolineTarget();
private:
void BuildPreCallRouting();
void BuildPostCallRouting();
private:
void *prologue_dispatch_bridge;
void *epilogue_dispatch_bridge;
};
#endif