mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-10-23 04:58:16 +08:00
added a new debug option "ResumeByDebugger" for the Windows version of the client loader
This commit is contained in:
parent
bc62efa7f7
commit
ace7aa4acb
@ -1,3 +1,6 @@
|
|||||||
|
* added a new option to the Windows version of the client loader to aid in debugging.
|
||||||
|
the option is called `ResumeByDebugger`, and setting it to `1` will prevent the loader from
|
||||||
|
auto resuming the main app thread, giving you a chance to attach your debugger.
|
||||||
* make the script `generate_emu_config` generate an empty `DLC.txt` if the app has no DLCs
|
* make the script `generate_emu_config` generate an empty `DLC.txt` if the app has no DLCs
|
||||||
* windows build: sign each file after build with a self-signed generated certificate + note in the release readme regarding false-positives
|
* windows build: sign each file after build with a self-signed generated certificate + note in the release readme regarding false-positives
|
||||||
* windows build: note in readme about Windows SDK
|
* windows build: note in readme about Windows SDK
|
||||||
|
@ -24,7 +24,11 @@ You do not need to create a `steam_interfaces.txt` file for the `steamclient` ve
|
|||||||
* `ExeCommandLine` additional args to pass to the exe, example: `-dx11 -windowed`
|
* `ExeCommandLine` additional args to pass to the exe, example: `-dx11 -windowed`
|
||||||
Optionally you can specify a different location for `steamclient(64).dll`:
|
Optionally you can specify a different location for `steamclient(64).dll`:
|
||||||
* `SteamClientDll`: path to `steamclient.dll`, either full path or relative to this `.ini` file
|
* `SteamClientDll`: path to `steamclient.dll`, either full path or relative to this `.ini` file
|
||||||
* `SteamClientDll`: path to `steamclient(64).dll`, either full path or relative to this `.ini` file
|
* `SteamClientDll`: path to `steamclient(64).dll`, either full path or relative to this `.ini` file
|
||||||
|
* For debug **build** only:
|
||||||
|
* `ResumeByDebugger`: setting this to `1` or 'y' or `true` will prevent the loader from calling `ResumeThread` on the main thread after spawning the .exe, and it will display a mesage with the process ID (PID) so you attach your debugger on it.
|
||||||
|
Note that you have to resume the main thread from the debugger after attaching, also the entry breakpoint may not be set automatically, but you can do that manually.
|
||||||
|
|
||||||
|
|
||||||
**Note** that any arguments passed to `steamclient_loader.exe` via command line will be passed to the target `.exe`.
|
**Note** that any arguments passed to `steamclient_loader.exe` via command line will be passed to the target `.exe`.
|
||||||
Example: `steamclient_loader.exe` `-dx11`
|
Example: `steamclient_loader.exe` `-dx11`
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
bool IsNotRelativePathOrRemoveFileName(WCHAR* output, bool Remove)
|
bool IsNotRelativePathOrRemoveFileName(WCHAR* output, bool Remove)
|
||||||
{
|
{
|
||||||
@ -166,8 +167,32 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// run and wait
|
bool run_exe = true;
|
||||||
ResumeThread(processInfo.hThread);
|
#ifndef EMU_RELEASE_BUILD
|
||||||
|
{
|
||||||
|
std::wstring dbg_file(50, L'\0');
|
||||||
|
auto res_dbg_len = GetPrivateProfileStringW(L"Debug", L"ResumeByDebugger", L"", &dbg_file[0], dbg_file.size(), CurrentDirectory);
|
||||||
|
if (dbg_file[0]) {
|
||||||
|
dbg_file = dbg_file.substr(0, res_dbg_len);
|
||||||
|
} else {
|
||||||
|
dbg_file.clear();
|
||||||
|
}
|
||||||
|
for (auto &c : dbg_file) {
|
||||||
|
c = (wchar_t)std::tolower((int)c);
|
||||||
|
}
|
||||||
|
if (dbg_file == L"1" || dbg_file == L"y" || dbg_file == L"yes" || dbg_file == L"true") {
|
||||||
|
run_exe = false;
|
||||||
|
std::string msg = "Attach a debugger now to PID " + std::to_string(processInfo.dwProcessId) + " and resume its main thread";
|
||||||
|
MessageBoxA(NULL, msg.c_str(), "ColdClientLoader", MB_OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// run
|
||||||
|
if (run_exe) {
|
||||||
|
ResumeThread(processInfo.hThread);
|
||||||
|
}
|
||||||
|
// wait
|
||||||
WaitForSingleObject(processInfo.hThread, INFINITE);
|
WaitForSingleObject(processInfo.hThread, INFINITE);
|
||||||
|
|
||||||
CloseHandle(processInfo.hThread);
|
CloseHandle(processInfo.hThread);
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
#My own modified version of ColdClientLoader originally by Rat431
|
#My own modified version of ColdClientLoader originally by Rat431
|
||||||
[SteamClient]
|
[SteamClient]
|
||||||
Exe=game.exe
|
Exe=game.exe
|
||||||
ExeRunDir=.
|
ExeRunDir=.
|
||||||
ExeCommandLine=
|
ExeCommandLine=
|
||||||
#IMPORTANT:
|
#IMPORTANT:
|
||||||
AppId=
|
AppId=
|
||||||
|
|
||||||
SteamClientDll=steamclient.dll
|
SteamClientDll=steamclient.dll
|
||||||
SteamClient64Dll=steamclient64.dll
|
SteamClient64Dll=steamclient64.dll
|
||||||
|
|
||||||
|
[Debug]
|
||||||
|
ResumeByDebugger=0
|
||||||
|
Loading…
Reference in New Issue
Block a user