flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Size of executing file |
Author |
|
Reverend 26 Oct 2005, 18:52
Hmm... The more code you have the larger .exe file gets Simple.
But there are some ways to make .exes smaller. Use PE Packer eg. FSG is great and free, but it has two disadvantages: some stupid antivirus programs claim that all programs packed with fsg are viruses; second, if some processors (recent ones) have such protection that code inside a header cannot be executed - and this trick was used in FSG. Other solution is to use (also free) UPX. Google for both and check them |
|||
26 Oct 2005, 18:52 |
|
Kermil 27 Oct 2005, 06:41
Thanks, but I wanted to tell absolutely another. When I compile the file, in my exe-file there is a lot of empty space between sections. How to make, that it has disappeared? I used only one section but file, at the same there is a lot of empty space.
|
|||
27 Oct 2005, 06:41 |
|
vid 27 Oct 2005, 08:25
what you meant is section alignment. it's value somwhere in PE file header, which gives minimum size of section, and each section mustb multiply of this number. in theory you could change this number, but i think windows refuses to run EXE with any other than it's (i think it's 512 bytes, not sure). There are some hacks how to make section smaller, but they are quite system-dependant (they maybe won't run on newer windozes etc.). It's really best with bigger EXEs to use some packer
|
|||
27 Oct 2005, 08:25 |
|
Kermil 27 Oct 2005, 08:33
The size of file only 3 kb and UPX does not want to pack this file.
|
|||
27 Oct 2005, 08:33 |
|
Kermil 27 Oct 2005, 08:38
Is opportunity in fasm, that change alignment? The option 'align' does not help. Masm32 give such opportunity.
|
|||
27 Oct 2005, 08:38 |
|
vid 27 Oct 2005, 09:36
no, because windows wouldn't be able to run such executable anyway
|
|||
27 Oct 2005, 09:36 |
|
Kermil 27 Oct 2005, 09:46
Why? I thought, that alignment is needed only for quickly execution application in Windows.
|
|||
27 Oct 2005, 09:46 |
|
vid 27 Oct 2005, 10:58
yes, but they, as usual, don't support specification (even thei own). If PE executable has other alignment then they want it won't load. THis is how it ends up with commercial projects - if it works (somehow), thn leave it be
|
|||
27 Oct 2005, 10:58 |
|
Kermil 27 Oct 2005, 11:04
Ok, thx.
|
|||
27 Oct 2005, 11:04 |
|
Reverend 01 Nov 2005, 09:52
1 - upx compresses only files above 5 kb I think
2 - section alignment set by default is the smallest possible you can change it, but only to higher value; but there's one exception for this - drivers, afaik they can have section alignment set to 2 There's also one trick to mention. You can rip all zeroes in the last section.The file will have then some weirdsize, but it will execute normally. Also you can have all data in one section, and so when you rip these zeroes you don't have any unused space |
|||
01 Nov 2005, 09:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.