-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunlockAll.h
110 lines (73 loc) · 2.79 KB
/
unlockAll.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include "stdafx.h"
//#include "types.h"
#include "minhook/MinHook.h"
#include "sdk.h"
#include<fstream>
#include "xor.hpp"
#define _PRINT_DEBUG
struct StringTable {
char* name;
int columnCount;
int rowCount;
};
struct LootItem {
int m_itemId;
int m_itemQuantity;
};
extern BOOL g_running;
extern std::once_flag g_flag;
using DWGetLogonStatus_t = int (*)(int);
using MoveResponseToInventory_t = bool(__fastcall*)(LPVOID, int);
extern MoveResponseToInventory_t fpMoveResponseOrig;
extern MoveResponseToInventory_t manual_call;
namespace unlock {
extern __int64 base;
extern __int64 fpGetLootBase;
extern __int64 fpGetLogonStatus;
extern __int64 fpMoveResponseToInventory;
extern __int64 fpFindStringtable;
extern __int64 fpStringtableGetColumnValueForRow;
extern __int64 fpGetLootBase2;
extern __int64 fpGetLogonStatus2;
extern __int64 fpMoveResponseToInventory2;
extern __int64 fpFindStringtable2;
extern __int64 fpStringtableGetColumnValueForRow2;
extern bool init();
}
/*bool find_sigs()
{
MODULEINFO moduleInfo;
if (!GetModuleInformation((HANDLE)-1, GetModuleHandle(NULL), &moduleInfo, sizeof(MODULEINFO)) || !moduleInfo.lpBaseOfDll) {
LOG("Couldnt GetModuleInformation");
return NULL;
}
LOG("Base: 0x%llx", moduleInfo.lpBaseOfDll);
LOG("Size: 0x%llx", moduleInfo.SizeOfImage);
__int64 searchStart = (__int64)moduleInfo.lpBaseOfDll;
__int64 searchEnd = (__int64)moduleInfo.lpBaseOfDll + moduleInfo.SizeOfImage;
bool result = true;
auto resolve_jmp = [](__int64 addr) -> __int64 {
return *(int*)(addr + 1) + addr + 5;
};
auto resolve_lea = [](__int64 addr) -> __int64 {
return *(int*)(addr + 3) + addr + 7;
};
LOG_ADDR(fpGetLogonStatus = resolve_jmp(
find_pattern(searchStart, searchEnd, xorstr("E8 ? ? ? ? 83 F8 02 0F 84 ? ? ? ? 48 89"))));
LOG_ADDR(fpFindStringtable = resolve_jmp(
find_pattern(searchStart, searchEnd, xorstr("E8 ? ? ? ? 48 8B 8C 24 ? ? ? ? E8 ? ? ? ? 44"))));
LOG_ADDR(fpStringtableGetColumnValueForRow = resolve_jmp(
find_pattern(searchStart, searchEnd, xorstr("E8 ? ? ? ? 48 8D 4B 02 FF"))));
LOG_ADDR(fpMoveResponseToInventory =
(find_pattern(searchStart, searchEnd, xorstr("83 7C 24 ? ? 74 1B 83 7C 24 ? ? 0F 84")) - 43));
LOG_ADDR(fpGetLootBase = resolve_jmp(
(find_pattern(searchStart, searchEnd, xorstr("E8 ? ? ? ? 48 89 44 24 ? 41 B9 ? ? ? ? 44 ")))));
return result;
}*/
void get_func_ptr();
static void* GetLootBase();
static void FindStringTable(const char* name, StringTable** table);
static char* StringTable_GetColumnValueForRow(void* stringTable, int row, int column);
static void SaveLootTable(StringTable* loot_master);
extern bool __fastcall MoveResponseToInventory_Hooked(LPVOID a1, int a2);
extern void on_attach();