forked from sims3fiend/Sims3SettingsSetter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvtable_manager.h
More file actions
24 lines (19 loc) · 750 Bytes
/
vtable_manager.h
File metadata and controls
24 lines (19 loc) · 750 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
#pragma once
#include <Windows.h>
#include <string>
#include "pattern_scan.h"
class VTableManager {
private:
uintptr_t vtableBase = 0;
bool validated = false;
// Pattern for constructor: MOV [ESI],vtable; XOR ECX,ECX; MOV [ESI+0C],ECX
const char* constructorPattern = "56 8B F1 C7 06 ?? ?? ?? ?? 33 C9 89 4E 0C";
//would not believe...
const char* vfuncPattern = "83 EC 18 53 56 8B F1 8D ?? 38 68 ?? ?? ?? ?? 89 4C 24 ?? E8 ?? ?? ?? ?? "
"C6 44 24 ?? 00 8B 44 24 ??";
bool ValidateVTable(uintptr_t candidate);
bool IsExecutableAddress(uintptr_t addr);
public:
bool Initialize();
void* GetFunctionAddress(const char* debugStr, uintptr_t offset);
};