-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHacks.cpp
executable file
·83 lines (68 loc) · 2.6 KB
/
Hacks.cpp
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
#include "EG_client.h"
#include "Preferences.h"
///////////////////////////////////////////////////////////////////////////////////////////
// old memory values that hacks change are stored here
static
float fOldSpecRange = 10000.0f,
fOldSingleGoodPrice = 9999999.0f;
static
signed char cOldChatLogMaxLines = 0x20,
cOldMaxOnScreenChatLines = 0x20;
static
ULONG lOldOnScreenChatTime = 10000;
///////////////////////////////////////////////////////////////////////////////////////////
void InitHacks(void)
{
// special solars high range
ReadProcMem(FLADDR(ADDR_FL_SPEC_SOLAR_RANGE), &fOldSpecRange, 4);
if(g_Prefs->bHRLODs())
{
float fSpecRange = 250000.0f;
WriteProcMem(FLADDR(ADDR_FL_SPEC_SOLAR_RANGE), &fSpecRange, 4);
}
// max single good price
ReadProcMem(FLADDR(ADDR_FL_SINGLE_GOOD_PRICE_LIMIT), &fOldSingleGoodPrice, 4);
float fSingleGoodPrice = 999999999.0f;
WriteProcMem(FLADDR(ADDR_FL_SINGLE_GOOD_PRICE_LIMIT), &fSingleGoodPrice, 4);
// max lines in chat log window
ReadProcMem(FLADDR(ADDR_FL_CHATLOG_MAX_LINES), &cOldChatLogMaxLines, 1);
if(g_Prefs->bHugeChatWindowLog())
{
signed char cMaxLines = 127;
WriteProcMem(FLADDR(ADDR_FL_CHATLOG_MAX_LINES), &cMaxLines, 1);
}
// reading on-screen chat params
ReadProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_TIME), &lOldOnScreenChatTime, 4);
ReadProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_MAX_LINES), &cOldMaxOnScreenChatLines, 1);
if(g_Prefs->bDisableOnScreenChat())
{
signed char cMaxLines = -1;
WriteProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_MAX_LINES), &cMaxLines, 1);
}
else
{
// on-screen chat not disabled
if(g_Prefs->bDecOnScreenChatTime())
{
// decrease time chat shown on screen
ULONG lTime = 2500;
WriteProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_TIME), &lTime, 4);
}
if(g_Prefs->bDecOnScreenChatLines())
{
// decrease chat lines shown on screen
signed char cMaxLines = 4;
WriteProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_MAX_LINES), &cMaxLines, 1);
}
}
}
////////////////////////////////////////////////////////////////////////////////////////
void UnloadHacks(void)
{
WriteProcMem(FLADDR(ADDR_FL_SPEC_SOLAR_RANGE), &fOldSpecRange, 4);
WriteProcMem(FLADDR(ADDR_FL_SINGLE_GOOD_PRICE_LIMIT), &fOldSingleGoodPrice, 4);
WriteProcMem(FLADDR(ADDR_FL_CHATLOG_MAX_LINES), &cOldChatLogMaxLines, 1);
WriteProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_TIME), &lOldOnScreenChatTime, 4);
WriteProcMem(FLADDR(ADDR_FL_CHAT_ONSCREEN_MAX_LINES), &cOldMaxOnScreenChatLines, 1);
}
////////////////////////////////////////////////////////////////////////////////////////