Skip to content

Commit 9fe90b5

Browse files
committed
v2: Merge upstream master (36 commits) with universal dispatch preservation
Upstream additions integrated: - LooseTextureLoader mod (TDB>=81 runtime-gated) - FaultyFileDetector TDB>=81 runtime-gated toast notifications - IntegrityCheckBypass: RE9 heartbeat bypass + MHSTORIES3 hardening - SDK Renderer migration: intrusive_ptr, command namespace, Texture::Desc, set_rtv, Overlay accessors, clear_rtv, alloc - RenderResource conditional padding (TDB>=73 / TDB>=82) with runtime get_runtime_size() helper in universal mode - STARFORCE (Mega Man Star Force Legacy Collection, TDB 78) support - FreeCam RE9 cutscene joint helpers (runtime tdb>=81 gate) - Memory allocate_plugin_loader indirection - ObjectExplorer unhook-all + auto-unhook tooling New dispatches added to universal build: - GameID::STARFORCE enum + exe mapping (starforce/megamanstarforce) - TDB 78 case routes through tdb74 layout in TDB_DISPATCH, TDB_DISPATCH_69, TDB_DISPATCH_PTR(_69), TIMPL_DISPATCH - Runtime RenderResource::get_runtime_size() replacing compile-time sizeof(RenderResource) in DirectXResource::get_native_resource - Runtime Texture::get_s_desc_offset / get_s_d3d12_resource_offset expanded to cover TDB>=73 / SF6 / MHRISE / RE4 cases - Runtime rtv_size() helper replacing compile-time detail::rtv_size - DRAW_VTABLE_INDEX runtime dispatch adds TDB>=81 => 15 tier - RenderTargetView::get_texture_d3d12 tier dispatch on tdb_ver - REGlobals TDB_VER>=78 checks converted to runtime tdb_ver()>=78 - ENABLE_LOOSE_TEXTURE_LOADER / FAULTY_FILE_DETECTOR_ENABLED macros unconditionally 1 in universal, gated at runtime Build deps: - bddisasm 70db0957 - kananlib 8c27b656 Tested: builds cleanly, main DLL produced.
2 parents 842fabf + 8dc91e6 commit 9fe90b5

38 files changed

Lines changed: 4807 additions & 505 deletions

.github/workflows/build-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: windows-latest
88
strategy:
99
matrix:
10-
target: [RE2, RE2_TDB66, RE3, RE3_TDB67, RE4, RE7, RE7_TDB49, RE8, RE9, DMC5, MHRISE, SF6, DD2, MHWILDS, PRAGMATA, MHSTORIES3]
10+
target: [RE2, RE2_TDB66, RE3, RE3_TDB67, RE4, RE7, RE7_TDB49, RE8, RE9, DMC5, MHRISE, SF6, DD2, MHWILDS, PRAGMATA, MHSTORIES3, STARFORCE]
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

.github/workflows/dev-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
runs-on: windows-latest
4646
strategy:
4747
matrix:
48-
target: [RE2, RE2_TDB66, RE3, RE3_TDB67, RE4, RE7, RE7_TDB49, RE8, RE9, DMC5, MHRISE, SF6, DD2, MHWILDS, PRAGMATA, MHSTORIES3]
48+
target: [RE2, RE2_TDB66, RE3, RE3_TDB67, RE4, RE7, RE7_TDB49, RE8, RE9, DMC5, MHRISE, SF6, DD2, MHWILDS, PRAGMATA, MHSTORIES3, STARFORCE]
4949
steps:
5050
- name: Checkout
5151
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,21 @@ FetchContent_Declare(freetype
138138
)
139139
FetchContent_MakeAvailable(freetype)
140140

141-
message(STATUS "Fetching bddisasm (v1.34.10)...")
141+
message(STATUS "Fetching bddisasm (70db095765ab2066dd88dfb7bbcc42259ed167c5)...")
142142
FetchContent_Declare(bddisasm
143143
GIT_REPOSITORY
144144
"https://github.com/bitdefender/bddisasm"
145145
GIT_TAG
146-
v1.34.10
146+
70db095765ab2066dd88dfb7bbcc42259ed167c5
147147
)
148148
FetchContent_MakeAvailable(bddisasm)
149149

150-
message(STATUS "Fetching kananlib (7109f03a487be4db05ff3950981c9d303a260680)...")
150+
message(STATUS "Fetching kananlib (8c27b656734355db0f2893581fd62e838fa130ad)...")
151151
FetchContent_Declare(kananlib
152152
GIT_REPOSITORY
153153
"https://github.com/cursey/kananlib"
154154
GIT_TAG
155-
7109f03a487be4db05ff3950981c9d303a260680
155+
8c27b656734355db0f2893581fd62e838fa130ad
156156
)
157157
FetchContent_MakeAvailable(kananlib)
158158

@@ -485,6 +485,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
485485
"shared/sdk/ReClass_Internal_MHSTORIES3.hpp"
486486
"shared/sdk/ReClass_Internal_MHWILDS.hpp"
487487
"shared/sdk/ReClass_Internal_PRAGMATA.hpp"
488+
"shared/sdk/ReClass_LooseTextureLoader_Internal.hpp"
488489
"shared/sdk/ReClass_Internal_RE2_TDB70.hpp"
489490
"shared/sdk/ReClass_Internal_RE3.hpp"
490491
"shared/sdk/ReClass_Internal_RE3_TDB70.hpp"
@@ -1404,6 +1405,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
14041405
"src/ExceptionHandler.cpp"
14051406
"src/ExceptionHandler.hpp"
14061407
"src/Genny.hpp"
1408+
"src/DisasmUtils.hpp"
14071409
"src/GennyIda.hpp"
14081410
"src/HookManager.cpp"
14091411
"src/HookManager.hpp"
@@ -1443,6 +1445,8 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
14431445
"src/mods/IntegrityCheckBypass.hpp"
14441446
"src/mods/LooseFileLoader.cpp"
14451447
"src/mods/LooseFileLoader.hpp"
1448+
"src/mods/LooseTextureLoader.cpp"
1449+
"src/mods/LooseTextureLoader.hpp"
14461450
"src/mods/ManualFlashlight.cpp"
14471451
"src/mods/ManualFlashlight.hpp"
14481452
"src/mods/MethodDatabase.cpp"

cmake.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ condition = "build-framework"
175175

176176
[fetch-content.bddisasm]
177177
git = "https://github.com/bitdefender/bddisasm"
178-
tag = "v1.34.10"
178+
tag = "70db095765ab2066dd88dfb7bbcc42259ed167c5"
179179

180180
[fetch-content.kananlib]
181181
git = "https://github.com/cursey/kananlib"
182-
tag = "7109f03a487be4db05ff3950981c9d303a260680"
182+
tag = "8c27b656734355db0f2893581fd62e838fa130ad"
183183

184184
[target.utility]
185185
type = "static"

csharp-api/REFCoreDeps/PipeServer.cs

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ static void ServerLoop()
154154
pipe = null; // prevent finally from disposing
155155
var clientThread = new Thread(() => {
156156
try { HandleClient(clientPipe, token); }
157+
catch (Exception ex) { Console.WriteLine("[PipeServer] Client error: " + ex.Message); }
157158
finally { try { clientPipe.Dispose(); } catch { } }
158159
}) { IsBackground = true, Name = "PipeServer.Client" };
159160
clientThread.Start();
@@ -178,46 +179,54 @@ static void ServerLoop()
178179

179180
static void HandleClient(NamedPipeServerStream pipe, CancellationToken token)
180181
{
181-
using var reader = new StreamReader(pipe, s_utf8NoBom, detectEncodingFromByteOrderMarks: false, leaveOpen: true);
182-
using var writer = new StreamWriter(pipe, s_utf8NoBom, leaveOpen: true) { AutoFlush = true };
182+
var reader = new StreamReader(pipe, s_utf8NoBom, detectEncodingFromByteOrderMarks: false, leaveOpen: true);
183+
var writer = new StreamWriter(pipe, s_utf8NoBom, leaveOpen: true) { AutoFlush = true };
183184

184-
while (!token.IsCancellationRequested && pipe.IsConnected)
185+
try
185186
{
186-
string line;
187-
try
188-
{
189-
line = reader.ReadLine();
190-
}
191-
catch
187+
while (!token.IsCancellationRequested && pipe.IsConnected)
192188
{
193-
break; // pipe broken
194-
}
189+
string line;
190+
try
191+
{
192+
line = reader.ReadLine();
193+
}
194+
catch
195+
{
196+
break; // pipe broken
197+
}
195198

196-
if (line == null) break; // client disconnected
199+
if (line == null) break; // client disconnected
197200

198-
line = line.Trim();
199-
if (line.Length == 0) continue;
201+
line = line.Trim();
202+
if (line.Length == 0) continue;
200203

201-
string response;
202-
try
203-
{
204-
response = DispatchRequest(line);
205-
}
206-
catch (Exception ex)
207-
{
208-
response = JsonSerializer.Serialize(new { id = 0, error = ex.Message });
209-
}
204+
string response;
205+
try
206+
{
207+
response = DispatchRequest(line);
208+
}
209+
catch (Exception ex)
210+
{
211+
response = JsonSerializer.Serialize(new { id = 0, error = ex.Message });
212+
}
210213

211-
try
212-
{
213-
writer.WriteLine(response);
214-
pipe.Flush();
215-
}
216-
catch
217-
{
218-
break; // pipe broken
214+
try
215+
{
216+
writer.WriteLine(response);
217+
pipe.Flush();
218+
}
219+
catch
220+
{
221+
break; // pipe broken
222+
}
219223
}
220224
}
225+
finally
226+
{
227+
try { writer.Dispose(); } catch { }
228+
try { reader.Dispose(); } catch { }
229+
}
221230

222231
Console.WriteLine("[PipeServer] Client disconnected");
223232
}

csharp-api/cmake.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ set_dotnet_references(CSharpAPITestWebAPI "mhwilds" "${MHWILDS_DLLS}")
282282
[target.CSharpAPITestRE9]
283283
condition = "build-csharp-test-re9"
284284
type = "CSharpSharedTarget"
285-
sources = ["test/Test/TestRE9.cs"]
285+
sources = ["test/Test/ZombieSpawner.cs"]
286286
link-libraries = ["csharp-api"]
287287
cmake-after = """
288288
set_dotnet_references(CSharpAPITestRE9 "re9" "${RE9_DLLS}")

0 commit comments

Comments
 (0)