Skip to content

Commit f0329fd

Browse files
authored
Merge pull request #1084 from UE4SS-RE/ps-update
update patternsleuth
2 parents 518bcd0 + 6aece27 commit f0329fd

File tree

3 files changed

+48
-10
lines changed

3 files changed

+48
-10
lines changed

UE4SS/src/Signatures.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <Unreal/Signatures.hpp>
1414
#include <Unreal/UObject.hpp>
1515
#include <Unreal/UObjectArray.hpp>
16+
#include <Unreal/UEngine.hpp>
1617
#include <Unreal/UnrealInitializer.hpp>
1718

1819
#include <Helpers/String.hpp>
@@ -442,5 +443,31 @@ namespace RC
442443
});
443444
};
444445
}
446+
447+
auto lua_gameengine_tick_scan_script = working_directory / "UE4SS_Signatures/GameEngineTick.lua";
448+
if (std::filesystem::exists(lua_gameengine_tick_scan_script))
449+
{
450+
config.ScanOverrides.gameengine_tick =
451+
[lua_gameengine_tick_scan_script](std::vector<SignatureContainer>& signature_containers,
452+
Unreal::Signatures::ScanResult& scan_result) mutable {
453+
scan_from_lua_script(
454+
lua_gameengine_tick_scan_script,
455+
signature_containers,
456+
[](void* address) {
457+
Output::send(STR("GameEngine::Tick address: {} "
458+
"<- Lua Script\n"),
459+
address);
460+
Unreal::UEngine::TickInternal.assign_address(address);
461+
return DidLuaScanSucceed::Yes;
462+
},
463+
[&](DidLuaScanSucceed did_lua_scan_succeed) {
464+
if (did_lua_scan_succeed == DidLuaScanSucceed::No)
465+
{
466+
scan_result.Errors.emplace_back("Was unable to find AOB for "
467+
"'GameEngine::Tick' via Lua script");
468+
}
469+
});
470+
};
471+
}
445472
}
446473
} // namespace RC

deps/first/patternsleuth_bind/src/lib.rs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use patternsleuth::resolvers::{
1515
fuobject_hash_tables::FUObjectHashTablesGet,
1616
kismet::GNatives,
1717
ConsoleManagerSingleton,
18+
game_loop::UGameEngineTick,
1819
},
1920
ResolveError,
2021
};
@@ -32,6 +33,7 @@ impl_collector! {
3233
fuobject_hash_tables_get: FUObjectHashTablesGet,
3334
gnatives: GNatives,
3435
console_manager_singleton: ConsoleManagerSingleton,
36+
gameengine_tick: UGameEngineTick,
3537
}
3638
}
3739

@@ -82,20 +84,22 @@ pub struct PsScanConfig {
8284
fuobject_hash_tables_get: bool,
8385
gnatives: bool,
8486
console_manager_singleton: bool,
87+
gameengine_tick: bool,
8588
}
8689

8790
#[repr(C)]
8891
pub struct PsScanResults {
89-
guobject_array: usize,
90-
fname_tostring: usize,
91-
fname_ctor_wchar: usize,
92-
gmalloc: usize,
93-
static_construct_object_internal: usize,
94-
ftext_fstring: usize,
92+
guobject_array: u64,
93+
fname_tostring: u64,
94+
fname_ctor_wchar: u64,
95+
gmalloc: u64,
96+
static_construct_object_internal: u64,
97+
ftext_fstring: u64,
9598
engine_version: PsEngineVersion,
96-
fuobject_hash_tables_get: usize,
97-
gnatives: usize,
98-
console_manager_singleton: usize,
99+
fuobject_hash_tables_get: u64,
100+
gnatives: u64,
101+
console_manager_singleton: u64,
102+
gameengine_tick: u64,
99103
}
100104

101105
#[derive(Debug, Default)]
@@ -205,6 +209,13 @@ pub fn ps_scan_internal(ctx: &PsCtx, results: &mut PsScanResults) -> Result<(),
205209
true
206210
);
207211

212+
handle!(
213+
gameengine_tick,
214+
"GameEngineTick",
215+
"GameEngineTick.lua",
216+
true
217+
);
218+
208219
if errors.0.is_empty() {
209220
Ok(())
210221
} else {

0 commit comments

Comments
 (0)