Function at 0x40d882
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x820
mov dword [ebp - 0x804], 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x58]
and ecx, 8
test ecx, ecx
je 0x40d9b9
mov dword [ebp - 0x810], 1
mov dword [ebp - 0x80c], 4
lea edx, [ebp - 0x80c]
push edx
lea eax, [ebp - 0x810]
push eax
push 0x1007
push 0xffff
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x10]
push edx
call dword [sym.imp.WS2_32.dll_getsockopt]
mov dword [ebp - 0x808], eax
cmp dword [ebp - 0x808], 0
jne 0x40d97a
cmp dword [ebp - 0x810], 0
jne 0x40d97a
mov eax, dword [ebp + 8]
cmp dword [eax + 0x40], 0
je 0x40d97a
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x40]
push edx
call fcn.004037dd
add esp, 4
mov dword [ebp - 0x814], eax
mov eax, dword [ebp - 0x814]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040dbc4
add esp, 8
mov dword [ebp - 0x818], eax
cmp dword [ebp - 0x814], 1
jne 0x40d94b
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
or al, 4
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x58], eax
jmp 0x40d96c
cmp dword [ebp - 0x818], 2
je 0x40d95d
cmp dword [ebp - 0x818], 3
jne 0x40d962
jmp 0x40db4d
mov dword [ebp - 0x810], 1
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
and al, 0x9f
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x58], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
and al, 0xf7
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x58], eax
cmp dword [ebp - 0x810], 0
je 0x40d99f
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
or al, 0x10
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x58], eax
lea edx, [ebp - 0x810]
push edx
push 2
mov eax, dword [ebp + 8]
push eax
call fcn.0040c990
add esp, 0xc
jmp 0x40db4d
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x40], 0
je 0x40dacd
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
and eax, 4
test eax, eax
je 0x40da49
push 0x800
lea ecx, [ebp - 0x800]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x40]
push eax
call fcn.00403a1e
add esp, 0xc
mov dword [ebp - 0x804], eax
cmp dword [ebp - 0x804], 0
jle 0x40da31
mov ecx, dword [ebp - 0x804]
push ecx
lea edx, [ebp - 0x800]
push edx
mov eax, dword [ebp + 8]
add eax, 0x28
push eax
call fcn.0040c188
add esp, 0xc
lea ecx, [ebp - 0x804]
push ecx
push 3
mov edx, dword [ebp + 8]
push edx
call fcn.0040c990
add esp, 0xc
jmp 0x40d9d3
mov eax, dword [ebp - 0x804]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040dbc4
add esp, 8
jmp 0x40dacb
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x40]
push eax
call fcn.00403311
add esp, 4
mov dword [ebp - 0x81c], eax
mov ecx, dword [ebp - 0x81c]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.0040dbc4
add esp, 8
mov dword [ebp - 0x820], eax
cmp dword [ebp - 0x81c], 1
jne 0x40daa0
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x58]
or ecx, 4
mov edx, dword [ebp + 8]
mov dword [edx + 0x58], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x58]
and ecx, 0xffffff9f
mov edx, dword [ebp + 8]
mov dword [edx + 0x58], ecx
jmp 0x40dac6
cmp dword [ebp - 0x820], 2
je 0x40dab2
cmp dword [ebp - 0x820], 3
jne 0x40dab7
jmp 0x40db4d
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x58]
or ecx, 0x10
mov edx, dword [ebp + 8]
mov dword [edx + 0x58], ecx
jmp 0x40db4d
jmp 0x40db2b
push 0
push 0x800
lea eax, [ebp - 0x800]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x10]
push edx
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x804], eax
cmp dword [ebp - 0x804], 0
jle 0x40db2b
mov eax, dword [ebp - 0x804]
push eax
lea ecx, [ebp - 0x800]
push ecx
mov edx, dword [ebp + 8]
add edx, 0x28
push edx
call fcn.0040c188
add esp, 0xc
lea eax, [ebp - 0x804]
push eax
push 3
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040c990
add esp, 0xc
jmp 0x40dacd
mov edx, dword [ebp - 0x804]
push edx
call fcn.0040db51
add esp, 4
test eax, eax
je 0x40db4d
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x58]
or ecx, 0x10
mov edx, dword [ebp + 8]
mov dword [edx + 0x58], ecx
mov esp, ebp
pop ebp
ret