Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.53 KB | None | 0 0
  1. char __thiscall GetKey(struct_this *this, size_t Size)
  2. {
  3.   char result; // bl
  4.   void *buff; // eax
  5.  
  6.   result = 1;
  7.   if ( Size <= this->someSize )
  8.     goto LABEL_11;
  9.   result = 0;
  10.   if ( this->ptrBuff )
  11.     free(this->ptrBuff);
  12.   buff = malloc(Size);
  13.   this->ptrBuff = buff;
  14.   if ( buff )
  15.   {
  16.     this->someSize = Size;
  17.     result = 1;
  18.   }
  19.   ++this->someCounter;
  20.   if ( result )
  21.   {
  22. LABEL_11:
  23.     _mm_storel_epi64(&this->key1dest, _mm_loadl_epi64(&this->key1src));
  24.     _mm_storel_epi64(&this->key2dest, _mm_loadl_epi64(&this->key2src));
  25.   }
  26.   return result;
  27. }
  28.  
  29. int __thiscall sub_543AD0(struct_this *this, void *Dst, int a3, int a4)
  30. {
  31.   int v5; // eax
  32.   int v6; // edi
  33.   int result; // eax
  34.   DWORD time; // [esp+8h] [ebp-Ch]
  35.   int *decryptedBuff; // [esp+Ch] [ebp-8h]
  36.   int Size; // [esp+10h] [ebp-4h]
  37.  
  38.   v5 = this->dword1178;
  39.   if ( v5 )
  40.   {
  41.     if ( a4 < v5 )
  42.     {
  43.       Size = a4;
  44.       goto LABEL_6;
  45.     }
  46.   }
  47.   else
  48.   {
  49.     v5 = a4;
  50.   }
  51.   Size = v5;
  52. LABEL_6:
  53.   if ( this->dword1180 != 2 )
  54.     return 0;
  55.   if ( !GetKey(this, Size) )                    // get key
  56.     return 0;
  57.   time = GetTickCount();
  58.   decryptedBuff = this->ptrBuff;
  59.   v6 = DecryptBuffer(&this->byte113C, &this->dword18, Dst, 8 * Size, decryptedBuff);// do decryption
  60.   if ( v6 == 8 * Size )
  61.     memcpy(Dst, decryptedBuff, Size);           // copy data, is decrypted here
  62.   this->timeElapsed += GetTickCount() - time;
  63.   this->dwordC += a4;
  64.   ++this->dword8;
  65.   result = v6;
  66.   if ( v6 != a4 )
  67.     ++this->dword14;
  68.   return result;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement