Closed veksha closed 7 months ago
sorry. context: NoSteamWebHelper does nothing for me. steam launches and webhelper process launches too. same as running steam.exe. no difference.
Steam Beta Branch: Stable Client Steam Version: 1705108172 Steam Client Build Date: Sat, Jan 13 2:54 AM UTC -08:00 Steam Web Build Date: Fri, Jan 12 7:02 PM UTC -08:00 Steam API Version: SteamClient021
The webhelper is terminated when an app/game starts up.
I compiled code, debugged and found a reason.
dwSize was 35 for me, so dll name was truncated in memory:
35 is the length of "D:\Games\Steam\NoSteamWebHelper.exe"
string, because dwSize
is the same var that is used for holding length of "NoSteamWebHelper.dll" wide char length and then it gets overwritten with 35 later in code and then used again by WriteProcessMemory
with wrong vaule.
if your path has longer length it explains why it was working for you and not working for me. so to reproduce this bug you can temporarily move your steam to "D:\Games\Steam" for example.
Fix:
diff --git a/src/WinMain.c b/src/WinMain.c
index 25ee536..a83fbd4 100644
--- a/src/WinMain.c
+++ b/src/WinMain.c
@@ -7,7 +7,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
HANDLE hProcess = GetCurrentProcess();
WCHAR *lpExeName = NULL;
DWORD cbData = 0,
- dwSize = sizeof(WCHAR) * (wcslen(L"NoSteamWebHelper.dll") + 1);
+ dwSize = 0;
SHELLEXECUTEINFOW sei = {.cbSize = sizeof(SHELLEXECUTEINFOW),
.lpParameters = lpCmdLine,
.lpFile = L"steam.exe",
@@ -38,6 +38,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
}
(VOID) ShellExecuteExW(&sei);
+ dwSize = sizeof(WCHAR) * (wcslen(L"NoSteamWebHelper.dll") + 1);
lpBaseAddress = VirtualAllocEx(sei.hProcess, NULL, dwSize, MEM_COMMIT, PAGE_READWRITE);
(VOID) WriteProcessMemory(sei.hProcess, lpBaseAddress, L"NoSteamWebHelper.dll", dwSize, NULL);
(VOID) CloseHandle(CreateRemoteThread(sei.hProcess, 0, 0, (LPTHREAD_START_ROUTINE)LoadLibraryW, lpBaseAddress, 0, NULL));
Feel free to submit a PR which fixes this issue, if you desire.
What's exactly the issue?