mirror of
https://gitea.tendokyu.moe/TeamTofuShop/capnhook.git
synced 2026-09-22 22:38:12 +03:00
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>
30 lines
763 B
C
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);
|