removed prints, added phantom device

This commit is contained in:
Hay1tsme 2021-12-30 00:51:44 -05:00
parent 40ce4d1bb3
commit fe9f78b016
5 changed files with 15 additions and 13 deletions

View File

@ -284,8 +284,6 @@ static HMODULE WINAPI hook_LoadLibraryW(const wchar_t *name)
{ {
HMODULE result; HMODULE result;
dprintf("hook_LoadLibraryW: Loading %S\n", name);
if (name == NULL) { if (name == NULL) {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);

View File

@ -196,7 +196,6 @@ static BOOL WINAPI my_SetupDiEnumDeviceInterfaces(
DWORD MemberIndex, DWORD MemberIndex,
SP_DEVICE_INTERFACE_DATA *DeviceInterfaceData) SP_DEVICE_INTERFACE_DATA *DeviceInterfaceData)
{ {
dprintf("my_SetupDiEnumDeviceInterfaces hit!\n");
const struct setupapi_class *class_; const struct setupapi_class *class_;
size_t i; size_t i;

View File

@ -1,3 +1,4 @@
#include <initguid.h>
#include <windows.h> #include <windows.h>
#include <assert.h> #include <assert.h>
@ -36,8 +37,7 @@ static const struct hook_symbol win32_hooks[] = {
}; };
static const wchar_t *target_modules[] = { static const wchar_t *target_modules[] = {
L"USBIntLED.DLL", L"USBIntLED.DLL"
L"ftd2XX.dll",
}; };
static const size_t target_modules_len = _countof(target_modules); static const size_t target_modules_len = _countof(target_modules);
@ -45,6 +45,7 @@ static const size_t target_modules_len = _countof(target_modules);
void elisabeth_hook_init() void elisabeth_hook_init()
{ {
dll_hook_insert_hooks(NULL); dll_hook_insert_hooks(NULL);
setupapi_add_phantom_dev(&elisabeth_guid, L"USB\\VID_0403&PID_6001");
} }
static void dll_hook_insert_hooks(HMODULE target) static void dll_hook_insert_hooks(HMODULE target)
@ -65,8 +66,6 @@ static HMODULE WINAPI my_LoadLibraryW(const wchar_t *name)
size_t name_len; size_t name_len;
size_t target_module_len; size_t target_module_len;
dprintf("Elisabeth: Trying to load %S\n", name);
if (name == NULL) { if (name == NULL) {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
@ -118,7 +117,7 @@ FARPROC WINAPI my_GetProcAddress(HMODULE hModule, const char *name)
if (ordinal > 0xFFFF) { if (ordinal > 0xFFFF) {
/* Import by name */ /* Import by name */
dprintf("Elisabeth: GetProcAddress %s is %p\n", name, result); //dprintf("Elisabeth: GetProcAddress %s is %p\n", name, result);
} }
return result; return result;

View File

@ -1,3 +1,11 @@
#pragma once #pragma once
#include <initguid.h>
DEFINE_GUID(
elisabeth_guid,
0x219D058,
0x57A8,
0x4FF5,
0x97, 0x1A, 0xBD, 0x86, 0x58, 0x7C, 0x6C, 0x7E);
void elisabeth_hook_init(); void elisabeth_hook_init();

View File

@ -7,8 +7,6 @@
#include "mercuryio/config.h" #include "mercuryio/config.h"
static uint8_t mercury_opbtn; static uint8_t mercury_opbtn;
static uint16_t mercury_player1_btn;
static uint16_t mercury_player2_btn;
static struct mercury_io_config mercury_io_cfg; static struct mercury_io_config mercury_io_cfg;
uint16_t mercury_io_get_api_version(void) uint16_t mercury_io_get_api_version(void)