Improve cmdline

Use full path to resolve win32 exe image info
This commit is contained in:
halx99 2024-09-25 23:19:17 +08:00 committed by GitHub
parent 30a899ee07
commit ca12633ca8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -179,6 +179,7 @@ function is_console_app($path) {
# $isConsole = $peReader.PEHeaders.PEHeader.Subsystem -eq 3
# $peFile.Close()
# return $isConsole
$path = $1k.realpath($path)
$buffer = New-Object Byte[] 248
$fileStream = [System.IO.FileStream]::new($path, [IO.FileMode]::Open, [IO.FileAccess]::Read)
$fileStream.Seek(0x3C, [System.IO.SeekOrigin]::Begin) | Out-Null