forked from toneomgomg/D2HackIt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Structs.h
146 lines (139 loc) · 5.22 KB
/
Structs.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//////////////////////////////////////////////////////////////////////
// Structs.h
// -------------------------------------------------------------------
// This include file contains all structs used by only the server.
//
// <[email protected]>
//////////////////////////////////////////////////////////////////////
#pragma once
#include <windows.h>
//////////////////////////////////////////////////////////////////////
// FINGERPRINTSTRUCT
// -------------------------------------------------------------------
// Structure used when fingerprinting functions.
//////////////////////////////////////////////////////////////////////
#define MAX_FPS_NAME_LEN 0x40
#define MAX_FPS_MODULENAME_LEN 0x10
#define MAX_FPS_FINGERPRINT_LEN 0x80
typedef struct fingerprintstruct_t
{
char Name[MAX_FPS_NAME_LEN];
char ModuleName[MAX_FPS_MODULENAME_LEN];
char FingerPrint[MAX_FPS_FINGERPRINT_LEN];
DWORD Offset;
DWORD PatchSize;
DWORD AddressFound;
} FINGERPRINTSTRUCT;
//////////////////////////////////////////////////////////////////////
// FINGERPRINTINFO
// -------------------------------------------------------------------
// Contains information about fingerprints.
//////////////////////////////////////////////////////////////////////
typedef struct fingerprintinfo_t
{
LPSTR FingerprintName;
LPSTR DllName;
LPSTR Fingerprint;
DWORD PatchSize;
DWORD Offset;
PBYTE OriginalCode;
DWORD MemoryLocation;
} FINGERPRINTINFO;
//////////////////////////////////////////////////////////////////////
// LOADERDATA *psi;
// -------------------------------------------------------------------
// Contains information passed from the loader.
//////////////////////////////////////////////////////////////////////
typedef struct loaderdata_t {
DWORD LoaderMagic;
DWORD LoaderVersion;
DWORD CodeLocation;
HWND hwnd;
DWORD pid;
HANDLE hProcess;
DWORD pLoadLibraryA;
DWORD pFreeLibrary;
DWORD pGetModuleHandleA;
char ModuleName[0x10];
DWORD WinProcLocation;
DWORD WinProcPatchsize;
} LOADERDATA;
//////////////////////////////////////////////////////////////////////
// PRIVATESERVERINFO *psi;
// -------------------------------------------------------------------
// Contains private information about the server.
//////////////////////////////////////////////////////////////////////
#define MAXINSERTRECVBUFFERS 20
#define MAXRECVBUFFERLEN 0x80
typedef struct privateserverinfo_t
{
DWORD pid;
HWND hwnd;
HANDLE hProcess;
CRITICAL_SECTION csData;
LOADERDATA* loader;
char BuildDate[16];
char BuildTime[16];
LPCSTR IniFile;
char ErrorPrompt[MAXPROMPTLENGTH];
char InfoPrompt[MAXPROMPTLENGTH];
char VerbosePrompt[MAXPROMPTLENGTH];
BOOL Verbose;
// Tick thread
volatile DWORD TickShutDown;
BOOL TickThreadActive;
HANDLE TickThreadHandle;
// Quick hack
BOOL DontShowErrors;
// Insert receive buffers
BYTE InsertRecvBuffer[MAXINSERTRECVBUFFERS][MAXRECVBUFFERLEN];
volatile DWORD InsertRecvLen[MAXINSERTRECVBUFFERS];
volatile DWORD nRecvBufferPos;
// Fingerprinted information
DWORD GameSocketLocation;
DWORD GamePrintStringLocation;
DWORD GameKeyDownIntercept;
DWORD pPlayerInfoStruct;
DWORD GameSendPacketToGameLocation;
DWORD GameSendMessageToChatLocation;
struct {
FINGERPRINTSTRUCT GamePacketReceivedIntercept;
FINGERPRINTSTRUCT GamePacketReceivedIntercept2;
FINGERPRINTSTRUCT GamePacketSentIntercept;
FINGERPRINTSTRUCT GamePlayerInfoIntercept;
} fps;
} PRIVATESERVERINFO;
extern PRIVATESERVERINFO *psi;
//////////////////////////////////////////////////////////////////////
// PRIVATEFUNCTIONENTRYPOINTS *pfep;
// -------------------------------------------------------------------
// Contains information about entrypoints only used by the server.
//////////////////////////////////////////////////////////////////////
// Typedefs for toolhelp32
typedef BOOL (WINAPI *fnModule32First)(HANDLE hSnapshot, LPMODULEENTRY32 lpme);
typedef BOOL (WINAPI *fnModule32Next)(HANDLE hSnapshot, LPMODULEENTRY32 lpme);
typedef HANDLE (WINAPI *fnCreateToolhelp32Snapshot)(DWORD dwFlags, DWORD th32ProcessID);
// Typedefs for psapi
typedef struct _MODULEINFO {LPVOID lpBaseOfDll;DWORD SizeOfImage;LPVOID EntryPoint;} MODULEINFO, *LPMODULEINFO;
typedef BOOL (*fnEnumProcessModules)(HANDLE hProcess, HMODULE * lphModule, DWORD cb, LPDWORD lpcbNeeded);
typedef DWORD (*fnGetModuleBaseName)(HANDLE hProcess, HMODULE hModule, LPTSTR lpBaseName, DWORD nSize);
typedef BOOL (*fnGetModuleInformation)(HANDLE hProcess,HMODULE hModule,LPMODULEINFO lpmodinfo,DWORD cb);
// Common typedefs
typedef DWORD (PRIVATE *fnGetBaseAddress)(LPSTR ModuleName);
typedef DWORD (PRIVATE *fnGetImageSize)(LPSTR ModuleName);
typedef struct privatefunctionentrypoints_t
{
fnGetBaseAddress GetBaseAddress;
fnGetImageSize GetImageSize;
struct {
fnCreateToolhelp32Snapshot CreateToolhelp32Snapshot;
fnModule32First Module32First;
fnModule32Next Module32Next;
} toolhelp;
struct {
fnEnumProcessModules EnumProcessModules;
fnGetModuleBaseName GetModuleBaseName;
fnGetModuleInformation GetModuleInformation;
} psapi;
} PRIVATEFUNCTIONENTRYPOINTS;
extern PRIVATEFUNCTIONENTRYPOINTS *pfep;