Underhanded C Contest announces winners 150
Matthew Skala writes "The 2005 Underhanded C Contest has announced its winners: the team entry from M Joonas Pihlaja and Paul V-Khuong, and the solo entry from Natori Shin. The contest (which appeared on Slashdot in June) tests programmers' ability to hide malicious behaviour in innocent-seeming code, making it a kind of evil shadow twin to the International Obfuscated C Contest."
Just what the world needs... (Score:2, Interesting)
Thanks be to Slashdot for giving them the recognition/praise they so richly deserve.
Re:Just what the world needs... (Score:2, Insightful)
Re:Just what the world needs... (Score:2, Insightful)
Re:Just what the world needs... (Score:3, Insightful)
A-ha (Score:2, Funny)
Bill Gates Entry (Score:5, Funny)
Re:Bill Gates Entry (Score:5, Interesting)
Re:Bill Gates Entry (Score:5, Interesting)
Re:Bill Gates Entry (Score:2)
Re:Bill Gates Entry (Score:2)
Runtime code generation (Score:5, Informative)
Re:Runtime code generation (Score:2)
But the CLR team would have to have gotten lazy, and not marked things as executable, and started exploiting other such things, just to save a few cycles.
There's no reason why BOP should break the CLR.
Re:Runtime code generation (Score:2)
MC = Molten Core?
I'm confused what MC is...
Re:Runtime code generation (Score:4, Insightful)
Re:Runtime code generation (Score:3, Informative)
Well, you could make the compile function recursive. That is, compile a single method, then run it, and if it calls (at runtime) any other methods that haven't been compiled yet, call the compile function iteratively, passing a pointer to the point in stack where the code was executing.
So how do you figure out which methods are comp
Cheney on the MTA (Score:2)
One solution (used in RABBIT, or a derivative, I believe), is to output everything in a big switch, and have each function call target be a case in it. (What about returns, you ask? You just CPS (transform into continuation passing style) the code first, so that every return becomes a call to the r
Erratum (Score:2)
Re:Bill Gates Entry (Score:2, Informative)
Patches are not available from the public download location. You may need to have a support contract to get them.
good to see (Score:5, Insightful)
I'll tell you what's underhanded (Score:5, Funny)
Stashing all the entries in a 1.1M archive rather than posting links to the code. No way I'm going to download that just to see what all the fuss is about.
Re:I'll tell you what's underhanded (Score:5, Funny)
Re:I'll tell you what's underhanded (Score:5, Funny)
Re:I'll tell you what's underhanded (Score:2)
No, we are not shills from MicroSoft trying to evangelize C-sharp.
No, they are from AcuCorp [acucorp.com], demonstrating how C really sucks sheep testicles, and how we should all be writing in COBOL or FORTRAN.
Except, of course, for OS developers, who should write in Bliss [wikipedia.org].
Re:I'll tell you what's underhanded (Score:2)
This is only funny if you actually believe OSS means more code review and not less. The reverse is actually true as OSS has the aura of suggesting the first case so in effect, it becomes the opposite by way of assumption of it having been or being checked, so few bother.
Got any proof to back that up? When I have a problem with an OSS program, I often dig into the code to see if I can find the cause. That's not saying there is a great deal of peer review before OSS code is released, but as it becomes ma
Re:I'll tell you what's underhanded (Score:5, Funny)
but they would have known that only a great fool would open the archive given to him. I am not a great fool, so I can clearly not choose to open the archive. But they must have known I was not a great fool, they would have counted on it, so I can clearly open the archive supplied by them.
Re:I'll tell you what's underhanded (Score:2)
Re:I'll tell you what's underhanded (Score:2, Informative)
No, but it probably relies on lots of helper software to handle certain file types. This helper software is probably written in C or C++, and probably contains exploitable vulnerabilities. For example, your system might be compromised if the "archive" is actually an image file which your browser will try to display, using a library which contains a vulnerability which the image exploits to execute arbitrary code on your system. This may sound looney to you,
Re:I'll tell you what's underhanded (Score:1)
You visited the site?
This is one I'll pass up, thanks.
Re:I'll tell you what's underhanded (Score:3, Funny)
It's ok, I'm using Firefox. It's the most zyg234 bof*(0sls lkM12134 bsxQxo%9X browser out there!
Re:I'll tell you what's underhanded (Score:2, Informative)
Re:I'll tell you what's underhanded (Score:2)
*sigh*
I'm on a cablemodem. I just don't care to wade through megabytes of crap just to read the winning entry.
Don't make assumptions about people you don't know. Just a suggestion mind you....
Will Code For Beer (Score:5, Funny)
Re:Will Code For Beer (Score:1, Informative)
Re:Will Code For Beer (Score:2)
Re:Will Code For Beer (Score:2)
Whether you can drink 47 pints a day for more than a day or two in a row is a different story...
Re:Will Code For Beer (Score:3, Funny)
Re:Will Code For Beer (Score:2, Informative)
http://www.aa.org/ [aa.org]
Re:Will Code For Beer (Score:2)
Re:Will Code For Beer (Score:2)
Re:Will Code For Beer (Score:2)
Re:Will Code For Beer (Score:4, Informative)
Negative reinforcement is a reward that occurs by subtracting an adverse stimulus from the environment. For example, Fridays are a form of negative reinforcement -- the withdrawal of a negative stimulus (work) is rewarding, makes people feel good/relieved, and thus, people come to really like Friday afternoons. http://en.wikipedia.org/wiki/Reinforcement#Positi
Re:Will Code For Beer (Score:2)
"Withdrawal of negative stimulus (work)" applies to every day, not just Friday. The difference is that on Friday you know that you're not going to have to work on the weekend.
This is starting to sound like it's completely arbitrary as to what you would call positive and negative reinforcement.
I like e
Re:Will Code For Beer (Score:2)
If you add something, it's considered "positive". If you take something away, it's considered "negative".
giving treat to your dog -- positive reinforcement
spanking a child -- positive punishment
giving someone a day off -- negative reinforcement
taking away your kid's toys -- negative punishment
Re:Will Code For Beer (Score:2)
Re:Will Code For Beer (Score:2, Interesting)
Why? I don't exactly go round killing people. Drink is just another liquid.
What's with the moralising, anti-alcohol mods today? Slashdot's always whining about people's rights to do what they want with their own body, what about my right to drink? Why should that be censored?
Re:Will Code For Beer (Score:2)
Your rights become null as soon as you start hurting other people, and whether you see it or not, that's what alchoholics do.
Re:Will Code For Beer (Score:1)
Re:Will Code For Beer (Score:2)
I have nothing against having a beer now and then. Actually, I'm very fond of beer and I like to try all the different brews that I can. However, there's a large difference between drinking once in a while and being an alchoholic. To consider alchoholism a tolerable part of one's personality is a frightening mentality indeed.
I'm still fond of this one (Score:5, Interesting)
if ((options == (__WCLONE|__WALL)) && (current->uid = 0))
retval = -EINVAL;
In other words, you become root if you call sys_wait4()with the __WCLONE|__WALL) flags
Story here [theregister.co.uk] and here [iu.edu]
Re:I'm still fond of this one (Score:5, Informative)
It *did* make it into the kernel for anyone using the BK-to-CVS gateway.
Re:I'm still fond of this one (Score:1)
Re:I'm still fond of this one, official releases (Score:1)
CVS/git development trees are not pre-releases for testers. Git trees are for
Re:I'm still fond of this one (Score:5, Informative)
Re:I'm still fond of this one (Score:3, Insightful)
That said - I think that C IDEs which perform context sensitive coloring should use two different colors for = and ==. Or maybe put in a macro or something to make it harder for these types of bugs.
Re:I'm still fond of this one (Score:2, Insightful)
It's really not that hard to get used to, i dont find it to be particularly ugly and it solves the problem.
Re:I'm still fond of this one (Score:1)
The mere idea that somehow the constant being on the left as opposed to the right brings forth the stentch of religious idiocy.
Re:I'm still fond of this one (Score:2, Interesting)
Also note that -pedantic wouldn't create a warning, but gcc -Wall would.
Re:I'm still fond of this one (Score:4, Informative)
You can still do things like if ((line = in.readLine()) == null) of course
Re:I'm still fond of this one (Score:1)
although its hardly used in C, and not as well defined in C, but thats how afterthoughts typically work.
I can print a line to standard output in less than 16 characters though!
Re:I'm still fond of this one (Score:2)
Java's boolean type is a little bit different from C99's bool type in that it's a seperate primitive which cannot be cast back and forth between int. So code like
will compile and run in C (probably even without a warning, depending on which compiler you're using), but it probably won't do what you expect. Whereas b
Re:I'm still fond of this one (Score:1)
Re:I'm still fond of this one (Score:1)
In C, NULL != 0 either, its equal to (void *)0, which is different.
Re:I'm still fond of this one (Score:1, Informative)
Meanwhile, the preprocessor symbol NULL is typically defined as 0 in stdlib.h, but any pro
Re:I'm still fond of this one (Score:2)
2) In the C++ standard, NULL is required to be 0
3) Programs are not free to change NULL. Doing so is unspecified behavior and leads to a non-standard comforming program
4) The reason NULL cannot be of type void* in C++ is that, unlike C, C++ does not allow implict casting from void*. Thus, int* p = malloc(sizeof(int)); is legal in C, but not C++.
Re:I'm still fond of this one (Score:2)
What the hell is ptr = NULL != 0 suppose to mean?
ptr = NULL; and ptr = 0; are equivalent statements in both languages. So, setting a pointer to NULL and comparing it for equality with 0 is always true. Thus, ptr = NULL != 0 is always false.
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:4, Insightful)
Re:I'm still fond of this one (Score:2)
Re:I'm still fond of this one (Score:1)
How, exactly, is it ugly/revolting ? I don't get it.
Re:I'm still fond of this one (Score:2)
Gcc's sanity-check-for-use-of-assignments-for-equality-
Splint flags it as a boolean expression containing a non-boolean value, but unless you are an exceedingly anal coder, you probably have this warning off.
Re:I'm still fond of this one (Score:2)
It won't, mainly because doing anything more complex could raise false alarms for what should be legitimate statements (e.g. if (ptr=fgets(buffer, 80, stdin)) { /* ... */ } )
GCC also allows including parenthesis to supress the check. Any experienced programmer would detect such holes, especially in the case of the Linux Kernel where there is a team dedicated to ensuring that changes are reviewed.
The only thing
Re:I'm still fond of this one (Score:1)
Important contest (Score:3, Insightful)
Virus writers and script kiddies are not a worry for this kind of code writing. The programmer you hire to write that AJAX extention to your website is also worth to worry about. This contest just shows how it is done.
Re:Important contest (Score:1, Informative)
Re: (Score:1)
Re:Important contest (Score:2, Informative)
Re:Important contest (Score:3, Informative)
Making Wrong Code Look Wrong (Score:3, Insightful)
Joel has a great article [joelonsoftware.com] on this.
Re:Or use a very strongly-typed language (Score:2)
Comment removed (Score:5, Funny)
Re:cute fluffy kittens! (Score:1)
Re:cute fluffy kittens! (Score:5, Funny)
Re: (Score:1)
Re:cute fluffy kittens! (Score:2)
Re:i fixed your cute fluffy kittens function (Score:2)
How about Curly-Wurliam Shakspere?
Corewar veterans (Score:4, Interesting)
Good practice for writing obscure, but useful, code.
I'd give clickable links but fear for these sites under load.
www.corewar.info/
www.corewar.co.uk/94nophof.txt
OT, nPaper II's ownership (Score:4, Interesting)
Even now that we have evolvers throwing tons of computing power at a relatively small search space (nano), John submitted something that rocketted to 1st place and manages more than 50% wins. Again, the dude is a corewar genius.
Paul(-Virak) Khuong
PS, note the position of the dash
First Prize (Score:1)
Re:First Prize (Score:1)
"Hennipen"
Props to brewery Ommegang and anyone who gives there stuff out.
Ken Thompson... (Score:5, Informative)
Reflections on Trusting Trust
http://www.acm.org/classics/sep95/ [acm.org]
Other interesting papers that come to mind include Tom Duff's on Unix viruses, as well as McIlroy.
Sam
sam @ iamsam.com
http:
So fingerprinting is evil now ... (Score:2)
The "hiding the code"-part is relevant in open-source systems, and I can think of a ton of valid uses for this kind of "evil" technology. Hell, I'd be glad if some kind of function was avalible in GIMP.
Re:divide by 0 (Score:2)
Re:divide by 0 (Score:2)
On second thought, nothing might happen, because i isn't used and so everything can be optimized away.
On third thought, that would be wrong, because it should (if compiled) crash, because that's what the program says :).
Re:divide by 0 (Score:2)