Extra code , msvcrt and heaps ??

Windows specific forum
n0na
New User
New User
Posts: 2
Joined: Mon Jul 12, 2010 5:30 am

Extra code , msvcrt and heaps ??

Post by n0na »

hey ,,,

1st i want to thank u for ur great app :)

i want to ask about something ,

when i make an app like this:

Code: Select all

Sleep_(-1)
its suposed to b as smallest as it can
like,

Code: Select all

push -1
call Kernel32.Sleep
but i get an exe with
( 2 imports )
> MSVCRT.dll: memset
> KERNEL32.dll: GetModuleHandleA, HeapCreate, Sleep, HeapDestroy, ExitProcess
isn't there anyway to strip memory allocations and set the base address on my own code ?

thanks in advance and have a great day ,,, :)
Fred
Administrator
Administrator
Posts: 18252
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Extra code , msvcrt and heaps ??

Post by Fred »

PB setup some (small) stuff for every executable. Just compile with /COMMENTED and look for the assembly output to see what. About the base allocation, you can pass linker flags with the /LINKER compiler option.
Cournefinates
New User
New User
Posts: 5
Joined: Tue Jul 27, 2010 11:05 am

Re: Extra code , msvcrt and heaps ??

Post by Cournefinates »

Can we have a "no bloat"-option in the compiler options that strips those unnecessary code parts?

Thanks.
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Extra code , msvcrt and heaps ??

Post by freak »

You are calling this bloat? You can't spare 3kb on your 1TB hard drive? :mrgreen:

These parts are needed as soon as you try to do anything useful anyway. Whats the point of removing them only so you can have the smallest executable that doesn't do anything at all?
quidquid Latine dictum sit altum videtur
Cournefinates
New User
New User
Posts: 5
Joined: Tue Jul 27, 2010 11:05 am

Re: Extra code , msvcrt and heaps ??

Post by Cournefinates »

Sorry, I didn't mean to exaggerate and call that "bloat". PureBasic just got me in the mood of having a small executable as possible (compared to Delphi 5, which I used before, and produced a "Hello World"-program with about 450kb - crazy!). So I'm pretty excited PureBasic can do this within 2kb.

:o

Edit: Is there something we can do to further shrink the executable without sacrificing functionality? I'd rather not use any kind of compressor like UPX or PECompact, I just had too many false virus alarms.
n0na
New User
New User
Posts: 2
Joined: Mon Jul 12, 2010 5:30 am

Re: Extra code , msvcrt and heaps ??

Post by n0na »

Cournefinates wrote:Sorry, I didn't mean to exaggerate and call that "bloat". PureBasic just got me in the mood of having a small executable as possible (compared to Delphi 5, which I used before, and produced a "Hello World"-program with about 450kb - crazy!). So I'm pretty excited PureBasic can do this within 2kb.

:o

Edit: Is there something we can do to further shrink the executable without sacrificing functionality? I'd rather not use any kind of compressor like UPX or PECompact, I just had too many false virus alarms.

thats wht im talking about =\

i want small apps , i even use PB as an IDE for my fasm codes , i can debug it easily and print registers values ,,
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: Extra code , msvcrt and heaps ??

Post by Rings »

n0na wrote:hey ,,,

1st i want to thank u for ur great app :)

i want to ask about something ,

when i make an app like this:

Code: Select all

Sleep_(-1)
its suposed to b as smallest as it can
like,

Code: Select all

push -1
call Kernel32.Sleep
but i get an exe with
( 2 imports )
> MSVCRT.dll: memset
> KERNEL32.dll: GetModuleHandleA, HeapCreate, Sleep, HeapDestroy, ExitProcess
isn't there anyway to strip memory allocations and set the base address on my own code ?

thanks in advance and have a great day ,,, :)
writing the smallest malware perhaps ?

greets to the south of arabia....
SPAMINATOR NR.1
Post Reply