Jump to content
Returning Members: Password Reset Required ×

Reverse Engineering COPacket


leorbmello

Recommended Posts

Hey let's populate this forum hehe

I'm using the Client version 6907 and i used the MACOS Client like Spirited's tutorial and i got the packet structures for two basic things that i'm having problens at this version.

1st: The CMsgUserInfo does not spawn the character name, but everything else is set correctly.

2nd: The CMsgTaskDialog (Npc Dialogs) i can spawn the picture and the box but not the texts.

So, i'm trying to understand the whole thing, i got many things working already

Here we have the Packet base Constructors but the things seems to have changed a lot from the older clients, or am i missing something basic.

int __ZN12CMsgUserInfoC2Ev() {
   CNetMsg::CNetMsg();
   *rdi = 0x101a66a50;
   CNetStringPacker::CNetStringPacker();
   CNetMsg::Init();
   *(rdi + 0x408) = rdi + 0x8;
   rax = CNetStringPacker::SetBuf(rdi + 0x410, rdi + 0xa1);
   return rax;
}

int __ZN12CMsgUserInfo6CreateEPcj(int * arg0, unsigned int arg1) {
   rbx = arg0;
   rcx = CNetMsg::Create(arg0, arg1);
   rax = 0x0;
   if (rcx != 0x0) {
           rax = (*(int16_t *)(rbx + 0xa) & 0xffff) == 0x8ad ? 0x1 : 0x0;
   }
   return rax;
}

This is the CMsgUserInfo::Process (when client receives the packet from server and build the Hero), it was very interesting to see how the things go this far, i've ben for hours to check it and i'm getting excited to learn more about those things, so here we go.

The code is big so i removed the end of it because there is a limit of the characteres to post this.

I could identify nearly all offsets, and they match for sure with the tests. The name is missing, but, i would like to understand why the name is being set at first, the offsets are set into the order from id to the final of the packet, so.... Is the name before the Character informations, or am i wrong?

 

int __ZN12CMsgUserInfo7ProcessEPv(void * arg0) {
   r14 = arg0;
   xmm0 = intrinsic_xorpd(xmm0, xmm0);
   *(int128_t *)(&stack[-344] + 0x10) = intrinsic_movapd(*(int128_t *)(&stack[-344] + 0x10), xmm0);
   *(int128_t *)&stack[-344] = intrinsic_movapd(*(int128_t *)&stack[-344], xmm0);
   *(int128_t *)(&stack[-376] + 0x10) = intrinsic_movapd(*(int128_t *)(&stack[-376] + 0x10), xmm0);
   *(int128_t *)&stack[-376] = intrinsic_movapd(*(int128_t *)&stack[-376], xmm0);
   *(int128_t *)(&stack[-408] + 0x10) = intrinsic_movapd(*(int128_t *)(&stack[-408] + 0x10), xmm0);
   *(int128_t *)&stack[-408] = intrinsic_movapd(*(int128_t *)&stack[-408], xmm0);
   rax = CNetStringPacker::GetString(r14 + 0x410, 0x0, &stack[-344]);
   CNetStringPacker::GetString(r14 + 0x410, 0x1, &stack[-376]);
   rax = CNetStringPacker::GetString(r14 + 0x410, 0x2, &stack[-408]);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rbx = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(&stack[-1448], &stack[-344], &stack[-312]);
   StringToWStringCS(&stack[-2560]);
   CHero::SetName(rbx);
   rax = stack[-2560];
   if (rax - 0x18 != *std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_destroy();
           }
   }
   rax = stack[-1448];
   if (rax - 0x18 != *std::string::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::string::_Rep::_M_destroy();
           }
   }
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (*Loki::SingletonHolder<CServerStrMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CServerStrMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   r15 = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(&stack[-2544], &stack[-408], &stack[-2488]);
   CServerStrMgr::ProcessServerResCS(&stack[-2552]);
   CPlayer::SetMate(r15);
   rax = stack[-2552];
   if (rax - 0x18 != *std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_destroy();
           }
   }
   rax = stack[-2544];
   if (rax - 0x18 != *std::string::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::string::_Rep::_M_destroy();
           }
   }
   PostCmd(0xe20, 0x0);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   *(int32_t *)(rdi + 0x1e8) = *(int32_t *)(*(r14 + 0x408) + 0x4);
   if (rdi == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CRole::SetOrigID(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CRole::SetSoldID(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   CNetwork::CreateChkData(_g_objNetwork);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetData(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, 0x1);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetMana(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *(r14 + 0x408);
   *(int32_t *)(rdi + 0x920) = *(int16_t *)(rax + 0x3a) & 0xffff;
   if (rdi != 0x0) {
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x928) = *(int16_t *)(rax + 0x3c) & 0xffff;
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x92c) = *(int16_t *)(rax + 0x3e) & 0xffff;
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x930) = *(int16_t *)(rax + 0x40) & 0xffff;
           *(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd58) = *(rax + 0x1e);
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd54) = *(int32_t *)(rax + 0x26);
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd3c) = *(int32_t *)(rax + 0x2a);
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
   }
   else {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
           rax = *(r14 + 0x408);
           *(int32_t *)(rdi + 0x928) = *(int16_t *)(rax + 0x3c) & 0xffff;
           if (rdi != 0x0) {
                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x92c) = *(int16_t *)(rax + 0x3e) & 0xffff;
                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x930) = *(int16_t *)(rax + 0x40) & 0xffff;
                   *(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd58) = *(rax + 0x1e);
                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd54) = *(int32_t *)(rax + 0x26);
                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd3c) = *(int32_t *)(rax + 0x2a);
                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
           }
           else {
                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
                   rax = *(r14 + 0x408);
                   *(int32_t *)(rdi + 0x92c) = *(int16_t *)(rax + 0x3e) & 0xffff;
                   if (rdi == 0x0) {
                           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                           rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
                           rax = *(r14 + 0x408);
                           *(int32_t *)(rdi + 0x930) = *(int16_t *)(rax + 0x40) & 0xffff;
                           if (rdi == 0x0) {
                                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                                   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
                                   rax = *(r14 + 0x408);
                                   *(rdi + 0xd58) = *(rax + 0x1e);
                                   if (rdi == 0x0) {
                                           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                                           rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
                                           rax = *(r14 + 0x408);
                                           *(int32_t *)(rdi + 0xd54) = *(int32_t *)(rax + 0x26);
                                           if (rdi == 0x0) {
                                                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                                                   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
                                                   rax = *(r14 + 0x408);
                                                   *(int32_t *)(rdi + 0xd3c) = *(int32_t *)(rax + 0x2a);
                                                   if (rdi == 0x0) {
                                                           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                                                           rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
                                                           rax = *(r14 + 0x408);
                                                           *(int32_t *)(rdi + 0xd40) = *(int32_t *)(rax + 0x2e);
                                                           if (rdi == 0x0) {
                                                                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                                                                   rax = *(r14 + 0x408);
                                                           }
                                                   }
                                                   else {
                                                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
                                                   }
                                           }
                                           else {
                                                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd3c) = *(int32_t *)(rax + 0x2a);
                                                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
                                           }
                                   }
                                   else {
                                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd54) = *(int32_t *)(rax + 0x26);
                                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd3c) = *(int32_t *)(rax + 0x2a);
                                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
                                   }
                           }
                           else {
                                   *(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd58) = *(rax + 0x1e);
                                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd54) = *(int32_t *)(rax + 0x26);
                                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd3c) = *(int32_t *)(rax + 0x2a);
                                   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
                           }
                   }
                   else {
                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x930) = *(int16_t *)(rax + 0x40) & 0xffff;
                           *(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd58) = *(rax + 0x1e);
                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd54) = *(int32_t *)(rax + 0x26);
                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd3c) = *(int32_t *)(rax + 0x2a);
                           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd40) = *(int32_t *)(rax + 0x2e);
                   }
           }
   }
   CHero::SetMoney(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::SetEmoney(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (CHero::GetEmoney() <= 0x7cf) {
           rsi = 0x0;
   }
   else {
           rsi = 0x1;
   }
   PostCmd(0x501, rsi);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rsi = *(int32_t *)(*(r14 + 0x408) + 0xa);
   CRole::Create(rdi, rsi - (rsi * 0x10624dd3 >> 0x26) * 0x3e8);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *(r14 + 0x408);
   rax = *(int32_t *)(rax + 0xa);
   CRole::SetFace(rdi, (0xffffffffd1b71759 * rax >> 0x2d) - ((0xffffffffd1b71759 * rax >> 0x2d) * 0x10624dd3 >> 0x26) * 0x3e8);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CRole::SetLookFace(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *(r14 + 0x408);
   rcx = *(int32_t *)(rax + 0xa);
   *(int32_t *)(rdi + 0x288) = (rcx * 0x10624dd3 >> 0x26) - ((0xffffffffcccccccd * (rcx * 0x10624dd3 >> 0x26) >> 0x23) + (0xffffffffcccccccd * (rcx * 0x10624dd3 >> 0x26) >> 0x23)) * 0x4 + (0xffffffffcccccccd * (rcx * 0x10624dd3 >> 0x26) >> 0x23) + (0xffffffffcccccccd * (rcx * 0x10624dd3 >> 0x26) >> 0x23);
   if (rdi == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           rax = *(r14 + 0x408);
   }
   CRole::SetShowType(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, *(int16_t *)(rax + 0x8) & 0xffff);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rsi = *(int32_t *)(*(r14 + 0x408) + 0xe);
   CRole::SetHair(rdi, rsi - (0xffffffffd1b71759 * rsi >> 0x2d) * 0x2710);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CRole::SetHead(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, 0xffffffffd1b71759 * *(int32_t *)(*(r14 + 0x408) + 0xe) >> 0x2d & 0xffff);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::BeginXpCounterUp();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *(r14 + 0x408);
   *(int32_t *)(rdi + 0x13ec) = *(int8_t *)(rax + 0x5b) & 0xff;
   if (rdi == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           rax = *(r14 + 0x408);
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rcx = *rdi;
   (*(rcx + 0x1d8))(rdi, *(int8_t *)(rax + 0x4c) & 0xff, 0x1, rcx);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetMeteLev(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *rdi;
   rcx = *(r14 + 0x408);
   (*(rax + 0xd8))(rdi, *(int32_t *)(rcx + 0x4d), 0x1, rcx);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CRole::SetClientType(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<GoalMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<GoalMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   GoalMgr::UpdateClientGoal(*Loki::SingletonHolder<GoalMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, 0x6a);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *(r14 + 0x408);
   *(int32_t *)(rdi + 0xd38) = *(int16_t *)(rax + 0x42) & 0xffff;
   if (rdi == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           rax = *(r14 + 0x408);
   }
   CHero::SetProExp(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::SetNobility(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *rdi;
   rcx = *(r14 + 0x408);
   (*(rax + 0x1d0))(rdi, *(int8_t *)(rcx + 0x5a) & 0xff, 0x0, rcx);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetBirthProf(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetFirMeteProf(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CProUpgradeMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CProUpgradeMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CProUpgradeMgr::UpdateAddLife();
   rax = *(r14 + 0x408);
   rax = *(int16_t *)(rax + 0x83) & 0xffff;
   if (rax != 0x0) {
           if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
                   rax = *(r14 + 0x408);
                   rax = *(int16_t *)(rax + 0x83) & 0xffff;
           }
           CPlayer::SetNationality(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   }
   else {
           if (*Loki::SingletonHolder<CNationalityMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CNationalityMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           CNationalityMgr::SubmitIDbyName(*Loki::SingletonHolder<CNationalityMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   }
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rbx = CPlayer::GetQuizLevel();
   if (rbx > 0x0) {
           r15 = CUserAttribMgr::Instance();
           CQuiz::QueryLevel(rbx);
           CUserAttribMgr::UnRegisterIcon(r15);
   }
   if (*(int32_t *)(*(r14 + 0x408) + 0x5c) != 0x0) {
           CUserAttribMgr::RegisterIcon(CUserAttribMgr::Instance(), CQuiz::QueryLevel(*(int32_t *)(*(r14 + 0x408) + 0x5c)), 0x0, 0x0, 0x0);
   }
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *rdi;
   rcx = *(r14 + 0x408);
   (*(rax + 0x208))(rdi, *(int32_t *)(rcx + 0x5c), 0x0, rcx);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CRole::SetUserFlag(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (CRole::TestUserFlag(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_) != 0x0) {
           if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           if (CRole::TestUserFlag(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_) == 0x0) {
                   PostCmd(0xd44, 0x1);
           }
   }
   else {
           PostCmd(0xd44, 0x1);
   }
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (CRole::TestUserFlag(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_) != 0x0) {
           MsgData(0xd46, 0x3ff, 0x101480450);
   }
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd60) = sign_extend_64(*(int16_t *)(*(r14 + 0x408) + 0x4a));
   PostCmd(0x403, 0x0);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ != 0x0) {
           *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd28) = 0x0;
   }
   else {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
           *(int32_t *)(rdi + 0xd28) = 0x0;
           if (rdi == 0x0) {
                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
   }
   if (CHero::GetKillNum() != 0x0) {
           if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           CKillImgString::SetNum(CHero::GetKillNum());
   }
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetVipLev(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetTitleID(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::UpdateMyCoachChanceValueP(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, *(int16_t *)(*(r14 + 0x408) + 0x64) & 0xffff);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   rax = *rdi;
   rcx = *(r14 + 0x408);
   (*(rax + 0x228))(rdi, *(int16_t *)(rcx + 0x66) & 0xffff, 0x1, rcx);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetCoachDayInfo(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::SetPresentEmoney(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::SetRideMatchPoint(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetMeritLev(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CEducationMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CEducationMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CEducationMgr::UpdateMaxStudent();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::UpdateBattleLevInfo();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::SetRegisterDays(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<GoalMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<GoalMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   GoalMgr::UpdateClientGoal(*Loki::SingletonHolder<GoalMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, 0x65);
   if (*Loki::SingletonHolder<NewServerWarcraftMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<NewServerWarcraftMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   NewServerWarcraftMgr::UpdateCompleteByClient(*Loki::SingletonHolder<NewServerWarcraftMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<COperateActivityData, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<COperateActivityData, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   COperateActivityData::SendUpgradeComplete(*Loki::SingletonHolder<COperateActivityData, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_, *(int8_t *)(*(r14 + 0x408) + 0x4c) & 0xff, 0x0);
   PostCmd(0x451, 0x0);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::DelProfSuit();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetAllSubProf(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::SetCurrentSubProfession(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   rcx = *(r14 + 0x408);
   rax = *(int8_t *)(rcx + 0x76) & 0xff;
   if (rax != 0x0) {
           rbx = *(rcx + 0x77);
           xmm1 = intrinsic_cvtsi2sd(xmm1, rax - 0x1);
           xmm0 = intrinsic_movsd(xmm0, *double_value_10);
           rax = pow(xmm0, xmm1);
           rax = intrinsic_cvttsd2si(rax, xmm0);
           rax = rbx / sign_extend_64(rax);
           rdx = HIQWORD(rax * 0x6666666666666667);
           rbx = rax - ((rdx >> 0x2) + (rdx >> 0x3f) + (rdx >> 0x2) + (rdx >> 0x3f)) * 0x4 + (rdx >> 0x2) + (rdx >> 0x3f) + (rdx >> 0x2) + (rdx >> 0x3f);
           if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           CPlayer::SetSubProfessionStepLevel(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   }
   PostCmd(0xc63, 0x0);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CPlayer::AddProfSuit();
   PostCmd(0xf8b, 0x91);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   rdi = *Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_;
   (*(*rdi + 0x180))(rdi, *(int32_t *)(*(r14 + 0x408) + 0x32));
   CMsgAction::CMsgAction();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   stack[0] = 0x0;
   rax = CMsgAction::Create(&stack[-1448], *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0x1e8), 0x0, 0x0, 0x0, 0x4a, stack[0]);
   if (rax == 0x0) {
           xmm0 = intrinsic_xorpd(xmm0, xmm0);
           *(int128_t *)(&stack[-312] + 0xf0) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0xf0), xmm0);
           *(int128_t *)(&stack[-312] + 0xe0) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0xe0), xmm0);
           *(int128_t *)(&stack[-312] + 0xd0) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0xd0), xmm0);
           *(int128_t *)(&stack[-312] + 0xc0) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0xc0), xmm0);
           *(int128_t *)(&stack[-312] + 0xb0) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0xb0), xmm0);
           *(int128_t *)(&stack[-312] + 0xa0) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0xa0), xmm0);
           *(int128_t *)(&stack[-312] + 0x90) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x90), xmm0);
           *(int128_t *)(&stack[-312] + 0x80) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x80), xmm0);
           *(int128_t *)(&stack[-312] + 0x70) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x70), xmm0);
           *(int128_t *)(&stack[-312] + 0x60) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x60), xmm0);
           *(int128_t *)(&stack[-312] + 0x50) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x50), xmm0);
           *(int128_t *)(&stack[-312] + 0x40) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x40), xmm0);
           *(int128_t *)(&stack[-312] + 0x30) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x30), xmm0);
           *(int128_t *)(&stack[-312] + 0x20) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x20), xmm0);
           *(int128_t *)(&stack[-312] + 0x10) = intrinsic_movapd(*(int128_t *)(&stack[-312] + 0x10), xmm0);
           *(int128_t *)&stack[-312] = intrinsic_movapd(*(int128_t *)&stack[-312], xmm0);
           stack[0] = 0xe3;
           rax = snprintf(&stack[-312], 0x100, "\xA1\xEF%s(%s)\xA1\xEF in %s, %d", "ASSERT", "msg.Create(g_objHero.GetID(), 0, 0, 0, actionEnterMap)", "/Users/nd/Documents/CQ2ClientMac/CQClientMac/3DRole/Network/MsgUserInfo.cpp", stack[0]);
           if (*(int32_t *)GetMainLogger() >= 0x64) {
                   CLogger<CDateFileLogWriter>::ErrorMsg(GetMainLogger());
           }
   }
   rax = stack[-1448];
   rax = *(rax + 0x20);
   rax = (rax)(&stack[-1448]);
   CMsgRank::CMsgRank();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::ClearFlowerRankInfo();
   CMsgRank::Create(&stack[-2488], 0x2, 0x0);
   rax = stack[-2488];
   rax = *(rax + 0x20);
   rax = (rax)(&stack[-2488]);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::CheckEMoneyShopOn();
   if (*Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHeroConfigMgr::InitRecord();
   PostCmd(0xfb6, 0x0);
   if (*Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHeroConfigMgr::ReloadSkinRecord();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (*Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (CHeroConfigMgr::GetSimplifyStatus() != 0x0) {
           if (*Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           CHeroConfigMgr::GetSimplifyNum();
   }
   CHero::SetUserSimplifyNum(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   if (CPlayer::IsGM() != 0x0) {
           if (*Loki::SingletonHolder<CDebugMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CDebugMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           CDebugMgr::EnableGMMode(*Loki::SingletonHolder<CDebugMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   }
   if (*Loki::SingletonHolder<CDebugMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CDebugMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CDebugMgr::OnUserLogin();
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   CHero::EnableQUseAutoAdd(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_);
   PostCmd(0x401, 0x0);
   if (*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
           Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
   }
   r15 = *(int32_t *)(*Loki::SingletonHolder<CHero, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ + 0xd30);
   rbx = Singleton<CIniMgrW>::GetSingletonPtr();
   rax = std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(&stack[-312], 0x101480458, &stack[-2520]);
   rax = std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(&stack[-2536], 0x10148048c, &stack[-2512]);
   rax = std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(&stack[-2528], 0x1014804c0, &stack[-2504]);
   rax = CIniMgrW::GetData(rbx, &stack[-312], &stack[-2536], &stack[-2528]);
   rbx = rax;
   rax = stack[-2528];
   if (rax - 0x18 != *std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_destroy();
           }
   }
   rax = stack[-2536];
   if (rax - 0x18 != *std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_destroy();
           }
   }
   rax = stack[-312];
   if (rax - 0x18 != *std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_S_empty_rep_storage) {
           *(int32_t *)(rax - 0x8) = lock intrinsic_xadd(*(int32_t *)(rax - 0x8), 0xffffffffffffffff);
           if (0xffffffffffffffff <= 0x0) {
                   std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_destroy();
           }
   }
   if (r15 >= rbx) {
           if (*Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::pInstance_ == 0x0) {
                   Loki::SingletonHolder<CHeroConfigMgr, Loki::CreateUsingNew, Loki::DefaultLifetime, Loki::SingleThreaded, Loki::Mutex>::MakeInstance();
           }
           if (CHeroConfigMgr::SetGameAnnounceRecord() != 0x0) {
                   PostCmd(0x1060, 0x0);
           }
   }
   }

Other thing is, the strings 3 strings (name, last name and mate) are set to max lenght (32), i could see it at the beggining of the method... The 0xa1(161) is the base packet lenght and the other 0x8ad(2221) is the packet id.

Obs.: Also i would love to discuss this at discord with someone, i really want to learn more about this.

Link to comment
Share on other sites

Most packet values in Conquer Online get dereferenced at address 0x404 from the packet pointer + an offset for the value. This packet structure looks totally different than anything I've seen... which is unfortunate. What I recommend maybe trying is mapping addresses to packet offsets that you already know. For example, you know the mana of the player. If you can get the address from the packet pointer using that known offset (look for SetMana in the snippet you provided above), then you can figure out the rest of the offsets using that mapping. I hope that makes sense.
Link to comment
Share on other sites

It seems the packet is using the ProtoBuf... this makes a lot of sense, tested using protobuf at the MsgTaskDialog and i got some things working now, but not with the UserInfo one yet.... i checked out for 0x404 and from what i've seen it is 0x408, sometimes 0x410... so i don't really got yet.
Link to comment
Share on other sites

Quote

Well, i found the problem!

Tq changed the StringLenght offset to Ushort, so, if i would write a string to a packet the structure now is:

(Ushort) Value.Lenght

(String) Value

Oh, interesting! So it's an actual P-string now. That could be part of the protobuf serializer, but I'm not sure.

If you have time after you reverse the packet, could you please post your findings here:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...