Function at 0x405880
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x539310
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x30bc
call fcn.005003b0
mov eax, dword [0x56d380]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, ecx
mov dword [ebp - 0x30cc], ebx
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
push 3
mov dword [ebp - 0x30c4], eax
push eax
mov eax, dword [ebx + 0x14]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
jne 0x4058e5
or eax, eax
jmp 0x405f1f
push 0xfff
lea edx, [ebp - 0x1027]
push 0
push edx
mov dword [ebp - 0x30c0], 0
mov byte [ebp - 0x1028], 0
call fcn.00500080
add esp, 0xc
lea esp, [esp]
mov eax, dword [0x571d80]
cmp dword [eax + 0x34], 0
jne 0x405f1d
push 0
push 0xa
push 0
lea ecx, [ebp - 0x30c4]
push ecx
push 1
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
mov eax, dword [ebp - 0x30c4]
mov ecx, dword [ebx + 0x14]
lea edx, [ebp - 0x1054]
push edx
mov edx, dword [ecx]
push eax
push edx
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test byte [ebp - 0x1054], 1
je case.0x4059e6.5
push 0x1000
lea eax, [ebp - 0x1028]
push 0
push eax
mov dword [ebp - 4], 0
call fcn.00500080
add esp, 0xc
lea ecx, [ebp - 0x30c0]
push ecx
mov ecx, dword [ebx + 0x14]
lea edx, [ebp - 0x28]
push edx
push 0x1000
lea eax, [ebp - 0x1028]
push eax
call fcn.0044c2f0
mov edi, eax
or esi, 0xffffffff
cmp edi, esi
jne 0x4059ae
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], esi
jmp 0x405910
mov eax, dword [ebp - 0x1028]
lea ecx, [ebp - 0x1028]
mov dword [ebx + 0x20], ecx
cmp eax, edi
jne 0x4059a6
cmp eax, 0x2c
jb 0x4059a6
cmp dword [ebp - 0x1010], 0xffff2011
jne case.0x4059e6.5
mov eax, dword [ebp - 0x1024]
dec eax
cmp eax, 5
ja case.0x4059e6.5
jmp dword [eax*4 + 0x405f3c]
mov esi, dword [0x571d80]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x1034
mov dword [esi + 0x109c], eax
lea esi, [ebx + 0x24]
push 0
push esi
call fcn.00500080
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 4]
mov ecx, dword [0x571d80]
mov dword [esi], eax
movzx eax, word [ecx + 0x10a4]
add esp, 0xc
mov word [ebx + 0x1048], ax
test ax, ax
je 0x405a76
mov dx, word [ebp - 0xff8]
mov eax, dword [ebp - 0xff4]
add edi, 0xffffffc8
mov word [ebx + 0x104a], dx
mov dword [ebx + 0x104c], eax
mov dword [ebx + 0x28], edi
cmp edi, 0x1000
jae 0x405a64
push edi
lea ecx, [ebp - 0xff0]
jmp 0x405a9d
push 0x1000
lea eax, [ebp - 0xff0]
push eax
lea ecx, [ebx + 0x2c]
push ecx
jmp 0x405aa2
add edi, 0xffffffd4
mov dword [ebx + 0x28], edi
cmp edi, 0x1000
jae 0x405a92
push edi
lea edx, [ebp - 0xffc]
push edx
lea eax, [ebx + 0x2c]
push eax
jmp 0x405aa2
push 0x1000
lea ecx, [ebp - 0xffc]
push ecx
lea edx, [ebx + 0x2c]
push edx
call fcn.004ff9a0
mov eax, dword [ebp - 0x30c0]
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
mov dword [ebx + 0x1030], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebx + 0x102c], eax
mov eax, dword [ebp - 0x20]
mov dword [ebx + 0x1034], edx
mov edx, dword [ebp - 0x18]
mov dword [ebx + 0x1038], eax
mov eax, dword [ebx + 0x28]
add esp, 0xc
push eax
mov eax, dword [0x571d80]
mov dword [ebx + 0x103c], ecx
push 0x5566d4
mov dword [ebx + 0x1040], edx
call fcn.004016c0
add esp, 8
mov eax, 0x1034
call fcn.005003b0
mov edi, esp
mov ecx, 0x40d
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebx + 0x1c]
call fcn.00403210
mov dword [ebp - 4], 0xffffffff
jmp 0x405910
mov esi, dword [0x571d80]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esi + 0x109c], eax
movzx eax, word [ebp - 0xffc]
lea ecx, [ebp - 0xffc]
mov edx, edi
sub edx, eax
mov dword [ebx + 0x1058], ecx
mov ecx, dword [ebp - 0xff4]
sub edx, 0x2c
cmp ecx, edx
je 0x405b8a
mov edx, dword [ebp - 0xff0]
test edx, edx
jne 0x405b8a
cmp edx, 0xa00000
jb 0x405b8a
push edx
push eax
mov eax, dword [0x571d80]
push ecx
push edi
push str.Recv_BigPackage_Error__RecvSize_d_BlockSize_d_StructSize_d_PackSize_d_
call fcn.004016c0
add esp, 0x14
mov dword [ebp - 4], 0xffffffff
jmp 0x405910
mov eax, dword [ebp - 0xfec]
cmp eax, dword [ebx + 0x1064]
je 0x405c0d
push eax
mov eax, dword [0x571d80]
push str.Recv_BigPackage_Start_SessionID_u
call fcn.004016c0
mov eax, dword [ebx + 0x105c]
add esp, 8
test eax, eax
je 0x405bc8
push eax
call fcn.005001ec
add esp, 4
mov dword [ebx + 0x105c], 0
xor eax, eax
mov word [ebx + 0x106a], ax
mov eax, dword [ebx + 0x1058]
mov ecx, dword [eax + 0x10]
mov dword [ebx + 0x1064], ecx
mov edx, dword [eax + 0xc]
inc edx
push edx
call fcn.0047c0b3
mov dword [ebx + 0x105c], eax
mov eax, dword [ebx + 0x1058]
mov ecx, dword [eax + 0xc]
mov dword [ebx + 0x1060], ecx
mov dx, word [eax + 2]
add esp, 4
mov word [ebx + 0x1068], dx
cmp dword [ebx + 0x105c], 0
je case.0x4059e6.5
mov eax, dword [ebx + 0x1058]
mov esi, dword [eax + 0xc]
cmp dword [ebx + 0x1060], esi
jne 0x405c5a
mov ecx, dword [eax + 8]
mov edx, dword [eax + 4]
lea edi, [edx + ecx]
cmp edi, esi
ja 0x405c5a
movzx eax, word [eax]
add edx, dword [ebx + 0x105c]
push ecx
lea eax, [ebp + eax - 0xffc]
push eax
push edx
call fcn.004ff9a0
add esp, 0xc
inc word [ebx + 0x106a]
cmp dword [ebx + 0x105c], 0
je case.0x4059e6.5
movzx ecx, word [ebx + 0x1068]
test cx, cx
je case.0x4059e6.5
movzx eax, word [ebx + 0x106a]
test ax, ax
je case.0x4059e6.5
cmp ax, cx
jb case.0x4059e6.5
push 0x1034
lea esi, [ebx + 0x24]
push 0
push esi
call fcn.00500080
mov eax, dword [0x571d80]
mov dword [esi], 1
movzx eax, word [eax + 0x10a4]
add esp, 0xc
mov word [ebx + 0x1048], ax
mov dword [ebp - 0x30c8], 0
test ax, ax
je 0x405cfd
mov eax, dword [ebx + 0x105c]
mov cx, word [eax + 4]
mov word [ebx + 0x104a], cx
mov edx, dword [eax + 8]
mov eax, dword [ebx + 0x1060]
sub eax, 0xc
mov dword [ebx + 0x104c], edx
mov dword [ebx + 0x28], eax
mov dword [ebp - 0x30c8], 0xc
jmp 0x405d06
mov ecx, dword [ebx + 0x1060]
mov dword [ebx + 0x28], ecx
mov edx, dword [ebx + 0x28]
push edx
call fcn.0047c0b3
mov ecx, dword [ebx + 0x105c]
add ecx, dword [ebp - 0x30c8]
mov edi, eax
mov eax, dword [ebx + 0x28]
add esp, 4
push eax
push ecx
push edi
call fcn.004ff9a0
mov edx, dword [ebp - 0x30c0]
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
mov dword [ebx + 0x1030], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebx + 0x102c], edx
mov edx, dword [ebp - 0x20]
mov dword [ebx + 0x1034], ecx
mov ecx, dword [ebp - 0x18]
mov dword [ebx + 0x1038], edx
mov edx, dword [ebx + 0x28]
mov dword [ebx + 0x103c], eax
mov eax, dword [ebx + 0x1064]
push edx
push eax
mov eax, dword [0x571d80]
push str.Recv_BigPackage_Finish_SessionID_u_Size_d
mov dword [ebx + 0x1050], 1
mov dword [ebx + 0x1054], edi
mov dword [ebx + 0x1040], ecx
call fcn.004016c0
add esp, 0x18
jmp 0x405af9
mov eax, dword [0x571d80]
mov ecx, dword [ebp - 0x1014]
mov dword [eax + 0x1094], ecx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esi + 0x109c], eax
mov dword [ebp - 4], 0xffffffff
jmp 0x405910
mov esi, dword [0x571d80]
mov edx, dword [ebp - 0x30c0]
push 2
mov dword [esi + 4], edx
call fcn.00402d10
mov esi, dword [0x571d80]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x1034
mov dword [esi + 0x109c], eax
lea eax, [ebp - 0x30bc]
push 0
push eax
call fcn.00500080
mov edx, dword [0x571d80]
movzx eax, word [edx + 0x10a4]
mov word [ebx + 0x1048], ax
add esp, 0xc
mov eax, 0x1034
mov dword [ebp - 0x30bc], 3
lea esi, [ebp - 0x30bc]
call fcn.005003b0
mov edi, esp
mov ecx, 0x40d
rep movsd dword es:[edi], dword [esi]
mov esi, dword [edx + 0x3c]
call fcn.00403210
mov ecx, dword [ebp - 0x30c0]
mov eax, dword [0x571d80]
push ecx
push str.Recv_ConnectPackage_Port_d
call fcn.004016c0
add esp, 8
mov dword [ebp - 4], 0xffffffff
jmp 0x405910
push 0x1034
lea edx, [ebp - 0x2088]
push 0
push edx
call fcn.00500080
mov edx, dword [0x571d80]
movzx eax, word [edx + 0x10a4]
mov word [ebx + 0x1048], ax
add esp, 0xc
mov eax, 0x1034
mov dword [ebp - 0x2088], 4
lea esi, [ebp - 0x2088]
call fcn.005003b0
mov edi, esp
mov ecx, 0x40d
rep movsd dword es:[edi], dword [esi]
mov esi, dword [edx + 0x3c]
call fcn.00403210
mov edi, dword [0x571d80]
call fcn.00402f70
mov eax, dword [0x571d80]
push str.Recv_QuitPackage
call fcn.004016c0
add esp, 4
mov dword [ebp - 4], 0xffffffff
jmp 0x405910
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00500397
mov esp, ebp
pop ebp
ret