From 3994188b089b30d50a80e4416e95c5648b54e012 Mon Sep 17 00:00:00 2001 From: mkrsym1 Date: Sat, 10 Jun 2023 18:23:43 +0300 Subject: [PATCH] Add WAIT_BEFORE_RESUME envvar --- README.md | 2 ++ injector/launcher_payload/src/dll.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index fa81aef..2fefeb3 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ This tool is capable of starting the games from a different process. This may be ### Configuration These environment variables can be used to configure the behaviour of the tool. +- (future release) `WAIT_BEFORE_RESUME=1` - show a messagebox and wait for user input before resuming the game process. Useful on my side for debugging + **SR-exclusive**: - `I_WANT_A_BAN=1` - allows to launch SR. Please only use testing accounts, as there is an extremely high risk of getting banned - `SRFIX_DISABLE=1` - disable shared resources fix diff --git a/injector/launcher_payload/src/dll.c b/injector/launcher_payload/src/dll.c index c40828f..097721f 100644 --- a/injector/launcher_payload/src/dll.c +++ b/injector/launcher_payload/src/dll.c @@ -60,6 +60,14 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) { size_t payloadSize = (size_t)&_binary_lpayload_o_p_payload_bin_size; inject(pi.hProcess, payloadStart, payloadSize, injectDll); + // Optional: wait for user input before resuming (useful for debugging) + char *waitEnabled = getenv("WAIT_BEFORE_RESUME"); + if (waitEnabled && strcmp(waitEnabled, "") != 0) { + char message[64]; + sprintf(message, "PID: %ld. Press OK to continue", pi.dwProcessId); + MessageBoxA(NULL, message, "Jadeite Launcher Payload", MB_OK | MB_ICONINFORMATION); + } + // Resume the process ResumeThread(pi.hThread);