SHARE
TWEET

Untitled

a guest Sep 28th, 2018 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _DWORD *__cdecl ParseCH_Segment7_Entry(int bufferOffset, int buffer, int canBeZero)
  2. {
  3.   int v3; // edi
  4.   unsigned int v4; // ebp
  5.   _DWORD *result; // eax
  6.   char v6; // al
  7.   _DWORD *actorInfoPtr; // eax
  8.   _DWORD *resultActorInfo; // esi
  9.   _DWORD *v9; // eax
  10.   int v10; // ecx
  11.   double v11; // st7
  12.   int v12; // eax
  13.   void *v13; // eax
  14.   int v14; // eax
  15.   char *v15; // eax
  16.   int v16; // eax
  17.   int v17; // eax
  18.   float bufferOffseta; // [esp+Ch] [ebp+4h]
  19.   float bufferOffsetb; // [esp+Ch] [ebp+4h]
  20.  
  21.   v3 = bufferOffset;
  22.   v4 = *(_DWORD *)(bufferOffset + 28);
  23.   if ( !v4 )
  24.   {
  25.     if ( *(_BYTE *)(bufferOffset + 4) == 1 )
  26.       *(_DWORD *)bufferOffset = -1;
  27.     return 0;
  28.   }
  29.   if ( !canBeZero )
  30.   {
  31.     result = *(_DWORD **)bufferOffset;
  32.     if ( *(_DWORD *)bufferOffset )
  33.       return result;
  34.   }
  35.   v6 = *(_BYTE *)(bufferOffset + 4);
  36.   switch ( v6 )
  37.   {
  38.     case 2:
  39.       sub_40D1D0(v4);
  40.       return 0;
  41.     case 1:
  42.       *(_DWORD *)bufferOffset = -1;
  43.       return 0;
  44.     case 4:
  45.       return 0;
  46.   }
  47.   actorInfoPtr = ActorInfo_Ctor();
  48.   resultActorInfo = actorInfoPtr;
  49.   if ( canBeZero )
  50.     actorInfoPtr[6] |= 0x100u;
  51.   else
  52.     *(_DWORD *)bufferOffset = actorInfoPtr;
  53.   actorInfoPtr[105] = bufferOffset;
  54.   *((_WORD *)actorInfoPtr + 200) = 0;
  55.   if ( *(_BYTE *)(bufferOffset + 4) == 3 )
  56.   {
  57.     v9 = sub_40F5A0(v4, 0);
  58.     resultActorInfo[89] = v9;
  59.     if ( !v9 )
  60.     {
  61. LABEL_27:
  62.       free(resultActorInfo);
  63.       *(_DWORD *)bufferOffset = 0;
  64.       return 0;
  65.     }
  66.     v10 = v9[2] + 288 * *(unsigned __int8 *)(bufferOffset + 5);
  67.     if ( *(_WORD *)(v10 + 38) == 100 )
  68.     {
  69.       resultActorInfo[6] &= 0xFFEFFFFF;
  70.       v11 = 1.0;
  71.     }
  72.     else
  73.     {
  74.       resultActorInfo[6] |= 0x100000u;
  75.       v11 = 100.0 / (double)*(unsigned __int16 *)(v10 + 38);
  76.     }
  77.     *((double *)resultActorInfo + 56) = v11;
  78.     v4 = *(_DWORD *)(v10 + 16);
  79.     resultActorInfo[4] = v4;
  80.     *((_WORD *)resultActorInfo + 180) = *(unsigned __int8 *)(bufferOffset + 5);
  81.     *((_WORD *)resultActorInfo + 200) = *(unsigned __int8 *)(v10 + 28);
  82.     *((float *)resultActorInfo + 93) = (double)*(unsigned int *)(v10 + 248);
  83.     sub_4421A0(resultActorInfo, v10);
  84.   }
  85.   else
  86.   {
  87.     *((float *)actorInfoPtr + 93) = 50.0;
  88.   }
  89.   *((float *)resultActorInfo + 94) = *((float *)resultActorInfo + 93) * 0.6000000238418579;
  90.   if ( v4 )
  91.   {
  92.     v12 = sub_40F000(v4);
  93.     resultActorInfo[16] = v12;
  94.     if ( !v12 )
  95.     {
  96.       v13 = (void *)resultActorInfo[89];
  97.       if ( v13 )
  98.         sub_40EAB0(v13, 0);
  99.       goto LABEL_27;
  100.     }
  101.     if ( (unsigned int)*((unsigned __int16 *)resultActorInfo + 200) >= *(_DWORD *)(v12 + 28) )
  102.       *((_WORD *)resultActorInfo + 200) = 0;
  103.     if ( !sub_4116F0(v4) && !*(_WORD *)(*(_DWORD *)(resultActorInfo[16] + 8) + 46) )
  104.       resultActorInfo[6] |= 0x200u;
  105.     v14 = resultActorInfo[16];
  106.     if ( *(_DWORD *)(v14 + 12) >= 0x10u && *(_WORD *)(*(_DWORD *)(v14 + 8) + 1262) )
  107.       resultActorInfo[6] |= 0x40u;
  108.   }
  109.   if ( v4 == 16795317 || v4 == 134221760 )
  110.     resultActorInfo[20] = 32;
  111.   v15 = sub_4106E0(v4);
  112.   strncpy((char *)resultActorInfo, v15, 7u);
  113.   resultActorInfo[4] = v4;
  114.   *((float *)resultActorInfo + 21) = (double)*(unsigned __int16 *)(bufferOffset + 6);
  115.   if ( *(_BYTE *)(bufferOffset + 4) != 3 )
  116.     *((_WORD *)resultActorInfo + 200) = *(unsigned __int8 *)(bufferOffset + 5);
  117.   if ( *(_BYTE *)(bufferOffset + 13) )
  118.     resultActorInfo[6] |= 4u;
  119.   v16 = *(unsigned __int8 *)(bufferOffset + 12);
  120.   resultActorInfo[19] = v16;
  121.   resultActorInfo[18] = v16;
  122.   bufferOffseta = (double)*(signed __int16 *)(bufferOffset + 16);
  123.   *((float *)resultActorInfo + 14) = bufferOffseta;
  124.   *((float *)resultActorInfo + 12) = bufferOffseta;
  125.   *((float *)resultActorInfo + 8) = bufferOffseta;
  126.   bufferOffsetb = (double)*(signed __int16 *)(v3 + 18);
  127.   *((float *)resultActorInfo + 15) = bufferOffsetb;
  128.   *((float *)resultActorInfo + 13) = bufferOffsetb;
  129.   *((float *)resultActorInfo + 9) = bufferOffsetb;
  130.   v17 = *(_DWORD *)(v3 + 32);
  131.   *(_DWORD *)((char *)resultActorInfo + 306) |= 0x10000u;
  132.   resultActorInfo[24] = v17;
  133.   resultActorInfo[23] = v17;
  134.   resultActorInfo[27] = -1;
  135.   *((_WORD *)resultActorInfo + 34) = -1;
  136.   resultActorInfo[33] = 0;
  137.   resultActorInfo[32] = 0;
  138.   *((_BYTE *)resultActorInfo + 412) = *(_BYTE *)(v3 + 14);
  139.   *((_BYTE *)resultActorInfo + 413) = *(_BYTE *)(v3 + 15);
  140.   if ( *(_BYTE *)(v3 + 8) )
  141.   {
  142.     if ( *(_BYTE *)(v3 + 8) == 1 )
  143.     {
  144.       resultActorInfo[6] &= 0xFFFFFFF7;
  145.     }
  146.     else if ( *(_BYTE *)(v3 + 8) == 2 )
  147.     {
  148.       resultActorInfo[6] |= 1u;
  149.     }
  150.   }
  151.   else
  152.   {
  153.     resultActorInfo[6] |= 8u;
  154.   }
  155.   sub_40EA00(resultActorInfo);
  156.   if ( !sub_423910(resultActorInfo) )
  157.   {
  158.     free(resultActorInfo);
  159.     *(_DWORD *)v3 = 0;
  160.     resultActorInfo = 0;
  161.   }
  162.   return resultActorInfo;
  163. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top