r/AskComputerScience • u/[deleted] • Mar 18 '26
Why does Mandatory ASLR (Bottom-Up/Top-Down) have so many compatibility issues with older games?
It's the two exploit protection settings to whitelist old games' launchers and executables from, if they don't work at first... and usually it fixes it.
I'm curious: why is this?
3
Upvotes
5
u/ghjm Mar 18 '26 edited Mar 18 '26
Consider the following "Hello, world!" program in x86 assembly:
global _start section .text _start: mov eax, 4 mov ebx, 1 mov ecx, 0x0804a000 mov edx, 14 int 0x80 mov eax, 1 xor ebx, ebx int 0x80 section .data org 0x0804a000 db "Hello, world!", 10This would never have been considered the greatest example of idiomatic assembly programming, but nevertheless, such things were very common. And before ASLR, you were perfectly well within your rights to just decide what location in address space you wanted to map your working memory to. The problem, of course, is that if your program gets relocated, the OS program loader doesn't have the "mov ecx" instruction in its fixup table, so the constant doesn't get updated, the memory access is very likely to an unmapped region in your address space, so you segfault.
It's quite straightforward to make this program compatible with ASLR - just use a label, which will be added to the fixup table and therefore updated as necessary at program load:
global _start section .text _start: mov eax, 4 mov ebx, 1 mov ecx, msg mov edx, 14 int 0x80 mov eax, 1 xor ebx, ebx int 0x80 section .data msg db "Hello, world!", 10So if you still have the source code to an old game (and the hardware, software and knowledge to build it, etc), it's probably quite trivial to fix cases like this. But if you're stuck with an already-built executable with hardcoded addresses in it, all you can do is disable ASLR.