| 331 | } |
| 332 | |
| 333 | std::wstring Process::GetCmdLine(HANDLE hProcess) { |
| 334 | std::wstring cmdLine; |
| 335 | PEB peb; |
| 336 | if (!GetProcessPeb(hProcess, &peb)) |
| 337 | return cmdLine; |
| 338 | |
| 339 | RTL_USER_PROCESS_PARAMETERS processParams; |
| 340 | if (!::ReadProcessMemory(hProcess, peb.ProcessParameters, &processParams, sizeof(processParams), nullptr)) |
| 341 | return cmdLine; |
| 342 | |
| 343 | cmdLine.resize(processParams.CommandLine.Length / sizeof(WCHAR) + 1); |
| 344 | if (!::ReadProcessMemory(hProcess, processParams.CommandLine.Buffer, cmdLine.data(), |
| 345 | processParams.CommandLine.Length, nullptr)) |
| 346 | return L""; |
| 347 | |
| 348 | return cmdLine; |
| 349 | } |
| 350 | |
| 351 | std::vector<std::pair<std::wstring, std::wstring>> Process::GetEnvironment(HANDLE hProcess) { |
| 352 | std::vector<std::pair<std::wstring, std::wstring>> env; |
nothing calls this directly
no test coverage detected