Advertisement
Guest User

Untitled

a guest
Oct 26th, 2014
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.62 KB | None | 0 0
  1. int __fastcall CallFunction(int Stack, struct_Function *Function, _DWORD *a3, void *Result)
  2. {
  3.   struct_v4 *tFunction; // esi@1
  4.   char v5; // zf@1
  5.   struct_v6 *tStack; // edi@1
  6.   int result; // eax@2
  7.   int v8; // eax@3
  8.   int v9; // eax@9
  9.   int Frame; // ebx@10
  10.   void *v11; // esp@11
  11.   struct_Property *Property; // esi@12
  12.   int PropertyFlags; // eax@13
  13.   int tCode; // eax@13
  14.   int tCodeP; // edx@13
  15.   int v16; // ecx@13
  16.   void *v17; // esp@14
  17.   int v18; // eax@14
  18.   int v19; // edx@16
  19.   int v20; // ebx@16
  20.   int v21; // ST0C_4@24
  21.   void (__thiscall *v22)(_DWORD, _DWORD, _DWORD); // edx@29
  22.   int v23; // ecx@32
  23.   char v24; // al@32
  24.   void *v25; // esp@34
  25.   int v26; // edx@34
  26.   void (__thiscall *v27)(_DWORD, _DWORD, _DWORD); // edx@37
  27.   int v28; // ST0C_4@37
  28.   int tCodeP2; // eax@38
  29.   int v30; // ecx@39
  30.   struct_Function *v31; // edi@40
  31.   int i; // esi@40
  32.   struct_Function *j; // esi@44
  33.   int v34; // ecx@45
  34.   __int16 v35; // ax@45
  35.   unsigned int v36; // [sp-4h] [bp-470h]@1
  36.   int v37; // [sp+0h] [bp-46Ch]@14
  37.   int v38; // [sp+4h] [bp-468h]@14
  38.   int v39; // [sp+8h] [bp-464h]@14
  39.   char v40; // [sp+10h] [bp-45Ch]@12
  40.   int v41; // [sp+2Ch] [bp-440h]@29
  41.   int v42; // [sp+30h] [bp-43Ch]@24
  42.   char v43; // [sp+38h] [bp-434h]@12
  43.   struct_Function *v44; // [sp+40h] [bp-42Ch]@1
  44.   int v45; // [sp+48h] [bp-424h]@10
  45.   int v46; // [sp+50h] [bp-41Ch]@12
  46.   void *tResult; // [sp+54h] [bp-418h]@1
  47.   int v48; // [sp+58h] [bp-414h]@1
  48.   char Buffer; // [sp+5Ch] [bp-410h]@4
  49.   unsigned int v50; // [sp+45Ch] [bp-10h]@1
  50.   int v51; // [sp+468h] [bp-4h]@12
  51.   int v52; // [sp+46Ch] [bp+0h]@1
  52.  
  53.   v50 = (unsigned int)&v52 ^ __security_cookie;
  54.   v36 = (unsigned int)&v52 ^ __security_cookie;
  55.   tFunction = (struct_v4 *)Function;
  56.   v5 = Function->iNative == 0;                  // is (Function->iNative)?
  57.   v48 = (int)a3;
  58.   tStack = (struct_v6 *)Stack;
  59.   tResult = Result;
  60.   v44 = Function;
  61.   if ( v5 )
  62.   {
  63.     v8 = Function->FunctionFlags;               // Function->FunctionFlags
  64.     if ( v8 & 0x400 )                           // IsNative? ( & FUNC_Native != 0)
  65.     {
  66.       if ( (*(int (__thiscall **)(_DWORD *, struct_Function *, char *, int))(*a3 + 292))(a3, Function, &Buffer, Stack) )
  67.         result = (int)sub_4522B0(tStack, tResult, (int)tFunction);
  68.       else
  69.         result = tFunction->Func(a3, tStack, tResult);
  70.     }
  71.     else
  72.     {
  73.       if ( v8 & 2 )
  74.       {
  75.         v9 = Function->PropertiesSize;
  76.         if ( v9 )
  77.         {
  78.           v11 = alloca(v9);
  79.           v45 = (int)&v36;
  80.           Frame = (int)&v36;
  81.         }
  82.         else
  83.         {
  84.           Frame = 0;
  85.           v45 = 0;
  86.         }
  87.         memset((void *)Frame, 0, Function->PropertiesSize);
  88.         sub_454CB0((int)&v40, (int)tFunction, v48, 0, Frame, (int)tStack);
  89.         v51 = 0;
  90.         v5 = *(_BYTE *)tStack->Code == 22;
  91.         Property = (struct_Property *)tFunction->Children;
  92.         v46 = (int)&v43;
  93.         if ( !v5 )
  94.         {
  95.           do
  96.           {
  97.             PropertyFlags = Property->PropertyFlags;
  98.             dword_1A7F79C &= 0xFFFFFFFDu;
  99.             v5 = (PropertyFlags & 0x100) == 0;  // Is CPF_OutParam
  100.             tCode = tStack->Code;
  101.             tCodeP = *(_BYTE *)tCode;
  102.             LODWORD(GPropAddr) = 0;
  103.             GPropObject = 0;
  104.             v16 = tStack->dword18;
  105.             if ( v5 )                           // If (Property->PropertyFlags & CPF_OutParm)
  106.             {
  107.               v20 = v42 + Property->Offset;
  108.               v21 = v42 + Property->Offset;
  109.               tStack->Code = tCode + 1;
  110.               ((void (__thiscall *)(int, struct_v6 *, int))*(&dword_193AAA0 + tCodeP))(v16, tStack, v21);
  111.             }
  112.             else
  113.             {
  114.               tStack->Code = tCode + 1;
  115.               ((void (__thiscall *)(int, struct_v6 *, _DWORD, unsigned int, int, int, int))*(&dword_193AAA0 + tCodeP))(
  116.                 v16,
  117.                 tStack,
  118.                 0,
  119.                 v36,
  120.                 v37,
  121.                 v38,
  122.                 v39);
  123.               v17 = alloca(16);
  124.               v18 = LODWORD(GPropAddr);
  125.               if ( !LODWORD(GPropAddr) )
  126.                 v18 = Frame + Property->Offset;
  127.               v19 = v46;
  128.               v37 = v18;
  129.               v36 = (unsigned int)Property;
  130.               v20 = v18;
  131.               if ( *(_DWORD *)v46 )
  132.               {
  133.                 *(_DWORD *)(*(_DWORD *)v46 + 8) = &v36;
  134.                 v46 = *(_DWORD *)v19 + 8;
  135.               }
  136.               else
  137.               {
  138.                 *(_DWORD *)v46 = &v36;
  139.               }
  140.               if ( GPropObject && GProperty && *(_DWORD *)(GProperty + 80) & 0x20 && !(Property->PropertyFlags & 2) )
  141.                 (*(void (__thiscall **)(int, int))(*(_DWORD *)GPropObject + 216))(GPropObject, GProperty);
  142.             }
  143.             if ( Property->PropertyFlags & 0x10 )
  144.             {
  145.               if ( dword_1A7F79C & 2 && *(_DWORD *)(Property->dword34 + 172) & 0x100000 )
  146.                 sub_490AF0((int)Property, v20);
  147.               v22 = (void (__thiscall *)(_DWORD, _DWORD, _DWORD))*(&dword_193AAA0 + *(_BYTE *)v41++);
  148.               v22(v48, &v40, v20);
  149.             }
  150.             Property = (struct_Property *)Property->Next;
  151.             Frame = v45;
  152.           }
  153.           while ( *(_BYTE *)tStack->Code != 22 );
  154.         }
  155.         ++tStack->Code;
  156.         for ( ; Property; Property = (struct_Property *)Property->Next )
  157.         {
  158.           v23 = Property->PropertyFlags;
  159.           v24 = Property->PropertyFlags;
  160.           v45 = Property->dword54;
  161.           if ( !(v24 & 0x10) )
  162.             break;
  163.           LODWORD(GPropAddr) = 0;
  164.           GPropObject = 0;
  165.           if ( v23 & 0x100 )
  166.           {
  167.             v25 = alloca(16);
  168.             v26 = v46;
  169.             v37 = Frame + Property->Offset;
  170.             v36 = (unsigned int)Property;
  171.             if ( *(_DWORD *)v46 )
  172.             {
  173.               *(_DWORD *)(*(_DWORD *)v46 + 8) = &v36;
  174.               v46 = *(_DWORD *)v26 + 8;
  175.             }
  176.             else
  177.             {
  178.               *(_DWORD *)v46 = &v36;
  179.             }
  180.           }
  181.           v27 = (void (__thiscall *)(_DWORD, _DWORD, _DWORD))*(&dword_193AAA0 + *(_BYTE *)v41);
  182.           v28 = Frame + Property->Offset;
  183.           ++v41;
  184.           v27(v48, &v40, v28);
  185.         }
  186.         tCodeP2 = tStack->Code;
  187.         if ( *(_BYTE *)tCodeP2 == 0x41 )
  188.         {
  189.           v30 = tStack->dword18;
  190.           tStack->Code = tCodeP2 + 1;
  191.           dword_193ABA4(v30, tStack, 0);
  192.         }
  193.         v31 = v44;
  194.         for ( i = *(_DWORD *)&v44[1].f0[6]; i; i = *(_DWORD *)(i + 64) )
  195.         {
  196.           if ( *(_DWORD *)(*(_DWORD *)(i + 52) + 172) & 0x100000 )
  197.             sub_490AF0(i, v42 + *(_DWORD *)(i + 104));
  198.         }
  199.         result = sub_4527F0(&v40, tResult);
  200.         for ( j = *(struct_Function **)&v31->f4C[28]; j; j = *(struct_Function **)&j->f4C[40] )
  201.         {
  202.           v34 = *(_DWORD *)&j->f4C[4];
  203.           v35 = *(_DWORD *)&j->f4C[4];
  204.           v44 = *(struct_Function **)&j->f4C[8];
  205.           if ( v35 & 0x100 )
  206.           {
  207.             result = 0;
  208.             if ( !(v34 & 0x10) )
  209.               continue;
  210.           }
  211.           result = (*(int (__thiscall **)(struct_Function *, int))(*(_DWORD *)&j->f0[0] + 412))(
  212.                      j,
  213.                      v42 + *(_DWORD *)&j->f4C[28]);
  214.         }
  215.       }
  216.       else
  217.       {
  218.         (*(void (__thiscall **)(_DWORD *, struct_Function *, char *, int))(*a3 + 292))(a3, Function, &Buffer, Stack);
  219.         result = (int)sub_4522B0(tStack, tResult, (int)tFunction);
  220.       }
  221.     }
  222.   }
  223.   else
  224.   {
  225.     result = Function->Func((int)a3, Stack, Result);
  226.   }
  227.   dword_1A7F79C &= 0xFFFFFFFDu;
  228.   return result;
  229. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement