score_under
|
|
Reply #15 Posted on: May 27, 2010, 03:57:21 pm |
|
|
Joined: Aug 2008
Posts: 308
|
http://upurload.com/dl/?n=230*single-digit snip*
(User was banned for this post ("Yes, that will consume many system resources, requiring reboot on Windows (I imagine) or pkill here on Linux." - Josh @ Dreamland))
Disasm tells me: void death(int argc,char**argv) { while(1)malloc(1024); } void main(int argc,char**argv) { death(argc,argv); } Disasm also tells me that your optimizer sucks. (For the lulz, wrote the program myself. Does exactly the same, size of actual code executed is 15 bytes, the rest is IAT and PE header)
|
|
« Last Edit: May 27, 2010, 04:27:39 pm by score_under »
|
Logged
|
|
|
|
|
|
|
score_under
|
|
Reply #19 Posted on: May 27, 2010, 05:29:44 pm |
|
|
Joined: Aug 2008
Posts: 308
|
int main(){ while(1){ malloc(1024); } return 0; } How the hell did vc++ get a death function out of that?
I don't know, but it nested another function inside your main(). Also it changed main to void and added arguments to it. Tried turning the optimizer on next time? XD
|
|
|
Logged
|
|
|
|
|
|
|
|
|
serprex
|
|
Reply #25 Posted on: May 31, 2010, 05:07:59 pm |
|
|
Smooth ER
Joined: Apr 2008
Posts: 106
|
C99: 5.1.2.2.1 Program startup 1 The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int and with no parameters: int main(void) { /* ... */ } or with two parameters (referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared): int main(int argc, char *argv[]) { /* ... */ } or equivalent;9) or in some other implementation-defined manner. 2 If they are declared, the parameters to the main function shall obey the following constraints: — The value of argc shall be nonnegative. — argv[argc] shall be a null pointer. — If the value of argc is greater than zero, the array members argv[0] through argv[argc-1] inclusive shall contain pointers to strings, which are given implementation-defined values by the host environment prior to program startup. The intent is to supply to the program information determined prior to program startup from elsewhere in the hosted environment. If the host environment is not capable of supplying strings with letters in both uppercase and lowercase, the implementation shall ensure that the strings are received in lowercase. — If the value of argc is greater than zero, the string pointed to by argv[0] represents the program name; argv[0][0] shall be the null character if the program name is not available from the host environment. If the value of argc is greater than one, the strings pointed to by argv[1] through argv[argc-1] represent the program parameters. — The parameters argc and argv and the strings pointed to by the argv array shall be modifiable by the program, and retain their last-stored values between program startup and program termination.
|
|
|
Logged
|
|
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #29 Posted on: June 01, 2010, 05:48:29 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
No, most compiler writers just think that disallowing void main() is stupid.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|