Fix GetProcAddress issue on ARM64 (#5)

See [TeamTofuShop/segatools/issues/20](https://gitea.tendokyu.moe/TeamTofuShop/segatools/issues/20).

This PR adds `pe_is_arm64` for detecting ARM64 systems and `pe_get_arm64_real_proc` for retrieving the real thread address.

I'm still getting familiar with the project, so I’d really appreciate any feedback, suggestions, or corrections.

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/capnhook/pulls/5
Co-authored-by: oldkingOK <oldkingok@qq.com>
Co-committed-by: oldkingOK <oldkingok@qq.com>
This commit is contained in:
oldkingOK
2026-08-10 15:38:40 +00:00
committed by Dniel97
parent 25be44b13f
commit e45e2ed352
3 changed files with 67 additions and 0 deletions
+3
View File
@@ -73,6 +73,9 @@ static HRESULT process_hijack_try_thread(
exe_entry = pe_get_entry_point(exe);
ntstart = GetProcAddress(ntdll, "RtlUserThreadStart");
if (pe_is_arm64()) {
ntstart = pe_thunk_resolve(ntstart);
}
if (ntstart == NULL) {
/* TODO Deal with WinXP, for the poor souls still stuck on that OS.