flat assembler
Message board for the users of flat assembler.

Index > Heap > Can I safely remove .reloc from PE executable?

Author
Thread Post new topic Reply to topic
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
There's this tool: http://www.jrsoftware.org/striprlc.php

Which strips the .reloc section in the EXE.

I tried running it in some EXE I compiled with VC++ and it does reduce the EXE size!

The application runs normally in my system.

Is .reloc section needed at all in .EXEs?
Post 14 Feb 2013, 19:09
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 21:29; edited 1 time in total
Post 14 Feb 2013, 19:21
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
You can remove them safely, if you never load the exe as a dynamic library (which is possible AFAIK).
Post 14 Feb 2013, 19:23
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
Yeah, that seems to match the information I got on the internet.

I'm not loading anything from the EXE using LoadLibrary.
Post 14 Feb 2013, 19:27
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
As the comment in PEDEMO.ASM example in fasm's package says, it was also needed for Win32s. Long time ago. I wonder whether there is a single person still using Windows 3.x with Win32s installed. Smile
Post 14 Feb 2013, 22:07
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
As long as you have an image base that's guaranteed not to be taken (the standard 0x400000, for instance) then yes - you can safely remove .reloc from your .EXE files.

However, if you want to take advantage of ASLR (a good idea in many situations), leave the .reloc.
Post 15 Feb 2013, 15:26
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17332
Location: In your JS exploiting you and your system
revolution
Tomasz Grysztar wrote:
I wonder whether there is a single person still using Windows 3.x with Win32s installed. Smile
Probably, like most things, there will always be a few people using the old systems for something.
Post 16 Feb 2013, 03:11
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.