From 0ef5a4b239cdbf59723ddf702c298d55a1fe114a Mon Sep 17 00:00:00 2001 From: supervoidcoder Date: Mon, 9 Feb 2026 22:07:29 -0500 Subject: [PATCH 01/13] feat: show related processes, essentially deduplicating processes like witr but being more helpful --- main.cpp | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/main.cpp b/main.cpp index 20a4477..44c3e31 100644 --- a/main.cpp +++ b/main.cpp @@ -1727,7 +1727,8 @@ void FindProcessPorts(DWORD targetPid) { -void PIDinspect(DWORD pid) { // ooh guys look i'm in the void +void PIDinspect(const std::vector& pids) { // ooh guys look i'm in the void + DWORD pid = pids[0]; std::string procName = GetProcessNameFromPid(pid); if (IsVirtualTerminalModeEnabled()) { if (procName == ""){ @@ -1937,6 +1938,24 @@ std::string FRAM = ""; // fram means formatted ram, i'm so creative at var namin } else { std::cout << "\nStarted: " << GetReadableFileTime(pid) << std::endl; } + + if (pids.size() > 1) { + if (IsVirtualTerminalModeEnabled()) { + std::cout << "\033[1;35mRelated Processes:\033[0m\n"; + } else { + std::cout << "Related Processes:\n"; + } + + for (size_t i = 1; i < pids.size(); i++) { + std::string relatedProcName = GetProcessNameFromPid(pids[i]); + if (IsVirtualTerminalModeEnabled()) { + std::cout << "\t\033[36m" << relatedProcName << "\033[90m (PID " << pids[i] << ")\033[0m\n"; + } else { + std::cout << "\t" << relatedProcName << " (PID " << pids[i] << ")\n"; + } + + } + } /* TODO: This definitely needs a lot more details to be complete like witr. Unfortunately, windows needs even more shenanigans and a whole @@ -1962,18 +1981,20 @@ std::string FRAM = ""; // fram means formatted ram, i'm so creative at var namin */ CloseHandle(hProcess); + } -int findMyProc(const char *procname) { +std::vector findMyProc(const char *procname) { HANDLE hSnapshot; PROCESSENTRY32 pe; - int pid = 0; + std::vector pids; BOOL hResult; + // snapshot of all processes in the system hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if (INVALID_HANDLE_VALUE == hSnapshot) return 0; + if (INVALID_HANDLE_VALUE == hSnapshot) return {}; // initializing size: needed for using Process32First pe.dwSize = sizeof(PROCESSENTRY32); @@ -1986,15 +2007,14 @@ int findMyProc(const char *procname) { while (hResult) { // if we find the process: return process ID if (strcmp(procname, WideToString(pe.szExeFile).c_str()) == 0) { - pid = pe.th32ProcessID; - break; + pids.push_back(pe.th32ProcessID); } hResult = Process32Next(hSnapshot, &pe); } // closes an open handle (CreateToolhelp32Snapshot) CloseHandle(hSnapshot); - return pid; + return pids; } // The above function is taken from https://cocomelonc.github.io/pentest/2021/09/29/findmyprocess.html , modified simply to use WideToString for the process name comparison among other things. // Thanks! @@ -2093,7 +2113,7 @@ int main(int argc, char* argv[]) { - PIDinspect(static_cast(pid)); + PIDinspect({static_cast(pid)}); } else { if (IsVirtualTerminalModeEnabled()) { // ugh i have to do this EVERY SINGLE TIME std::cerr << "\033[1;31mError:\033[0m --pid option requires an argument." << std::endl; @@ -2111,10 +2131,10 @@ int main(int argc, char* argv[]) { // check for process name if no recognized flags else if (arg[0] != '-') { // if it doesn't start with -- or - std::string procName = arg; - int pid = findMyProc(procName.c_str()); - if (pid != 0) { - - PIDinspect(static_cast(pid)); + std::vector pids = findMyProc(procName.c_str()); + if (!pids.empty()) { + std::vector dwPids(pids.begin(), pids.end()); + PIDinspect(dwPids); } else { if (IsVirtualTerminalModeEnabled()) { std::cerr << "\033[1;31mError:\033[0m Could not find process with name " << procName << "." << std::endl; From 5b3e47bf458f59d8071f07ca3652a739ceb13f06 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:12:39 -0500 Subject: [PATCH 02/13] Update process.ps1 --- tests/process/process.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/process/process.ps1 b/tests/process/process.ps1 index 835190a..ff3dc4a 100644 --- a/tests/process/process.ps1 +++ b/tests/process/process.ps1 @@ -1,4 +1,4 @@ -REM Test system processes that should always be running + Measure-Command { win-witr winlogon.exe | Out-Default} Measure-Command { win-witr lsass.exe | Out-Default} Measure-Command { win-witr win-witr.exe | Out-Default} @@ -29,13 +29,12 @@ timeout /t 1 /nobreak >nul Measure-Command { win-witr notepad.exe | Out-Default} taskkill /F /IM notepad.exe >nul 2>&1 -REM Start calc and test it, then close start /B calc.exe timeout /t 1 /nobreak >nul Measure-Command { win-witr calc.exe | Out-Default} taskkill /F /IM calc.exe >nul 2>&1 -REM Start mspaint and test it, then close + start /B mspaint.exe timeout /t 1 /nobreak >nul Measure-Command { win-witr mspaint.exe | Out-Default} @@ -45,4 +44,3 @@ taskkill /F /IM mspaint.exe >nul 2>&1 Measure-Command { win-witr powershell.exe | Out-Default} - From 147bb6837a050169ee4b39c517e9b60ac26df63d Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:17:09 -0500 Subject: [PATCH 03/13] Update process.ps1 --- tests/process/process.ps1 | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tests/process/process.ps1 b/tests/process/process.ps1 index ff3dc4a..83d72d0 100644 --- a/tests/process/process.ps1 +++ b/tests/process/process.ps1 @@ -24,23 +24,7 @@ Measure-Command { win-witr spoolsv.exe | Out-Default} Measure-Command { win-witr taskhostw.exe | Out-Default} Measure-Command { win-witr dllhost.exe | Out-Default} -start /B notepad.exe -timeout /t 1 /nobreak >nul -Measure-Command { win-witr notepad.exe | Out-Default} -taskkill /F /IM notepad.exe >nul 2>&1 - -start /B calc.exe -timeout /t 1 /nobreak >nul -Measure-Command { win-witr calc.exe | Out-Default} -taskkill /F /IM calc.exe >nul 2>&1 - - -start /B mspaint.exe -timeout /t 1 /nobreak >nul -Measure-Command { win-witr mspaint.exe | Out-Default} -taskkill /F /IM mspaint.exe >nul 2>&1 - - Measure-Command { win-witr powershell.exe | Out-Default} + From 6e7728e5248ac40d4ec7dffe4e4ecfdbdc941ca5 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:20:56 -0500 Subject: [PATCH 04/13] Update process.ps1 --- tests/process/process.ps1 | 93 ++++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 26 deletions(-) diff --git a/tests/process/process.ps1 b/tests/process/process.ps1 index 83d72d0..d92c4d7 100644 --- a/tests/process/process.ps1 +++ b/tests/process/process.ps1 @@ -1,30 +1,71 @@ +$time = Measure-Command { win-witr winlogon.exe | Out-Default } +"winlogon.exe check took {0} ms" -f $time.TotalMilliseconds -Measure-Command { win-witr winlogon.exe | Out-Default} -Measure-Command { win-witr lsass.exe | Out-Default} -Measure-Command { win-witr win-witr.exe | Out-Default} -Measure-Command { win-witr wininit.exe | Out-Default} -Measure-Command { win-witr explorer.exe | Out-Default} -Measure-Command { win-witr Registry| Out-Default} -Measure-Command { win-witr csrss.exe| Out-Default} -Measure-Command { win-witr fontdrvhost.exe | Out-Default} -Measure-Command { win-witr svchost.exe | Out-Default} -Measure-Command { win-witr smss.exe | Out-Default} -Measure-Command { win-witr services.exe | Out-Default} -Measure-Command { win-witr powershell.exe | Out-Default } -Measure-Command { win-witr Runner.Listener.exe | Out-Default} -Measure-Command { win-witr cmd.exe | Out-Default} -Measure-Command { win-witr pwsh.exe | Out-Default} -Measure-Command { win-witr Runner.Worker.exe | Out-Default} -Measure-Command { win-witr hosted-compute-agent | Out-Default} -Measure-Command { win-witr conhost.exe | Out-Default} -Measure-Command { win-witr dwm.exe | Out-Default} -Measure-Command { win-witr RuntimeBroker.exe | Out-Default} -Measure-Command { win-witr SearchIndexer.exe | Out-Default} -Measure-Command { win-witr spoolsv.exe | Out-Default} -Measure-Command { win-witr taskhostw.exe | Out-Default} -Measure-Command { win-witr dllhost.exe | Out-Default} - -Measure-Command { win-witr powershell.exe | Out-Default} +$time = Measure-Command { win-witr lsass.exe | Out-Default } +"lsass.exe check took {0} ms" -f $time.TotalMilliseconds +$time = Measure-Command { win-witr win-witr.exe | Out-Default } +"win-witr.exe check took {0} ms" -f $time.TotalMilliseconds +$time = Measure-Command { win-witr wininit.exe | Out-Default } +"wininit.exe check took {0} ms" -f $time.TotalMilliseconds +$time = Measure-Command { win-witr explorer.exe | Out-Default } +"explorer.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr Registry | Out-Default } +"Registry check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr csrss.exe | Out-Default } +"csrss.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr fontdrvhost.exe | Out-Default } +"fontdrvhost.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr svchost.exe | Out-Default } +"svchost.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr smss.exe | Out-Default } +"smss.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr services.exe | Out-Default } +"services.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr powershell.exe | Out-Default } +"powershell.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr Runner.Listener.exe | Out-Default } +"Runner.Listener.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr cmd.exe | Out-Default } +"cmd.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr pwsh.exe | Out-Default } +"pwsh.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr Runner.Worker.exe | Out-Default } +"Runner.Worker.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr hosted-compute-agent | Out-Default } +"hosted-compute-agent check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr conhost.exe | Out-Default } +"conhost.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr dwm.exe | Out-Default } +"dwm.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr RuntimeBroker.exe | Out-Default } +"RuntimeBroker.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr SearchIndexer.exe | Out-Default } +"SearchIndexer.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr spoolsv.exe | Out-Default } +"spoolsv.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr taskhostw.exe | Out-Default } +"taskhostw.exe check took {0} ms" -f $time.TotalMilliseconds + +$time = Measure-Command { win-witr dllhost.exe | Out-Default } +"dllhost.exe check took {0} ms" -f $time.TotalMilliseconds From 1894fedbb0edf56b290f2c19765e4fd3ad8518b7 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:06:38 -0500 Subject: [PATCH 05/13] perf: make related procnames use stored vector of names rather than calling win32 api for proc name on every related process --- main.cpp | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/main.cpp b/main.cpp index 44c3e31..df232fc 100644 --- a/main.cpp +++ b/main.cpp @@ -1727,7 +1727,7 @@ void FindProcessPorts(DWORD targetPid) { -void PIDinspect(const std::vector& pids) { // ooh guys look i'm in the void +void PIDinspect(const std::vector& pids, std::vector names) { // ooh guys look i'm in the void DWORD pid = pids[0]; std::string procName = GetProcessNameFromPid(pid); if (IsVirtualTerminalModeEnabled()) { @@ -1947,7 +1947,7 @@ std::string FRAM = ""; // fram means formatted ram, i'm so creative at var namin } for (size_t i = 1; i < pids.size(); i++) { - std::string relatedProcName = GetProcessNameFromPid(pids[i]); + std::string relatedProcName = names[i]; if (IsVirtualTerminalModeEnabled()) { std::cout << "\t\033[36m" << relatedProcName << "\033[90m (PID " << pids[i] << ")\033[0m\n"; } else { @@ -1984,11 +1984,16 @@ std::string FRAM = ""; // fram means formatted ram, i'm so creative at var namin } -std::vector findMyProc(const char *procname) { +struct ProcInfos { + std::vector names; + std::vector pids; +} + +std::vector, std::vector> findMyProc(const char *procname) { HANDLE hSnapshot; PROCESSENTRY32 pe; - std::vector pids; + ProcResult result BOOL hResult; @@ -2007,14 +2012,20 @@ std::vector findMyProc(const char *procname) { while (hResult) { // if we find the process: return process ID if (strcmp(procname, WideToString(pe.szExeFile).c_str()) == 0) { - pids.push_back(pe.th32ProcessID); + result.names.push_back(pe.szExeFile); // let me cook + // while you might think its less performant to waste all this + // on storing related names for no reason + // its crucial for the related processes since + // otherwise we'd have to call the get process name for every related process + // and slow us down significantly so storing it on the fly is better + result.pids.push_back(pe.th32ProcessID); } hResult = Process32Next(hSnapshot, &pe); } // closes an open handle (CreateToolhelp32Snapshot) CloseHandle(hSnapshot); - return pids; + return pids, names; } // The above function is taken from https://cocomelonc.github.io/pentest/2021/09/29/findmyprocess.html , modified simply to use WideToString for the process name comparison among other things. // Thanks! @@ -2112,8 +2123,10 @@ int main(int argc, char* argv[]) { } - - PIDinspect({static_cast(pid)}); + std::vector pids; + pids.push_back(pid); // function requires it to be a list even if only 1 is passed + + PIDinspect({static_cast(pids)}); } else { if (IsVirtualTerminalModeEnabled()) { // ugh i have to do this EVERY SINGLE TIME std::cerr << "\033[1;31mError:\033[0m --pid option requires an argument." << std::endl; @@ -2131,10 +2144,10 @@ int main(int argc, char* argv[]) { // check for process name if no recognized flags else if (arg[0] != '-') { // if it doesn't start with -- or - std::string procName = arg; - std::vector pids = findMyProc(procName.c_str()); - if (!pids.empty()) { - std::vector dwPids(pids.begin(), pids.end()); - PIDinspect(dwPids); + ProcResult r = findMyProc(procName.c_str()); + if (!r.pids.empty()) { + std::vector dwPids(r.pids.begin(), r.pids.end()); + PIDinspect(dwPids, r.names); } else { if (IsVirtualTerminalModeEnabled()) { std::cerr << "\033[1;31mError:\033[0m Could not find process with name " << procName << "." << std::endl; From b9e6b6499c36fce39675e42a8d0ee1c5f1e59669 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:08:31 -0500 Subject: [PATCH 06/13] fix: syntax error and terrible syntax --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index df232fc..297ad14 100644 --- a/main.cpp +++ b/main.cpp @@ -1989,11 +1989,11 @@ struct ProcInfos { std::vector pids; } -std::vector, std::vector> findMyProc(const char *procname) { +ProcInfos findMyProc(const char *procname) { HANDLE hSnapshot; PROCESSENTRY32 pe; - ProcResult result + ProcResult result; BOOL hResult; @@ -2025,7 +2025,7 @@ std::vector, std::vector> findMyProc(const char *p // closes an open handle (CreateToolhelp32Snapshot) CloseHandle(hSnapshot); - return pids, names; + return result; } // The above function is taken from https://cocomelonc.github.io/pentest/2021/09/29/findmyprocess.html , modified simply to use WideToString for the process name comparison among other things. // Thanks! @@ -2144,7 +2144,7 @@ int main(int argc, char* argv[]) { // check for process name if no recognized flags else if (arg[0] != '-') { // if it doesn't start with -- or - std::string procName = arg; - ProcResult r = findMyProc(procName.c_str()); + ProcInfos r = findMyProc(procName.c_str()); if (!r.pids.empty()) { std::vector dwPids(r.pids.begin(), r.pids.end()); PIDinspect(dwPids, r.names); From cea6b6ba33db9288243e70be57181fed9594e7f1 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:09:48 -0500 Subject: [PATCH 07/13] fix: missing semicolon --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 297ad14..4e8d82d 100644 --- a/main.cpp +++ b/main.cpp @@ -1987,7 +1987,7 @@ std::string FRAM = ""; // fram means formatted ram, i'm so creative at var namin struct ProcInfos { std::vector names; std::vector pids; -} +}; ProcInfos findMyProc(const char *procname) { From a435b95d5a1f1849126f6b16ecbf5d3ce9e6aee2 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:11:53 -0500 Subject: [PATCH 08/13] fix: another missing semicolon --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 4e8d82d..636a0d3 100644 --- a/main.cpp +++ b/main.cpp @@ -1993,7 +1993,7 @@ ProcInfos findMyProc(const char *procname) { HANDLE hSnapshot; PROCESSENTRY32 pe; - ProcResult result; + ProcInfos result; BOOL hResult; From cbafa76a8aa0f94ea56e758fa14a8acdc3439a4a Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:13:06 -0500 Subject: [PATCH 09/13] fix: add missing initializing argument --- main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 636a0d3..4294996 100644 --- a/main.cpp +++ b/main.cpp @@ -2124,7 +2124,9 @@ int main(int argc, char* argv[]) { std::vector pids; - pids.push_back(pid); // function requires it to be a list even if only 1 is passed + std::vector trash; + trash.push_back(""): + pids.push_back(pid, trash); // function requires it to be a list even if only 1 is passed PIDinspect({static_cast(pids)}); } else { From 1242a6d0feb34f61008ec103c5fd77b0b8fb8b10 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:20:32 -0500 Subject: [PATCH 10/13] fix: fix type error and fix semicolon accidentally typed as colon --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 4294996..61cde14 100644 --- a/main.cpp +++ b/main.cpp @@ -2125,10 +2125,10 @@ int main(int argc, char* argv[]) { std::vector pids; std::vector trash; - trash.push_back(""): - pids.push_back(pid, trash); // function requires it to be a list even if only 1 is passed + trash.push_back(""); + pids.push_back(static_cast(pid));// function requires it to be a list even if only 1 is passed - PIDinspect({static_cast(pids)}); + PIDinspect({static_cast(pids)}, trash); } else { if (IsVirtualTerminalModeEnabled()) { // ugh i have to do this EVERY SINGLE TIME std::cerr << "\033[1;31mError:\033[0m --pid option requires an argument." << std::endl; From 10f435959d13505f7ed9485bb61cf4f0e58bf3af Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:21:52 -0500 Subject: [PATCH 11/13] fix: type error --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 61cde14..b5fdd1f 100644 --- a/main.cpp +++ b/main.cpp @@ -2123,12 +2123,12 @@ int main(int argc, char* argv[]) { } - std::vector pids; + std::vector pids; std::vector trash; trash.push_back(""); pids.push_back(static_cast(pid));// function requires it to be a list even if only 1 is passed - PIDinspect({static_cast(pids)}, trash); + PIDinspect(pids, trash); } else { if (IsVirtualTerminalModeEnabled()) { // ugh i have to do this EVERY SINGLE TIME std::cerr << "\033[1;31mError:\033[0m --pid option requires an argument." << std::endl; From c37dd6080a076e55e5c095245253d7823ad53135 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:26:42 -0500 Subject: [PATCH 12/13] fix: Fix process name storage conversion issue --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index b5fdd1f..c924391 100644 --- a/main.cpp +++ b/main.cpp @@ -2012,7 +2012,7 @@ ProcInfos findMyProc(const char *procname) { while (hResult) { // if we find the process: return process ID if (strcmp(procname, WideToString(pe.szExeFile).c_str()) == 0) { - result.names.push_back(pe.szExeFile); // let me cook + result.names.push_back(WideToString(pe.szExeFile)); // let me cook // while you might think its less performant to waste all this // on storing related names for no reason // its crucial for the related processes since From aa030237ac239001ac2d13cd2f5aa76f1a517296 Mon Sep 17 00:00:00 2001 From: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com> Date: Wed, 11 Feb 2026 00:16:06 -0500 Subject: [PATCH 13/13] =?UTF-8?q?refactor:=20names=20is=20passed=20by=20va?= =?UTF-8?q?lue=20=E2=80=94=20prefer=20const=20std::vector&?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With svchost.exe yielding ~78 related processes, this copies all those strings on every call. Since names is only read inside the function, pass by const reference like pids Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index c924391..4b3c7f4 100644 --- a/main.cpp +++ b/main.cpp @@ -1727,7 +1727,7 @@ void FindProcessPorts(DWORD targetPid) { -void PIDinspect(const std::vector& pids, std::vector names) { // ooh guys look i'm in the void +void PIDinspect(const std::vector& pids, const std::vector& names) { // ooh guys look i'm in the void DWORD pid = pids[0]; std::string procName = GetProcessNameFromPid(pid); if (IsVirtualTerminalModeEnabled()) {