逆向工程 - 外挂 PACIFY安抚

人在焦虑中总是要逃避一小段时间 , 比如玩游戏 ,可是多巴胺消退不再给我刺激时 ,焦虑还是会萦绕于心 ,不面对就永远无法摆脱。 ——jelly

兴趣于学业结合

我也会想短短的逃避一下,但又不能抛弃学业,陷入其中

我会在玩游戏的时候 ,去对一个游戏逆向工程,这就是兴趣于学业结合

我做了什么

首先就是内存地址

我采用 Github开源的 ImGui框架 编写

我获取到了游戏的 关键的 模块地址基址内存偏移,我把他们写在如下

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

#include <iostream>
#include <Windows.h>
#include <vector>
#include <tlhelp32.h>
#include "lib_function.h"


DWORD_PTR roomLimit_baseAddressOffset = 0x036840F0; //房间人数地址
std::vector<DWORD> roomLimit_offsets = { 0x8, 0xA8, 0x170, 0x1F8, 0x2FC };
DWORD_PTR roomLimit_finalAddress;
int roomLimit =0;

DWORD_PTR Flying_baseAddressOffset = 0x03625870; //飞天状态
std::vector<DWORD> Flying_offsets = { 0x8, 0x110, 0x280, 0x168 };
DWORD_PTR Flying_finalAddress;
int Flying = 0;

DWORD_PTR Unlimitedpower_baseAddressOffset = 0x03676480; //自身电池电量
std::vector<DWORD> Unlimitedpower_offsets = { 0x30, 0x2B0, 0xE30, 0xA90 };
DWORD_PTR Unlimitedpower_finalAddress;
int Unlimitedpower = 0;

/// <summary>
/// 本地玩家坐标
/// </summary>
DWORD_PTR Zpos_baseAddressOffset = 0x03625880; //Zpos 坐标 Float
std::vector<DWORD> Zpos_offsets = { 0x0, 0x110, 0x130, 0x1D8};
DWORD_PTR Zpos_finalAddress;
float Zpos =0.0;

DWORD_PTR Xpos_baseAddressOffset = 0x03625880; //Xpos 坐标 Float
std::vector<DWORD> Xpos_offsets = { 0x0, 0x110, 0x130, 0x1D4 };
DWORD_PTR Xpos_finalAddress;
float Xpos =0.0;

DWORD_PTR Ypos_baseAddressOffset = 0x03625880; //Ypos 坐标 Float
std::vector<DWORD> Ypos_offsets = { 0x0, 0x110, 0x130, 0x1D0 };
DWORD_PTR Ypos_finalAddress;
float Ypos =0.0;


/// <summary>
/// 地下电源
/// </summary>
DWORD_PTR witch_BaseAddress = 0x03267D40; //右内 女巫艾格尼丝 房间电源
std::vector<DWORD> witch_offsets = { 0x0, 0x20, 0xE8, 0x3F0, 0x294 };
DWORD_PTR witch_finalAddress;
int witch =0;

DWORD_PTR Joey_BaseAddress = 0x03267D40; //右内 乔伊 房间电源
std::vector<DWORD> Joey_offsets = { 0x0, 0x20, 0xE8, 0x3E0, 0x294 };
DWORD_PTR Joey_finalAddress;
int Joey =0;

DWORD_PTR Karen_BaseAddress = 0x03267D40; //右外 凯伦 房间电源
std::vector<DWORD> Karen_offsets = { 0x0, 0x20, 0xE8, 0x3D8, 0x294 };
DWORD_PTR Karen_finalAddress;
int Karen =0;

DWORD_PTR Quinn_BaseAddress = 0x03267D40; //右外 奎恩 房间电源
std::vector<DWORD> Quinn_offsets = { 0x0, 0x20, 0xE8, 0x3E8, 0x294 };
DWORD_PTR Quinn_finalAddress;
int Quinn =0;

DWORD_PTR Kit_BaseAddress = 0x03267D40; //左外 吉特 房间电源
std::vector<DWORD> Kit_offsets = { 0x0, 0x20, 0xE8, 0x3C0, 0x294 };
DWORD_PTR Kit_finalAddress;
int Kit =0;

DWORD_PTR Amelia_BaseAddress = 0x03267D40; //左外 艾米利亚 房间电源
std::vector<DWORD> Amelia_offsets = { 0x0, 0x20, 0xE8, 0x3D0, 0x294 };
DWORD_PTR Amelia_finalAddress;
int Amelia =0;

DWORD_PTR Bouli_BaseAddress = 0x03267D40; //左内 布利 房间电源
std::vector<DWORD> Bouli_offsets = { 0x0, 0x20, 0xE8, 0x3C8, 0x294 };
DWORD_PTR Bouli_finalAddress;
int Bouli =0;

DWORD_PTR Venusin_BaseAddress = 0x03267D40; //左内 维妮辛 房间电源
std::vector<DWORD> Venusin_offsets = { 0x0, 0x20, 0xE8, 0x3B8, 0x294 };
DWORD_PTR Venusin_finalAddress;
int Venusin =0;

DWORD_PTR incinerator_BaseAddress = 0x035AEDE8; //焚烧炉电源
std::vector<DWORD> incinerator_offsets = { 0x30, 0x98, 0x10, 0xCC0, 0x294 };
DWORD_PTR incinerator_finalAddress;
int incinerator =0;

DWORD_PTR unit1_BaseAddress = 0x03267D40; //小单元电源1
std::vector<DWORD> unit1_offsets = { 0x0, 0x20, 0xE8, 0x360, 0x294 };
DWORD_PTR unit1_finalAddress;
int unit1;

DWORD_PTR unit2_BaseAddress = 0x03267D40; //小单元电源2
std::vector<DWORD> unit2_offsets = { 0x0, 0x20, 0xE8, 0x368, 0x294 };
DWORD_PTR unit2_finalAddress;
int unit2 =0;


/// <summary>
/// 二楼电源
/// </summary>
DWORD_PTR hall_BaseAddress = 0x0326A080; //大厅电源
std::vector<DWORD> hall_offsets = { 0x0, 0x1F8, 0x4E0, 0x20, 0x294 };
DWORD_PTR hall_finalAddress;
int hall =0;

DWORD_PTR toilet_BaseAddress = 0x0326A080; //卫生间电源
std::vector<DWORD> toilet_offsets = { 0x0, 0x1F8, 0x4C0, 0x20, 0x294 };
DWORD_PTR toilet_finalAddress;
int toilet =0;

DWORD_PTR diversion_BaseAddress = 0x0326A080; //娱乐房电源
std::vector<DWORD> diversion_offsets = { 0x0, 0x1F8, 0x4F0, 0x20, 0x294 };
DWORD_PTR diversion_finalAddress;
int diversion =0;

DWORD_PTR Officearea1_BaseAddress = 0x0326A080; //办公区1电源
std::vector<DWORD> Officearea1_offsets = { 0x0, 0x1F8, 0x578, 0x20, 0x294 };
DWORD_PTR Officearea1_finalAddress;
int Officearea1 =0;

DWORD_PTR Officearea2_BaseAddress = 0x0326A080; //办公区2电源
std::vector<DWORD> Officearea2_offsets = { 0x0, 0x1F8, 0x520, 0x20, 0x294 };
DWORD_PTR Officearea2_finalAddress;
int Officearea2 =0;

DWORD_PTR Officearea3_BaseAddress = 0x0326A080; //办公区3电源
std::vector<DWORD> Officearea3_offsets = { 0x0, 0x1F8, 0x540, 0x20, 0x294 };
DWORD_PTR Officearea3_finalAddress;
int Officearea3 =0;

DWORD_PTR warehouse_BaseAddress = 0x0326A080; //仓库电源
std::vector<DWORD> warehouse_offsets = { 0x0, 0x1F8, 0x570, 0x20, 0x294 };
DWORD_PTR warehouse_finalAddress;
int warehouse =0;

DWORD_PTR Ghosthouse_BaseAddress = 0x0326A080; //鬼房电源
std::vector<DWORD> Ghosthouse_offsets = { 0x0, 0x1F8, 0x560, 0x20, 0x294 };
DWORD_PTR Ghosthouse_finalAddress;
int Ghosthouse =0;

DWORD_PTR Undergroundpassage_BaseAddress = 0x0326A080; //地下通道电源
std::vector<DWORD> Undergroundpassage_offsets = { 0x0, 0x1F8, 0x598, 0x20, 0x294 };
DWORD_PTR Undergroundpassage_finalAddress;
int Undergroundpassage =0;

DWORD_PTR cleanchannel_BaseAddress = 0x0326A080; //净化通道电源
std::vector<DWORD> cleanchannel_offsets = { 0x0, 0x1F8, 0x5D8, 0x20, 0x294 };
DWORD_PTR cleanchannel_finalAddress;
int cleanchannel =0;


编写类和成员函数

编写了 class External_API

我在这里定义属性 : 进程句柄进程ID程序的模块地址名称是为了更规范一些,代码看着更简洁;

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
#include <windows.h>
#include <tlhelp32.h>
#include <iostream>
#include <vector>
#include "lib_function.h"
#include "addressOffset.h"


extern class External_API {
public:

HANDLE hProcess; //进程句柄

DWORD pid =0; //进程ID

const wchar_t* moduleName; //模块地址名称

HANDLE Get_hProcess() const {
return hProcess;
}

External_API():hProcess(NULL), pid(0), moduleName(nullptr) {

}

External_API(DWORD pid , const wchar_t* moduleName):pid(pid), hProcess(NULL) {
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
this->moduleName = moduleName;
}

External_API(DWORD pid) :pid(pid), hProcess(NULL) {
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
}

~External_API() {
if (hProcess != NULL) {
CloseHandle(hProcess);
}
}
};

自定义的函数

在这里定义

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
#include <iostream>
#include <vector>
#include <Windows.h>
#include "lib_function.h"
#include "addressOffset.h"




//这三个是color_Changes 所需的依赖
#include "imgui.h"
#include "imgui_impl_win32.h"
#include "imgui_impl_dx11.h"

/// <summary>
/// 获取进程PID
/// </summary>
/// <param name="processName"></param>
/// <returns></returns>
LONG_PTR GetPID(const TCHAR* processName)
{
bool success;
PROCESSENTRY32 pe = { sizeof(pe) };
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

if (snapshot == INVALID_HANDLE_VALUE)
return 1;
success = Process32First(snapshot, &pe);
if (_tcscmp(processName, pe.szExeFile) == 0)
{
CloseHandle(snapshot);
return pe.th32ProcessID;
}
while (success)
{
success = Process32Next(snapshot, &pe);
if (_tcscmp(processName, pe.szExeFile) == 0)
{
CloseHandle(snapshot);
return pe.th32ProcessID;
}
}
CloseHandle(snapshot);
return NULL;
}

/// <summary>
/// 获取模块地址
/// </summary>
DWORD_PTR GetModuleBaseAddress(DWORD pid, const wchar_t* moduleName) {
DWORD_PTR baseAddress = 0;
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
if (hSnapshot != INVALID_HANDLE_VALUE) {
MODULEENTRY32W moduleEntry;
moduleEntry.dwSize = sizeof(MODULEENTRY32W);
if (Module32FirstW(hSnapshot, &moduleEntry)) {
do {
if (_wcsicmp(moduleEntry.szModule, moduleName) == 0) {
baseAddress = (DWORD_PTR)moduleEntry.modBaseAddr;
break;
}
} while (Module32NextW(hSnapshot, &moduleEntry));
}
CloseHandle(hSnapshot);
}
return baseAddress;
}

/// <summary>
/// 计算多级指针偏移并返回最终地址
/// </summary>
DWORD_PTR ReadMultiLevelPointer(HANDLE hProcess, DWORD_PTR baseAddress, const std::vector<DWORD>& offsets) {
DWORD_PTR address = baseAddress;
for (size_t i = 0; i < offsets.size(); ++i) {
if (!ReadProcessMemory(hProcess, (BYTE*)address, &address, sizeof(address), nullptr)) {
std::cerr << "读取内存地址失败: 0x" << std::hex << address << std::endl;
return 0;
}
address += offsets[i];
std::cout << "解引用第 " << i + 1 << " 级: 地址 = 0x" << std::hex << address << std::endl;
}
return address;
}


/// <summary>
/// Color 判断
/// </summary>
ImVec4 color_Changes(int value) {
ImVec4 color;
if (value > 75) {
return color = ImVec4(0.0f, 1.0f, 0.0f, 1.0f); // 绿色
}
else if (value > 25) {
return color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f); // 黄色
}
else {
return color = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); // 红色
}
}

Main函数

我做了一个按钮 , 按下按钮就执行

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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
mapi.pid = 0;
mapi.pid = GetPID("Pacify-Win64-Shipping.exe");
mapi.moduleName = L"Pacify-Win64-Shipping.exe";

//打获取进程句柄
mapi.hProcess = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, mapi.pid);
if (mapi.hProcess == nullptr) {

std::cerr << "[ Error ]: hProcess is nullptr: " << GetLastError() << std::endl;
MessageBox(NULL, "你没有打开游戏,请先打开游戏再启动辅助", "提示", MB_OK);
return 1;
}

//调用获取模块地址
DWORD_PTR moduleBaseAddress = GetModuleBaseAddress(mapi.pid, mapi.moduleName);
if (moduleBaseAddress == 0) {
std::cerr << "[ Error ]: moduleBaseAddress is null" << std::endl;
CloseHandle(mapi.hProcess);
return 1;
}

//定义一个存储 模块地址+ 基址 的临时地址
DWORD_PTR initialAddress;

//获取 房间人数上限 地址
initialAddress = moduleBaseAddress + roomLimit_baseAddressOffset;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
roomLimit_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, roomLimit_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << roomLimit_finalAddress << std::endl;

//获取 飞天状态 地址
initialAddress = moduleBaseAddress + Flying_baseAddressOffset;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Flying_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Flying_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Flying_finalAddress << std::endl;

//获取 自身电池电量 地址
initialAddress = moduleBaseAddress + Unlimitedpower_baseAddressOffset;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Unlimitedpower_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Unlimitedpower_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Unlimitedpower_finalAddress << std::endl;

//获取 自身Z坐标 地址
initialAddress = moduleBaseAddress + Zpos_baseAddressOffset;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Zpos_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Zpos_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Zpos_finalAddress << std::endl;

//获取 自身X坐标 地址
initialAddress = moduleBaseAddress + Xpos_baseAddressOffset;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Xpos_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Xpos_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Xpos_finalAddress << std::endl;

//获取 自身Y坐标 地址
initialAddress = moduleBaseAddress + Ypos_baseAddressOffset;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Ypos_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Ypos_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Ypos_finalAddress << std::endl;


/// <summary>
/// 以下是实体的地址
/// </summary>

//获取 女巫 地址
initialAddress = moduleBaseAddress + witch_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
witch_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, witch_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << witch_finalAddress << std::endl;

//获取 乔伊 地址
initialAddress = moduleBaseAddress + Joey_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Joey_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Joey_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Joey_finalAddress << std::endl;

//获取 凯伦 地址
initialAddress = moduleBaseAddress + Karen_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Karen_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Karen_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Karen_finalAddress << std::endl;

//获取 奎恩 地址
initialAddress = moduleBaseAddress + Quinn_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Quinn_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Quinn_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Quinn_finalAddress << std::endl;

//获取 吉特 地址
initialAddress = moduleBaseAddress + Kit_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Kit_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Kit_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Kit_finalAddress << std::endl;

//获取 艾米利亚 地址
initialAddress = moduleBaseAddress + Amelia_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Amelia_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Amelia_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Amelia_finalAddress << std::endl;

//获取 布利 地址
initialAddress = moduleBaseAddress + Bouli_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Bouli_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Bouli_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Bouli_finalAddress << std::endl;

//获取 维妮辛 地址
initialAddress = moduleBaseAddress + Venusin_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Venusin_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Venusin_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Venusin_finalAddress << std::endl;

//获取 焚烧炉电源 地址
initialAddress = moduleBaseAddress + incinerator_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
incinerator_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, incinerator_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << incinerator_finalAddress << std::endl;

//获取 小单元电源1 地址
initialAddress = moduleBaseAddress + unit1_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
unit1_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, unit1_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << unit1_finalAddress << std::endl;

//获取 小单元电源2 地址
initialAddress = moduleBaseAddress + unit2_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
unit2_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, unit2_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << unit2_finalAddress << std::endl;

/// <summary>
/// 二楼电源
/// </summary>

//获取 大厅电源 地址
initialAddress = moduleBaseAddress + hall_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
hall_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, hall_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << hall_finalAddress << std::endl;

//获取 卫生间电源 地址
initialAddress = moduleBaseAddress + toilet_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
toilet_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, toilet_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << toilet_finalAddress << std::endl;

//获取 娱乐房电源 地址
initialAddress = moduleBaseAddress + diversion_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
diversion_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, diversion_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << diversion_finalAddress << std::endl;

//获取 办公区1电源 地址
initialAddress = moduleBaseAddress + Officearea1_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Officearea1_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Officearea1_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Officearea1_finalAddress << std::endl;

//获取 办公区2电源 地址
initialAddress = moduleBaseAddress + Officearea2_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Officearea2_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Officearea2_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Officearea2_finalAddress << std::endl;

//获取 办公区3电源 地址
initialAddress = moduleBaseAddress + Officearea3_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Officearea3_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Officearea3_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Officearea3_finalAddress << std::endl;

//获取 仓库电源 地址
initialAddress = moduleBaseAddress + warehouse_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
warehouse_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, warehouse_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << warehouse_finalAddress << std::endl;

//获取 鬼房电源 地址
initialAddress = moduleBaseAddress + Ghosthouse_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Ghosthouse_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Ghosthouse_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Ghosthouse_finalAddress << std::endl;

//获取 地下通道电源 地址
initialAddress = moduleBaseAddress + Undergroundpassage_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
Undergroundpassage_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, Undergroundpassage_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << Undergroundpassage_finalAddress << std::endl;

//获取 净化通道电源 地址
initialAddress = moduleBaseAddress + cleanchannel_BaseAddress;
std::cout << "[address]: initialAddress: 0x" << std::hex << initialAddress << std::endl;
cleanchannel_finalAddress = ReadMultiLevelPointer(mapi.hProcess, initialAddress, cleanchannel_offsets);
std::cout << "[address]: finalAddress: 0x" << std::hex << cleanchannel_finalAddress << std::endl;

控件与修改代码

修改房间人数的 拖动条

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ImGui::Text("房间人数上限"); ImGui::Value("人数上限", roomLimit);
//房间人数上限
if (ReadProcessMemory(mapi.hProcess, (BYTE*)roomLimit_finalAddress, &roomLimit, sizeof(roomLimit), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
ImGui::SliderInt("房间人数上限", &roomLimit, 2, 80);
if (WriteProcessMemory(mapi.hProcess, (BYTE*)roomLimit_finalAddress, &roomLimit, sizeof(roomLimit), nullptr)) {
std::cout << "[succeed]: Changes Roomlimit num =" << roomLimit << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Roomlimit num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Roomlimit num" << std::endl;
}

修改 飞行状态 快捷键按钮控件

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
//飞天
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Flying_finalAddress, &Flying, sizeof(Flying), nullptr)) {
std::cout << "Flying num:" << Flying << std::endl;
if (ImGui::Button("开启飞天")) {
Global_Flying_status = true;
}
if (ImGui::Button("关闭飞天")) {
Global_Flying_status = false;
}
if (Global_Flying_status)
{
Flying = 5;
}
if (GetAsyncKeyState(VK_UP) & 0x8000) {
Flying = 5;
}
if (GetAsyncKeyState(VK_DOWN) & 0x8000) {
Flying = 1;
}
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Flying_finalAddress, &Flying, sizeof(Flying), nullptr)) {
std::cout << "[succeed]: Changes Flying num =" << Flying << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Flying num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Flying num" << std::endl;
}

修改自身电池电量的代码 | 快捷键是 ctrl 触发将电量 赋值 100

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//自身电池电量
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Unlimitedpower_finalAddress, &Unlimitedpower, sizeof(Unlimitedpower), nullptr)) {
std::cout << "Unlimitedpower num:" << Unlimitedpower << std::endl;
if (GetAsyncKeyState(VK_CONTROL) & 0x8000) {
Unlimitedpower = 100;
}
ImGui::SliderInt("电池电量", &Unlimitedpower, 0, 100);
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Unlimitedpower_finalAddress, &Unlimitedpower, sizeof(Unlimitedpower), nullptr)) {
std::cout << "[succeed]: Changes Unlimitedpower num =" << Unlimitedpower << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Unlimitedpower num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Unlimitedpower num" << std::endl;
}

修改Z坐标信息的代码 包含 拖动条VK_SPACE快捷键

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
//Zpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
if (GetAsyncKeyState(VK_SPACE) & 0x8000) {
Zpos += 5.0f; // 每次按下空格键时增加 5
// 限制 Zpos 的范围在 SliderFloat 的范围内
if (Zpos > 5000.0f) Zpos = 5000.0f;
}
if (GetAsyncKeyState(VK_CONTROL) & 0x8000) {
Zpos -= 5.0f; // 每次按下空格键时增减去 5
// 限制 Zpos 的范围在 SliderFloat 的范围内
if (Zpos < -5000.0f) Zpos = -5000.0f;
}
if (GetAsyncKeyState(VK_XBUTTON1) & 0x8000) {
Zpos += 120.0f;

if (Zpos > 5000.0f) Zpos = 5000.0f;
}
if (GetAsyncKeyState(VK_XBUTTON2) & 0x8000) {
Zpos -= 120.0f;

if (Zpos < -5000.0f) Zpos = -5000.0f;
}

ImGui::SliderFloat("高度", &Zpos, -1000.0f, 1000.0f);
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
std::cout << "[succeed]: Changes Zpos num =" << Zpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Zpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Zpos num" << std::endl;
}

X,Y 的坐标信息监控代码

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
//Xpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
std::cout << "[succeed]: Changes Xpos num =" << Xpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Xpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Xpos num" << std::endl;
}
//Ypos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
std::cout << "[succeed]: Changes Ypos num =" << Ypos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Ypos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Ypos num" << std::endl;
}




//提示信息
ImGui::Text("快捷键小键盘 ,上是开启飞天, 下是关闭飞天");
ImGui::Text("空格向上飞,Ctrl向下飞,鼠标侧键 m1 m2 分别向上和向下快飞");
//监控信息
ImGui::Value("飞行状态:", Flying);
ImGui::Value("Z轴坐标:", Zpos);
ImGui::Value("X轴坐标:", Xpos);
ImGui::Value("Y轴坐标:", Ypos);

总部功能

它可以实时监控总部的电源

这个是从 洞口跳下来就已经确定的 方向 , 左外左内右内右外;
anfu.jpg

这是获取 它们各自房间电源的代码 , 这些的代码都是写在 循环体中的所以会不停的去获取最新的数据

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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
//右内 女巫艾格尼丝	房间电源 
if (ReadProcessMemory(mapi.hProcess, (BYTE*)witch_finalAddress, &witch, sizeof(witch), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)witch_finalAddress, &witch, sizeof(witch), nullptr)) {
std::cout << "[succeed]: Changes witch num =" << witch << std::endl;
}
else {
std::cerr << "[ Error ]: Changes witch num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read witch num" << std::endl;
}
//右内 乔伊 房间电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Joey_finalAddress, &Joey, sizeof(Joey), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Joey_finalAddress, &Joey, sizeof(Joey), nullptr)) {
std::cout << "[succeed]: Changes Joey num =" << Joey << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Joey num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Joey num" << std::endl;
}
//右外 凯伦
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Karen_finalAddress, &Karen, sizeof(Karen), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Karen_finalAddress, &Karen, sizeof(Karen), nullptr)) {
std::cout << "[succeed]: Changes Karen num =" << Karen << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Karen num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Karen num" << std::endl;
}
//右外 奎恩
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Quinn_finalAddress, &Quinn, sizeof(Quinn), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Quinn_finalAddress, &Quinn, sizeof(Quinn), nullptr)) {
std::cout << "[succeed]: Changes Quinn num =" << Quinn << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Quinn num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Quinn num" << std::endl;
}
//左外 吉特
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Kit_finalAddress, &Kit, sizeof(Kit), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Kit_finalAddress, &Kit, sizeof(Kit), nullptr)) {
std::cout << "[succeed]: Changes Kit num =" << Kit << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Kit num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Kit num" << std::endl;
}
//左外 艾米利亚
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Amelia_finalAddress, &Amelia, sizeof(Amelia), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Amelia_finalAddress, &Amelia, sizeof(Amelia), nullptr)) {
std::cout << "[succeed]: Changes Amelia num =" << Amelia << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Amelia num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Amelia num" << std::endl;
}
//左内 布利
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Bouli_finalAddress, &Bouli, sizeof(Bouli), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Bouli_finalAddress, &Bouli, sizeof(Bouli), nullptr)) {
std::cout << "[succeed]: Changes Bouli num =" << Bouli << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Bouli num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Bouli num" << std::endl;
}
//左内 维妮辛
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Venusin_finalAddress, &Venusin, sizeof(Venusin), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Venusin_finalAddress, &Venusin, sizeof(Venusin), nullptr)) {
std::cout << "[succeed]: Changes Venusin num =" << Venusin << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Venusin num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Venusin num" << std::endl;
}
//焚烧炉电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)incinerator_finalAddress, &incinerator, sizeof(incinerator), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)incinerator_finalAddress, &incinerator, sizeof(incinerator), nullptr)) {
std::cout << "[succeed]: Changes incinerator num =" << incinerator << std::endl;
}
else {
std::cerr << "[ Error ]: Changes incinerator num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read incinerator num" << std::endl;
}
//小单元电源1
if (ReadProcessMemory(mapi.hProcess, (BYTE*)unit1_finalAddress, &unit1, sizeof(unit1), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)unit1_finalAddress, &unit1, sizeof(unit1), nullptr)) {
std::cout << "[succeed]: Changes unit1 num =" << unit1 << std::endl;
}
else {
std::cerr << "[ Error ]: Changes unit1 num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read unit1 num" << std::endl;
}
//小单元电源2
if (ReadProcessMemory(mapi.hProcess, (BYTE*)unit2_finalAddress, &unit2, sizeof(unit2), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)unit2_finalAddress, &unit2, sizeof(unit2), nullptr)) {
std::cout << "[succeed]: Changes unit2 num =" << unit2 << std::endl;
}
else {
std::cerr << "[ Error ]: Changes unit2 num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read unit2 num" << std::endl;
}
//大厅电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)hall_finalAddress, &hall, sizeof(hall), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)hall_finalAddress, &hall, sizeof(hall), nullptr)) {
std::cout << "[succeed]: Changes hall num =" << hall << std::endl;
}
else {
std::cerr << "[ Error ]: Changes hall num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read hall num" << std::endl;
}
//卫生间电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)toilet_finalAddress, &toilet, sizeof(toilet), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)toilet_finalAddress, &toilet, sizeof(toilet), nullptr)) {
std::cout << "[succeed]: Changes toilet num =" << toilet << std::endl;
}
else {
std::cerr << "[ Error ]: Changes toilet num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read toilet num" << std::endl;
}
//娱乐房电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)diversion_finalAddress, &diversion, sizeof(diversion), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)diversion_finalAddress, &diversion, sizeof(diversion), nullptr)) {
std::cout << "[succeed]: Changes diversion num =" << diversion << std::endl;
}
else {
std::cerr << "[ Error ]: Changes diversion num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read diversion num" << std::endl;
}
//办公区1电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Officearea1_finalAddress, &Officearea1, sizeof(Officearea1), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Officearea1_finalAddress, &Officearea1, sizeof(Officearea1), nullptr)) {
std::cout << "[succeed]: Changes Officearea1 num =" << Officearea1 << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Officearea1 num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Officearea1 num" << std::endl;
}
//办公区2电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Officearea2_finalAddress, &Officearea2, sizeof(Officearea2), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Officearea2_finalAddress, &Officearea2, sizeof(Officearea2), nullptr)) {
std::cout << "[succeed]: Changes Officearea2 num =" << Officearea2 << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Officearea2 num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Officearea2 num" << std::endl;
}
//办公区3电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Officearea3_finalAddress, &Officearea3, sizeof(Officearea3), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Officearea3_finalAddress, &Officearea3, sizeof(Officearea3), nullptr)) {
std::cout << "[succeed]: Changes Officearea3 num =" << Officearea3 << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Officearea3 num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Officearea3 num" << std::endl;
}
//仓库电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)warehouse_finalAddress, &warehouse, sizeof(warehouse), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)warehouse_finalAddress, &warehouse, sizeof(warehouse), nullptr)) {
std::cout << "[succeed]: Changes warehouse num =" << warehouse << std::endl;
}
else {
std::cerr << "[ Error ]: Changes warehouse num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read warehouse num" << std::endl;
}
//鬼房电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Ghosthouse_finalAddress, &Ghosthouse, sizeof(Ghosthouse), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Ghosthouse_finalAddress, &Ghosthouse, sizeof(Ghosthouse), nullptr)) {
std::cout << "[succeed]: Changes Ghosthouse num =" << Ghosthouse << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Ghosthouse num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Ghosthouse num" << std::endl;
}
//地下通道电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Undergroundpassage_finalAddress, &Undergroundpassage, sizeof(Undergroundpassage), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Undergroundpassage_finalAddress, &Undergroundpassage, sizeof(Undergroundpassage), nullptr)) {
std::cout << "[succeed]: Changes Undergroundpassage num =" << Undergroundpassage << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Undergroundpassage num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Undergroundpassage num" << std::endl;
}
//净化通道电源
if (ReadProcessMemory(mapi.hProcess, (BYTE*)cleanchannel_finalAddress, &cleanchannel, sizeof(cleanchannel), nullptr)) {
std::cout << "Roomlimit num:" << roomLimit << std::endl;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)cleanchannel_finalAddress, &cleanchannel, sizeof(cleanchannel), nullptr)) {
std::cout << "[succeed]: Changes cleanchannel num =" << cleanchannel << std::endl;
}
else {
std::cerr << "[ Error ]: Changes cleanchannel num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read cleanchannel num" << std::endl;
}

