diff options
author | Matt Graeber <mattgraeber@gmail.com> | 2013-08-17 17:55:31 -0400 |
---|---|---|
committer | Matt Graeber <mattgraeber@gmail.com> | 2013-08-17 17:55:31 -0400 |
commit | fcdd3ad6428b4f1ecfd7f63be629af8cbe3204af (patch) | |
tree | 6d00f1929a4f8b488d4a80b5d6412b608ba6390e /ReverseEngineering/Get-NtSystemInformation.ps1 | |
parent | 7f0be861f23e85e35284125620a4a0c1a52e83e5 (diff) | |
download | PowerSploit-fcdd3ad6428b4f1ecfd7f63be629af8cbe3204af.tar.gz PowerSploit-fcdd3ad6428b4f1ecfd7f63be629af8cbe3204af.zip |
Explicitly casting types as [Type]v2.2
The latest version of .NET added generics to many of the InteropService
methods. Therefore, all of my uses of types need to be explicitly cast
with [Type].
Diffstat (limited to 'ReverseEngineering/Get-NtSystemInformation.ps1')
-rw-r--r-- | ReverseEngineering/Get-NtSystemInformation.ps1 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ReverseEngineering/Get-NtSystemInformation.ps1 b/ReverseEngineering/Get-NtSystemInformation.ps1 index b571ac0..bb0871a 100644 --- a/ReverseEngineering/Get-NtSystemInformation.ps1 +++ b/ReverseEngineering/Get-NtSystemInformation.ps1 @@ -633,7 +633,7 @@ foreach ($i in 0..($Count-1)) { - [Runtime.InteropServices.Marshal]::PtrToStructure($StructAddress, $StructType) + [Runtime.InteropServices.Marshal]::PtrToStructure($StructAddress, [Type] $StructType) $StructAddress = ([IntPtr]($StructAddress.ToInt64() + $StructSize)) } @@ -958,7 +958,7 @@ # Base address of the _SYSTEM_OBJECTTYPE_INFORMATION struct $ObjectTypeAbsoluteAddress = [IntPtr]($PtrData.ToInt64() + $NextTypeOffset) - $Result = [Runtime.InteropServices.Marshal]::PtrToStructure($ObjectTypeAbsoluteAddress, $ObjectTypeClass) + $Result = [Runtime.InteropServices.Marshal]::PtrToStructure($ObjectTypeAbsoluteAddress, [Type] $ObjectTypeClass) if ($Result.NumberOfObjects -gt 0) { @@ -970,7 +970,7 @@ do { - $ObjectResult = [Runtime.InteropServices.Marshal]::PtrToStructure(( [IntPtr]($ObjectBaseAddr.ToInt64() + $NextObjectOffset) ), $ObjectClass) + $ObjectResult = [Runtime.InteropServices.Marshal]::PtrToStructure(( [IntPtr]($ObjectBaseAddr.ToInt64() + $NextObjectOffset) ), [Type] $ObjectClass) $ResultHashTable2 = @{ Object = $ObjectResult.Object |