Skip to content

Commit feb85f8

Browse files
committed
Again for sync
2 parents a293208 + 86a7b02 commit feb85f8

File tree

15 files changed

+131
-572
lines changed

15 files changed

+131
-572
lines changed

CMakeLists.txt

100755100644
File mode changed.

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ SPDX-FileCopyrightText = "2019-2024 Baldur Karlsson"
6565
SPDX-License-Identifier = "MIT"
6666

6767
[[annotations]]
68-
path = "externals/stb_image.h"
68+
path = "externals/stb/**"
6969
precedence = "aggregate"
7070
SPDX-FileCopyrightText = "2017 Sean Barrett"
7171
SPDX-License-Identifier = "MIT"

src/common/memory_patcher.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include <algorithm>
55
#include <codecvt>
6+
#include <fstream>
7+
#include <iostream>
68
#include <sstream>
79
#include <string>
810
#include <pugixml.hpp>
@@ -118,6 +120,18 @@ std::string convertValueToHex(const std::string type, const std::string valueStr
118120

119121
void OnGameLoaded() {
120122

123+
if (g_game_serial == "CUSA03173" || g_game_serial == "CUSA00900" ||
124+
g_game_serial == "CUSA00299" || g_game_serial == "CUSA00207") {
125+
std::filesystem::path savedir = Common::FS::GetUserPath(Common::FS::PathType::SaveDataDir) /
126+
"1" / g_game_serial / "SPRJ0005";
127+
128+
std::ofstream savefile1;
129+
savefile1.open(savedir / "userdata0010.", std::ios::in | std::ios::out | std::ios::binary);
130+
savefile1.seekp(0x204E);
131+
savefile1.put(0x1);
132+
savefile1.close();
133+
}
134+
121135
if (!patchFile.empty()) {
122136
std::filesystem::path patchDir = Common::FS::GetUserPath(Common::FS::PathType::PatchesDir);
123137

@@ -443,4 +457,4 @@ uintptr_t PatternScan(const std::string& signature) {
443457
return 0;
444458
}
445459

446-
} // namespace MemoryPatcher
460+
} // namespace MemoryPatcher

src/common/ntapi.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,18 @@
55

66
#include "ntapi.h"
77

8-
NtClose_t NtClose = nullptr;
8+
NtDelayExecution_t NtDelayExecution = nullptr;
99
NtSetInformationFile_t NtSetInformationFile = nullptr;
10-
NtCreateThread_t NtCreateThread = nullptr;
11-
NtTerminateThread_t NtTerminateThread = nullptr;
1210

1311
namespace Common::NtApi {
1412

1513
void Initialize() {
1614
HMODULE nt_handle = GetModuleHandleA("ntdll.dll");
1715

1816
// http://stackoverflow.com/a/31411628/4725495
19-
NtClose = (NtClose_t)GetProcAddress(nt_handle, "NtClose");
17+
NtDelayExecution = (NtDelayExecution_t)GetProcAddress(nt_handle, "NtDelayExecution");
2018
NtSetInformationFile =
2119
(NtSetInformationFile_t)GetProcAddress(nt_handle, "NtSetInformationFile");
22-
NtCreateThread = (NtCreateThread_t)GetProcAddress(nt_handle, "NtCreateThread");
23-
NtTerminateThread = (NtTerminateThread_t)GetProcAddress(nt_handle, "NtTerminateThread");
2420
}
2521

2622
} // namespace Common::NtApi

0 commit comments

Comments
 (0)