Sections
Personal tools
You are here: Home people lamer Archive 2008 May 11 Fun code snippet
Document Actions

Fun code snippet

by lamer last modified 2008-05-11 11:49
Filed Under:

This small snippet is copied from a much popular application.

.text:1000EBE0 push ecx ; some_string
.text:1000EBE1 push '%'
.text:1000EBE3 push '%'
.text:1000EBE5 push offset aCsystemdriveCS ; "%cSystemDrive%c%s"
.text:1000EBEA push edx ; buffer
.text:1000EBEB call ds:swprintf

Translated to C:

swprintf(buffer, "%cSystemDrive%c%s", '%', '%', some_string);

Of course you'd be scratching your head to explain why the writer wrote it this way, instead of simply swprintf(buffer, "%%SystemDrive%%%s", some_string);. To show off great C-kungfu? Or the lack thereof? Anyway, I just thought it was funny enough to post.

Re: Fun code snippet

Posted by rd at 2008-05-13 19:39
LOLz


Powered by Plone CMS, the Open Source Content Management System