Guest User

decrypt

a guest
Aug 26th, 2012
610
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void __stdcall decrypt(char* Buf, unsigned int BufLen, char* Key)
  2. {
  3.   BYTE keyLen, tmpByte;
  4.   unsigned int i, j;
  5.   BYTE codeTable[256];
  6.  
  7.  
  8.   keyLen = strlen(Key);
  9.  
  10.   if ( keyLen > 0 )
  11.   {
  12.     for (i = 0 ; i < 256 ; i++)
  13.     {
  14.         codeTable[i] = i;
  15.     }
  16.     BYTE loc = 0, loc1 = 0;
  17.     for ( i = 0; i < 256; ++i )
  18.     {
  19.       loc = (BYTE)loc + codeTable[i] + *(BYTE *)(Key + i % keyLen);
  20.       tmpByte = codeTable[loc];
  21.       codeTable[loc] = codeTable[i];
  22.       codeTable[i] = tmpByte;
  23.     }
  24.     loc = 0;
  25.     loc1 = 0;
  26.     for ( j = 0; BufLen > j; ++j )
  27.     {
  28.       loc += 1;
  29.       loc1 = loc1 + codeTable[loc];
  30.       tmpByte = codeTable[loc1];
  31.       codeTable[loc1] = codeTable[loc];
  32.       codeTable[loc] = tmpByte;
  33.       tmpByte = codeTable[loc1] + tmpByte;
  34.       Buf[j] ^= codeTable[tmpByte];
  35.     }
  36.   }
  37. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×