Skip to content

Instantly share code, notes, and snippets.

@trietptm
Forked from huyna/DisableASLR-win10.bat
Created March 28, 2016 19:21
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save trietptm/b84ccad9db01f459ac7e to your computer and use it in GitHub Desktop.
Save trietptm/b84ccad9db01f459ac7e to your computer and use it in GitHub Desktop.
@ECHO OFF
SETLOCAL
ECHO ASLR Enable / Diable Batch Script - Please run as admin
set /p Choice=Want to Enable or Disable ASLR? (e or d):%=%
if "%Choice%"=="e" goto :ENABLE
if "%Choice%"=="d" goto :DISABLE
:ENABLE
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "MoveImages" /t REG_DWORD /d 1 /f
goto :EOF
:DISABLE
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "MoveImages"
goto :EOF
@glnzglnz
Copy link

glnzglnz commented Jul 4, 2019

Will this work in Win 7 Pro 64-bit, which does not even have the key "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" ?

@trietptm
Copy link
Author

@glnzglnz It exists on Windows 10, so it should exists on Windows 7 ;) .

@xambroz
Copy link

xambroz commented Sep 9, 2019

I believe the default is to have ASLR enabled so deleting the key will most probably enable ASLR. To disable you need to explicitly set the value to 0.

@mishrasunny174
Copy link

I believe the default is to have ASLR enabled so deleting the key will most probably enable ASLR. To disable you need to explicitly set the value to 0.

yes that is the case @xambroz

@maskelihileci
Copy link

This method is only valid for x86 software, I guess ASLR is not disabled for x64 software

@chaoscreater
Copy link

On Win10 and WIn11, you can disable ASLR by adjusting the settings in Windows Defender. See here for screenshots:
https://gfs-gamerfullstop.online/how-to-fix-windows-11-settings-menu-not-opening/

@he852100
Copy link

he852100 commented May 2, 2023

It is invalid, and Windows 11 cannot disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment