Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Reduce size of compiled binary

Name: Anonymous 2013-07-22 4:36

Hey /prog/, I'm making a remote control tool that works over Tor  because reasons.
But Tor itself weights 3Mio and my final executable is over 1Mio upx'd.
I'm compiling in plain C with Visual'12, have activated all the size optimisation but it's not enough. The client must be able to transfer itself over the network very fast and fit even on small embeded systems.

So do you know of any methods to reduce size further, or any packer better than UPX ? I don't care if it makes my code really slow, but size is critical.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-22 7:34

>>7
WTF? AFAIK MSVC only outputs PEs, but you're targeting Linux?

--fomit-frame-pointer isn't going to reduce size in the case where you have many live variables on the stack; esp+x is 1 byte larger than ebp+x per access. Try -mpush-args, it stops it from emitting stupid "move to stack" and forces it to use push, like Intel intended.

You can try forcing the compiler to not align everything, my usual method is to compile to Asm only and strip out all the .align directives, then assemble the result. (16-byte(!!) function alignment is absolutely retarded for all but the most speed-critical code on a very small subset of CPUs, most of which are probably not in widespread usage today.)

People crying about "DLL hell" on Windows have it easy. *nix is worse, although in this case I'd bet that most Linux systems are going to have the libs you need already (including libc...)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List