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

Fixed fov for cannon and helm (feature request) #2

Open
terpii opened this issue Aug 24, 2022 · 6 comments
Open

Fixed fov for cannon and helm (feature request) #2

terpii opened this issue Aug 24, 2022 · 6 comments

Comments

@terpii
Copy link

terpii commented Aug 24, 2022

Would be nice if the fov stays the same during cannon and helm.
I tried to implement this myself, but I'm confused how one finds the pattern for the functions to hook.
My idea would be to hook cannon and helm functions you can probably find in this list and just run the same that we would run when we trap the fov call.
I'm just not sure how to convert the memory address in the list to the byte array used to find the fov function.

@superkooks
Copy link
Owner

superkooks commented Aug 25, 2022

I'll look into it. I don't really know how the function signature was found, I copied it from https://github.com/NtLoadDriverEx/fov_hk. The signature is simply the first 10 bytes of the function. I'm not exactly sure how this function was found, but I do know that it accepts a pointer to the struct as it's first argument, so somewhere must a function that does the same thing, but potentially with a different struct.

I can't find the current function in the list by it's address, but it could have a different for different versions and platforms. By my reckoning the function we are hooking is this one:
0x00007FF745C90010 , UFOVHandlerFunctions::execSetTargetFOV "void UFOVHandlerFunctions::SetTargetFOV(AAthenaPlayerCharacter* Character, float TargetFOV)"

@superkooks
Copy link
Owner

I've been thinking about this issue. I don't see a realistic way to do this. The only way to really do this is collect all function calls that happen when the user uses the cannon, and then try to map each one to a function in the list you provided. Then you look for function calls mentioning fov, or at least the AAthenaPlayerCharacter and try set breakpoints on each. The problem is that the list you posted isn't accurate on linux, which makes it impossible to look through the function calls.

Maybe the addresses line up on windows? I am unable to test this as my Sea of Thieves is installed on a ext4 partition, which isn't accessible from windows, and I can't run the game in a VM because it doesn't support DX11. If you have Sea of Thieves installed on windows, maybe you could use WinDbg to view the address 0x00007FF745C90010 and see if it lines up with the function signature we use, 40 57 48 83 EC 30 80 79 44 00. Right now that seems the only way forward.

@superkooks
Copy link
Owner

Update:
I managed to start Sea of Thieves on Windows, but whenever I attach WinDbg, it crashes the game, meaning I am unable to do any debugging. Unless it works for someone else, I don't see any way to support this.

@terpii
Copy link
Author

terpii commented Sep 1, 2022

You can also use WinDbg on Linux using protonhax. Its probably better because we wanna develop it for Linux anyway.

@terpii terpii closed this as completed Sep 1, 2022
@terpii
Copy link
Author

terpii commented Sep 1, 2022

Sorry didn't want to close this

@superkooks superkooks reopened this Sep 1, 2022
@superkooks
Copy link
Owner

superkooks commented Sep 2, 2022

I've taken another crack at this, but it hasn't worked either. I extracted the list of functions for the latest version using https://github.com/guttir14/UnrealDumper-4.25 (UnrealDumper-4.10 branch). Then I used the generated header files to find the address of other functions, based on the address of the known function. It didn't work, all I ended up with were segfaults.

Protonhax looks cool, but I couldn't install CheatEngine, so... not very useful to me. I ended using WinDbg as a disassembler/memory inspector, then copying the byte sequence of the function so I could use find it on linux using gdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants