Skip to content

Commit 063c1bb

Browse files
committed
升级了一下内存工具,这理论上可以防止剧烈波动下的字符串阅读崩溃
1 parent 5531e6a commit 063c1bb

16 files changed

Lines changed: 822 additions & 788 deletions

File tree

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

bin/MulNX/CS2OBTool/CS2OBTool.dll

5.5 KB
Binary file not shown.

bin/MulNX/CS2OBTool/UISystem/Config/MulNXUIConfig.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ Collapsed=0
278278
DockId=0x00000001,0
279279

280280
[Window][观战信息]
281-
Pos=733,474
282-
Size=542,271
281+
Pos=515,319
282+
Size=647,286
283283
Collapsed=0
284284

285285
[Docking][Data]

bin/MulNX/Log/Log_CS2Injector.txt

Lines changed: 100 additions & 100 deletions
Large diffs are not rendered by default.

bin/MulNX/Log/Log_CS2OBTool.txt

Lines changed: 644 additions & 644 deletions
Large diffs are not rendered by default.

source/MulNXExtensions/CS2/Buildup/EntityListScanner/EntityListScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void EntityListScanner::Window() {
1818
if (!pawn)continue;
1919

2020
auto id = MulNX::MRead(controller->m_steamID());
21-
auto userName = MulNX::Memory::ReadString(controller->m_iszPlayerName());
21+
auto userName = MulNX::Memory::ReadString(controller->m_iszPlayerName()).value();
2222

2323
auto info = std::format("检测到实体列表第{}项,是玩家{},steam ID为{}", i, userName, id);
2424
ImGui::Text(info.c_str());

source/MulNXExtensions/CS2/Buildup/PlayerHub/PlayerHub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bool PlayerHub::Window(MulNX::UICoordinator* uico) {
5252
ImGui::OpenPopupOnItemClick(std::format("PlayerPopup_{:X}", info.steamID).c_str(),
5353
ImGuiPopupFlags_MouseButtonLeft);
5454

55-
auto naturalName = MulNX::Memory::ReadString(info.controller->m_iszPlayerName());
55+
auto naturalName = MulNX::Memory::ReadString(info.controller->m_iszPlayerName()).value();
5656
ImGui::TextUnformatted(std::format("自然名字: {}", naturalName).c_str());
5757
ImGui::Separator();
5858
};

source/MulNXExtensions/CS2/Feature/DemoSystem/Rending/DemoPlayerInfoRender/DemoPlayerInfoRender.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,35 @@ void DemoPlayerInfoRender::Menu(MulNX::Message* umsg) {
55
auto&& [uid] = umsg->Access<Steam64UID>();
66
this->Update();
77
auto it = this->crosshairShareCodes.find(uid);
8-
if (it == this->crosshairShareCodes.end()) {
9-
ImGui::Text("无准星信息");
10-
return;
8+
if (it != this->crosshairShareCodes.end()) {
9+
std::string& code = it->second;
10+
11+
ImGui::InputText("Demo准星", code.data(), code.size() + 1,
12+
ImGuiInputTextFlags_ReadOnly);
13+
ImGui::SameLine();
14+
if (ImGui::Button("复制到剪贴板")) {
15+
ImGui::SetClipboardText(code.c_str());
16+
}
17+
}
18+
else {
19+
ImGui::Text("无Demo准星信息");
1120
}
12-
std::string& code = it->second;
21+
22+
23+
auto pPawn = this->CS2->client.TryGetObservingPawn();
24+
if (!pPawn)return;
25+
auto pCtrler = this->CS2->client.GetBaseEntityFromHandle(MulNX::MRead(pPawn->m_hController()))
26+
->As<CS2::CCSPlayerController>();
27+
if (!pCtrler)return;
28+
auto Symbol = MulNX::MRead(pCtrler->m_szCrosshairCodes());
29+
30+
auto str = MulNX::Memory::ReadString(Symbol.pStr).value_or("读取失败");
1331

14-
ImGui::InputText("##sharecode", code.data(), code.size() + 1,
32+
ImGui::InputText("内存准星", str.data(), str.size() + 1,
1533
ImGuiInputTextFlags_ReadOnly);
1634
ImGui::SameLine();
17-
if (ImGui::Button("复制到剪贴板")) {
18-
ImGui::SetClipboardText(code.c_str());
35+
if (ImGui::Button("复制内存准星到剪贴板")) {
36+
ImGui::SetClipboardText(str.c_str());
1937
}
2038
}
2139

source/MulNXExtensions/CS2/Feature/View/ProjectileTracker/ProjectileTracker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ static std::string GetControllerPlayerName(CS2::CCSPlayerController* pController
66
if (!pController) return "未知玩家";
77
auto namePtr = pController->m_iszPlayerName();
88
if (!namePtr) return "未知玩家";
9-
auto name = MulNX::Memory::ReadString(namePtr);
9+
auto name = MulNX::Memory::ReadString(namePtr).value_or("读取失败");
1010
return name.empty() ? "未知玩家" : name;
1111
}
1212

0 commit comments

Comments
 (0)