在这里会实时 显示 它们各自房间的电源

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
ImGui::TextColored(color_Changes(Kit), "左外 吉特	: %d", Kit);
ImGui::TextColored(color_Changes(Amelia), "左外 艾米利亚 : %d", Amelia);
ImGui::TextColored(color_Changes(Bouli), "左内 布利 : %d", Bouli);
ImGui::TextColored(color_Changes(Venusin), "左内 维妮辛 : %d", Venusin);
ImGui::TextColored(color_Changes(witch), "右内 女巫 : %d", witch);
ImGui::TextColored(color_Changes(Joey), "右内 乔伊 : %d", Joey);
ImGui::TextColored(color_Changes(Karen), "右外 凯伦 : %d", Karen);
ImGui::TextColored(color_Changes(Quinn), "右外 奎恩 : %d", Quinn);
ImGui::Separator();
ImGui::TextColored(color_Changes(incinerator), "焚烧炉电源 : %d", incinerator);
ImGui::TextColored(color_Changes(unit1), "小单元电源1 : %d", unit1);
ImGui::TextColored(color_Changes(unit2), "小单元电源2 : %d", unit2);
ImGui::Separator();

ImGui::Text("二楼电源");
ImGui::TextColored(color_Changes(hall), "大厅电源 : %d", hall);
ImGui::TextColored(color_Changes(toilet), "净化通道电源: %d", toilet);
ImGui::TextColored(color_Changes(diversion), "娱乐房电源: %d", diversion);
ImGui::TextColored(color_Changes(Officearea1), "办公区1电源: %d", Officearea1);
ImGui::TextColored(color_Changes(Officearea2), "办公区2电源: %d", Officearea2);
ImGui::TextColored(color_Changes(Officearea3), "办公区3电源: %d", Officearea3);
ImGui::TextColored(color_Changes(warehouse), "仓库电源: %d", warehouse);
ImGui::TextColored(color_Changes(Ghosthouse), "鬼房电源: %d", Ghosthouse);
ImGui::TextColored(color_Changes(Undergroundpassage), "地下通道电源 : %d", Undergroundpassage);
ImGui::TextColored(color_Changes(cleanchannel), "卫生间电源: %d", cleanchannel);

传送功能

我是通过修改 XYZ 坐标实现的 , 一开始的监视坐标也是为了 获取 目标地点的 坐标值

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
ImGui::Text("传送功能");
/// <summary>
/// 传送到资源区
/// </summary>
if (ImGui::Button("资源区"))
{
//Zpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
Zpos = 1022.016;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
std::cout << "[succeed]: Changes Zpos num =" << Zpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Zpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Zpos num" << std::endl;
}
//Xpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
Xpos = 3793.890;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
std::cout << "[succeed]: Changes Xpos num =" << Xpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Xpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Xpos num" << std::endl;
}
//Ypos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
Ypos = 5046.566;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
std::cout << "[succeed]: Changes Ypos num =" << Ypos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Ypos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Ypos num" << std::endl;
}
}

/// <summary>
/// 传送到净化通道
/// </summary>
if (ImGui::Button("净化通道")) {
//Zpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
Zpos = 982.411;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
std::cout << "[succeed]: Changes Zpos num =" << Zpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Zpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Zpos num" << std::endl;
}
//Xpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
Xpos = 941.970;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
std::cout << "[succeed]: Changes Xpos num =" << Xpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Xpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Xpos num" << std::endl;
}
//Ypos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
Ypos = 6383.516;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
std::cout << "[succeed]: Changes Ypos num =" << Ypos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Ypos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Ypos num" << std::endl;
}
}

/// <summary>
/// 传送到地下充电房
/// </summary>
if (ImGui::Button("地下充电房"))
{
//Zpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
Zpos = 159.955;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Zpos_finalAddress, &Zpos, sizeof(Zpos), nullptr)) {
std::cout << "[succeed]: Changes Zpos num =" << Zpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Zpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Zpos num" << std::endl;
}
//Xpos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
Xpos = 1882.329;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Xpos_finalAddress, &Xpos, sizeof(Xpos), nullptr)) {
std::cout << "[succeed]: Changes Xpos num =" << Xpos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Xpos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Xpos num" << std::endl;
}
//Ypos
if (ReadProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
Ypos = 2863.134;
if (WriteProcessMemory(mapi.hProcess, (BYTE*)Ypos_finalAddress, &Ypos, sizeof(Ypos), nullptr)) {
std::cout << "[succeed]: Changes Ypos num =" << Ypos << std::endl;
}
else {
std::cerr << "[ Error ]: Changes Ypos num" << std::endl;
}
}
else {
std::cerr << "[ Error ]: Read Ypos num" << std::endl;
}
}

Github地址

安抚辅助
项目地址:Butterfly