- Aug
- 2,799
- 144
It does not appear that PSHELL can read a stream, and execute a stream.
It would be beneficial for PSHELL to have this ability.
Joe
It would be beneficial for PSHELL to have this ability.
Code:
U:\>pshell isnetdll.btm:isnetdll.ps1
PSHELL: The term 'U:\isnetdll.btm:isnetdll.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
U:\>type IsNETDll.btm:isnetdll.ps1
$r = [System.IO.File]::ReadAllBytes("U:\cs2ps1.dll")
$peOffset = [BitConverter]::ToInt32($r, 0x3C)
$optHeader = $peOffset + 0x18
$comDirRVA = [BitConverter]::ToInt32($r, $optHeader + 0xE0)
$comDirSize = [BitConverter]::ToInt32($r, $optHeader + 0xE4)
if ($comDirRVA -ne 0 -and $comDirSize -ne 0) {
"This DLL contains a CLR header ? .NET assembly."
} else {
"No CLR header ? native Win32 DLL."
}
U:\>type IsNETDll.btm:isnetdll.ps1 > isnetdll.ps1
U:\>pshell isnetdll.ps1
This DLL contains a CLR header ? .NET assembly.
Joe