Skip to content

Instantly share code, notes, and snippets.

@coruus
Created September 2, 2014 17:34
Show Gist options
  • Save coruus/b0656c281f34f42d3ae0 to your computer and use it in GitHub Desktop.
Save coruus/b0656c281f34f42d3ae0 to your computer and use it in GitHub Desktop.
gpgwtf
const byte *
get_session_marker( size_t *rlen )
{
static byte marker[SIZEOF_UNSIGNED_LONG*2];
static int initialized;
if ( !initialized ) {
volatile ulong aa, bb;
ulong a, b;
initialized = 1;
a = aa ^ (ulong)getpid();
b = bb ^ (ulong)time(NULL);
memcpy( marker, &a, SIZEOF_UNSIGNED_LONG );
memcpy( marker+SIZEOF_UNSIGNED_LONG, &b, SIZEOF_UNSIGNED_LONG );
}
*rlen = sizeof(marker);
return marker;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment