Skip to content

Instantly share code, notes, and snippets.

@theahmadzai
Created August 21, 2019 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theahmadzai/ea50a834fafc1be2fa705e66f8a14438 to your computer and use it in GitHub Desktop.
Save theahmadzai/ea50a834fafc1be2fa705e66f8a14438 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char* argv[])
{
clock_t start, end;
double cpu_time_used;
start = clock();
char _m[4] = {'J','A','V'};
char _k[4] = {'B','D','N'};
int m = (int)((int*)m);
int k = (int)((int*)k);
int c = m ^ k;
for(int i = 0x1l; i < 0x7FFFFFFFl; i += 0x1)
{
if((i ^ c) == m)
{
int b = i ^ c;
printf("MATCHED\n");
for(int j = 0; j<4; j++)
{
printf("%d", (int)(b));
b = b >> 8;
}
break;
}
}
end = clock();
cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
printf("%f ms", cpu_time_used);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment