mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-09-15 11:55:10 -05:00
* 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.
95 lines
2.8 KiB
C
95 lines
2.8 KiB
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
/**
|
|
* Initialize inject's logger backend.
|
|
*
|
|
* This takes care of hooking and merging the different log
|
|
* streams, e.g. inject's local logging and inject's debugger
|
|
* receiving remote logging events.
|
|
*
|
|
* @param log_file_path Path to the file to log to or NULL to
|
|
* disable.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Initialize the debugger.
|
|
*
|
|
* This creates the remote process of the provided application.
|
|
*
|
|
* The remote process is created suspended. This allows you to
|
|
* to some more process setup tasks like injecting hook DLLs
|
|
* before you call debugger_resume_process to actually start
|
|
* execution of it.
|
|
*
|
|
* The actual debugging runs in a dedicated thread which spawns
|
|
* the process, waits for and dispatches debug events.
|
|
*
|
|
* However, if you want to attach a remote debugger, you have to
|
|
* set the parameter local_debugger to false. Then, the debugger
|
|
* will only create the remote process and monitor it.
|
|
*
|
|
* @param local_debugger True to attach inject's local debugger,
|
|
* false to allow attaching a remote
|
|
* debugger with enhanced features.
|
|
* @param app_name Name of the application to spawn and debug.
|
|
* @param cmd_line Command line string to pass to application.
|
|
* @return true on success, false on error. On error, no remote
|
|
* application and local debugger is started.
|
|
*/
|
|
bool debugger_init(bool local_debugger, const char *app_name, char *cmd_line);
|
|
|
|
/**
|
|
* Inject a DLL into the remote process.
|
|
*
|
|
* @param path_dll Path to the dll to inject.
|
|
* @return true if sucessful, false on error.
|
|
*/
|
|
bool debugger_inject_dll(const char *path_dll);
|
|
|
|
/**
|
|
* Inject a DLL into the remote process by replacing its reference in
|
|
* the import table.
|
|
*
|
|
* @param expected_dll Name of dll to override.
|
|
* @param replacement_path_dll Name of dll to inject.
|
|
* @return true if sucessful, false on error.
|
|
*/
|
|
bool debugger_replace_dll_iat(const char *expected_dll, const char *replacement_path_dll);
|
|
|
|
/**
|
|
* Wait/block for a remote debugger to attach to the remote process.
|
|
*
|
|
* You only need to call this if you specified local_debugger = false
|
|
* on debugger_init.
|
|
*
|
|
* @return True if successfull and a remote debugger attached, false
|
|
* on error.
|
|
*/
|
|
bool debugger_wait_for_remote_debugger();
|
|
|
|
/**
|
|
* Resume the remote process.
|
|
*
|
|
* Make sure to call this once you are done with setting it up.
|
|
*
|
|
* @return true on success, false on error.
|
|
*/
|
|
bool debugger_resume_process();
|
|
|
|
/**
|
|
* Wait for the remote process to exit.
|
|
*/
|
|
void debugger_wait_process_exit();
|
|
|
|
/**
|
|
* Cleanup the debugger.
|
|
*
|
|
* @param failure Set this to true if you have to cleanup due to
|
|
* a failure of another debugger function call.
|
|
* Otherwise, set this to false.
|
|
*/
|
|
void debugger_finit(bool failure); |