Update Get-PEHeader.ps1

This commit is contained in:
caseysmithrc
2018-08-28 11:12:26 -06:00
committed by GitHub
parent ebb56d2b78
commit 0734e42642
+4 -2
View File
@@ -564,7 +564,9 @@ PROCESS {
$UnsafeNativeMethods = $SystemAssembly.GetType('Microsoft.Win32.UnsafeNativeMethods')
# Get a reference to the GetModuleHandle and GetProcAddress methods
$GetModuleHandle = $UnsafeNativeMethods.GetMethod('GetModuleHandle')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')
#Fix For Windows 10 1803. Probably should check version , but meh.
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress', [Type[]]@([System.Runtime.InteropServices.HandleRef], [String]))
#$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')
# Get a handle to the module specified
$Kern32Handle = $GetModuleHandle.Invoke($null, @($Module))
$tmpPtr = New-Object IntPtr
@@ -957,4 +959,4 @@ PROCESS {
}
}
}