-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShared.h
More file actions
27 lines (24 loc) · 755 Bytes
/
Shared.h
File metadata and controls
27 lines (24 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#include <string>
struct Il2CppClass;
template<typename TReturn, typename... TArgs>
struct Method
{
private:
typedef TReturn(*MethodRef)(TArgs...);
MethodRef method;
public:
Method(HMODULE hModule, const std::string& szMethodName)
: method{ reinterpret_cast<MethodRef>(GetProcAddress(hModule, szMethodName.c_str())) }
{
}
TReturn operator() (TArgs... args)
{
return method(args...);
}
};
const Il2CppClass* FindClass(HMODULE hModuleGasm, const std::string& szNamespace, const std::string& szName);
void InjectSelfToProcessById(DWORD processId);
DWORD FindProcessByName(const std::wstring& wzName);
char* GetBaseAddressOfModule(const std::wstring& wzName);
std::wstring GetPathOfThisModule();