This should be fast
| 128 | |
| 129 | // This should be fast |
| 130 | Process* MakeProcess(DWORD pid, std::vector<std::string> targetNames) { |
| 131 | Process* process; |
| 132 | process = new Process(pid); |
| 133 | |
| 134 | // Process PEB info |
| 135 | ProcessPebInfoRet pebInfo = GetProcessNameByPid(pid); |
| 136 | process->name = pebInfo.image_path; |
| 137 | process->commandline = pebInfo.commandline; |
| 138 | |
| 139 | // Dont observe ourselves |
| 140 | if (contains_case_insensitive(process->name, "rededr.exe")) { |
| 141 | process->observe = 0; |
| 142 | return process; |
| 143 | } |
| 144 | |
| 145 | // Check if we should trace |
| 146 | process->ObserveIfMatchesTargets(targetNames); |
| 147 | |
| 148 | return process; |
| 149 | } |
| 150 | |
| 151 | |
| 152 | BOOL Process::OpenTarget() { |