MapCRC Reverse Engineering

Newbie Spellweaver
Joined
Apr 11, 2008
Messages
31
Reaction score
0
So... i am currently trying to RE the MapCRC using the KMST leak so i can properly calculate the movement packet CRC without having to manually log it every patch.

Currently im having trouble with what's displayed in

Code:
CWvsPhysicalSpace2D::Load

I understand up to half way where all of the foothold data are looped into the CRC32 function to be calculated. As for the second half? I believe it has something to do with the LadderRope tree within the map? But ladderrope has no correlation with the footholds. Unless i am not seeing the relationship between them. The part of the code in question is posted below.


Code:
if ( p.m_pInterface )        {
          v189 = (int)v5->m_aLadderOrRope.a + hr;
          v226[12] = 0;
          v226[11] = (volatile LONG *)i;
          nVRRight = &v226[11];
          v226[10] = (volatile LONG *)3758;
          v226[9] = (volatile LONG *)&v226[11];
          *(_DWORD *)v189 = i;
          v190 = StringPool::GetInstance();
          StringPool::GetBSTR(v190, (Ztl_bstr_t *)v226[9], (unsigned int)v226[10]);
          LOBYTE(v277) = 78;
          if ( !v187 )
            goto LABEL_4;
          LOBYTE(v277) = 77;
          v191 = IWzProperty::Getitem(v187, (Ztl_variant_t *)&v248, (Ztl_bstr_t)v226[11]);
          LOBYTE(v277) = 79;
          pData = (char *)(v189 + 4);
          v192 = get_int32(v191, (int)v226[12]);
          v36 = v248 == 8;
          *(_DWORD *)pData = v192 != 0;
          LOBYTE(v277) = 77;
          if ( v36 )
          {
            v248 = 0;
            if ( v249 )
              dword_27BD538(v249 - 4, v226[13], v226[14], v226[15], v226[16]);
          }
          else
          {
            VariantClear((VARIANTARG *)&v248);
          }
          v226[12] = 0;
          v226[11] = v193;
          nVRRight = &v226[11];
          v226[10] = (volatile LONG *)3759;
          v226[9] = (volatile LONG *)&v226[11];
          v194 = StringPool::GetInstance();
          StringPool::GetBSTR(v194, (Ztl_bstr_t *)v226[9], (unsigned int)v226[10]);
          LOBYTE(v277) = 77;
          v195 = IWzProperty::Getitem(v187, (Ztl_variant_t *)&v252, (Ztl_bstr_t)v226[11]);
          LOBYTE(v277) = 81;
          xMax = (const char *)(v189 + 8);
          v196 = get_int32(v195, (int)v226[12]);
          v36 = v252 == 8;
          *(_DWORD *)xMax = v196 != 0;
          LOBYTE(v277) = 77;
          if ( v36 )
          {
            v252 = 0;
            if ( v253 )
              dword_27BD538(v253 - 4, v226[13], v226[14], v226[15], v226[16]);
          }
          else
          {
            VariantClear((VARIANTARG *)&v252);
          }
          v226[12] = 0;
          v226[11] = v197;
          nVRRight = &v226[11];
          v226[10] = (volatile LONG *)1682;
          v226[9] = (volatile LONG *)&v226[11];
          v198 = StringPool::GetInstance();
          StringPool::GetBSTR(v198, (Ztl_bstr_t *)v226[9], (unsigned int)v226[10]);
          LOBYTE(v277) = 77;
          v199 = IWzProperty::Getitem(v187, (Ztl_variant_t *)&v256, (Ztl_bstr_t)v226[11]);
          LOBYTE(v277) = 83;
          dwSNPrev = (volatile LONG *)(v189 + 12);
          v200 = get_int32(v199, (int)v226[12]);
          v36 = v256 == 8;
          *dwSNPrev = v200;
          LOBYTE(v277) = 77;
          if ( v36 )
          {
            v256 = 0;
            if ( v257 )
              dword_27BD538(v257 - 4, v226[13], v226[14], v226[15], v226[16]);
          }
          else
          {
            VariantClear((VARIANTARG *)&v256);
          }
          v226[12] = 0;
          v226[11] = v201;
          nVRRight = &v226[11];
          v226[10] = (volatile LONG *)3756;
          v226[9] = (volatile LONG *)&v226[11];
          v202 = StringPool::GetInstance();
          StringPool::GetBSTR(v202, (Ztl_bstr_t *)v226[9], (unsigned int)v226[10]);
          LOBYTE(v277) = 77;
          v203 = IWzProperty::Getitem(v187, (Ztl_variant_t *)&v250, (Ztl_bstr_t)v226[11]);
          LOBYTE(v277) = 85;
          dwSNNext = (int *)(v189 + 16);
          v204 = get_int32(v203, (int)v226[12]);
          v36 = v250 == 8;
          *dwSNNext = v204;
          LOBYTE(v277) = 77;
          if ( v36 )
          {
            v250 = 0;
            if ( v251 )
              dword_27BD538(v251 - 4, v226[13], v226[14], v226[15], v226[16]);
          }
          else
          {
            VariantClear((VARIANTARG *)&v250);
          }
          v226[12] = 0;
          v226[11] = v205;
          nVRRight = &v226[11];
          v226[10] = (volatile LONG *)3757;
          v226[9] = (volatile LONG *)&v226[11];
          v206 = StringPool::GetInstance();
          StringPool::GetBSTR(v206, (Ztl_bstr_t *)v226[9], (unsigned int)v226[10]);
          LOBYTE(v277) = 77;
          v207 = IWzProperty::Getitem(v187, (Ztl_variant_t *)&v258, (Ztl_bstr_t)v226[11]);
          LOBYTE(v277) = 87;
          cantThrough = (const char *)(v189 + 20);
          v208 = get_int32(v207, (int)v226[12]);
          v36 = v258 == 8;
          *(_DWORD *)cantThrough = v208;
          LOBYTE(v277) = 77;
          if ( v36 )
          {
            v258 = 0;
            if ( v259 )
              dword_27BD538(v259 - 4, v226[13], v226[14], v226[15], v226[16]);
          }
          else
          {
            VariantClear((VARIANTARG *)&v258);
          }
          v226[12] = 0;
          v226[11] = v209;
          nVRRight = &v226[11];
          v226[10] = (volatile LONG *)2859;
          v226[9] = (volatile LONG *)&v226[11];
          v210 = StringPool::GetInstance();
          StringPool::GetBSTR(v210, (Ztl_bstr_t *)v226[9], (unsigned int)v226[10]);
          LOBYTE(v277) = 77;
          v211 = IWzProperty::Getitem(v187, (Ztl_variant_t *)&v254, (Ztl_bstr_t)v226[11]);
          LOBYTE(v277) = 89;
          forbidFallDown = (volatile LONG *)(v189 + 24);
          v212 = get_int32(v211, (int)v226[12]);
          v36 = v254 == 8;
          *forbidFallDown = v212;
          LOBYTE(v277) = 77;
          if ( v36 )
          {
            v254 = 0;
            if ( v255 )
              dword_27BD538(v255 - 4, v226[13], v226[14], v226[15], v226[16]);
          }
          else
          {
            VariantClear((VARIANTARG *)&v254);
          }
          v213 = (volatile LONG *)CCrc32::GetCrc32((const char *)v189, 4u, v5->m_dwCRC, 0, 0, 0, 0);
          v226[5] = 0;
          v226[4] = 0;
          v226[3] = 0;
          v226[2] = 0;
          v226[1] = v213;
          v226[0] = (volatile LONG *)4;
          v214 = pData;
          v5->m_dwCRC = (unsigned int)v213;
          v215 = CCrc32::GetCrc32(
                   v214,
                   (unsigned int)v226[0],
                   (unsigned int)v226[1],
                   (int)v226[2],
                   (unsigned int *)v226[3],
                   (int)v226[4],
                   (int)v226[5]);
          v5->m_dwCRC = v215;
          v216 = (volatile LONG *)CCrc32::GetCrc32(xMax, 4u, v215, 0, 0, 0, 0);
          v226[12] = 0;
          v226[11] = 0;
          v226[10] = 0;
          v226[9] = 0;
          v226[8] = v216;
          v226[7] = (volatile LONG *)4;
          v226[6] = dwSNPrev;
          v5->m_dwCRC = (unsigned int)v216;
          v217 = (volatile LONG *)CCrc32::GetCrc32(
                                    (const char *)v226[6],
                                    (unsigned int)v226[7],
                                    (unsigned int)v226[8],
                                    (int)v226[9],
                                    (unsigned int *)v226[10],
                                    (int)v226[11],
                                    (int)v226[12]);
          v226[5] = 0;
          v226[4] = 0;
          v226[3] = 0;
          v226[2] = 0;
          v226[1] = v217;
          v226[0] = (volatile LONG *)4;
          v218 = (const char *)dwSNNext;
          v5->m_dwCRC = (unsigned int)v217;
          v219 = CCrc32::GetCrc32(
                   v218,
                   (unsigned int)v226[0],
                   (unsigned int)v226[1],
                   (int)v226[2],
                   (unsigned int *)v226[3],
                   (int)v226[4],
                   (int)v226[5]);
          v5->m_dwCRC = v219;
          v220 = (volatile LONG *)CCrc32::GetCrc32(cantThrough, 4u, v219, 0, 0, 0, 0);
          v226[12] = 0;
          v226[11] = 0;
          v226[10] = 0;
          v226[9] = 0;
          v226[8] = v220;
          v226[7] = (volatile LONG *)4;
          v226[6] = forbidFallDown;
          v5->m_dwCRC = (unsigned int)v220;
          v5->m_dwCRC = CCrc32::GetCrc32(
                          (const char *)v226[6],
                          (unsigned int)v226[7],
                          (unsigned int)v226[8],
                          (int)v226[9],
                          (unsigned int *)v226[10],
                          (int)v226[11],
                          (int)v226[12]);
          v221 = (void (*)(void))v187->baseclass_0.baseclass_0.vfptr->Release;
          v226[12] = (volatile LONG *)v187;
          LOBYTE(v277) = 7;
          v221();
          v180 = i;
        }
        else
        {
          LOBYTE(v277) = 7;
          if ( p.m_pInterface )
          {
            v188 = (void (*)(void))p.m_pInterface->baseclass_0.baseclass_0.vfptr->Release;
            v226[12] = (volatile LONG *)p.m_pInterface;
            v188();
          }
        }
        hr += 32;
        i = ++v180;
      }

Your help is very much appreciated.
 
Assuming you're a server developer and not a packet editor/exploiter (which, if I may add, is actually not allowed here), then you won't ever have a need to reverse Nexon's CRC checks. When it comes to "calculating movement" packet-wise, you don't actually need any real CRC checks -- just the packet data from MovePath. WvsPhysicalSpace2D on the client-end, you have to realize, is not specific to loading just the CRC upon initialization. This is also loading actual data of the ladders and ropes. It's not about "footholds" specifically, that's what CStaticFoothold is strictly for, the physical space is for objects within the map that have the use of footholds (which includes ladders and ropes to be parsed, in addition to field VR limits).
 
Upvote 0
Assuming you're a server developer and not a packet editor/exploiter (which, if I may add, is actually not allowed here), then you won't ever have a need to reverse Nexon's CRC checks. When it comes to "calculating movement" packet-wise, you don't actually need any real CRC checks -- just the packet data from MovePath. WvsPhysicalSpace2D on the client-end, you have to realize, is not specific to loading just the CRC upon initialization. This is also loading actual data of the ladders and ropes. It's not about "footholds" specifically, that's what CStaticFoothold is strictly for, the physical space is for objects within the map that have the use of footholds (which includes ladders and ropes to be parsed, in addition to field VR limits).


Yes i understand that it is data being loaded. But that data is also being used to calculate the CRC which shows up in the movement packet. The crc is in the movepath packet data but it is not calculated there. It is calculated in 4 different methods, constant, portal, footholds&ladders?, and the map info.
I'm focused more on the actual formula that goes into the packet.
 
Upvote 0
Yes i understand that it is data being loaded. But that data is also being used to calculate the CRC which shows up in the movement packet. The crc is in the movepath packet data but it is not calculated there. It is calculated in 4 different methods, constant, portal, footholds&ladders?, and the map info.
I'm focused more on the actual formula that goes into the packet.

Huh? Packets NEVER require CRC. A client->server packet (thus, a server-end handler) will have CRC checks to compare, yes, but you never construct CRC to send to the client in regular game packets. This is all you decode for the movepath in KMST PDB:

