Page 1 of 1

Extra code , msvcrt and heaps ??

Posted: Mon Jul 12, 2010 5:39 am
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 ,,, :)

Re: Extra code , msvcrt and heaps ??

Posted: Mon Jul 12, 2010 6:55 am
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.

Re: Extra code , msvcrt and heaps ??

Posted: Tue Jul 27, 2010 11:08 am
by Cournefinates
Can we have a "no bloat"-option in the compiler options that strips those unnecessary code parts?

Thanks.

Re: Extra code , msvcrt and heaps ??

Posted: Tue Jul 27, 2010 2:47 pm
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?

Re: Extra code , msvcrt and heaps ??

Posted: Tue Jul 27, 2010 5:11 pm
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.

Re: Extra code , msvcrt and heaps ??

Posted: Tue Jul 27, 2010 7:43 pm
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 ,,

Re: Extra code , msvcrt and heaps ??

Posted: Fri Jul 30, 2010 9:33 am
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....