pythonpowershellportable-executableaslrdep

How to enable ASLR of an exe file


I have wrote a simple python script (just a message box) and make it executable using pyInstaller. I want to load that exe file reflectively using Powershell script Invoke-ReflectivePEInjection.ps1 but powershell is throwing an error (PE file does not support ASLR )

Is there any way to make ASLR compatible exe file from python script.


Solution

  • There's a tool called editbin which can be used to change PE file settings. In your case, /DYNAMICBASE and /HIGHENTROPYVA seem to apply. Use that tool after creating the executable.