jrsoftware.org // Jordan Russell's Software
-Home

Products

-Inno Setup

-Toolbar2000

-Toolbar97

Support

-Forums

-Contact

#######
visitors since
Jan. 1998

StripReloc

About

StripReloc is a free (GPL license) command line utility that removes the relocation (".reloc") section from Win32 PE EXE files, reducing their size. Most compilers/linkers (including Delphi) put a relocation section in EXE files, but this is actually not necessary since EXEs never get relocated. Hence, a relocation section only wastes space except if ASLR is required.

This program is designed for developers to run on their own applications' executables only. It is not recommended that you run StripReloc indiscriminately on all EXEs you come across, because certain programs may rely on their internal structure staying intact.

StripReloc will not run on DLLs because they can get relocated, and thus need a relocation section.

EXEs run through StripReloc work on all Windows OSes since Windows 95 and NT 3.51 (at least). Windows 3.1x with Win32s is not supported.

Download

Filename Date Size Description
StripReloc113.zip 2005-02-12 45 KB StripReloc version 1.13 (Delphi 5 source code included, GPL license)
What's New

(The StripReloc program itself has been processed with StripReloc, which reduced it by 4KB, or 7%!)

md5sum: 18e75cf5f726eb456348c72d8b376135

DISCLAIMER:

This program is distributed "as is" without any warranties, express or implied. Should any problems arise as a result of using it I shall not be held responsible. Your use of the program is entirely at your own risk.

Why not use an EXE compressor?

Some have asked why one would use StripReloc when there are EXE compression programs such as ASPack and UPX that will trim more bytes off of executables than StripReloc ever could.

The reason is there are downsides to using EXE compressors. Most notably:

  • Upon startup of a compressed EXE/DLL, all of the code is decompressed from the disk image into memory in one pass, which can cause disk thrashing if the system is low on memory and is forced to access the swap file. In contrast, with uncompressed EXE/DLLs, the OS allocates memory for code pages on demand (i.e. when they are executed).
  • Multiple instances of a compressed EXE/DLL create multiple instances of the code in memory. If you have a compressed EXE that contains 1 MB of code (before compression) and the user starts 5 instances of it, approximately 4 MB of memory is wasted. Likewise, if you have a DLL that is 1 MB and it is used by 5 running applications, approximately 4 MB of memory is wasted. With uncompressed EXE/DLLs, code is only stored in memory once and is shared between instances.
  • Some older virus scanners flag compressed EXE/DLLs as being virus-infected.
    Update: In fairness, this was written several years ago. This very well may no longer be an issue today.

Site contents Copyright © 1997-2024 Jordan Russell. All rights reserved.
Portions Copyright © 2000-2024 Martijn Laan. All rights reserved.