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:
@@ -244,12 +244,7 @@ skip:
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
#ifdef DEBUG_HOOKING
|
log_to_writer(log_writer_debug, NULL);
|
||||||
FILE *file = fopen("iidxhook.dllmain.log", "w+");
|
|
||||||
log_to_writer(log_writer_file, file);
|
|
||||||
#else
|
|
||||||
log_to_writer(log_writer_null, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
@@ -262,14 +257,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
|||||||
adapter_hook_init();
|
adapter_hook_init();
|
||||||
eamuse_hook_init();
|
eamuse_hook_init();
|
||||||
settings_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;
|
return TRUE;
|
||||||
|
|||||||
@@ -243,12 +243,7 @@ skip:
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
#ifdef DEBUG_HOOKING
|
log_to_writer(log_writer_debug, NULL);
|
||||||
FILE *file = fopen("iidxhook.dllmain.log", "w+");
|
|
||||||
log_to_writer(log_writer_file, file);
|
|
||||||
#else
|
|
||||||
log_to_writer(log_writer_null, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
@@ -261,14 +256,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
|||||||
adapter_hook_init();
|
adapter_hook_init();
|
||||||
eamuse_hook_init();
|
eamuse_hook_init();
|
||||||
settings_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;
|
return TRUE;
|
||||||
|
|||||||
@@ -234,12 +234,8 @@ skip:
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
#ifdef DEBUG_HOOKING
|
log_to_writer(log_writer_debug, NULL);
|
||||||
FILE *file = fopen("iidxhook.dllmain.log", "w+");
|
|
||||||
log_to_writer(log_writer_file, file);
|
|
||||||
#else
|
|
||||||
log_to_writer(log_writer_null, NULL);
|
|
||||||
#endif
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
hook_table_apply(
|
hook_table_apply(
|
||||||
@@ -253,14 +249,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
|||||||
adapter_hook_init();
|
adapter_hook_init();
|
||||||
eamuse_hook_init();
|
eamuse_hook_init();
|
||||||
settings_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;
|
return TRUE;
|
||||||
|
|||||||
@@ -148,12 +148,7 @@ static HWND CDECL my_mwindow_create(
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
#ifdef DEBUG_HOOKING
|
log_to_writer(log_writer_debug, NULL);
|
||||||
FILE *file = fopen("jbhook.dllmain.log", "w+");
|
|
||||||
log_to_writer(log_writer_file, file);
|
|
||||||
#else
|
|
||||||
log_to_writer(log_writer_null, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
@@ -164,14 +159,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
|||||||
|
|
||||||
acp_hook_init();
|
acp_hook_init();
|
||||||
adapter_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;
|
return TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user