move reg and epay hook insert to it's own function
This commit is contained in:
parent
103baa269e
commit
49c31853e6
@ -274,11 +274,16 @@ static void reg_hook_init(void)
|
||||
}
|
||||
|
||||
reg_hook_initted = true;
|
||||
reg_hook_apply_hooks(NULL);
|
||||
InitializeCriticalSection(®_hook_lock);
|
||||
dprintf("Reg hook init\n");
|
||||
|
||||
}
|
||||
|
||||
void reg_hook_apply_hooks(HMODULE target)
|
||||
{
|
||||
hook_table_apply(
|
||||
NULL,
|
||||
target,
|
||||
"advapi32.dll",
|
||||
reg_hook_syms,
|
||||
_countof(reg_hook_syms));
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void reg_hook_apply_hooks(HMODULE target);
|
||||
|
||||
struct reg_hook_val {
|
||||
const wchar_t *name;
|
||||
HRESULT (*read)(void *bytes, uint32_t *nbytes);
|
||||
|
@ -163,12 +163,8 @@ HRESULT epay_hook_init(const struct epay_config *cfg) {
|
||||
epay_tcap_url1_keys,
|
||||
_countof(epay_tcap_url1_keys));
|
||||
|
||||
hook_table_apply(
|
||||
NULL,
|
||||
"ThincaPayment.dll",
|
||||
epay_syms,
|
||||
_countof(epay_syms));
|
||||
|
||||
epay_insert_hook(NULL);
|
||||
|
||||
thinca_stub = (struct thinca_main *)malloc(sizeof(struct thinca_main));
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return reg_hook_read_wstr(bytes, nbytes, L"aime_rw_adapterMD.dll");
|
||||
|
@ -60,4 +60,5 @@ struct thinca_main {
|
||||
};
|
||||
|
||||
#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);
|
Loading…
Reference in New Issue
Block a user