Skip to content

Commit

Permalink
Print final process we choose
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Brignull committed Sep 7, 2020
1 parent 212f448 commit 7d9c81f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export async function injectWindowsTracer(
$id = $p[0].ParentProcessId
}
}
Write-Host "Final process: $p"
Invoke-Expression "&$tracer --inject=$id"`;
} else {
Expand All @@ -134,9 +135,9 @@ export async function injectWindowsTracer(
)
$id = $PID
for ($i = 0; $i -lt ${processLevel}; $i++) {
for ($i = 0; $i -le ${processLevel}; $i++) {
$p = Get-CimInstance -Class Win32_Process -Filter "ProcessId = $id"
Write-Host "Found process: $p"
Write-Host "Parent process \${i}: $p"
if ($p -eq $null) {
throw "Process tree ended before reaching required level"
}
Expand All @@ -149,6 +150,7 @@ export async function injectWindowsTracer(
$id = $p[0].ParentProcessId
}
}
Write-Host "Final process: $p"
Invoke-Expression "&$tracer --inject=$id"`;
}
Expand Down

0 comments on commit 7d9c81f

Please sign in to comment.