Files
TeamTofuShop_capnhook/hook/pe.h
T
oldkingOK e45e2ed352 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>
2026-08-10 15:38:40 +00:00

30 lines
763 B
C

#pragma once
#include <windows.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
typedef IMAGE_IMPORT_DESCRIPTOR pe_iid_t;
struct pe_iat_entry {
const char *name;
uint16_t ordinal;
void **ppointer;
};
const pe_iid_t *pe_iid_get_first(HMODULE pe);
const char *pe_iid_get_name(HMODULE pe, const pe_iid_t *iid);
const pe_iid_t *pe_iid_get_next(HMODULE pe, const pe_iid_t *iid);
HRESULT pe_iid_get_iat_entry(
HMODULE pe,
const pe_iid_t *iid,
size_t n,
struct pe_iat_entry *entry);
void *pe_get_export(HMODULE pe, const char *name, uint16_t ord);
void *pe_get_entry_point(HMODULE pe);
HRESULT pe_patch(void *dest, const void *src, size_t nbytes);
BOOL pe_is_arm64();
void *pe_thunk_resolve(FARPROC proc);