forked from brewsterl/tibianic-dll
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.h
161 lines (128 loc) · 3.65 KB
/
main.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#ifndef __DLLH__
#define __DLLH___
#include "definitions.h"
#include <windows.h>
#include <windowsx.h>
#include <sddl.h>
#include <iostream>
#include <assert.h>
#include "const.h"
#include "pinger.h"
#include "cam.h"
#include "buttons.h"
#include "uitibia.h"
#include "guiwindow.h"
#include "gui.h"
#include "updatewindow.h"
#include "newswindow.h"
#include "optionswindow.h"
#include "questlogwindow.h"
#include "questlinewindow.h"
#include "tradewindow.h"
#include "outfitdialog.h"
#include "testdialog.h"
#include "tools.h"
#include "functions.h"
#include "networkmessage.h"
#include "xtea.h"
#include "rsa.h"
#include "crc.h"
class LIB {
public:
LIB();
~LIB();
// Initialization of the library
void Initialize();
void Deinitialize();
// The first tick function which will be called right after first tick from the Tibia timer
void FirstTick();
// Input events (keyboard, mouse)
bool onAsciiCharacter(WORD character);
// Cursor validation
void checkCursorPos();
// Events
void onConnectEvent(const struct sockaddr* address);
void onLogoutEvent();
// Memory re-allocation
void InitializeMemory();
// Login data related functions
void InitHostLogin(std::string host, uint16_t port);
void InitLocalHostLogin();
void InitGlobalHostLogin();
// Network related functions
void RequestSharedExperience();
void RequestOutfitDialog();
void RequestQuestLine(uint16_t questId);
void SendXTEANetworkMessage(NetworkMessage* message);
void SendRSANetworkMessage(NetworkMessage* message);
// Client visible manipulations
void SetExperienceText(bool Display, uint32_t Experience = 0);
// Main objects
void setPinger(Pinger* p){ pinger = p; }
Pinger* getPinger(){ return pinger; }
Buttons* getButtons(){ return buttons; }
CAM* getCAM(){ return cam; }
// Asm related functions
DWORD HookAsmCall(DWORD dwAddress, DWORD dwFunction, DWORD NOPs = 0);
void AsmNop(DWORD dwAddress, DWORD dwNops);
void AsmDword(DWORD dwAddress, DWORD dwFunction);
// Public variables
GUINewsWindow* m_newsDialog;
GUIUpdateWindow* m_updateDialog;
GUIOptionsWindow* m_optionsDialog;
GUIQuestsLog* m_questsDialog;
GUIQuestLine* m_questDialog;
GUITradeWindow* m_tradeDialog;
GUIOutfitDialog* m_outfitDialog;
NetworkMessage* m_networkMessage;
bool m_gameMenu;
bool m_gameFps;
bool m_firstFrame;
bool m_firstExperience;
bool m_wsad;
bool m_escToggle;
bool m_manaBar;
bool m_online;
bool m_inventory;
bool m_sharedExperience;
bool m_validHost;
bool m_validBuffer;
bool m_validCursor;
Pinger* pinger;
CAM* cam;
Buttons* buttons;
Buttons* m_inventoryButtons;
Button* m_gameRecordButton;
Button* m_gameQuestsButton;
Button* m_inventoryOptsButton;
Button* m_inventoryNewsButton;
Button* m_inventoryManaButton;
Button* m_inventoryPingButton;
Button* m_inventoryWsadButton;
ArrowSlot* m_arrowSlot;
bool m_displayExperience;
uint64_t m_beginExperience;
uint64_t m_beginExpTime;
std::string m_error;
std::string m_pingHost;
std::string m_moduleName;
uint32_t m_accountNumber;
std::string m_accountPassword;
int32_t m_screenHeight;
int32_t m_screenWidth;
HWND m_hWnd;
WNDPROC m_wndProc;
SOCKET m_socket;
char* m_buffer;
char* m_chunk;
WSADATA wsaData;
protected:
void InitializeHook();
void DeinitializeHook();
bool InitSecurityAttr();
bool CreateDACL(SECURITY_ATTRIBUTES* pSA);
private:
HANDLE m_currentProcess;
DWORD m_currentProcessId;
};
#endif