Thursday, February 28, 2008

DeCipher this...

This is one of the dirtiest C code I have ever written. If you can decipher this, you can consider yourself GOD in C. I know its pretty dumb to ask you to do this without knowing the context, but then to be GOD, you have to have such supernatural powers. :)

uint64 next_ptr
uint64 *HEAP;
uint64 heap_size;

if((*(uint64*)(*(uint64*)next_ptr - 8) > *(uint64*)&HEAP) &&
((long)(*(uint64*)(*(uint64*)next_ptr - 8) - *(uint64*)&HEAP)/8 < heap_size/2))
{
memcpy((uint64*)next_ptr, (uint64*)(*(uint64*)next_ptr - 8), sizeof(uint64));
}

3 comments:

Tapasya said...

Hahahaha!!!

It looks pretty similar to what I've written. Just that, I cleansed it up a little by using more variables :D

(Spcl msg to Prof. Collberg:: Bacchhe ki jaan lega kya?? )

Gandalf said...

And whatever happened to your 'blogging drive' ! Readers are waiting for more :)

Karthik said...

Gandalf.. comment incorporated :)