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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6dc
mov eax, dword [0x4a2300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x3b8
lea eax, [ebp - 0x4a0]
mov esi, ecx
xorps xmm0, xmm0
mov dword [ebp - 0x6cc], esi
push 0
push eax
movlpd qword [ebp - 0x4a8], xmm0
call fcn.00451650
add esp, 0xc
lea edi, [esi*4 + 0x4a6c28]
lea ebx, [ebp - 0x4a8]
xor esi, esi
mov edi, edi
mov eax, dword [esi + 0x4a6af0]
or eax, dword [esi + 0x4a6af4]
je 0x401934
mov ecx, dword [edi]
test ecx, ecx
je 0x401934
cmp dword [esi + 0x4a6c00], 0
je 0x401934
call fcn.00401400
mov dword [ebx + 0xc], eax
mov eax, dword [esi + 0x4a6af0]
mov dword [ebx], eax
mov eax, dword [esi + 0x4a6af4]
mov dword [ebx + 4], eax
mov eax, dword [esi + 0x4a6af8]
push 0x63
mov dword [ebx + 8], eax
lea eax, [ebp - 0xd7]
push 0
push eax
mov byte [ebp - 0xd8], 0
call fcn.00451650
movzx eax, byte [edi + 3]
add esp, 0xc
push eax
movzx eax, byte [edi + 2]
push eax
movzx eax, byte [edi + 1]
push eax
movzx eax, byte [edi]
push eax
lea eax, [ebp - 0xd8]
push 0x480690
push eax
call fcn.0045671f
add esp, 0x18
lea eax, [ebp - 0xd8]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebp - 0xd8]
push eax
call fcn.0045738c
add esp, 4
add esi, 0x160
add ebx, 0x20
add edi, 0x160
cmp esi, 0x2940
jb 0x401890
xor eax, eax
lea ecx, [ebp - 0x45c]
lea edx, [eax + 5]
lea ebx, [ebx]
cmp dword [ecx - 0x40], 0
je 0x401967
inc eax
cmp dword [ecx - 0x20], 0
je 0x40196e
inc eax
cmp dword [ecx], 0
je 0x401974
inc eax
cmp dword [ecx + 0x20], 0
je 0x40197b
inc eax
cmp dword [ecx + 0x40], 0
je 0x401982
inc eax
cmp dword [ecx + 0x60], 0
je 0x401989
inc eax
add ecx, 0xc0
dec edx
jne 0x401960
test eax, eax
je 0x401ea9
call fcn.0040ee00
mov dword [ebp - 0x6c4], eax
mov dword [ebp - 0x6c8], edx
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
lea eax, [ebp - 0xaf]
push 0x3f
push 0
push eax
mov byte [ebp - 0xb0], 0
call fcn.00451650
add esp, 0xc
lea esi, [ebp - 0x49c]
mov edi, 0x1e
mov eax, dword [esi]
test eax, eax
je 0x401a4c
push 0
push 0x40
lea ecx, [ebp - 0xb0]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jne 0x401a02
push dword [esi]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi], 0
jmp 0x401a4c
cmp eax, 0xffffffff
jne 0x401a29
call ebx
cmp eax, 0x2733
je 0x401a4c
call ebx
cmp eax, 0x2749
je 0x401a4c
push dword [esi]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi], 0
jmp 0x401a4c
cmp eax, 0x14
jne 0x401a4c
mov dword [esi + 0xc], 1
call fcn.0040ee00
sub eax, dword [ebp - 0x6c4]
mov dword [esi + 4], eax
sbb edx, dword [ebp - 0x6c8]
mov dword [esi + 8], edx
add esi, 0x20
dec edi
jne 0x4019d6
xor eax, eax
lea ecx, [ebp - 0x45c]
lea edx, [edi + 5]
lea ecx, [ecx]
cmp dword [ecx - 0x40], 0
je 0x401a67
inc eax
cmp dword [ecx - 0x20], 0
je 0x401a6e
inc eax
cmp dword [ecx], 0
je 0x401a74
inc eax
cmp dword [ecx + 0x20], 0
je 0x401a7b
inc eax
cmp dword [ecx + 0x40], 0
je 0x401a82
inc eax
cmp dword [ecx + 0x60], 0
je 0x401a89
inc eax
add ecx, 0xc0
dec edx
jne 0x401a60
test eax, eax
je 0x401be6
call fcn.0040ee00
mov ebx, dword [ebp - 0x6c4]
sub eax, ebx
mov esi, dword [ebp - 0x6c8]
sbb edx, esi
mov dword [ebp - 0x6d4], edx
js 0x401ad8
jg 0x401abe
cmp eax, 0x64
jbe 0x401ad8
xor ecx, ecx
lea eax, [ebp - 0x490]
cmp dword [eax], 1
je 0x401be6
inc ecx
add eax, 0x20
cmp ecx, 0x1e
jb 0x401ac6
call fcn.0040ee00
sub eax, ebx
sbb edx, esi
test edx, edx
jg 0x401be6
jl 0x401af6
cmp eax, 0xbb8
ja 0x401be6
push 0x100
lea eax, [ebp - 0x5b4]
push 0
push eax
call fcn.00451650
add esp, 0xc
lea eax, [ebp - 0x6bc]
xor esi, esi
mov dword [ebp - 0x5b8], esi
push 0x100
push esi
push eax
call fcn.00451650
add esp, 0xc
lea edi, [ebp - 0x49c]
xor edx, edx
lea ebx, [esi + 0x1e]
mov dword [ebp - 0x4ac], edx
mov dword [ebp - 0x6c0], edx
mov dword [ebp - 0x4b0], edx
mov dword [ebp - 0x4ac], 0x64
mov ecx, dword [edi]
test ecx, ecx
je 0x401bbe
cmp dword [edi + 0xc], 1
je 0x401bbe
xor eax, eax
test esi, esi
je 0x401b70
cmp dword [ebp + eax*4 - 0x5b4], ecx
je 0x401b70
inc eax
cmp eax, esi
jb 0x401b62
cmp eax, esi
jne 0x401b8d
cmp esi, 0x40
jae 0x401b8d
mov dword [ebp + eax*4 - 0x5b4], ecx
mov esi, dword [ebp - 0x5b8]
inc esi
mov dword [ebp - 0x5b8], esi
xor eax, eax
test edx, edx
je 0x401ba1
cmp dword [ebp + eax*4 - 0x6bc], ecx
je 0x401ba1
inc eax
cmp eax, edx
jb 0x401b93
cmp eax, edx
jne 0x401bbe
cmp edx, 0x40
jae 0x401bbe
mov dword [ebp + eax*4 - 0x6bc], ecx
mov edx, dword [ebp - 0x6c0]
inc edx
mov dword [ebp - 0x6c0], edx
add edi, 0x20
dec ebx
jne 0x401b50
lea eax, [ebp - 0x4b0]
push eax
lea eax, [ebp - 0x6c0]
push eax
push ebx
lea eax, [ebp - 0x5b8]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_select]
jmp 0x4019ab
xor esi, esi
lea ecx, [ebp - 0x4a8]
lea edx, [esi + 0x1e]
cmp dword [ecx + 0x18], 0
je 0x401c0f
test esi, esi
je 0x401c0d
mov eax, dword [ecx + 0x14]
cmp eax, dword [esi + 0x14]
jg 0x401c0f
jl 0x401c0d
mov eax, dword [ecx + 0x10]
cmp eax, dword [esi + 0x10]
jae 0x401c0f
mov esi, ecx
add ecx, 0x20
dec edx
jne 0x401bf1
test esi, esi
je 0x401e82
push 0x74
push edx
lea eax, [ebp - 0xe4]
mov dword [ebp - 0xe8], edx
push eax
call fcn.00451650
add esp, 0xc
lea edx, [ebp - 0xe0]
lea ecx, [ebp - 0x478]
mov ebx, 5
cmp dword [ecx - 0x18], 0
je 0x401c69
mov edi, dword [esi + 0x10]
sub edi, dword [ecx - 0x20]
mov eax, dword [esi + 0x14]
sbb eax, dword [ecx - 0x1c]
test eax, eax
jg 0x401c69
jl 0x401c63
cmp edi, 0x14
ja 0x401c69
lea eax, [ecx - 0x30]
mov dword [edx - 8], eax
cmp dword [ecx + 8], 0
je 0x401c8b
mov edi, dword [esi + 0x10]
sub edi, dword [ecx]
mov eax, dword [esi + 0x14]
sbb eax, dword [ecx + 4]
test eax, eax
jg 0x401c8b
jl 0x401c85
cmp edi, 0x14
ja 0x401c8b
lea eax, [ecx - 0x10]
mov dword [edx - 4], eax
cmp dword [ecx + 0x28], 0
je 0x401cad
mov edi, dword [esi + 0x10]
sub edi, dword [ecx + 0x20]
mov eax, dword [esi + 0x14]
sbb eax, dword [ecx + 0x24]
test eax, eax
jg 0x401cad
jl 0x401ca8
cmp edi, 0x14
ja 0x401cad
lea eax, [ecx + 0x10]
mov dword [edx], eax
cmp dword [ecx + 0x48], 0
je 0x401cd0
mov edi, dword [esi + 0x10]
sub edi, dword [ecx + 0x40]
mov eax, dword [esi + 0x14]
sbb eax, dword [ecx + 0x44]
test eax, eax
jg 0x401cd0
jl 0x401cca
cmp edi, 0x14
ja 0x401cd0
lea eax, [ecx + 0x30]
mov dword [edx + 4], eax
cmp dword [ecx + 0x68], 0
je 0x401cf3
mov edi, dword [esi + 0x10]
sub edi, dword [ecx + 0x60]
mov eax, dword [esi + 0x14]
sbb eax, dword [ecx + 0x64]
test eax, eax
jg 0x401cf3
jl 0x401ced
cmp edi, 0x14
ja 0x401cf3
lea eax, [ecx + 0x50]
mov dword [edx + 8], eax
cmp dword [ecx + 0x88], 0
je 0x401d1f
mov edi, dword [esi + 0x10]
sub edi, dword [ecx + 0x80]
mov eax, dword [esi + 0x14]
sbb eax, dword [ecx + 0x84]
test eax, eax
jg 0x401d1f
jl 0x401d19
cmp edi, 0x14
ja 0x401d1f
lea eax, [ecx + 0x70]
mov dword [edx + 0xc], eax
add ecx, 0xc0
add edx, 0x18
dec ebx
jne 0x401c46
xor ecx, ecx
lea edx, [ebp - 0xe0]
lea esi, [ebx + 5]
lea ebx, [ebx]
mov eax, dword [edx - 8]
test eax, eax
je 0x401d4f
mov eax, dword [eax + 8]
cmp eax, ecx
cmovg ecx, eax
mov eax, dword [edx - 4]
test eax, eax
je 0x401d5e
mov eax, dword [eax + 8]
cmp eax, ecx
cmovg ecx, eax
mov eax, dword [edx]
test eax, eax
je 0x401d6c
mov eax, dword [eax + 8]
cmp eax, ecx
cmovg ecx, eax
mov eax, dword [edx + 4]
test eax, eax
je 0x401d7b
mov eax, dword [eax + 8]
cmp eax, ecx
cmovg ecx, eax
mov eax, dword [edx + 8]
test eax, eax
je 0x401d8a
mov eax, dword [eax + 8]
cmp eax, ecx
cmovg ecx, eax
mov eax, dword [edx + 0xc]
test eax, eax
je 0x401d99
mov eax, dword [eax + 8]
cmp eax, ecx
cmovg ecx, eax
add edx, 0x18
dec esi
jne 0x401d40
xor ebx, ebx
mov edx, dword [ebp + esi*4 - 0xe8]
test edx, edx
je 0x401dc9
cmp dword [edx + 8], ecx
jne 0x401dc9
test ebx, ebx
je 0x401dc7
mov eax, dword [edx + 0x14]
cmp eax, dword [ebx + 0x14]
jg 0x401dc9
jl 0x401dc7
mov eax, dword [edx + 0x10]
cmp eax, dword [ebx + 0x10]
jae 0x401dc9
mov ebx, edx
inc esi
cmp esi, 0x1e
jb 0x401da1
test ebx, ebx
je 0x401e82
mov edx, dword [ebx]
xor ecx, ecx
mov esi, dword [ebx + 4]
xor eax, eax
cmp dword [eax + 0x4a6af0], edx
jne 0x401df0
cmp dword [eax + 0x4a6af4], esi
je 0x401dff
add eax, 0x160
inc ecx
cmp eax, 0x2940
jb 0x401de0
jmp 0x401e17
imul esi, ecx, 0x160
mov edi, 0x4a9430
mov ecx, 0x58
add esi, 0x4a6af0
rep movsd dword es:[edi], dword [esi]
push 0x63
lea eax, [ebp - 0x6f]
mov byte [ebp - 0x70], 0
push 0
push eax
call fcn.00451650
mov ecx, dword [ebp - 0x6cc]
add esp, 0xc
movzx eax, byte [ecx*4 + 0x4a956b]
push eax
movzx eax, byte [ecx*4 + 0x4a956a]
push eax
movzx eax, byte [ecx*4 + 0x4a9569]
push eax
movzx eax, byte [ecx*4 + 0x4a9568]
push eax
push dword [ebx + 0x14]
lea eax, [ebp - 0x70]
push dword [ebx + 0x10]
push str._DEBUG___u__
push eax
call fcn.0045671f
add esp, 0x20
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebp - 0x70]
push eax
call fcn.0045738c
add esp, 4
lea esi, [ebp - 0x49c]
mov edi, 0x1e
lea ecx, [ecx]
mov eax, dword [esi]
test eax, eax
je 0x401ea3
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi], 0
add esi, 0x20
dec edi
jne 0x401e90
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045094b
mov esp, ebp
pop ebp
ret