2023-01-03 05:35:53 +01:00
|
|
|
#include <windows.h>
|
|
|
|
#include "taikohook/config.h"
|
|
|
|
|
|
|
|
#include "hook/table.h"
|
|
|
|
|
|
|
|
#include "hooklib/path.h"
|
|
|
|
|
|
|
|
#include "util/dprintf.h"
|
|
|
|
|
2023-01-04 20:24:44 +01:00
|
|
|
/*
|
|
|
|
* AMFrameWork (AMFW) is a DLL that contains many helper classes
|
2023-01-03 05:35:53 +01:00
|
|
|
* for things like input, network, dongle, and other functions that
|
2023-01-04 20:24:44 +01:00
|
|
|
* it would be useful for us to have control of. Luckily we don't have
|
|
|
|
* to reinvent the wheel for the most part, we can just hook the functions
|
2023-01-03 05:35:53 +01:00
|
|
|
* that AMFW uses and let it talk to the game for us.
|
|
|
|
*/
|
|
|
|
|
|
|
|
HRESULT amfw_hook_init(wchar_t serial[13])
|
|
|
|
{
|
|
|
|
HANDLE hMod;
|
|
|
|
|
|
|
|
dprintf("AMFW: Init\n");
|
|
|
|
|
|
|
|
hMod = GetModuleHandle("AMFrameWork.dll");
|
2023-01-04 20:24:44 +01:00
|
|
|
|
2023-01-03 05:35:53 +01:00
|
|
|
if (hMod == NULL) {
|
|
|
|
dprintf("AMFW: DLL not found, disabling\n");
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
dprintf("AMFW: Found AMFrameWork Handle\n");
|
|
|
|
|
|
|
|
path_hook_insert_hooks(hMod);
|
2023-01-04 20:24:44 +01:00
|
|
|
|
2023-01-03 05:35:53 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|