Function at 0x401500
Capabilities:
Connect socket
Get socket status
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3f4
mov eax, dword [0x4a4300]
xor eax, esp
mov dword [esp + 0x3f0], eax
mov eax, dword [0x4ab498]
mov ecx, 0x58
or eax, dword [0x4ab49c]
push ebx
push esi
push edi
mov esi, 0x4ab498
lea edi, [esp + 0x20]
rep movsd dword es:[edi], dword [esi]
je 0x40186d
xor ecx, ecx
mov dword [esp + 0x1c], ecx
jmp 0x401550
mov ebx, dword [esp + ecx*4 + 0x158]
test ebx, ebx
je 0x40185f
push 0x3f
lea eax, [esp + 0x3bd]
mov dword [esp + 0x14], 0xffffffff
push 0
push eax
mov byte [esp + 0x3c4], 0
call fcn.00452270
xorps xmm0, xmm0
mov dword [esp + 0x3b8], 0
add esp, 0xc
movq qword [esp + 0x3b0], xmm0
xor edi, edi
lea esp, [esp]
xor edx, edx
xor ecx, ecx
call fcn.0040fe40
mov esi, eax
test esi, esi
je 0x401621
xorps xmm0, xmm0
mov dword [esp + 0x192], 0
mov eax, 2
movq qword [esp + 0x18a], xmm0
push 0xfff2
mov word [esp + 0x19a], 0
mov word [esp + 0x18c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x18a], ax
lea eax, [esp + 0x188]
push 0x10
push eax
push esi
mov dword [esp + 0x198], ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x401623
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x401623
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
xor esi, esi
mov dword [esp + edi*4 + 0x3ac], esi
inc edi
cmp edi, 3
jl 0x4015a0
mov esi, dword [esp + 0x3ac]
mov ebx, dword [esp + 0x3b4]
mov edi, dword [esp + 0x3b0]
test esi, esi
jne 0x401659
test edi, edi
jne 0x401659
test ebx, ebx
je 0x40182d
call fcn.0040fa20
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edx
call fcn.0040fa20
sub eax, dword [esp + 0x14]
sbb edx, dword [esp + 0x18]
test edx, edx
jg 0x40182d
jl 0x401688
cmp eax, 0xbb8
ja 0x40182d
test esi, esi
jne 0x401698
test edi, edi
jne 0x401698
test ebx, ebx
je 0x40182d
push 0x100
lea eax, [esp + 0x2a8]
push 0
push eax
call fcn.00452270
add esp, 0xc
lea eax, [esp + 0x19c]
xor esi, esi
mov dword [esp + 0x2a0], esi
push 0x100
push esi
push eax
call fcn.00452270
xor edx, edx
add esp, 0xc
mov dword [esp + 0x184], edx
xor edi, edi
mov dword [esp + 0x198], edx
mov dword [esp + 0x180], edx
mov dword [esp + 0x184], 0x64
mov ecx, dword [esp + edi*4 + 0x3ac]
test ecx, ecx
je 0x401763
xor eax, eax
test esi, esi
je 0x401711
cmp dword [esp + eax*4 + 0x2a4], ecx
je 0x401711
inc eax
cmp eax, esi
jb 0x401703
cmp eax, esi
jne 0x401730
cmp esi, 0x40
jae 0x401730
mov dword [esp + eax*4 + 0x2a4], ecx
mov esi, dword [esp + 0x2a0]
inc esi
mov dword [esp + 0x2a0], esi
xor eax, eax
test edx, edx
je 0x401744
cmp dword [esp + eax*4 + 0x19c], ecx
je 0x401744
inc eax
cmp eax, edx
jb 0x401736
cmp eax, edx
jne 0x401763
cmp edx, 0x40
jae 0x401763
mov dword [esp + eax*4 + 0x19c], ecx
mov edx, dword [esp + 0x198]
inc edx
mov dword [esp + 0x198], edx
inc edi
cmp edi, 3
jl 0x4016f2
lea eax, [esp + 0x180]
push eax
lea eax, [esp + 0x19c]
push eax
push 0
lea eax, [esp + 0x2ac]
push eax
push 0
call dword [sym.imp.WS2_32.dll_select]
xor edi, edi
lea ecx, [ecx]
mov esi, dword [esp + edi*4 + 0x3ac]
test esi, esi
je 0x4017e6
push 0
push 0x40
lea eax, [esp + 0x3c0]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x4017d4
cmp eax, 0x14
je 0x401820
cmp eax, 0xffffffff
jne 0x4017e6
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call ebx
cmp eax, 0x2733
je 0x4017e6
call ebx
cmp eax, 0x2749
je 0x4017e6
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + edi*4 + 0x3ac], 0
inc edi
cmp edi, 3
jl 0x401790
call fcn.0040fa20
sub eax, dword [esp + 0x14]
sbb edx, dword [esp + 0x18]
test edx, edx
jg 0x40182d
jl 0x401806
cmp eax, 0xbb8
ja 0x40182d
mov ebx, dword [esp + 0x3b4]
mov edi, dword [esp + 0x3b0]
mov esi, dword [esp + 0x3ac]
jmp 0x401688
call fcn.0040fa20
mov ebx, eax
sub ebx, dword [esp + 0x14]
jmp 0x401831
mov ebx, dword [esp + 0x10]
xor esi, esi
mov eax, dword [esp + esi*4 + 0x3ac]
test eax, eax
je 0x401850
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esp + esi*4 + 0x3ac], 0
inc esi
cmp esi, 3
jl 0x401833
cmp ebx, 0xffffffff
jne 0x401884
mov ecx, dword [esp + 0x1c]
inc ecx
mov dword [esp + 0x1c], ecx
cmp ecx, 0xa
jb 0x401550
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x3f0]
xor ecx, esp
call fcn.00451570
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x3fc]
mov eax, ebx
pop edi
cdq
pop esi
sub eax, edx
pop ebx
xor ecx, esp
sar eax, 1
call fcn.00451570
mov esp, ebp
pop ebp
ret