Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #77 from clymb3r/master
Browse files Browse the repository at this point in the history
Fix for multi-processor systems
  • Loading branch information
Matt Graeber committed Oct 1, 2015
2 parents 03ed2ad + 235af29 commit 9f78286
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Exfiltration/Invoke-Mimikatz.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2586,8 +2586,25 @@ $RemoteScriptBlock = {
#Load the PE reflectively
Write-Verbose "Calling Invoke-MemoryLoadLibrary"

if (((Get-WmiObject -Class Win32_Processor).AddressWidth / 8) -ne [System.Runtime.InteropServices.Marshal]::SizeOf([Type][IntPtr]))
try
{
$Processors = Get-WmiObject -Class Win32_Processor
}
catch
{
throw ($_.Exception)
}

if ($Processors -is [array])
{
$Processor = $Processors[0]
} else {
$Processor = $Processors
}

if ( ( $Processor.AddressWidth) -ne (([System.IntPtr]::Size)*8) )
{
Write-Verbose ( "Architecture: " + $Processor.AddressWidth + " Process: " + ([System.IntPtr]::Size * 8))
Write-Error "PowerShell architecture (32bit/64bit) doesn't match OS architecture. 64bit PS must be used on a 64bit OS." -ErrorAction Stop
}

Expand Down

0 comments on commit 9f78286

Please sign in to comment.