Advertisement
DrBoat

Untitled

Feb 12th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.02 KB | None | 0 0
  1. int __cdecl dwords_count(int a1)
  2. {
  3.   return (*(int (__cdecl **)(int))((char *)&etext + 1))(a1) >> 2;
  4. }
  5.  
  6. signed int __cdecl hashf(_DWORD *a1)
  7. {
  8.   _DWORD *v2; // [esp+4h] [ebp-10h]
  9.   signed int v3; // [esp+8h] [ebp-Ch]
  10.   int v4; // [esp+Ch] [ebp-8h]
  11.   int i; // [esp+10h] [ebp-4h]
  12.  
  13.   v4 = dwords_count((int)a1);
  14.   v3 = -889266515;
  15.   v2 = a1;
  16.   for ( i = 0; i < v4; ++i )
  17.   {
  18.     v3 ^= *v2;
  19.     ++v2;
  20.   }
  21.   return v3;
  22. }
  23.  
  24. int __cdecl decode(_DWORD *a1, int a2)
  25. {
  26.   int result; // eax
  27.   int i; // [esp+0h] [ebp-Ch]
  28.   int v4; // [esp+4h] [ebp-8h]
  29.   _DWORD *v5; // [esp+8h] [ebp-4h]
  30.  
  31.   v5 = a1;
  32.   v4 = dwords_count((int)a1);
  33.   for ( i = 0; ; ++i )
  34.   {
  35.     result = i;
  36.     if ( i >= v4 )
  37.       break;
  38.     *v5 ^= a2;
  39.     ++v5;
  40.   }
  41.   return result;
  42. }
  43.  
  44. int __cdecl main(int argc, const char **argv, const char **envp)
  45. {
  46.   int result; // eax
  47.   char Str[21]; // [esp+3h] [ebp-21h]
  48.   int v5; // [esp+18h] [ebp-Ch]
  49.   int v6; // [esp+1Ch] [ebp-8h]
  50.   int v7; // [esp+20h] [ebp-4h]
  51.  
  52.   if ( argc >= 2 )
  53.   {
  54.     v7 = (*(int (__cdecl **)(const char *))((char *)&etext + 1))(argv[1]);
  55.     if ( v7 % 4 )
  56.     {
  57.       puts(aOkYouAreWrong);
  58.       result = 2;
  59.     }
  60.     else if ( !strcmp(argv[1], Str2) )
  61.     {
  62.       puts(aNotEnough);
  63.       result = 3;
  64.     }
  65.     else
  66.     {
  67.       v6 = hashf(argv[1]);
  68.       v5 = hashf(aFlag123realfla_0);
  69.       if ( v6 == v5 )
  70.       {
  71.         Str[0] = -29;
  72.         Str[1] = -57;
  73.         Str[2] = -19;
  74.         Str[3] = -113;
  75.         Str[4] = -34;
  76.         Str[5] = -33;
  77.         Str[6] = -28;
  78.         Str[7] = -127;
  79.         Str[8] = -10;
  80.         Str[9] = -44;
  81.         Str[10] = -27;
  82.         Str[11] = -101;
  83.         Str[12] = -6;
  84.         Str[13] = -58;
  85.         Str[14] = -11;
  86.         Str[15] = -105;
  87.         Str[16] = -18;
  88.         Str[17] = -50;
  89.         Str[18] = -11;
  90.         Str[19] = -75;
  91.         Str[20] = 0;
  92.         decode(Str, v6);
  93.         puts(Str);
  94.       }
  95.       result = 0;
  96.     }
  97.   }
  98.   else
  99.   {
  100.     puts(::Str);
  101.     result = 1;
  102.   }
  103.   return result;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement