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

[linux] Dynohook confirmed issue #574

Open
Nianmou opened this issue Sep 14, 2024 · 10 comments
Open

[linux] Dynohook confirmed issue #574

Nianmou opened this issue Sep 14, 2024 · 10 comments
Labels
untriaged New issue has not been triaged

Comments

@Nianmou
Copy link

Nianmou commented Sep 14, 2024

        new("55 48 8D 35 ? ? ? ? 48 89 E5 41 57 41 56 41 55 41 54 53 48 89 FB 48 8D 3D ? ? ? ? 48 81 EC ? ? ? ? E8 ? ? ? ? 4C 8B 63", Addresses.ServerPath);
    private HookResult hk_CCSBot_FindMostDangerousThreat(DynamicHook hook)
    {
        //hook.SetReturn(0);
        Server.PrintToChatAll("hook Bot_FindMostDangerousThreat");
        return HookResult.Handled;
    }
    [ConsoleCommand("hook", "hook")]
    public void OnCommand(CCSPlayerController? player, CommandInfo command)
    {
        Console.WriteLine("---------------------------hook--------------------------------");
        CCSBotFindMostDangerousThreatFull.Hook(hk_CCSBot_FindMostDangerousThreat, HookMode.Pre);
        Console.WriteLine("---------------------------hook end--------------------------------");
    }```This code currently throws an error on csshook
    
    
@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

[Info] - Trampoline - Bounds of relative addresses accessed [0xffffffffffffffff, 0x7f7921be6d20]
[Info] - Trampoline - Attempting to allocate trampoline within +-2GB range of [0xffffffffffffffff, 0x7f7921be6d20] with a trampoline maximum size of 1000
[Warning] - Trampoline - Could not allocate trampoline within desired range. We currently can't relocate rip-relative instructions in this case!
[Error] - Trampoline - The trampoline could not be allocated withing +-2GB range. The instructions at the hook address do contain rip-relative memory access. Relocating those is not supported when the trampoline is not in +-2GB range!
[Error] - Detour - Failed to allocate trampoline

@github-actions github-actions bot added the untriaged New issue has not been triaged label Sep 14, 2024
@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

Signature has been confirmed to be in order

@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

This code currently throws an error on csshook

@KillStr3aK
Copy link
Contributor

Do you have any information about this on windows?

@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

Do you have any information about this on windows?你有关于Windows的信息吗?

48 89 4C 24 ? 55 53 56 41 57

@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

Do you have any information about this on windows?你有关于Windows的信息吗?

I'll go back and try win in 3 hours.
//CCSPlayer *CCSBot::FindMostDangerousThreat( void )
//WIN:
//48 89 4C 24 ? 55 53 56 41 57
//LINUX:
//55 48 8D 35 48 A8 05 01
//55 48 8D 35 ? ? ? ? 48 89 E5 41 57 41 56 41 55 41 54 53 48 89 FB 48 8D 3D ? ? ? ? 48 81 EC ? ? ? ? E8 ? ? ? ? 4C 8B 63

@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

private MemoryFunctionWithReturn<nint> CCSBotFindMostDangerousThreatFull = new("55 48 8D 35 ? ? ? ? 48 89 E5 41 57 41 56 41 55 41 54 53 48 89 FB 48 8D 3D ? ? ? ? 48 81 EC ? ? ? ? E8 ? ? ? ? 4C 8B 63", Addresses.ServerPath);
I feel like the incoming type should be CCSBot or one or two nints

@Mateshaopu
Copy link

[Info] - Trampoline - Bounds of relative addresses accessed [FFFFFFFFFFFFFFFF, 0000000000000000]
[Info] - Trampoline - Attempting to allocate trampoline within +-2GB range of 00007FF9589890F0
[Info] - Trampoline - Allocated trampoline at 00007FF9D8980000 (using 1 attempts)
---------------------------hook end--------------------------------
[17:24:01.246] CSSharp: Native 376a0359 was invoked on a non-main thread[Error] - Hook - Failed to find return address of original function. Check the arguments and return type of your detour setup.

1 similar comment
@Nianmou
Copy link
Author

Nianmou commented Sep 14, 2024

[Info] - Trampoline - Bounds of relative addresses accessed [FFFFFFFFFFFFFFFF, 0000000000000000]
[Info] - Trampoline - Attempting to allocate trampoline within +-2GB range of 00007FF9589890F0
[Info] - Trampoline - Allocated trampoline at 00007FF9D8980000 (using 1 attempts)
---------------------------hook end--------------------------------
[17:24:01.246] CSSharp: Native 376a0359 was invoked on a non-main thread[Error] - Hook - Failed to find return address of original function. Check the arguments and return type of your detour setup.

@KillStr3aK
Copy link
Contributor

Windows: 48 89 4C 24 08 55 53 56 41 54 41 57 48 8D AC 24 E0 FE FF FF
it seems to work as intended for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

3 participants