ASLR support in Total Commander

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
advsrch
Junior Member
Junior Member
Posts: 5
Joined: 2011-09-23, 13:53 UTC

ASLR support in Total Commander

Post by *advsrch »

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...
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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.
advsrch wrote:When I force its use thorugh group policy, everything appears to be working fine.
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
Junior Member
Junior Member
Posts: 5
Joined: 2011-09-23, 13:53 UTC

Post by *advsrch »

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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

TC8x64 is made in Lazarus because Delphi doesn't support x64 (at least it didn't support it when porting to Lazarus was started), TC8x32 is still made in Delphi 2.

Have you tried to enable ASLR for TOTALCMD64.EXE?
advsrch
Junior Member
Junior Member
Posts: 5
Joined: 2011-09-23, 13:53 UTC

Post by *advsrch »

Just tested in on TC64 and ASLR is working - confirmed both in Process Explorer and in VMMap.

Why? Is it not working for you? Are you testing it as well?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Actually I haven't tried it, I have WinXPx32 at home.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
advsrch
Junior Member
Junior Member
Posts: 5
Joined: 2011-09-23, 13:53 UTC

Post by *advsrch »

What exactly is the problem you are talking about? I perform stack traces just fine on my ASLR enabled applications.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
advsrch
Junior Member
Junior Member
Posts: 5
Joined: 2011-09-23, 13:53 UTC

Post by *advsrch »

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.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

ghisler(Author) wrote:[...] the posted numbers are useless without knowing the module base address (which would have to be included in the stack trace).
Module base addresses can be obtained by using FindHInstance function from this post.

Regards
Dstruct
Senior Member
Senior Member
Posts: 202
Joined: 2006-01-18, 22:06 UTC

Post by *Dstruct »

8.52a x64 still hasn't ASLR enabled
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Because no one have tried enabling. :wink:
Post Reply