Function at 0x40d349
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x402c
call fcn.0041dcd0
mov dword [ebp - 0x200c], 0xffffffff
push 0
call dword [sym.imp.MSVCRT.dll_time]
add esp, 4
mov dword [ebp - 0x2010], eax
mov dword [ebp - 0x1004], 0
mov dword [ebp - 0x2008], 0
lea eax, [ebp - 0x200c]
push eax
lea ecx, [ebp - 0x1004]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
push eax
call fcn.0040ddd3
add esp, 0xc
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [ebp - 0x2020], edx
jmp 0x40d3bb
mov eax, dword [ebp - 0x201c]
mov dword [ebp - 0x2020], eax
cmp dword [ebp - 0x2020], 0
je 0x40d4c6
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ecx]
mov dword [ebp - 0x201c], edx
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x58]
and ecx, 0x88
test ecx, ecx
jne 0x40d401
lea edx, [ebp - 0x2010]
push edx
push 0
mov eax, dword [ebp - 0x2020]
push eax
call fcn.0040c990
add esp, 0xc
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ecx + 0x58]
and edx, 0x10
test edx, edx
je 0x40d425
mov eax, dword [ebp - 0x2020]
push eax
call fcn.0040c91c
add esp, 4
jmp 0x40d4c1
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ecx + 0x58]
and edx, 0x40
test edx, edx
jne 0x40d455
lea eax, [ebp - 0x200c]
push eax
lea ecx, [ebp - 0x1004]
push ecx
mov edx, dword [ebp - 0x2020]
mov eax, dword [edx + 0x10]
push eax
call fcn.0040ddd3
add esp, 0xc
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ecx + 0x58]
and edx, 8
test edx, edx
je 0x40d475
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x58]
and ecx, 0x20
test ecx, ecx
je 0x40d4a1
mov edx, dword [ebp - 0x2020]
cmp dword [edx + 0x38], 0
jbe 0x40d4c1
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x58]
and ecx, 8
test ecx, ecx
jne 0x40d4c1
mov edx, dword [ebp - 0x2020]
mov eax, dword [edx + 0x58]
and eax, 2
test eax, eax
jne 0x40d4c1
lea ecx, [ebp - 0x200c]
push ecx
lea edx, [ebp - 0x2008]
push edx
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x10]
push ecx
call fcn.0040ddd3
add esp, 0xc
jmp 0x40d3af
mov eax, dword [ebp + 0xc]
cdq
mov ecx, 0x3e8
idiv ecx
mov dword [ebp - 0x2018], eax
mov eax, dword [ebp + 0xc]
cdq
mov ecx, 0x3e8
idiv ecx
imul edx, edx, 0x3e8
mov dword [ebp - 0x2014], edx
lea edx, [ebp - 0x2018]
push edx
push 0
lea eax, [ebp - 0x2008]
push eax
lea ecx, [ebp - 0x1004]
push ecx
mov edx, dword [ebp - 0x200c]
add edx, 1
push edx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x40d715
push 0
call dword [sym.imp.MSVCRT.dll_time]
add esp, 4
mov dword [ebp - 0x2010], eax
mov eax, dword [ebp + 8]
cmp dword [eax + 0xc], 0xffffffff
je 0x40d5f4
lea ecx, [ebp - 0x1004]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40d5f4
push 0
push 0x2004
lea ecx, [ebp - 0x4024]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
push eax
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x4028], eax
push 0
push 1
lea ecx, [ebp - 0x4020]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
push eax
call dword [sym.imp.WS2_32.dll_send]
cmp dword [ebp - 0x4028], 4
jl 0x40d5f4
cmp dword [ebp - 0x4024], 0
je 0x40d5f4
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040e10f
add esp, 8
mov dword [ebp - 0x402c], eax
jmp 0x40d5d0
mov edx, dword [ebp - 0x402c]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0040e10f
add esp, 8
mov dword [ebp - 0x402c], eax
cmp dword [ebp - 0x402c], 0
je 0x40d5f4
lea ecx, [ebp - 0x4020]
push ecx
push 0
mov edx, dword [ebp - 0x402c]
push edx
call dword [ebp - 0x4024]
add esp, 0xc
jmp 0x40d5b7
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0x2020], ecx
jmp 0x40d60d
mov edx, dword [ebp - 0x201c]
mov dword [ebp - 0x2020], edx
cmp dword [ebp - 0x2020], 0
je 0x40d715
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax]
mov dword [ebp - 0x201c], ecx
lea edx, [ebp - 0x1004]
push edx
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x10]
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40d6a7
mov edx, dword [ebp - 0x2020]
mov eax, dword [edx + 0x58]
and eax, 0x80
test eax, eax
je 0x40d689
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ecx + 0x58]
and edx, 0x100
test edx, edx
je 0x40d678
mov eax, dword [ebp - 0x2020]
push eax
call fcn.0040dd05
add esp, 4
jmp 0x40d687
mov ecx, dword [ebp - 0x2020]
push ecx
call fcn.0040d78c
add esp, 4
jmp 0x40d6a7
mov edx, dword [ebp - 0x2020]
mov eax, dword [ebp - 0x2010]
mov dword [edx + 0x50], eax
mov ecx, dword [ebp - 0x2020]
push ecx
call fcn.0040d882
add esp, 4
lea edx, [ebp - 0x2008]
push edx
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x10]
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40d710
mov edx, dword [ebp - 0x2020]
mov eax, dword [edx + 0x58]
and eax, 8
test eax, eax
je 0x40d6e2
mov ecx, dword [ebp - 0x2020]
push ecx
call fcn.0040d882
add esp, 4
jmp 0x40d710
mov edx, dword [ebp - 0x2020]
mov eax, dword [edx + 0x58]
and eax, 2
test eax, eax
jne 0x40d710
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ebp - 0x2010]
mov dword [ecx + 0x50], edx
mov eax, dword [ebp - 0x2020]
push eax
call fcn.0040dc0f
add esp, 4
jmp 0x40d601
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [ebp - 0x2020], edx
jmp 0x40d72e
mov eax, dword [ebp - 0x201c]
mov dword [ebp - 0x2020], eax
cmp dword [ebp - 0x2020], 0
je 0x40d782
mov ecx, dword [ebp - 0x2020]
mov edx, dword [ecx]
mov dword [ebp - 0x201c], edx
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x58]
and ecx, 0x10
test ecx, ecx
jne 0x40d771
mov edx, dword [ebp - 0x2020]
cmp dword [edx + 0x38], 0
jne 0x40d780
mov eax, dword [ebp - 0x2020]
mov ecx, dword [eax + 0x58]
and ecx, 1
test ecx, ecx
je 0x40d780
mov edx, dword [ebp - 0x2020]
push edx
call fcn.0040c91c
add esp, 4
jmp 0x40d722
mov eax, dword [ebp - 0x2010]
mov esp, ebp
pop ebp
ret