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

Empty Project

Name: Anonymous 2010-02-28 12:00

Trying to figure out how to get a clean empty project with Visual C++ 2005 Express Edition

I created a new Empty Project and added a file with this

int main(int argc, char* argv[])
{
    return 0;
}


I turned off debug information and buffer security

But my compiled binary still has a shitload of shit in it and is 49152 bytes large

In IDA I looked to the entry point and the first thing it does is go into a routine to set up buffer security

WTF am I missing?

Name: Anonymous 2010-02-28 12:15

wxDev-Cpp

Name: Anonymous 2010-02-28 12:32

Nothing's easy anymore.

Name: Anonymous 2010-02-28 13:11

Visual C++ 2005 Express Edition
There's your CUDDER

Name: Anonymous 2010-02-28 13:28

>>1
Disable standard library, of course. Most of this shit is what _main_CRT_startup(0) or whatever its name was, needs.

So, you need to disable standard library, reset entry point, set some cryptic linker option like "code page size" and get your nice 2k binary, mostly filled with zeroes.

Standard library is for fags anyway so you don't actually miss anything.

And don't forget #include <void.h> !!

Name: Anonymous 2010-02-28 14:31

Why are you so bothered about this?

49,152 bytes is almost nothing.

Name: Anonymous 2010-02-28 14:43

>>6
Coincidentally, there's also almost nothing in his source code.  All the space in the compiled file is taken up by stuff that is not his source code.

Name: Anonymous 2010-02-28 14:53

how about:
int main(){
return 0
}
>turn off precompiled header

Name: Anonymous 2010-02-28 15:09

void main(){}

Name: Anonymous 2010-02-28 15:23

void main(void){}

Name: Anonymous 2010-02-28 15:43

my empty program imports 59 functions from kernel32.dll called from code I don't want

Name: Anonymous 2010-02-28 15:55

>>11
That's because you're a loser.

Name: Anonymous 2010-02-28 16:19

op here, precompiled header is off

Name: Anonymous 2010-02-28 18:23

PRECOMPILE MY ANUS

Name: Anonymous 2010-02-28 18:42

>>1

So you'd prefer if all of the functions that the .exe included were inline? Sorry but that's kind of retarded. Anyway I managed to get the MSOC compiler to produce a 2kb file which printed "hello world". Just remove all the non-essential nonsense.

Name: Anonymous 2010-02-28 19:46

>>14
ANUS MY ANUS

Name: Anonymous 2010-02-28 20:07

We may have to compile this by hand.

Name: Anonymous 2010-02-28 21:51

cl /MD /O1 /Os <filename> /link /align:4096 /filealign:512 /merge:.rdata=.text /section:.text,EWR <extra libs>

Add /merge:.data=.text if you don't have any huge static arrays, and you'll save some more.

Name: Anonymous 2010-02-28 22:15

BLOAT MY ANUS

Name: Anonymous 2010-02-28 22:19

That's because you compiled the stdlib statically. Link to msvcrt dynamically, change the align to something small, and if you really want, define your own entrypoint directly. If you merge .rdata and .text you might be able to squeeze even more. There was a challenge for a minimal PE file the other month which I won, and all I did was use MSVC's compiler and then slightly edited the file in a hex editor to reduce the size some more (moved stuff to the header). I'll post link to the thread if I can find it.

Name: >>20 2010-02-28 22:26

http://dis.4chan.org/read/prog/1263880828/41 Oh it was MASM, though you can achieve similar with cl and link.

Name: Anonymous 2011-02-03 8:09

Name: Anonymous 2013-01-18 22:46

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

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