* popnhook1 for pop'n 15 - 18 has been added * popnio has been added * inject.exe has new syntax for loading hook DLLs, `real.dll=hook.dll`. This will trigger an early IAT hook where it will load the EXE suspended without resolving imports, replace the reference to real.dll in the import table with hook.dll, and then resolve everything before launching. This allows for ezusb.dll to be hooked properly. * launcher.exe also has a new early IAT hook feature now. Use `-I real.dll=hook.dll`. The idea is the same as described above for inject.exe. * Updated ezusb constant namings based on what is visible in ezusb.dll's debug statements. The launcher.exe implementation of early IAT hooking means that someone can implement popnhook2.dll for 19 and above. I have tried pop'n music Sunny Park using a modified version of popnhook1 and it seems to work to some degree: the I/O check and security check returns OK which means the ezusb hooking used in popnhook1 is also working for the later games using `launcher.exe -I ezusb.dll=ezusb2-popn-shim.dll ...`. The process is rather invasive (manually resolving all imports means more chances to fail) so it has been implemented in such a way that the launcher will work the same as it has before as long as `-I` isn't specified. One questionable thing I am not confident about is the `texture_usage_fix` hack flag I added in the conf. As the comment says, pop'n music 16 will work in Windows XP without the flag being set, but the game will immediately crash on later OSes without the flag being set in my experience. No other games had this issue in my experience. Enabling it in other games doesn't seem to have any negative effects.
33 lines
942 B
C
33 lines
942 B
C
#pragma once
|
|
|
|
#include <windows.h>
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
typedef IMAGE_IMPORT_DESCRIPTOR pe_iid_t;
|
|
typedef IMAGE_THUNK_DATA pe_thunk_t;
|
|
|
|
typedef DWORD (CALLBACK *dll_entry_t)(HMODULE self, DWORD reason, void *ctx);
|
|
|
|
struct pe_iat_entry {
|
|
const char *name;
|
|
uint16_t ordinal;
|
|
void **ppointer;
|
|
};
|
|
|
|
const pe_iid_t *pe_iid_get_first(HMODULE pe);
|
|
const char *pe_iid_get_name(HMODULE pe, const pe_iid_t *iid);
|
|
const pe_iid_t *pe_iid_get_next(HMODULE pe, const pe_iid_t *iid);
|
|
HRESULT pe_iid_get_iat_entry(
|
|
HMODULE pe,
|
|
const pe_iid_t *iid,
|
|
size_t n,
|
|
struct pe_iat_entry *entry);
|
|
void *pe_get_export(HMODULE pe, const char *name, uint16_t ord);
|
|
void *pe_get_entry_point(HMODULE pe);
|
|
HRESULT pe_patch(void *dest, const void *src, size_t nbytes);
|
|
|
|
HRESULT pe_hijack_entrypoint(const char *filename, dll_entry_t *orig_entry);
|
|
void pe_resolve_imports(HMODULE target_pe); |