Skip to content

Instantly share code, notes, and snippets.

@BobuSumisu
Created July 4, 2014 21:14
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 BobuSumisu/08e7d4319dc579d1918b to your computer and use it in GitHub Desktop.
Save BobuSumisu/08e7d4319dc579d1918b to your computer and use it in GitHub Desktop.
int __cdecl decrypt(int src, int count, int dest, unsigned int key)
{
unsigned int r1; // eax@1
unsigned int r3; // edx@1
unsigned int r2; // ecx@1
int pos; // esi@2
char byte; // bl@4
char done; // zf@4
r1 = key;
r2 = key;
r3 = key;
if ( count > 0 )
{
pos = dest;
while ( 1 )
{
r1 += (r1 >> 3) + 3;
r2 += (r2 >> 5) + 5;
key += -9 - (key << 9);
byte = *(_BYTE *)(src - dest + pos++) ^ ((_BYTE)key + -7 - ((_BYTE)r3 << 7) + (_BYTE)r3 + r2 + (_BYTE)r1);
done = count-- == 1;
*(_BYTE *)(pos - 1) = byte;
if ( done )
break;
r3 += -7 - (r3 << 7);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment