NO

Author Topic: How to Compile so VISTA and UP know NOT to use ASLR and DEP?  (Read 5856 times)

Seltsamuel

  • Guest
Hi,

i need to compile my applications so Vista and up know that the application is incompatible with DEP and ASLR.
The application must run from 95/98 - Windows 7.

How can i do this using PellesC?? There must be some linkflags to set.

Greetings

Seltsamuel

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: How to Compile so VISTA and UP know NOT to use ASLR and DEP?
« Reply #1 on: July 19, 2009, 03:39:03 PM »
I might be wrong, but those things are handled by a manifest, I think.
---
Stefan

Proud member of the UltraDefrag Development Team

Seltsamuel

  • Guest
Re: How to Compile so VISTA and UP know NOT to use ASLR and DEP?
« Reply #2 on: July 19, 2009, 03:56:19 PM »
Hi,

i dont know if ancient Windows versions support manifests at all but these Versions dont have ASLR and DEP so i dont know.
But i think i read about a flag inside the PE header and thats what the linker will generate.

An additional Manifest will be good but i didnt make one and have no knowledge on how to do it the easy way. Will this really prevent windows on using DEP and ASLR on my application?

DEP is a minor Problem for me because i Trick Windows into switching it off by adding a section with a special name into a dll i load anyway:
#pragma data_seg(".sforce")
#pragma data_seg()
#pragma comment(linker, "/SECTION:.sforce,RWS")
This forces Windows to switch off DEP for the entire application.

Until Vista SP3 i used a registry setting to switch off ASLR entirely but until this sacred SP it cannot be turned off anymore damn microsoft. so this is my main problem now until i fixed my entire application to support relocated dlls and thats much work for now.
----->>SNIP<<----
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
"MoveImages"=dword:00000000
----->>SNAP<<----

Any Help is much appreciated

Greetings

Seltsamuel

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: How to Compile so VISTA and UP know NOT to use ASLR and DEP?
« Reply #3 on: July 19, 2009, 04:47:34 PM »
i dont know if ancient Windows versions support manifests at all but these Versions dont have ASLR and DEP so i dont know.
Older versions will just ignore the manifest resource, since they do not search for it and they do not know about it.
---
Stefan

Proud member of the UltraDefrag Development Team

Seltsamuel

  • Guest
Re: How to Compile so VISTA and UP know NOT to use ASLR and DEP?
« Reply #4 on: July 19, 2009, 10:18:04 PM »
Hi,

cannot find any source of information about manifests in combination with ASLR.
Does someone have a link?

Greetings

Seltsamuel


Greg

  • Guest
Re: How to Compile so VISTA and UP know NOT to use ASLR and DEP?
« Reply #5 on: July 27, 2009, 05:39:38 AM »
Why not make them compatible?
 

Seltsamuel

  • Guest
Re: How to Compile so VISTA and UP know NOT to use ASLR and DEP?
« Reply #6 on: August 01, 2009, 12:01:46 PM »
Hi,

im in game Modding so i cannot make compatible what i not wrote ^^ so i only have the chance to force windows to deactivate this features for the application entirely. For DEP its the Problem of the Application but i already solved this. ASLR is the Problem of my code and the Stupidness of Microsoft im solving this at the moment in rewriting large parts of my code. Normally ASLR should not have affected me because the entire application is not written to support it so its not active for the application but ...
This Brainbugs at Microsoft forgot an important part:

Even when ASLR is deactivated for the Application it is affected from it because the system dlls are compiled for ASLR!
So the Module Loader does this:

1. Look for the prefered base of a dll
2. Load the DLL into the prefered Base BUT only when this is free and here goes Microsofts Brainbug
because when there is sporadic one of the system dlls that get relocated on every reboot the dll will not use its base and gets relocated even when there is no ASLR support in it!
Until Vista SP2 i used the above Registry key to deactivate ASLR entirely but from up SP2 it does not work anymore so the only possibility is to reboot windows as often as needed that on the place of the games dll is no system.dll. Thats really annoying because there is no solution for it.

Im now rewriting MUCH code because of Microsofts bullshit.

Greetings

Seltsamuel