ASLR support in Total Commander
Moderators: Hacker, petermad, Stefan2, white
ASLR support in Total Commander
Hello,
Is there a reason why Total Commander does not use ASLR (Address Space Layout Randomization, look it up on wikipedia ) ? When I force its use thorugh group policy, everything appears to be working fine. You can use this to test: kb2458544 on microsoft page.
Sorry, cannot post actual links due to forum restriction...
Is there a reason why Total Commander does not use ASLR (Address Space Layout Randomization, look it up on wikipedia ) ? When I force its use thorugh group policy, everything appears to be working fine. You can use this to test: kb2458544 on microsoft page.
Sorry, cannot post actual links due to forum restriction...
I don't see any reason to use it. 
TC is not an application that works with extra-secret data like user account credentials or credit card numbers, so it is not necessary for it. And, such applications require more time to start because of relocation.
Anyway, TC made with Delphi 2 which doesn't support it.
And, it is necessary to have relocations inside of EXE to enable this feature.
Hm-m, maybe this is the reason why it works for you - Delphi creates section with relocations even in EXE (redundant 121 kB of TOTALCMD.exe) although it is NOT necessary for executables at all since EXE's always loaded at preferred address.
It seems that this won't work with TOTALCMD64.exe because it doesn't contain relocation table. Or maybe it will just work as if option is disabled.

TC is not an application that works with extra-secret data like user account credentials or credit card numbers, so it is not necessary for it. And, such applications require more time to start because of relocation.
Anyway, TC made with Delphi 2 which doesn't support it.
And, it is necessary to have relocations inside of EXE to enable this feature.
Hm-m, maybe this is the reason why it works for you - Delphi creates section with relocations even in EXE (redundant 121 kB of TOTALCMD.exe) although it is NOT necessary for executables at all since EXE's always loaded at preferred address.
It seems that this won't work with TOTALCMD64.exe because it doesn't contain relocation table. Or maybe it will just work as if option is disabled.
BTW can you tell which base address OS chooses for module TOTALCMD.exe? Look e.g. in lower pane of Process Explorer. If TOTALCMD.exe has base 0x400000, ASLR is not used.advsrch wrote:When I force its use thorugh group policy, everything appears to be working fine.
The main use for ASLR is prevention of buffer overflow (or basically all shellcodes) which is a real issue for Total Commander since it can load modules etc.
Are you sure Total Commander is made in Delphi2? Since there is now a 64-bit version, it cannot be Delphi2.
The base address is different from 0x400000 when I use EMET so it is clearly working.
Are you sure Total Commander is made in Delphi2? Since there is now a 64-bit version, it cannot be Delphi2.
The base address is different from 0x400000 when I use EMET so it is clearly working.
- ghisler(Author)
- Site Admin
- Posts: 50873
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Unfortunately ASLR would make stack traces quite useless - or is there a way to find out the (random) module base programmatically?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50873
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I mean when TC crashes on a user's computer and he posts a stack trace, the posted numbers are useless without knowing the module base address (which would have to be included in the stack trace).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Unfortunately somebody else will need to answer that question. I perform memory dumps on crash.
I guess if you get the method parameters in the stack trace or enable reflection then you can derive what methods caused the crash.
But if I look at it logically, a lot of programs run with ASLR enabled, and the developers are not saying that it makes debugging more difficult...
I would say try enabling ASLR, make Total Commander crash (implement a crash method), and see what the stack trace gives you.
I guess if you get the method parameters in the stack trace or enable reflection then you can derive what methods caused the crash.
But if I look at it logically, a lot of programs run with ASLR enabled, and the developers are not saying that it makes debugging more difficult...
I would say try enabling ASLR, make Total Commander crash (implement a crash method), and see what the stack trace gives you.
Module base addresses can be obtained by using FindHInstance function from this post.ghisler(Author) wrote:[...] the posted numbers are useless without knowing the module base address (which would have to be included in the stack trace).
Regards