Code:
void __thiscall CMovePathCommon::Decode(CMovePathCommon *this, CInPacket *iPacket, int bPassive)
{
  CMovePathCommon *v3; // ebx@1
  CInPacket *v4; // edi@1
  __int16 v5; // si@1
  CMovePathCommon::ELEM *v6; // esi@3
  ZRefCountedDummy<CMovePathCommon::ELEM> *v7; // eax@3
  int v8; // eax@4
  int v9; // ecx@7
  CMovePathCommon::ELEM *v10; // esi@9
  CMovePathCommon::ELEM *v11; // eax@9
  char *v12; // ecx@12
  char v13; // al@17
  unsigned __int8 v14; // cl@17
  int v15; // eax@17
  unsigned int v16; // ebp@17
  int v17; // edx@17
  int v18; // ecx@17
  __int16 v19; // ax@19
  __int16 v20; // ax@19
  __int16 v21; // ax@19
  __int16 v22; // ax@19
  __int16 v23; // ax@19
  __int16 v24; // ax@21
  __int16 v25; // ax@22
  __int16 v26; // ax@22
  __int16 v27; // ax@23
  __int16 v28; // ax@23
  __int16 v29; // ax@23
  __int16 v30; // ax@23
  __int16 v31; // ax@23
  __int16 v32; // ax@24
  __int16 v33; // ax@24
  __int16 v34; // ax@26
  unsigned int v35; // eax@27
  __int16 v36; // cx@27
  __int16 *v37; // edx@27
  char v38; // bl@29
  char v39; // al@29
  char v40; // cl@29
  int v41; // eax@29
  __int16 v42; // ax@29
  char v43; // bl@29
  char v44; // al@29
  unsigned __int8 v45; // cl@29
  int v46; // eax@29
  unsigned int v47; // ST1C_4@29
  __int16 v48; // ax@32
  __int16 v49; // ax@32
  __int16 v50; // ax@32
  __int16 v51; // ax@33
  __int16 v52; // ax@33
  __int16 v53; // ax@34
  __int16 v54; // ax@34
  __int16 v55; // ax@34
  char v56; // al@35
  __int16 v57; // bp@35
  int v58; // ecx@36
  __int16 ox; // [sp+14h] [bp-3Ch]@1
  __int16 oy; // [sp+18h] [bp-38h]@1
  __int16 ovx; // [sp+1Ch] [bp-34h]@1
  __int16 ovy; // [sp+20h] [bp-30h]@1
  int i; // [sp+24h] [bp-2Ch]@1
  CMovePathCommon *v64; // [sp+28h] [bp-28h]@1
  int pExceptionObject; // [sp+2Ch] [bp-24h]@1
  MPA_INFO info; // [sp+34h] [bp-1Ch]@39
  int v67; // [sp+4Ch] [bp-4h]@3
  char iPacketa; // [sp+54h] [bp+4h]@17

  v3 = this;
  v64 = this;
  v4 = iPacket;
  this->m_tEncodedGatherDuration = CInPacket::Decode4(iPacket);
  v5 = CInPacket::Decode2(iPacket);
  v3->_ZtlSecureTear_m_x_CS = _ZtlSecureTear<short>(v5, v3->_ZtlSecureTear_m_x);
  ox = v5;
  oy = CInPacket::Decode2(iPacket);
  v3->_ZtlSecureTear_m_y_CS = _ZtlSecureTear<short>(oy, v3->_ZtlSecureTear_m_y);
  ovx = CInPacket::Decode2(iPacket);
  ovy = CInPacket::Decode2(iPacket);
  i = 0;
  pExceptionObject = CInPacket::Decode1(iPacket);
  if ( pExceptionObject > 0 )
  {
    do
    {
      v6 = v3->m_lElem._m_pTail;
      v7 = ZRecyclableAvBuffer<ZRefCountedDummy<CMovePathCommon::ELEM>,16,CMovePathCommon::ELEM>::raw_new(ZRecyclableAvBuffer<ZRefCountedDummy<CMovePathCommon::ELEM>,16,CMovePathCommon::ELEM>::s_pInstance);
      v67 = 0;
      if ( v7 )
        ZRefCountedDummy<CMovePathCommon::ELEM>::ZRefCountedDummy<CMovePathCommon::ELEM>(v7);
      else
        v8 = 0;
      v67 = -1;
      if ( v6 )
        v9 = v6[-1]._ZtlSecureTear_bMoveAction;
      else
        v9 = 0;
      *(v8 + 8) = v9;
      *(v8 + 4) = 0;
      ++v3->m_lElem._m_uCount;
      v10 = (v8 + 16);
      v11 = v3->m_lElem._m_pTail;
      if ( v11 )
      {
        if ( v10 )
          v12 = v10[-1]._ZtlSecureTear_bMoveAction;
        else
          v12 = 0;
        v11[-1]._ZtlSecureTear_bMoveAction_CS = v12;
        if ( v12 )
          v10 = (v12 + 16);
        else
          v10 = 0;
      }
      else
      {
        v3->m_lElem._m_pHead = v10;
      }
      v3->m_lElem._m_pTail = v10;
      iPacketa = CInPacket::Decode1(v4);
      v13 = CRand32::Random(&g_rand);
      v10->_ZtlSecureTear_nAttr[0] = v13;
      v14 = iPacketa ^ v13;
      v10->_ZtlSecureTear_nAttr[1] = iPacketa ^ v13;
      v15 = __ROR4__(v13 ^ 0xBAADF00D, 5);
      v16 = v14 + v15;
      v10->_ZtlSecureTear_nAttr_CS = v16;
      v17 = v10->_ZtlSecureTear_nAttr[1];
      v18 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
      if ( v17 + v18 != v16 )
      {
        pExceptionObject = 5;
        _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
      }
      switch ( (v17 ^ v10->_ZtlSecureTear_nAttr[0]) )
      {
        case 0u:
        case 8u:
        case 0xFu:
        case 0x11u:
        case 0x13u:
        case 0x41u:
        case 0x42u:
        case 0x43u:
          v19 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(v19, v10->_ZtlSecureTear_x);
          v20 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(v20, v10->_ZtlSecureTear_y);
          v21 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(v21, v10->_ZtlSecureTear_vx);
          v22 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(v22, v10->_ZtlSecureTear_vy);
          v23 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_fh_CS = _ZtlSecureTear<short>(v23, v10->_ZtlSecureTear_fh);
          if ( CMovePathCommon::ELEM::_ZtlSecureGet_nAttr(v10) == 15
            || CMovePathCommon::ELEM::_ZtlSecureGet_nAttr(v10) == 17 )
          {
            v24 = CInPacket::Decode2(v4);
            v10->_ZtlSecureTear_fhFallStart_CS = _ZtlSecureTear<short>(v24, v10->_ZtlSecureTear_fhFallStart);
          }
          v25 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_xOffset_CS = _ZtlSecureTear<short>(v25, v10->_ZtlSecureTear_xOffset);
          v26 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_yOffset_CS = _ZtlSecureTear<short>(v26, v10->_ZtlSecureTear_yOffset);
          goto LABEL_29;
        case 0x37u:
        case 0x40u:
          v27 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(v27, v10->_ZtlSecureTear_x);
          v28 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(v28, v10->_ZtlSecureTear_y);
          v29 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(v29, v10->_ZtlSecureTear_vx);
          v30 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(v30, v10->_ZtlSecureTear_vy);
          v31 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_fh_CS = _ZtlSecureTear<short>(v31, v10->_ZtlSecureTear_fh);
          goto LABEL_29;
        case 1u:
        case 2u:
        case 0x12u:
        case 0x15u:
        case 0x16u:
        case 0x18u:
        case 0x3Cu:
        case 0x3Du:
        case 0x3Eu:
        case 0x3Fu:
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(ox, v10->_ZtlSecureTear_x);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(oy, v10->_ZtlSecureTear_y);
          v10->_ZtlSecureTear_fh_CS = _ZtlSecureTear<short>(0, v10->_ZtlSecureTear_fh);
          v32 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(v32, v10->_ZtlSecureTear_vx);
          v33 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(v33, v10->_ZtlSecureTear_vy);
          if ( CMovePathCommon::ELEM::_ZtlSecureGet_nAttr(v10) == 21
            || CMovePathCommon::ELEM::_ZtlSecureGet_nAttr(v10) == 22 )
          {
            goto LABEL_26;
          }
          goto LABEL_29;
        case 0x1Cu:
        case 0x1Du:
        case 0x1Eu:
        case 0x1Fu:
        case 0x20u:
        case 0x21u:
        case 0x22u:
        case 0x23u:
        case 0x24u:
        case 0x25u:
        case 0x26u:
        case 0x27u:
        case 0x28u:
        case 0x29u:
        case 0x2Au:
        case 0x2Bu:
        case 0x2Cu:
        case 0x2Du:
        case 0x2Eu:
        case 0x2Fu:
        case 0x30u:
        case 0x31u:
        case 0x32u:
        case 0x38u:
        case 0x39u:
        case 0x3Au:
        case 0x3Bu:
        case 0x44u:
        case 0x45u:
        case 0x46u:
        case 0x48u:
        case 0x4Du:
        case 0x4Fu:
        case 0x51u:
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(ox, v10->_ZtlSecureTear_x);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(oy, v10->_ZtlSecureTear_y);
          v35 = _ZtlSecureTear<short>(ovx, v10->_ZtlSecureTear_vx);
          v36 = ovy;
          v10->_ZtlSecureTear_vx_CS = v35;
          v37 = v10->_ZtlSecureTear_vy;
          goto LABEL_28;
        case 3u:
        case 4u:
        case 5u:
        case 6u:
        case 7u:
        case 9u:
        case 0xAu:
        case 0xBu:
        case 0xDu:
        case 0x1Au:
        case 0x1Bu:
        case 0x33u:
        case 0x34u:
        case 0x35u:
        case 0x4Au:
        case 0x4Bu:
        case 0x4Cu:
        case 0x4Eu:
        case 0x50u:
          v48 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(v48, v10->_ZtlSecureTear_x);
          v49 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(v49, v10->_ZtlSecureTear_y);
          v50 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_fh_CS = _ZtlSecureTear<short>(v50, v10->_ZtlSecureTear_fh);
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(0, v10->_ZtlSecureTear_vy);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(0, v10->_ZtlSecureTear_vx);
          goto LABEL_29;
        case 0xEu:
        case 0x10u:
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(ox, v10->_ZtlSecureTear_x);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(oy, v10->_ZtlSecureTear_y);
          v10->_ZtlSecureTear_fh_CS = _ZtlSecureTear<short>(0, v10->_ZtlSecureTear_fh);
          v51 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(v51, v10->_ZtlSecureTear_vx);
          v52 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(v52, v10->_ZtlSecureTear_vy);
LABEL_26:
          v34 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_fhFallStart_CS = _ZtlSecureTear<short>(v34, v10->_ZtlSecureTear_fhFallStart);
          goto LABEL_29;
        case 0x17u:
          v53 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(v53, v10->_ZtlSecureTear_x);
          v54 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(v54, v10->_ZtlSecureTear_y);
          v55 = CInPacket::Decode2(v4);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(v55, v10->_ZtlSecureTear_vx);
          v36 = CInPacket::Decode2(v4);
          v37 = v10->_ZtlSecureTear_vy;
LABEL_28:
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(v36, v37);
          goto LABEL_29;
        case 0xCu:
          v56 = CInPacket::Decode1(v4);
          CMovePathCommon::ELEM::_ZtlSecurePut_bSN(v10, v56);
          v10->_ZtlSecureTear_x_CS = _ZtlSecureTear<short>(ox, v10->_ZtlSecureTear_x);
          v10->_ZtlSecureTear_y_CS = _ZtlSecureTear<short>(oy, v10->_ZtlSecureTear_y);
          v10->_ZtlSecureTear_tElapse_CS = _ZtlSecureTear<short>(0, v10->_ZtlSecureTear_tElapse);
          v57 = CMovePathCommon::ELEM::_ZtlSecurePut_bMoveAction(v10, 0);
          v10->_ZtlSecureTear_vy_CS = _ZtlSecureTear<short>(v57, v10->_ZtlSecureTear_vy);
          v10->_ZtlSecureTear_vx_CS = _ZtlSecureTear<short>(v57, v10->_ZtlSecureTear_vx);
          v10->_ZtlSecureTear_fh_CS = _ZtlSecureTear<short>(v57, v10->_ZtlSecureTear_fh);
          break;
        default:
          v58 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
          if ( v10->_ZtlSecureTear_nAttr[1] + v58 != v16 )
          {
            pExceptionObject = 5;
            _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
          }
          if ( (v10->_ZtlSecureTear_nAttr[1] ^ v10->_ZtlSecureTear_nAttr[0]) != 71
            && (v10->_ZtlSecureTear_nAttr[1] ^ v10->_ZtlSecureTear_nAttr[0]) != 73 )
          {
LABEL_29:
            v38 = CInPacket::Decode1(v4);
            v39 = CRand32::Random(&g_rand);
            v10->_ZtlSecureTear_bMoveAction[0] = v39;
            v40 = v38 ^ v39;
            v41 = __ROR4__(v39 ^ 0xBAADF00D, 5);
            v10->_ZtlSecureTear_bMoveAction[1] = v40;
            v10->_ZtlSecureTear_bMoveAction_CS = v40 + v41;
            v42 = CInPacket::Decode2(v4);
            v10->_ZtlSecureTear_tElapse_CS = _ZtlSecureTear<short>(v42, v10->_ZtlSecureTear_tElapse);
            v43 = CInPacket::Decode1(v4);
            v44 = CRand32::Random(&g_rand);
            v10->_ZtlSecureTear_bForcedStop[0] = v44;
            v10->_ZtlSecureTear_bForcedStop[1] = v43 ^ v44;
            v45 = v43 ^ v44;
            v46 = __ROR4__(v44 ^ 0xBAADF00D, 5);
            v47 = v10->_ZtlSecureTear_x_CS;
            v10->_ZtlSecureTear_bForcedStop_CS = v45 + v46;
            ox = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_x, v47);
            oy = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_y, v10->_ZtlSecureTear_y_CS);
            ovx = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vx, v10->_ZtlSecureTear_vx_CS);
            v3 = v64;
            ovy = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vy, v10->_ZtlSecureTear_vy_CS);
          }
          else
          {
            info.nMPA = 0;
            info.nParam3 = 0;
            info.nParam6 = 0;
            info.nParam1 = 0;
            info.nParam2 = 0;
            info.nParam4 = 0;
            info.nParam5 = 0;
            MPA_INFO::Decode(&info, v4);
            MPA_INFO::Get(&info, v10);
          }
          break;
      }
      ++i;
    }
    while ( i < pExceptionObject );
  }
}

Nothing here uses CRC, it's all simply decoding in the bytes, just like it's always been..
 
Upvote 0
I don't think we're talking about the same thing. I'm talking about a client to server packet. Not a server decoding packet. Hence not in the "server development" section but rather the "other development" section.
 
Upvote 0
I don't think we're talking about the same thing. I'm talking about a client to server packet. Not a server decoding packet. Hence not in the "server development" section but rather the "other development" section.

Other development simply means the information we're talking about is not related to our OdinMS emulators. If you're dealing with anything other than Java directly, it goes to the Other Developments section. It can be server related and still appear here, just not in Java.

Decode is the same thing as Encode when it comes to the data. You decode the same amount of bytes in the buffer as you do encoding it. There is no CRC checks when you send a Move packet, as there are no direct MovePath CRC checks when you encode it. This is the client->server movepath:

Code:
void __thiscall CMovePathCommon::Encode(CMovePathCommon *this, COutPacket *oPacket, int *pbPassive, bool bMobMove)
{
  CMovePathCommon *v4; // esi@1
  COutPacket *v5; // edi@1
  unsigned __int16 v6; // ax@1
  unsigned __int16 v7; // ax@1
  unsigned __int16 v8; // ax@1
  unsigned __int16 v9; // ax@1
  CMovePathCommon::ELEM *v10; // esi@1
  char *v11; // eax@5
  int v12; // eax@7
  int v13; // ecx@10
  char v14; // bl@10
  int v15; // eax@10
  char *v16; // eax@11
  unsigned int *v17; // ebp@11
  unsigned int v18; // ecx@13
  unsigned int v19; // eax@14
  int v20; // edx@18
  unsigned int v21; // ebx@18
  int v22; // eax@18
  unsigned __int16 v23; // ax@20
  unsigned __int16 v24; // ax@20
  unsigned __int16 v25; // ax@20
  unsigned __int16 v26; // ax@20
  unsigned __int16 v27; // ax@20
  int v28; // edx@20
  int v29; // eax@20
  unsigned __int16 v30; // ax@23
  unsigned __int16 v31; // ax@24
  unsigned __int16 v32; // ax@24
  int v33; // ecx@26
  char v34; // bl@26
  int v35; // eax@26
  unsigned int v36; // edx@28
  unsigned __int16 v37; // ax@29
  unsigned __int16 v38; // ax@29
  unsigned __int16 v39; // ax@29
  unsigned __int16 v40; // ax@29
  unsigned __int16 v41; // ST08_2@29
  unsigned __int16 v42; // ax@30
  unsigned __int16 v43; // ax@30
  int v44; // edx@30
  int v45; // eax@30
  unsigned __int16 v46; // ST08_2@33
  unsigned __int16 v47; // ax@34
  unsigned __int16 v48; // ax@34
  unsigned __int16 v49; // ST08_2@34
  unsigned __int16 v50; // ax@35
  unsigned __int16 v51; // ax@35
  unsigned __int16 v52; // ST08_2@35
  unsigned __int16 v53; // ax@36
  unsigned __int16 v54; // ax@36
  unsigned __int16 v55; // ax@36
  char v56; // al@37
  char v57; // cl@38
  int v58; // eax@38
  unsigned int v59; // eax@41
  unsigned int v60; // ecx@43
  unsigned int v61; // eax@44
  unsigned int v62; // eax@48
  unsigned int v63; // ecx@50
  unsigned int v64; // eax@51
  unsigned int v65; // eax@55
  unsigned int v66; // ecx@57
  unsigned int v67; // eax@58
  unsigned int v68; // eax@62
  unsigned int v69; // ecx@64
  unsigned int v70; // eax@65
  unsigned int v71; // eax@69
  unsigned int v72; // ecx@71
  unsigned int v73; // eax@72
  unsigned int v74; // eax@76
  unsigned int v75; // ecx@78
  unsigned int v76; // eax@79
  unsigned int v77; // eax@83
  unsigned int v78; // ecx@85
  unsigned int v79; // eax@86
  unsigned int v80; // ecx@92
  unsigned int v81; // eax@93
  __int16 v82; // bx@97
  unsigned int v83; // eax@97
  unsigned int v84; // ecx@99
  unsigned int v85; // eax@100
  int v86; // ecx@104
  char v87; // bl@104
  int v88; // eax@104
  unsigned int v89; // eax@105
  unsigned int v90; // ecx@107
  unsigned int v91; // eax@108
  int pExceptionObject; // [sp+8h] [bp-28h]@115
  int v93; // [sp+Ch] [bp-24h]@115
  int v94; // [sp+10h] [bp-20h]@120
  int v95; // [sp+14h] [bp-1Ch]@120
  int v96; // [sp+18h] [bp-18h]@121
  int v97; // [sp+1Ch] [bp-14h]@115
  MPA_INFO info; // [sp+20h] [bp-10h]@41

  v4 = this;
  v5 = oPacket;
  COutPacket::Encode4(oPacket, this->m_tEncodedGatherDuration);
  v6 = _ZtlSecureFuse<short>(v4->_ZtlSecureTear_m_x, v4->_ZtlSecureTear_m_x_CS);
  COutPacket::Encode2(v5, v6);
  v7 = _ZtlSecureFuse<short>(v4->_ZtlSecureTear_m_y, v4->_ZtlSecureTear_m_y_CS);
  COutPacket::Encode2(v5, v7);
  v8 = _ZtlSecureFuse<short>(v4->_ZtlSecureTear_m_vx, v4->_ZtlSecureTear_m_vx_CS);
  COutPacket::Encode2(v5, v8);
  v9 = _ZtlSecureFuse<short>(v4->_ZtlSecureTear_m_vy, v4->_ZtlSecureTear_m_vy_CS);
  COutPacket::Encode2(v5, v9);
  COutPacket::Encode1(v5, v4->m_lElem._m_uCount);
  v10 = v4->m_lElem._m_pHead;
  if ( v10 )
  {
    while ( 1 )
    {
      if ( v10 )
        v11 = v10[-1]._ZtlSecureTear_bMoveAction;
      else
        v11 = 0;
      v12 = *(v11 + 1);
      if ( v12 )
        oPacket = (v12 + 16);
      else
        oPacket = 0;
      v13 = v10->_ZtlSecureTear_nAttr[1];
      v14 = v13 ^ v10->_ZtlSecureTear_nAttr[0];
      v15 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
      if ( v13 + v15 != v10->_ZtlSecureTear_nAttr_CS )
      {
        pExceptionObject = 5;
        v93 = v97;
        _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
      }
      v16 = v5->m_aSendBuff.a;
      v17 = &v5->m_aSendBuff;
      if ( v16 )
        v16 = *(v16 - 1);
      v18 = v5->m_uOffset + 1;
      if ( v18 > v16 )
      {
        v19 = *v17;
        if ( *v17 )
          v19 = *(v19 - 4);
        do
          v19 *= 2;
        while ( v18 > v19 );
        ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v19, 0, &oPacket);
      }
      *(v5->m_uOffset++ + *v17) = v14;
      v20 = v10->_ZtlSecureTear_nAttr[1];
      v21 = v10->_ZtlSecureTear_nAttr_CS;
      v22 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
      if ( v20 + v22 != v21 )
      {
        pExceptionObject = 5;
        v93 = v97;
        _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
      }
      switch ( (v20 ^ v10->_ZtlSecureTear_nAttr[0]) )
      {
        case 0u:
        case 8u:
        case 15u:
        case 17u:
        case 19u:
        case 65u:
        case 66u:
        case 67u:
          v23 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_x, v10->_ZtlSecureTear_x_CS);
          COutPacket::Encode2(v5, v23);
          v24 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_y, v10->_ZtlSecureTear_y_CS);
          COutPacket::Encode2(v5, v24);
          v25 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vx, v10->_ZtlSecureTear_vx_CS);
          COutPacket::Encode2(v5, v25);
          v26 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vy, v10->_ZtlSecureTear_vy_CS);
          COutPacket::Encode2(v5, v26);
          v27 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_fh, v10->_ZtlSecureTear_fh_CS);
          COutPacket::Encode2(v5, v27);
          v28 = v10->_ZtlSecureTear_nAttr[1];
          v29 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
          if ( v28 + v29 != v10->_ZtlSecureTear_nAttr_CS )
          {
            pExceptionObject = 5;
            v93 = v97;
            _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
          }
          if ( (v28 ^ v10->_ZtlSecureTear_nAttr[0]) == 0xF || CMovePathCommon::ELEM::_ZtlSecureGet_nAttr(v10) == 0x11 )
          {
            v30 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_fhFallStart, v10->_ZtlSecureTear_fhFallStart_CS);
            COutPacket::Encode2(v5, v30);
          }
          v31 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_xOffset, v10->_ZtlSecureTear_xOffset_CS);
          COutPacket::Encode2(v5, v31);
          v32 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_yOffset, v10->_ZtlSecureTear_yOffset_CS);
          goto LABEL_25;
        case 28u:
        case 29u:
        case 30u:
        case 31u:
        case 32u:
        case 33u:
        case 34u:
        case 35u:
        case 36u:
        case 37u:
        case 38u:
        case 39u:
        case 40u:
        case 41u:
        case 42u:
        case 43u:
        case 44u:
        case 45u:
        case 46u:
        case 47u:
        case 48u:
        case 49u:
        case 50u:
        case 56u:
        case 57u:
        case 59u:
        case 68u:
        case 69u:
        case 70u:
        case 72u:
        case 77u:
        case 79u:
        case 81u:
          goto LABEL_26;
        case 55u:
        case 64u:
          v37 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_x, v10->_ZtlSecureTear_x_CS);
          COutPacket::Encode2(v5, v37);
          v38 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_y, v10->_ZtlSecureTear_y_CS);
          COutPacket::Encode2(v5, v38);
          v39 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vx, v10->_ZtlSecureTear_vx_CS);
          COutPacket::Encode2(v5, v39);
          v40 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vy, v10->_ZtlSecureTear_vy_CS);
          COutPacket::Encode2(v5, v40);
          v41 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_fh, v10->_ZtlSecureTear_fh_CS);
          COutPacket::Encode2(v5, v41);
          goto LABEL_26;
        case 1u:
        case 2u:
        case 18u:
        case 21u:
        case 22u:
        case 24u:
        case 60u:
        case 61u:
        case 62u:
        case 63u:
          v42 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vx, v10->_ZtlSecureTear_vx_CS);
          COutPacket::Encode2(v5, v42);
          v43 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vy, v10->_ZtlSecureTear_vy_CS);
          COutPacket::Encode2(v5, v43);
          v44 = v10->_ZtlSecureTear_nAttr[1];
          v45 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
          if ( v44 + v45 != v10->_ZtlSecureTear_nAttr_CS )
          {
            pExceptionObject = 5;
            v93 = v97;
            _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
          }
          if ( (v44 ^ v10->_ZtlSecureTear_nAttr[0]) == 21 || CMovePathCommon::ELEM::_ZtlSecureGet_nAttr(v10) == 22 )
          {
            v46 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_fhFallStart, v10->_ZtlSecureTear_fhFallStart_CS);
            COutPacket::Encode2(v5, v46);
          }
          goto LABEL_26;
        case 3u:
        case 4u:
        case 5u:
        case 6u:
        case 7u:
        case 9u:
        case 10u:
        case 11u:
        case 13u:
        case 26u:
        case 27u:
        case 51u:
        case 52u:
        case 53u:
        case 74u:
        case 75u:
        case 76u:
        case 78u:
        case 80u:
          v47 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_x, v10->_ZtlSecureTear_x_CS);
          COutPacket::Encode2(v5, v47);
          v48 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_y, v10->_ZtlSecureTear_y_CS);
          COutPacket::Encode2(v5, v48);
          v49 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_fh, v10->_ZtlSecureTear_fh_CS);
          COutPacket::Encode2(v5, v49);
          goto LABEL_26;
        case 14u:
        case 16u:
          v50 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vx, v10->_ZtlSecureTear_vx_CS);
          COutPacket::Encode2(v5, v50);
          v51 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vy, v10->_ZtlSecureTear_vy_CS);
          COutPacket::Encode2(v5, v51);
          v52 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_fhFallStart, v10->_ZtlSecureTear_fhFallStart_CS);
          COutPacket::Encode2(v5, v52);
          goto LABEL_26;
        case 23u:
          v53 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_x, v10->_ZtlSecureTear_x_CS);
          COutPacket::Encode2(v5, v53);
          v54 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_y, v10->_ZtlSecureTear_y_CS);
          COutPacket::Encode2(v5, v54);
          v55 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vx, v10->_ZtlSecureTear_vx_CS);
          COutPacket::Encode2(v5, v55);
          v32 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_vy, v10->_ZtlSecureTear_vy_CS);
LABEL_25:
          COutPacket::Encode2(v5, v32);
          goto LABEL_26;
        case 12u:
          v56 = CMovePathCommon::ELEM::_ZtlSecureGet_bSN(v10);
          COutPacket::Encode1(v5, v56);
          break;
        default:
          v57 = v10->_ZtlSecureTear_nAttr[1] ^ v10->_ZtlSecureTear_nAttr[0];
          v58 = __ROR4__(v10->_ZtlSecureTear_nAttr[0] ^ 0xBAADF00D, 5);
          if ( v10->_ZtlSecureTear_nAttr[1] + v58 != v21 )
          {
            pExceptionObject = 5;
            v93 = v97;
            _CxxThrowException(&pExceptionObject, &_TI1_AVZException__);
          }
          if ( v57 != 0x47 && v57 != 73 )
          {
LABEL_26:
            v33 = v10->_ZtlSecureTear_bMoveAction[1];
            v34 = v33 ^ v10->_ZtlSecureTear_bMoveAction[0];
            v35 = __ROR4__(v10->_ZtlSecureTear_bMoveAction[0] ^ 0xBAADF00D, 5);
            if ( v33 + v35 != v10->_ZtlSecureTear_bMoveAction_CS )
            {
              v94 = 5;
              v95 = v97;
              _CxxThrowException(&v94, &_TI1_AVZException__);
            }
            if ( *v17 )
              v36 = *(*v17 - 4);
            else
              v36 = 0;
            v80 = v5->m_uOffset + 1;
            if ( v80 > v36 )
            {
              v81 = *v17;
              if ( *v17 )
                v81 = *(v81 - 4);
              do
                v81 *= 2;
              while ( v80 > v81 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v81, 0, &oPacket);
            }
            *(v5->m_uOffset++ + *v17) = v34;
            v82 = _ZtlSecureFuse<short>(v10->_ZtlSecureTear_tElapse, v10->_ZtlSecureTear_tElapse_CS);
            v83 = *v17;
            if ( *v17 )
              v83 = *(v83 - 4);
            v84 = v5->m_uOffset + 2;
            if ( v84 > v83 )
            {
              v85 = *v17;
              if ( *v17 )
                v85 = *(v85 - 4);
              do
                v85 *= 2;
              while ( v84 > v85 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v85, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = v82;
            v5->m_uOffset += 2;
            v86 = v10->_ZtlSecureTear_bForcedStop[1];
            v87 = v86 ^ v10->_ZtlSecureTear_bForcedStop[0];
            v88 = __ROR4__(v10->_ZtlSecureTear_bForcedStop[0] ^ 0xBAADF00D, 5);
            if ( v86 + v88 != v10->_ZtlSecureTear_bForcedStop_CS )
            {
              v96 = 5;
              _CxxThrowException(&v96, &_TI1_AVZException__);
            }
            v89 = *v17;
            if ( *v17 )
              v89 = *(v89 - 4);
            v90 = v5->m_uOffset + 1;
            if ( v90 > v89 )
            {
              v91 = *v17;
              if ( *v17 )
                v91 = *(v91 - 4);
              do
                v91 *= 2;
              while ( v90 > v91 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v91, 0, &oPacket);
            }
            *(v5->m_uOffset++ + *v17) = v87;
          }
          else
          {
            info.nParam1 = 0;
            info.nParam4 = 0;
            info.nMPA = 0;
            info.nParam2 = 0;
            info.nParam3 = 0;
            info.nParam5 = 0;
            info.nParam6 = 0;
            MPA_INFO::Set(&info, v10);
            v59 = *v17;
            if ( *v17 )
              v59 = *(v59 - 4);
            v60 = v5->m_uOffset + 2;
            if ( v60 > v59 )
            {
              v61 = *v17;
              if ( *v17 )
                v61 = *(v61 - 4);
              do
                v61 *= 2;
              while ( v60 > v61 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v61, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nMPA;
            v5->m_uOffset += 2;
            v62 = *v17;
            if ( *v17 )
              v62 = *(v62 - 4);
            v63 = v5->m_uOffset + 2;
            if ( v63 > v62 )
            {
              v64 = *v17;
              if ( *v17 )
                v64 = *(v64 - 4);
              do
                v64 *= 2;
              while ( v63 > v64 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v64, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nParam1;
            v5->m_uOffset += 2;
            v65 = *v17;
            if ( *v17 )
              v65 = *(v65 - 4);
            v66 = v5->m_uOffset + 2;
            if ( v66 > v65 )
            {
              v67 = *v17;
              if ( *v17 )
                v67 = *(v67 - 4);
              do
                v67 *= 2;
              while ( v66 > v67 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v67, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nParam2;
            v5->m_uOffset += 2;
            v68 = *v17;
            if ( *v17 )
              v68 = *(v68 - 4);
            v69 = v5->m_uOffset + 2;
            if ( v69 > v68 )
            {
              v70 = *v17;
              if ( *v17 )
                v70 = *(v70 - 4);
              do
                v70 *= 2;
              while ( v69 > v70 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v70, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nParam3;
            v5->m_uOffset += 2;
            v71 = *v17;
            if ( *v17 )
              v71 = *(v71 - 4);
            v72 = v5->m_uOffset + 2;
            if ( v72 > v71 )
            {
              v73 = *v17;
              if ( *v17 )
                v73 = *(v73 - 4);
              do
                v73 *= 2;
              while ( v72 > v73 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v73, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nParam4;
            v5->m_uOffset += 2;
            v74 = *v17;
            if ( *v17 )
              v74 = *(v74 - 4);
            v75 = v5->m_uOffset + 2;
            if ( v75 > v74 )
            {
              v76 = *v17;
              if ( *v17 )
                v76 = *(v76 - 4);
              do
                v76 *= 2;
              while ( v75 > v76 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v76, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nParam5;
            v5->m_uOffset += 2;
            v77 = *v17;
            if ( *v17 )
              v77 = *(v77 - 4);
            v78 = v5->m_uOffset + 2;
            if ( v78 > v77 )
            {
              v79 = *v17;
              if ( *v17 )
                v79 = *(v79 - 4);
              do
                v79 *= 2;
              while ( v78 > v79 );
              ZArray<unsigned char>::_Realloc(&v5->m_aSendBuff, v79, 0, &oPacket);
            }
            *(v5->m_uOffset + *v17) = info.nParam6;
            v5->m_uOffset += 2;
          }
          break;
      }
      if ( !oPacket )
        break;
      v10 = oPacket;
    }
  }
}

Is there some specific movement you're talking about? There's multiple. You have Users, Pets, Summoneds, Npcs, Mobs, Dragons, Androids, etc. While they all result in generating a movepath, you may not be referring to MOVEMENT in itself, but movement within a certain field object.
 
Upvote 0
I'm interesting in the CRC algorithm Nexon uses to create the 4 bytes in the movement packet following the header sent from the client to the server in the current version (176)
This is the section i'm referring to in:

Code:
CField::LoadMap

Code:
  CPortalList::LoadPortalGroup(    TSingleton<CPortalList>::ms_pInstance,
    (_com_ptr_t<_com_IIID<IWzProperty,&_GUID_986515d9_0a0b_4929_8b4f_718682177b92> >)v33);
  CField::LoadObjectVisibleLevel(v2);
  v18 = CWvsPhysicalSpace2D::GetCRC(v2->baseclass_0.m_pSpace2D.p);
  v33 = 0;
  v2->m_dwCrc = v18;
  v19 = TSingleton<CPortalList>::ms_pInstance->m_dwPortalCrc;
  v32.m_pInterface = 0;
  v31 = 0;
  v20 = v19 ^ v18;
  v2->m_dwCrc = v20;
  v21 = CCrc32::GetCrc32((const char *)&v2->m_bTown, 4u, v20, 0, (unsigned int *)v31, (int)v32.m_pInterface, (int)v33);
  v2->m_dwCrc = v21;
  v22 = CCrc32::GetCrc32((const char *)&v2->m_bSwim, 4u, v21, 0, 0, 0, 0);
  v2->m_dwCrc = v22;
  v23 = CCrc32::GetCrc32((const char *)&v2->m_bFly, 4u, v22, 0, 0, 0, 0);
  v33 = 0;
  v32.m_pInterface = 0;
  v31 = 0;
  v2->m_dwCrc = v23;
  v24 = CCrc32::GetCrc32(
          (const char *)&v2->m_bPersonalShopAvailable,
          4u,
          v23,
          0,
          (unsigned int *)v31,
          (int)v32.m_pInterface,
          (int)v33);
  v2->m_dwCrc = v24;
  v25 = CCrc32::GetCrc32((const char *)&v2->m_nRidingMoveMap, 4u, v24, 0, 0, 0, 0);
  v2->m_dwCrc = v25;
  v26 = CCrc32::GetCrc32((const char *)&v2->m_FieldForce, 4u, v25, 0, 0, 0, 0);
  v33 = 0;
  v32.m_pInterface = 0;
  v31 = 0;
  v2->m_dwCrc = v26;
  v2->m_dwCrc = CCrc32::GetCrc32(
                  (const char *)&v2->m_FieldForce.nJump,
                  4u,
                  v26,
                  0,
                  (unsigned int *)v31,
                  (int)v32.m_pInterface,
                  (int)v33);


m_dwCrc = v18; is from the snippet i posted from the first post which is from
Code:
[COLOR=#666666]CWvsPhysicalSpace2D::Load[/COLOR]

m_dwCRC is then used as the first 4 bytes following the header of the movement packet.
THAT is that im trying to decipher. You're thinking im trying to decode the entire packet. No. im just trying to figure out ONLY those 4 bytes.
 
Upvote 0
Back