mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2025-02-17 19:19:16 +01:00
hooks for inject: Fix log output in DllMain
With the new inject tool, the output of OutputDebugString is available on console and file logging.
This commit is contained in:
parent
917dc88826
commit
55c9f5a521
@ -244,12 +244,7 @@ skip:
|
||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
#ifdef DEBUG_HOOKING
|
||||
FILE *file = fopen("iidxhook.dllmain.log", "w+");
|
||||
log_to_writer(log_writer_file, file);
|
||||
#else
|
||||
log_to_writer(log_writer_null, NULL);
|
||||
#endif
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
|
||||
/* Bootstrap hook for further init tasks (see above) */
|
||||
|
||||
@ -262,14 +257,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
adapter_hook_init();
|
||||
eamuse_hook_init();
|
||||
settings_hook_init();
|
||||
|
||||
#ifdef DEBUG_HOOKING
|
||||
fflush(file);
|
||||
fclose(file);
|
||||
#endif
|
||||
|
||||
/* Logging to file and other destinations is handled by inject */
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -243,12 +243,7 @@ skip:
|
||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
#ifdef DEBUG_HOOKING
|
||||
FILE *file = fopen("iidxhook.dllmain.log", "w+");
|
||||
log_to_writer(log_writer_file, file);
|
||||
#else
|
||||
log_to_writer(log_writer_null, NULL);
|
||||
#endif
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
|
||||
/* Bootstrap hook for further init tasks (see above) */
|
||||
|
||||
@ -261,14 +256,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
adapter_hook_init();
|
||||
eamuse_hook_init();
|
||||
settings_hook_init();
|
||||
|
||||
#ifdef DEBUG_HOOKING
|
||||
fflush(file);
|
||||
fclose(file);
|
||||
#endif
|
||||
|
||||
/* Logging to file and other destinations is handled by inject */
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -234,12 +234,8 @@ skip:
|
||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
#ifdef DEBUG_HOOKING
|
||||
FILE *file = fopen("iidxhook.dllmain.log", "w+");
|
||||
log_to_writer(log_writer_file, file);
|
||||
#else
|
||||
log_to_writer(log_writer_null, NULL);
|
||||
#endif
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
|
||||
/* Bootstrap hook for further init tasks (see above) */
|
||||
|
||||
hook_table_apply(
|
||||
@ -253,14 +249,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
adapter_hook_init();
|
||||
eamuse_hook_init();
|
||||
settings_hook_init();
|
||||
|
||||
#ifdef DEBUG_HOOKING
|
||||
fflush(file);
|
||||
fclose(file);
|
||||
#endif
|
||||
|
||||
/* Logging to file and other destinations is handled by inject */
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -148,12 +148,7 @@ static HWND CDECL my_mwindow_create(
|
||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
#ifdef DEBUG_HOOKING
|
||||
FILE *file = fopen("jbhook.dllmain.log", "w+");
|
||||
log_to_writer(log_writer_file, file);
|
||||
#else
|
||||
log_to_writer(log_writer_null, NULL);
|
||||
#endif
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
|
||||
/* Bootstrap hook for further init tasks (see above) */
|
||||
|
||||
@ -164,14 +159,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
|
||||
#ifdef DEBUG_HOOKING
|
||||
fflush(file);
|
||||
fclose(file);
|
||||
#endif
|
||||
|
||||
/* Logging to file and other destinations is handled by inject */
|
||||
log_to_writer(log_writer_debug, NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user