Forked from Dump-GUY/PE-Inspect-PortableExecutable-Namespace.ps1
Last active
March 4, 2025 23:52
-
-
Save gavz/b31a30a52ee6dd36dfe15acf28f9f641 to your computer and use it in GitHub Desktop.
PowerShell (pwsh): PE-Inspect-PortableExecutable-Namespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://x.com/i/status/1896749132280426616 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Expand-Properties($Object, $Depth = 5, $Indent = 0) { | |
if ($Depth -le 0 -or $null -eq $Object) { return } $prefix = " " * $Indent | |
$Object | gm -m Property | % { | |
$pValue = $Object.$($_.Name) | |
if ($pValue -is [Enum]) { Write-Host "$prefix$($_.Name): " -F Green -N; Write-Host "$pValue" -F Blue } | |
elseif ($null -eq $pValue) { Write-Host "$prefix$($_.Name): " -F Green -N; Write-Host "(null)" -F Blue } | |
elseif ($pValue -is [Collections.IEnumerable] -and $pValue -isnot [string]) { Write-Host "$prefix$($_.Name): " -F Green; $pValue | % { Expand-Properties $_ ($Depth - 1) ($Indent + 4) } } | |
elseif ($pValue -is [PSObject] -or $pValue.GetType().Namespace -match "^System.Reflection") { Write-Host "$prefix$($_.Name): " -F Green; Expand-Properties $pValue ($Depth - 1) ($Indent + 4) } | |
else { Write-Host "$prefix$($_.Name): " -F Green -N; Write-Host "$pValue" -F Blue }}} | |
Expand-Properties ([Reflection.PortableExecutable.PEReader]::new([IO.File]::OpenRead([IO.Path]::GetFullPath(".\StringDecryptor_task.exe"))).PEHeaders) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment