Skip to content

Instantly share code, notes, and snippets.

@0xm4ud
Last active January 15, 2023 01:31
Show Gist options
  • Save 0xm4ud/67ba7664333c00e6b471824a262d04b3 to your computer and use it in GitHub Desktop.
Save 0xm4ud/67ba7664333c00e6b471824a262d04b3 to your computer and use it in GitHub Desktop.
WinDbg autorun
Start-Process -FilePath .\Desktop\vulnAppDEP.exe -WindowStyle Hidden
Start-Process powershell -ArgumentList "-NoExit", "-File \tools\osed-scripts\attach-process.ps1 -process-name vulnAppDEP" -WindowStyle Hidden
Start-Sleep -Seconds 3
$process = Get-Process -Name "DbgX.Shell"
Register-ObjectEvent -InputObject $process -EventName Exited -Action {
# Code to run when the WinDbg process exits
Write-Host "WinDbgX has been closed."
Stop-Process -Name cmd -force
Write-Host "Re-running Vuln program and WinDBG"
Start-Process powershell -ArgumentList "-NoExit", "-File c:\Users\Administrator\Desktop\autorun.ps1 -process-name vulnAppDEP" -WindowStyle Hidden
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment