From 5c99ef198838f2d96136159fc6d85d84310bd94f Mon Sep 17 00:00:00 2001 From: Tau Date: Wed, 4 Sep 2019 13:46:46 -0400 Subject: [PATCH] cardhook: Use platform DNS hook aimeReaderHost.exe talks to aimedb as well as the card reader. --- cardhook/dllmain.c | 13 ++++++++++--- cardhook/meson.build | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cardhook/dllmain.c b/cardhook/dllmain.c index 3c979e6..8d317e2 100644 --- a/cardhook/dllmain.c +++ b/cardhook/dllmain.c @@ -10,20 +10,27 @@ #include "hooklib/serial.h" #include "hooklib/spike.h" +#include "platform/config.h" +#include "platform/dns.h" + #include "util/dprintf.h" -// Emulating an AiMe reader is the only thing this hook DLL does -static const struct aime_config app_aime_config = { .enable = true }; +static struct aime_config app_aime_config; +static struct dns_config app_dns_config; static process_entry_t app_startup; static DWORD CALLBACK app_pre_startup(void) { dprintf("--- Begin %s ---\n", __func__); - spike_hook_init("cardspike.txt"); + aime_config_load(&app_aime_config, L"segatools.ini"); + dns_config_load(&app_dns_config, L"segatools.ini"); serial_hook_init(); sg_reader_hook_init(&app_aime_config, 12); + dns_platform_hook_init(&app_dns_config); + + spike_hook_init("cardspike.txt"); dprintf("--- End %s ---\n", __func__); diff --git a/cardhook/meson.build b/cardhook/meson.build index 6573f7a..1dd59f2 100644 --- a/cardhook/meson.build +++ b/cardhook/meson.build @@ -12,6 +12,7 @@ shared_library( aimeio_dll, board_lib, hooklib_lib, + platform_lib, util_lib, ], sources : [