Function at 0x402020
Capabilities:
Get socket status
Print debug messages
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5cc
mov eax, dword [0x4a4300]
xor eax, esp
mov dword [esp + 0x5c8], eax
push ebx
push esi
push edi
mov dword [esp + 0x18], ecx
call fcn.00401f30
mov eax, dword [0x4ab498]
or eax, dword [0x4ab49c]
je 0x4024bf
mov edx, dword [esp + 0x18]
lea edi, [esp + 0x30]
mov ecx, 0x58
lea ebx, [esp + 0xad]
mov esi, 0x4ab498
sub ebx, edx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0xd5]
mov dword [edx + 0x1a0], eax
lea esi, [edx + 0x93]
mov eax, dword [esp + 0x34]
sub ecx, edx
mov dword [edx + 0x60], 0
mov edi, 0xa
mov dword [edx + 0x64], 0
mov dword [edx + 0x1a4], eax
mov dword [esp + 0x10], ecx
mov edi, edi
mov eax, dword [ebx + esi]
mov dword [esi - 0x2b], eax
mov eax, dword [ecx + esi]
mov dword [esi - 0x8f], 0
mov dword [esi - 3], eax
test eax, eax
je 0x402141
push 0x1ff
lea eax, [esp + 0x1d5]
mov byte [esp + 0x1d4], 0
push 0
push eax
call fcn.00452270
movzx eax, byte [esi]
add esp, 0xc
push eax
movzx eax, byte [esi - 1]
push eax
movzx eax, byte [esi - 2]
push eax
movzx eax, byte [esi - 3]
push eax
lea eax, [esp + 0x1e0]
push 0x482710
push eax
call fcn.004573bf
add esp, 0x18
lea eax, [esp + 0x1d0]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [esp + 0x1d0]
push eax
call fcn.004580ba
mov ecx, dword [esi - 3]
add esp, 4
call fcn.00401460
mov ecx, dword [esp + 0x10]
mov dword [esi - 0x8f], eax
add esi, 4
dec edi
jne 0x4020b0
mov ebx, dword [esp + 0x18]
xor eax, eax
cmp dword [ebx + 4], eax
lea esi, [ebx + 4]
mov ecx, 1
mov dword [esp + 0x14], esi
cmovne eax, ecx
cmp dword [esi + 4], edi
je 0x402169
inc eax
cmp dword [ebx + 0xc], 0
je 0x402170
inc eax
cmp dword [ebx + 0x10], 0
je 0x402177
inc eax
cmp dword [ebx + 0x14], 0
je 0x40217e
inc eax
cmp dword [ebx + 0x18], 0
je 0x402185
inc eax
cmp dword [ebx + 0x1c], 0
je 0x40218c
inc eax
cmp dword [ebx + 0x20], 0
je 0x402193
inc eax
cmp dword [ebx + 0x24], 0
je 0x40219a
inc eax
cmp dword [ebx + 0x28], 0
je 0x4021a1
inc eax
test eax, eax
je 0x4024bf
call fcn.0040fa20
mov dword [esp + 0x20], eax
mov dword [esp + 0x10], edx
push 0x3f
lea eax, [esp + 0x195]
mov byte [esp + 0x194], 0
push 0
push eax
call fcn.00452270
add esp, 0xc
xor edi, edi
mov eax, dword [esi]
test eax, eax
je 0x402229
push 0
push 0x40
lea ecx, [esp + 0x198]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x40221b
cmp eax, 0xffffffff
jne 0x402212
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x402229
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2749
je 0x402229
jmp 0x40221b
cmp eax, 0x14
je 0x4023cc
push dword [esi]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi], 0
inc edi
add esi, 4
cmp edi, 0xa
jb 0x4021d4
xor eax, eax
lea edi, [ebx + 4]
cmp dword [edi], eax
mov ecx, 1
cmovne eax, ecx
cmp dword [edi + 4], 0
je 0x402248
inc eax
cmp dword [ebx + 0xc], 0
je 0x40224f
inc eax
cmp dword [ebx + 0x10], 0
je 0x402256
inc eax
cmp dword [ebx + 0x14], 0
je 0x40225d
inc eax
cmp dword [ebx + 0x18], 0
je 0x402264
inc eax
cmp dword [ebx + 0x1c], 0
je 0x40226b
inc eax
cmp dword [ebx + 0x20], 0
je 0x402272
inc eax
cmp dword [ebx + 0x24], 0
je 0x402279
inc eax
cmp dword [ebx + 0x28], 0
je 0x402280
inc eax
test eax, eax
je 0x4024a1
call fcn.0040fa20
sub eax, dword [esp + 0x20]
sbb edx, dword [esp + 0x10]
test edx, edx
jg 0x4024a1
jl 0x4022aa
cmp eax, 0xbb8
ja 0x4024a1
push 0x100
lea eax, [esp + 0x38]
push 0
push eax
call fcn.00452270
add esp, 0xc
lea eax, [esp + 0x1d4]
xor esi, esi
mov dword [esp + 0x30], esi
push 0x100
push esi
push eax
call fcn.00452270
xor edx, edx
mov eax, 0xfffffffc
add esp, 0xc
mov dword [esp + 0x2c], edx
sub eax, ebx
mov dword [esp + 0x1d0], edx
mov dword [esp + 0x24], eax
mov eax, 0xa
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], 0x64
mov dword [esp + 0x1c], eax
jmp 0x402310
mov ebx, dword [edi]
test ebx, ebx
je 0x402395
xor ecx, ecx
test esi, esi
je 0x40233b
mov eax, dword [esp + 0x24]
add eax, dword [esp + 0x14]
mov eax, dword [eax + edi]
jmp 0x402330
cmp dword [esp + ecx*4 + 0x34], eax
je 0x40233b
inc ecx
cmp ecx, esi
jb 0x402330
cmp ecx, esi
jne 0x402351
cmp esi, 0x40
jae 0x402351
mov dword [esp + ecx*4 + 0x34], ebx
mov esi, dword [esp + 0x30]
inc esi
mov dword [esp + 0x30], esi
xor eax, eax
test edx, edx
je 0x402372
mov ecx, dword [esp + 0x24]
add ecx, dword [esp + 0x14]
mov ebx, dword [edi]
mov ecx, dword [ecx + edi]
cmp dword [esp + eax*4 + 0x1d4], ecx
je 0x402372
inc eax
cmp eax, edx
jb 0x402364
cmp eax, edx
jne 0x402391
cmp edx, 0x40
jae 0x402391
mov dword [esp + eax*4 + 0x1d4], ebx
mov edx, dword [esp + 0x1d0]
inc edx
mov dword [esp + 0x1d0], edx
mov eax, dword [esp + 0x1c]
add edi, 4
dec eax
mov dword [esp + 0x1c], eax
jne 0x402310
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x1d4]
push eax
push 0
lea eax, [esp + 0x3c]
push eax
push 0
call dword [sym.imp.WS2_32.dll_select]
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
jmp 0x4021b6
mov eax, dword [ebx]
test eax, eax
je 0x4023df
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebx], 0
mov eax, dword [esp + 0x19c]
mov dword [ebx + 0x180], eax
mov eax, dword [esp + 0x1a0]
mov dword [ebx + 0x184], eax
mov eax, dword [ebx + edi*4 + 4]
mov dword [ebx], eax
mov dword [ebx + edi*4 + 4], 0
mov eax, dword [ebx + 0x68]
mov dword [ebx + 0x60], eax
mov eax, dword [ebx + edi*4 + 0x90]
push 0x1ff
mov dword [ebx + 0x64], eax
lea eax, [esp + 0x3d5]
push 0
push eax
mov byte [esp + 0x3dc], 0
call fcn.00452270
movzx eax, byte [ebx + 0x67]
add esp, 0xc
push eax
movzx eax, byte [ebx + 0x66]
push eax
movzx eax, byte [ebx + 0x65]
push eax
movzx eax, byte [ebx + 0x64]
push eax
call fcn.0040fa20
sub eax, dword [esp + 0x30]
sbb edx, dword [esp + 0x20]
push edx
push eax
lea eax, [esp + 0x3e8]
push 0x482734
push eax
call fcn.004573bf
add esp, 0x20
lea eax, [esp + 0x3d0]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [esp + 0x3d0]
push eax
call fcn.004580ba
add esp, 4
call fcn.0040fa20
mov edi, dword [esp + 0x14]
mov dword [ebx + 0x1c0], eax
mov dword [ebx + 0x1c4], edx
mov esi, 0xa
mov eax, dword [edi]
test eax, eax
je 0x4024b9
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi], 0
add edi, 4
dec esi
jne 0x4024a6
mov ecx, dword [esp + 0x5d4]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00451570
mov esp, ebp
pop ebp
ret