mirror of
https://github.com/PowerShellMafia/PowerSploit
synced 2026-06-08 12:13:33 +00:00
Fixed a casting bug
This commit is contained in:
@@ -2381,7 +2381,7 @@ $RemoteScriptBlock = {
|
||||
$PEInfo = Get-PEBasicInfo -PEBytes $PEBytes -Win32Types $Win32Types
|
||||
$OriginalImageBase = $PEInfo.OriginalImageBase
|
||||
$NXCompatible = $true
|
||||
if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT)
|
||||
if (([Int] $PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT)
|
||||
{
|
||||
Write-Warning "PE is not compatible with DEP, might cause issues" -WarningAction Continue
|
||||
$NXCompatible = $false
|
||||
@@ -2440,7 +2440,7 @@ $RemoteScriptBlock = {
|
||||
|
||||
#ASLR check
|
||||
[IntPtr]$LoadAddr = [IntPtr]::Zero
|
||||
$PESupportsASLR = ($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) -eq $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
|
||||
$PESupportsASLR = ([Int] $PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) -eq $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
|
||||
if ((-not $ForceASLR) -and (-not $PESupportsASLR))
|
||||
{
|
||||
Write-Warning "PE file being reflectively loaded is not ASLR compatible. If the loading fails, try restarting PowerShell and trying again OR try using the -ForceASLR flag (could cause crashes)" -WarningAction Continue
|
||||
|
||||
Reference in New Issue
Block a user