Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.30 KB | None | 0 0
  1. signed int __thiscall dice::hfe::io::NetServer::_update(int this, int *a2)
  2. {
  3.   int v2; // esi
  4.   bool v3; // zf
  5.   int i; // ebx
  6.   int *v5; // ecx
  7.   int v6; // edi
  8.   int (__stdcall *v7)(char *); // edx
  9.   int v8; // eax
  10.   int v9; // ebp
  11.   int *v10; // ecx
  12.   int v11; // edi
  13.   int (__stdcall *v12)(char *); // eax
  14.   int v13; // eax
  15.   char *v14; // eax
  16.   int v15; // ecx
  17.   int v16; // edx
  18.   char *v17; // eax
  19.   char *v18; // edi
  20.   char *v19; // ST0C_4
  21.   int v20; // eax
  22.   int v21; // eax
  23.   int *v22; // edi
  24.   int v23; // eax
  25.   int *v24; // eax
  26.   int v25; // eax
  27.   int *v26; // ecx
  28.   int *v27; // eax
  29.   int v28; // eax
  30.   signed int result; // eax
  31.   __int64 v30; // [esp+10h] [ebp-54h]
  32.   int *v31; // [esp+18h] [ebp-4Ch]
  33.   int v32; // [esp+1Ch] [ebp-48h]
  34.   __int64 v33; // [esp+20h] [ebp-44h]
  35.   LARGE_INTEGER PerformanceCount; // [esp+28h] [ebp-3Ch]
  36.   __int64 v35; // [esp+30h] [ebp-34h]
  37.   char v36; // [esp+38h] [ebp-2Ch]
  38.   char *v37; // [esp+3Ch] [ebp-28h]
  39.   unsigned int v38; // [esp+50h] [ebp-14h]
  40.   int v39; // [esp+60h] [ebp-4h]
  41.  
  42.   v2 = this;
  43.   v3 = *(this + 1340) == 0;
  44.   v31 = a2;
  45.   if ( v3 )
  46.     *(this + 1340) = sub_A14780((this + 1264));
  47.   for ( i = (*(**(v2 + 1140) + 12))(*(v2 + 1132), 1472); i > 0; i = (*(**(v2 + 1140) + 12))(*(v2 + 1132), 1472) )
  48.   {
  49.     if ( dice::hfe::io::NetServer::m_outputDebugInfo )
  50.     {
  51.       std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string<char,std::char_traits<char>,std::allocator<char>>(&v36);
  52.       v5 = *(v2 + 1140);
  53.       v6 = *v5;
  54.       v7 = *(*v5 + 28);
  55.       v39 = 3;
  56.       v8 = v7(&v36);
  57.       (*(v6 + 36))(*(v2 + 1140), v8);
  58.       v39 = -1;
  59.       std::basic_string<char,std::char_traits<char>,std::allocator<char>>::~basic_string<char,std::char_traits<char>,std::allocator<char>>(&v36);
  60.     }
  61.     v9 = dice::hfe::io::PacketFilter::processPacket((v2 + 1396), *(v2 + 1132), i);
  62.     if ( v9 != 1 )
  63.     {
  64.       std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string<char,std::char_traits<char>,std::allocator<char>>(&v36);
  65.       v10 = *(v2 + 1140);
  66.       v11 = *v10;
  67.       v12 = *(*v10 + 28);
  68.       v39 = 7;
  69.       v13 = v12(&v36);
  70.       (*(v11 + 36))(*(v2 + 1140), v13);
  71.       v14 = v37;
  72.       if ( v38 < 0x10 )
  73.         v14 = &v37;
  74.       dice::hfe::io::PacketFilter::storePacket((v2 + 1396), *(v2 + 1132), i, v9, v14);
  75.       v39 = -1;
  76.       std::basic_string<char,std::char_traits<char>,std::allocator<char>>::~basic_string<char,std::char_traits<char>,std::allocator<char>>(&v36);
  77.       continue;
  78.     }
  79.     v15 = *(v2 + 1132);
  80.     ++*(v2 + 1288);
  81.     dice::hfe::io::BitStream::setBuffer(*(v2 + 1160), v15, i);
  82.     *(*(v2 + 1160) + 56) = 1;
  83.     if ( !dice::hfe::io::readBasicHeader(*(v2 + 1160), &v30 + 5, &v32) )
  84.       goto LABEL_27;
  85.     QueryPerformanceCounter(&PerformanceCount);
  86.     v16 = (PerformanceCount.QuadPart - *(v2 + 1264)) >> 32;
  87.     LODWORD(v35) = PerformanceCount.LowPart - *(v2 + 1264);
  88.     HIDWORD(v35) = v16;
  89.     v33 = (v35 / *(v2 + 1272) * 1000.0);
  90.     *(v2 + 1128) = v33;
  91.     if ( v32 == 9 )
  92.       goto LABEL_27;
  93.     if ( v32 == 1 )
  94.     {
  95.       *(v2 + 1112) = 0;
  96.       dice::hfe::io::NetServer::handleConnectRequest(v2);
  97.     }
  98.     else
  99.     {
  100.       v17 = std::_Rb_tree<int,std::pair<int const,dice::hfe::io::SWConnection *>,std::_Select1st<std::pair<int const,dice::hfe::io::SWConnection *>>,std::less<int>,std::allocator<std::pair<int const,dice::hfe::io::SWConnection *>>>::find(
  101.               v2,
  102.               SBYTE5(v30));
  103.       v18 = v17;
  104.       if ( !v17 )
  105.         goto LABEL_27;
  106.       LODWORD(v33) = *(v2 + 1140);
  107.       v19 = dice::hfe::io::SWConnection::getPeerAddress(v17);
  108.       v20 = (*(*v33 + 28))();
  109.       if ( !sub_A31CA0(v20, v19) )
  110.         goto LABEL_27;
  111.       *(v18 + 30) = *(v2 + 1128);
  112.       if ( v32 == 4 )
  113.       {
  114.         v21 = BYTE5(v30);
  115.         v22 = v31;
  116.         *(v2 + 1112) = 0;
  117.         *v22 = v21;
  118.         if ( !sub_A16090(v2, v21) )
  119.           dice::hfe::io::NetServer::storeConnectionEvent(v2, *v22, 1);
  120.         continue;
  121.       }
  122.       v23 = *(v18 + 39);
  123.       if ( v23 != 1 )
  124.       {
  125.         if ( v23 == 2 )
  126.         {
  127.           switch ( v32 )
  128.           {
  129.             case 5:
  130.               v25 = BYTE5(v30);
  131.               v26 = v31;
  132.               *(v2 + 1112) = 0;
  133.               *v26 = v25;
  134.               dice::hfe::io::NetServer::handleDisconnect(v2, v25);
  135.               break;
  136.             case 7:
  137.               v27 = v31;
  138.               *v31 = BYTE5(v30);
  139.               *(v2 + 1112) = 0;
  140.               dice::hfe::io::NetServer::handlePingRequest(v2, *v27);
  141.               break;
  142.             case 8:
  143.               v28 = BYTE5(v30);
  144.               *v31 = BYTE5(v30);
  145.               dice::hfe::io::NetServer::handlePingResponse(v2, v28);
  146.               break;
  147.             case 15:
  148.               v24 = v31;
  149.               *v31 = BYTE5(v30);
  150.               *(v2 + 1112) = i;
  151.               dice::hfe::io::NetServer::handleDataPacket(v2, *v24, i);
  152.               break;
  153.             default:
  154.               goto LABEL_27;
  155.           }
  156.           continue;
  157.         }
  158. LABEL_27:
  159.         *(v2 + 1112) = 0;
  160.         continue;
  161.       }
  162.       *(v18 + 39) = 1;
  163.       *(v18 + 30) = gettimeofday((v2 + 1264));
  164.       dice::hfe::io::NetServer::sendConnectAccept(v2, BYTE5(v30));
  165.     }
  166.   }
  167.   result = 8;
  168.   *(v2 + 1112) = 0;
  169.   return result;
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement