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:
Anonymous2010-02-28 12:15
wxDev-Cpp
Name:
Anonymous2010-02-28 12:32
Nothing's easy anymore.
Name:
Anonymous2010-02-28 13:11
Visual C++ 2005 Express Edition
There's your CUDDER
Name:
Anonymous2010-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:
Anonymous2010-02-28 14:31
Why are you so bothered about this?
49,152 bytes is almost nothing.
Name:
Anonymous2010-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:
Anonymous2010-02-28 14:53
how about:
int main(){
return 0
}
>turn off precompiled header
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.
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.