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

Kitty Kart 64 FMOD fails to be hooked #624

Open
CasualPokePlayer opened this issue Nov 8, 2024 · 1 comment
Open

Kitty Kart 64 FMOD fails to be hooked #624

CasualPokePlayer opened this issue Nov 8, 2024 · 1 comment

Comments

@CasualPokePlayer
Copy link
Contributor

https://snugboat11.itch.io/kitty-kart-64

Godot game which uses FMOD. FMOD::System::setOutput is called eventually, but it only calls the native function, not calling the hooked function. As such, PulseAudio is used which is not hooked.

@CasualPokePlayer
Copy link
Contributor Author

CasualPokePlayer commented Nov 8, 2024

Seems the issue comes with dlopen flags.

The game initially dlopen's with libfmod.linux.template_debug.so, which eventually tries to resolve symbols against libfmodL.so.13 and libfmodstudioL.so.13. It uses the RTLD_NOW | RTLD_DEEPBIND flags here. The docs on RTLD_DEEPBIND seem to indicate this is problematic:

RTLD_DEEPBIND (since glibc 2.3.4)
    Place the lookup scope of the symbols in this library ahead of the global scope. This means that a self-contained library will use its own symbols in preference to global symbols with the same name contained in libraries that have already been loaded. This flag is not specified in POSIX.1-2001.

This would effectively prevent the LD_PRELOAD trick from working at all. It's probably also why it appears to be able to dlopen libpulse.so.0 despite that normally being blocked by libTAS (since the dlopen hook is also bypassed). This flag could possibly also cause issues in other games perhaps, since again, it just completely prevents the LD_PRELOAD trick from working at all.

The different naming here might also be an issue here regardless with the hooked function perhaps? (L appears to be a logging variant of fmod, although the game also provides regular unused fmod .so's too so perhaps it'd work fine regardless).

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

1 participant