Function at 0x5087d6
Capabilities:
Check for time delay via gettickcount
Connect socket
Get socket status

Disassembly:
mov eax, 0x56f196
call fcn.0053c1d0
sub esp, 0x360
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
mov dword [ebp - 0x20], edi
je 0x5087ff
cmp dword [edi + 0x18], 0
je 0x5087ff
call fcn.00503f97
xor ebx, ebx
push 0
inc ebx
push ebx
mov ecx, edi
call fcn.00507ec7
cmp dword [edi + 4], 0xffffffff
jne 0x50881a
or eax, 0xffffffff
jmp 0x509190
push ebx
push 2
lea ecx, [ebp - 0x1e8]
call fcn.00404a20
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
and dword [ebp - 4], 0
call esi
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x24]
push eax
push 0x8004667e
push dword [edi + 4]
mov dword [ebp - 0x24], ebx
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
jne 0x508a83
push ebx
push 2
lea ecx, [ebp - 0xe8]
call fcn.00404a20
mov byte [ebp - 4], bl
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xe8]
push str.ioctlsocket:
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bbec
mov edi, 0x212
cmp dword [0x5b21c0], edi
jne 0x508a51
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push ebx
push 2
lea ecx, [ebp - 0x168]
call fcn.00404a20
mov esi, 0x572a6c
push esi
lea eax, [ebp - 0x68]
push eax
lea ecx, [ebp - 0xe8]
mov byte [ebp - 4], 2
call fcn.00407320
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 3
jb 0x5088d7
mov eax, dword [eax + 4]
jmp 0x5088da
add eax, 4
push eax
push 0x572a4c
push esi
push 0x572a48
push edi
push 0x572a40
push dword [ebp - 0x10]
mov eax, 0x572a3c
push eax
push dword [ebp - 0x12]
mov edx, 0x572a38
push eax
push dword [ebp - 0x14]
mov ecx, 0x572a34
push edx
push dword [ebp - 0x16]
push ecx
push dword [ebp - 0x1a]
push ecx
push dword [ebp - 0x1c]
push edx
push 0x620
push eax
push 0x5c
sub esp, 0x1c
mov ecx, esp
mov dword [ebp + 8], esp
push 0x57ea88
call fcn.00405500
lea eax, [ebp - 0x4c]
push eax
call fcn.00407150
add esp, 0x24
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 4
jb 0x508948
mov eax, dword [eax + 4]
jmp 0x50894b
add eax, 4
push eax
lea eax, [ebp - 0x168]
push 0x572a0c
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push 0
push ebx
lea ecx, [ebp - 0x4c]
call fcn.00402c50
push 0
push ebx
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 2
call fcn.00402c50
lea eax, [ebp - 0x168]
push eax
call fcn.00407930
pop ecx
lea ecx, [ebp - 0x11c]
mov byte [ebp - 4], bl
call fcn.004028d0
lea ecx, [ebp - 0x11c]
mov dword [ebp - 0x11c], 0x572840
call fcn.0054dfcb
mov ecx, dword [ebp - 0x20]
cmp dword [ecx + 0x18], 0
je 0x508a5f
call fcn.00503f97
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 0
call fcn.004028d0
mov dword [ebp - 0x9c], 0x572840
lea ecx, [ebp - 0x9c]
jmp 0x508d0f
push 0x10
push dword [ebp + 8]
push dword [edi + 4]
call sub.WSOCK32.dll_connect
mov eax, dword [ebp + 0xc]
xor ecx, ecx
lea edx, [ebp - 0x30]
push edx
push ecx
lea edx, [ebp - 0x36c]
push edx
mov dword [ebp - 0x30], eax
mov eax, dword [edi + 4]
push ecx
push eax
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x368], eax
mov dword [ebp - 0x36c], ebx
call sub.WSOCK32.dll_select
test eax, eax
jbe 0x508f2f
and dword [ebp - 0x24], 0
lea eax, [ebp - 0x24]
push eax
push 0x8004667e
push dword [edi + 4]
call sub.WSOCK32.dll_ioctlsocket
cmp eax, 0xffffffff
jne 0x508d19
push ebx
push 2
lea ecx, [ebp - 0x168]
call fcn.00404a20
mov byte [ebp - 4], 5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x168]
push str.ioctlsocket:
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bbec
mov edi, 0x212
cmp dword [0x5b21c0], edi
jne 0x508ce2
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push ebx
push 2
lea ecx, [ebp - 0xe8]
call fcn.00404a20
mov esi, 0x572a6c
push esi
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x168]
mov byte [ebp - 4], 6
call fcn.00407320
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 7
jb 0x508b67
mov eax, dword [eax + 4]
jmp 0x508b6a
add eax, 4
push eax
push 0x572a4c
push esi
push 0x572a48
push edi
push 0x572a40
push dword [ebp - 0x10]
mov eax, 0x572a3c
push eax
push dword [ebp - 0x12]
mov edx, 0x572a38
push eax
push dword [ebp - 0x14]
mov ecx, 0x572a34
push edx
push dword [ebp - 0x16]
push ecx
push dword [ebp - 0x1a]
push ecx
push dword [ebp - 0x1c]
push edx
push 0x63f
push eax
push 0x5c
sub esp, 0x1c
mov ecx, esp
mov dword [ebp + 8], esp
push 0x57ea88
call fcn.00405500
lea eax, [ebp - 0x68]
push eax
call fcn.00407150
add esp, 0x24
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 8
jb 0x508bd8
mov eax, dword [eax + 4]
jmp 0x508bdb
add eax, 4
push eax
lea eax, [ebp - 0xe8]
push 0x572a0c
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push 0
push ebx
lea ecx, [ebp - 0x68]
call fcn.00402c50
push 0
push ebx
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 6
call fcn.00402c50
lea eax, [ebp - 0xe8]
push eax
call fcn.00407930
pop ecx
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 5
call fcn.004028d0
lea ecx, [ebp - 0x9c]
mov dword [ebp - 0x9c], 0x572840
call fcn.0054dfcb
mov ecx, dword [ebp - 0x20]
cmp dword [ecx + 0x18], 0
je 0x508cf0
call fcn.00503f97
lea ecx, [ebp - 0x11c]
mov byte [ebp - 4], 0
call fcn.004028d0
mov dword [ebp - 0x11c], 0x572840
lea ecx, [ebp - 0x11c]
call fcn.0054dfcb
jmp 0x509167
mov eax, dword [ebp + 8]
push dword [eax + 4]
call sub.WSOCK32.dll_inet_ntoa
mov edi, eax
call esi
sub eax, dword [ebp - 0x28]
push eax
push 0x57eb74
push edi
lea eax, [ebp - 0x1e8]
push 0x57eb6c
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bbec
mov edi, 0x212
cmp dword [0x5b21c0], edi
jne 0x508f28
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push ebx
push 2
lea ecx, [ebp - 0xe8]
call fcn.00404a20
mov esi, 0x572a6c
push esi
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x1e8]
mov byte [ebp - 4], 9
call fcn.00407320
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 0xa
jb 0x508dad
mov eax, dword [eax + 4]
jmp 0x508db0
add eax, 4
push eax
push 0x572a4c
push esi
push 0x572a48
push edi
push 0x572a40
push dword [ebp - 0x10]
mov eax, 0x572a3c
push eax
push dword [ebp - 0x12]
mov edx, 0x572a38
push eax
push dword [ebp - 0x14]
mov ecx, 0x572a34
push edx
push dword [ebp - 0x16]
push ecx
push dword [ebp - 0x1a]
push ecx
push dword [ebp - 0x1c]
push edx
push 0x644
push eax
push 0x5c
sub esp, 0x1c
mov ecx, esp
mov dword [ebp + 8], esp
push 0x57ea88
call fcn.00405500
lea eax, [ebp - 0x68]
push eax
call fcn.00407150
add esp, 0x24
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 0xb
jb 0x508e1e
mov eax, dword [eax + 4]
jmp 0x508e21
add eax, 4
push eax
lea eax, [ebp - 0xe8]
push 0x572a0c
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push 0
push ebx
lea ecx, [ebp - 0x68]
call fcn.00402c50
push 0
push ebx
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 9
call fcn.00402c50
lea eax, [ebp - 0xe8]
push eax
call fcn.00407930
pop ecx
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 0
call fcn.004028d0
lea ecx, [ebp - 0x9c]
mov dword [ebp - 0x9c], 0x572840
call fcn.0054dfcb
xor esi, esi
jmp 0x50916a
mov eax, dword [ebp + 8]
push dword [eax + 4]
call sub.WSOCK32.dll_inet_ntoa
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.error:
call esi
sub eax, dword [ebp - 0x28]
push eax
push 0x57eb48
push edi
lea eax, [ebp - 0x1e8]
push 0x57eb6c
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bbec
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bbec
mov edi, 0x212
cmp dword [0x5b21c0], edi
jne 0x509159
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push ebx
push 2
lea ecx, [ebp - 0x268]
call fcn.00404a20
mov esi, 0x572a6c
push esi
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x1e8]
mov byte [ebp - 4], 0xc
call fcn.00407320
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 0xd
jb 0x508fde
mov eax, dword [eax + 4]
jmp 0x508fe1
add eax, 4
push eax
push 0x572a4c
push esi
push 0x572a48
push edi
push 0x572a40
push dword [ebp - 0x10]
mov eax, 0x572a3c
push eax
push dword [ebp - 0x12]
mov edx, 0x572a38
push eax
push dword [ebp - 0x14]
mov ecx, 0x572a34
push edx
push dword [ebp - 0x16]
push ecx
push dword [ebp - 0x1a]
push ecx
push dword [ebp - 0x1c]
push edx
push 0x648
push eax
push 0x5c
sub esp, 0x1c
mov ecx, esp
mov dword [ebp + 8], esp
push 0x57ea88
call fcn.00405500
lea eax, [ebp - 0x68]
push eax
call fcn.00407150
add esp, 0x24
cmp dword [eax + 0x18], 0x10
mov byte [ebp - 4], 0xe
jb 0x50904f
mov eax, dword [eax + 4]
jmp 0x509052
add eax, 4
push eax
lea eax, [ebp - 0x268]
push 0x572a0c
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.00403f50
push eax
call fcn.00403980
pop ecx
pop ecx
mov ecx, eax
call fcn.004040c0
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push eax
call fcn.00403980
pop ecx
pop ecx
push 0
push ebx
lea ecx, [ebp - 0x68]
call fcn.00402c50
push 0
push ebx
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 0xc
call fcn.00402c50
lea eax, [ebp - 0x268]
push eax
call fcn.00407930
pop ecx
lea ecx, [ebp - 0x21c]
mov byte [ebp - 4], 0
call fcn.004028d0
lea ecx, [ebp - 0x21c]
mov dword [ebp - 0x21c], 0x572840
call fcn.0054dfcb
mov ecx, dword [ebp - 0x20]
cmp dword [ecx + 0x18], 0
je 0x509167
call fcn.00503f97
or esi, 0xffffffff
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x19c]
call fcn.004028d0
lea ecx, [ebp - 0x19c]
mov dword [ebp - 0x19c], 0x572840
call fcn.0054dfcb
mov eax, esi
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 8