From d7ecdd9f77afde5134e09c0d391c9585808c87a8 Mon Sep 17 00:00:00 2001 From: supervoidcoder Date: Sun, 15 Feb 2026 21:36:24 -0500 Subject: [PATCH 1/3] fix vscode task --- .vscode/tasks.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 705bde4..45f6328 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,15 +2,16 @@ "tasks": [ { "type": "cppbuild", - "label": "C/C++: cl.exe build active file", + "label": "Build win-witr.exe", "command": "cl.exe", "args": [ - "/Zi", + "/O2", + "/std:c++20", "/EHsc", - "/nologo", - "/std:c++20", - "/Fe${fileDirname}\\${fileBasenameNoExtension}.exe", - "${file}" + "main.cpp", + "/DUNICODE", + "/D_UNICODE", + "/Fe:win-witr.exe" ], "options": { "cwd": "${fileDirname}" From ff90a997f5e617ff555c5652bd2e2e77882e4c0f Mon Sep 17 00:00:00 2001 From: supervoidcoder Date: Sun, 15 Feb 2026 21:53:07 -0500 Subject: [PATCH 2/3] refactor: Improve argument parsing by storing it all in a vector of strings rather than manually parsing each one on the fly --- main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 8258d1b..7cda6af 100644 --- a/main.cpp +++ b/main.cpp @@ -2072,18 +2072,19 @@ ProcInfos findMyProc(const char *procname, HANDLE hSnapshot) { int main(int argc, char* argv[]) { SetConsoleOutputCP(CP_UTF8); virtualTerminalEnabled = IsVirtualTerminalModeEnabled(); - for (int i = 0; i < argc; ++i) { - std::string arg = argv[i]; + std::vector arguments(argv, argv + argc); + for (size_t i = 0; i < arguments.size(); ++i) { + std::string arg = arguments[i]; - if (i == 0 && argc > 1) { + if (i == 0 && arguments.size() > 1) { continue; } - if (argc == 1 || std::string(argv[1]) == "-h" || std::string(argv[1]) == "--help") { + if (arguments.size() == 1 || arguments[1] == "-h" || arguments[1] == "--help") { if (!forkAuthor.empty()) { std::cout << "\nwin-witr - Why is this running? Windows version by supervoidcoder. Fork by " << forkAuthor << std::endl; } else { @@ -2130,9 +2131,9 @@ int main(int argc, char* argv[]) { } if (arg == "--pid") { - if (i + 1 < argc) { + if (i + 1 < arguments.size()) { - std::string pidStr = argv[i + 1]; // never increment the actual variable unless you're actually trying to find the next argument, otherwise + std::string pidStr = arguments[i + 1]; // never increment the actual variable unless you're actually trying to find the next argument, otherwise // skipping arguments will happen and can crash if there is, in fact, no next argument. int pid = 0; From 9a2fe0674dcf31a73877d0696c3b427a859e328f Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 17 Feb 2026 08:14:05 -0500 Subject: [PATCH 3/3] feat: Pass more arguments to PIDInspect so that it knows more stuff about the flags, making it more aware --- main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 7cda6af..4d63b1a 100644 --- a/main.cpp +++ b/main.cpp @@ -1745,7 +1745,8 @@ void FindProcessPorts(DWORD targetPid) { -void PIDinspect(const std::vector& pids, const std::vector& names, HANDLE hshot) { // ooh guys look i'm in the void +void PIDinspect(const std::vector& pids, const std::vector& names, HANDLE hshot, std::vector& statuses, int related, ) { +//^^^ ooh guys look i'm in the void DWORD pid = pids[0]; std::unordered_map pidMap; PROCESSENTRY32 pe32{};