Invoke-DllInjection detects OS arch on all OSes

This fix addresses issue #99. While I'm not the biggest fan of
performing tests based on environment variables, I felt that making
additional Win32 API calls would have been overkill.
This commit is contained in:
Matt Graeber 2015-12-16 14:31:03 -08:00
parent ef37a138b8
commit f5d9b25275
1 changed files with 4 additions and 6 deletions

View File

@ -224,12 +224,10 @@ http://www.exploit-monday.com
$PowerShell32bit = $False
}
$OSArchitecture = (Get-WmiObject Win32_OperatingSystem).OSArchitecture
switch ($OSArchitecture)
{
'32-bit' { $64bitOS = $False }
'64-bit' { $64bitOS = $True }
if (${Env:ProgramFiles(x86)}) {
$64bitOS = $True
} else {
$64bitOS = $False
}
# The address for IsWow64Process will be returned if and only if running on a 64-bit CPU. Otherwise, Get-ProcAddress will return $null.