Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary support for Unreal Engine #95

Merged
merged 7 commits into from
Apr 1, 2024

Conversation

Jujstme
Copy link
Contributor

@Jujstme Jujstme commented Mar 26, 2024

This adds support for memory scanning in UE games, allowing to automatically resolve pointer paths.
Support is provided for UE version from 2.43 and up.

Support for older UE version seems pretty easy to add anyway, although a bit of additional coding is required to deal with the difference in the FName tables.

Example:

async fn main() {
    loop {
        let process = Process::wait_attach("UnrealGame-Win64-Shipping.exe").await;
        let main_module =
            retry(|| process.get_module_address("UnrealGame-Win64-Shipping.exe")).await;

        process
            .until_closes(async {
                let module =
                    &unreal::Module::wait_attach(process, unreal::Version::V4_24, main_module)
                        .await;

                let money = UnrealPointer::<7>::new(
                    module.g_engine(),
                    &[
                        "GameViewport",
                        "GameInstance",
                        "LocalPlayers",
                        "0x0",
                        "PlayerController",
                        "Character",
                        "TotalMoney",
                    ],
                );

                loop {
                    if let Ok(money) = money.deref::<u32>(process, module) {
                        timer::set_variable("Total money:", &money.to_string());
                    }


                    next_tick().await;
                }
            })
            .await;
    }
}

@CryZe CryZe merged commit 2d2b6d2 into LiveSplit:master Apr 1, 2024
4 checks passed
@CryZe CryZe added the enhancement New feature or request label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants