1
0
mirror of synced 2024-11-27 23:10:49 +01:00

move reg and epay hook insert to it's own function

This commit is contained in:
Kevin Trocolli 2023-12-10 18:48:40 -05:00
parent 103baa269e
commit 49c31853e6
4 changed files with 21 additions and 8 deletions

View File

@ -274,11 +274,16 @@ static void reg_hook_init(void)
} }
reg_hook_initted = true; reg_hook_initted = true;
reg_hook_apply_hooks(NULL);
InitializeCriticalSection(&reg_hook_lock); InitializeCriticalSection(&reg_hook_lock);
dprintf("Reg hook init\n"); dprintf("Reg hook init\n");
}
void reg_hook_apply_hooks(HMODULE target)
{
hook_table_apply( hook_table_apply(
NULL, target,
"advapi32.dll", "advapi32.dll",
reg_hook_syms, reg_hook_syms,
_countof(reg_hook_syms)); _countof(reg_hook_syms));

View File

@ -5,6 +5,8 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
void reg_hook_apply_hooks(HMODULE target);
struct reg_hook_val { struct reg_hook_val {
const wchar_t *name; const wchar_t *name;
HRESULT (*read)(void *bytes, uint32_t *nbytes); HRESULT (*read)(void *bytes, uint32_t *nbytes);

View File

@ -163,11 +163,7 @@ HRESULT epay_hook_init(const struct epay_config *cfg) {
epay_tcap_url1_keys, epay_tcap_url1_keys,
_countof(epay_tcap_url1_keys)); _countof(epay_tcap_url1_keys));
hook_table_apply( epay_insert_hook(NULL);
NULL,
"ThincaPayment.dll",
epay_syms,
_countof(epay_syms));
thinca_stub = (struct thinca_main *)malloc(sizeof(struct thinca_main)); thinca_stub = (struct thinca_main *)malloc(sizeof(struct thinca_main));
thinca_stub->impl1 = (struct thinca_impl *)malloc(sizeof(struct thinca_impl)); thinca_stub->impl1 = (struct thinca_impl *)malloc(sizeof(struct thinca_impl));
@ -194,6 +190,15 @@ HRESULT epay_hook_init(const struct epay_config *cfg) {
return hr; return hr;
} }
void epay_insert_hook(HMODULE target)
{
hook_table_apply(
target,
"ThincaPayment.dll",
epay_syms,
_countof(epay_syms));
}
static HRESULT misc_read_thinca_adapter(void *bytes, uint32_t *nbytes) static HRESULT misc_read_thinca_adapter(void *bytes, uint32_t *nbytes)
{ {
return reg_hook_read_wstr(bytes, nbytes, L"aime_rw_adapterMD.dll"); return reg_hook_read_wstr(bytes, nbytes, L"aime_rw_adapterMD.dll");

View File

@ -61,3 +61,4 @@ struct thinca_main {
#pragma pack(pop) #pragma pack(pop)
HRESULT epay_hook_init(const struct epay_config *cfg); HRESULT epay_hook_init(const struct epay_config *cfg);
void epay_insert_hook(HMODULE target);