MCPcopy Index your code
hub / github.com/bytecode77/r77-rootkit / GetProcessPath

Function GetProcessPath

r77api/r77win.c:240–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 return result;
239}
240BOOL GetProcessPath(DWORD processId, PWCHAR fileName, DWORD fileNameLength)
241{
242 BOOL result = FALSE;
243
244 HANDLE process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId);
245 if (process)
246 {
247 WCHAR path[MAX_PATH + 1];
248 if (GetModuleFileNameExW(process, NULL, path, MAX_PATH))
249 {
250 if ((DWORD)lstrlenW(path) <= fileNameLength)
251 {
252 StrCpyW(fileName, path);
253 result = TRUE;
254 }
255 }
256
257 CloseHandle(process);
258 }
259
260 return result;
261}
262BOOL GetProcessUserName(HANDLE process, PWCHAR name, DWORD nameLength)
263{
264 BOOL result = FALSE;

Callers 1

GetProcessListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected