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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x14a4
call fcn.00463a90
mov eax, dword [0x4b9430]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov esi, ecx
call fcn.0040cbd0
mov dword [esi + 0x90], eax
cmp eax, 0xffffffff
je 0x40f4db
mov eax, dword [esi + 0x158]
cmp dword [esi + 0x154], eax
jae 0x40f28e
mov byte [eax - 1], 0xa
mov eax, dword [esi + 0x154]
mov dword [esi + 0x158], eax
mov ebx, dword [esi + 0x158]
mov edi, dword [esi + 0x15c]
sub edi, ebx
mov eax, dword [esi + 0x90]
mov dword [ebp - 0x149c], eax
je 0x40f31f
push ebx
push edi
push eax
push str.to_socket__d:__N
push 0x10
call fcn.004090c0
mov ecx, dword [ebp - 0x149c]
add esp, 0x14
push 0
push edi
push ebx
push ecx
call dword [sym.imp.WS2_32.dll_send]
xor edx, edx
cmp eax, edi
setne dl
mov eax, edx
test eax, eax
je 0x40f31f
mov eax, dword [esi + 0xd8]
test eax, 0x1000
je 0x40f304
test eax, 0x40000
jne 0x40f304
mov eax, dword [esi + 0x90]
push eax
push str.Marking_the_server_socket__d_tainted.
push 2
call fcn.004090c0
add esp, 0xc
or dword [esi + 0xd8], 0x40000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x84]
mov ecx, dword [esi + 0x90]
cmp eax, ecx
ja 0x40f331
mov eax, ecx
inc eax
mov dword [ebp - 0x149c], eax
mov edx, dword [esi + 0x90]
mov ecx, dword [esi + 0x84]
mov eax, dword [esi]
mov dword [ebp - 0x1490], edx
lea edx, [ebp - 0x14a4]
push edx
push 0
mov dword [ebp - 0x1494], ecx
mov dword [ebp - 0x1498], 2
mov ecx, dword [eax + 0x74]
push 0
lea eax, [ebp - 0x1498]
mov dword [ebp - 0x14a4], ecx
mov ecx, dword [ebp - 0x149c]
push eax
push ecx
mov dword [ebp - 0x14a0], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x40f4db
mov eax, dword [esi + 0x84]
lea edx, [ebp - 0x1498]
push edx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x40f436
mov ebx, dword [esi + 0x84]
push 0
push 0x1387
lea ecx, [ebp - 0x1390]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
jle 0x40f4db
lea edx, [ebp - 0x1390]
push edx
push edi
push ebx
push str.from_socket__d:__N
push 0x8000
call fcn.004090c0
mov ebx, dword [esi + 0x90]
add esp, 0x14
test edi, edi
je 0x40f436
lea eax, [ebp - 0x1390]
push eax
push edi
push ebx
push str.to_socket__d:__N
push 0x10
call fcn.004090c0
add esp, 0x14
push 0
push edi
lea ecx, [ebp - 0x1390]
push ecx
push ebx
call dword [sym.imp.WS2_32.dll_send]
xor edx, edx
cmp eax, edi
setne dl
mov eax, edx
test eax, eax
jne 0x40f4d6
mov ecx, dword [esi + 0x90]
lea eax, [ebp - 0x1498]
push eax
push ecx
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x40f338
mov ebx, dword [esi + 0x90]
push 0
push 0x1387
lea edx, [ebp - 0x1390]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
jle 0x40f4db
lea eax, [ebp - 0x1390]
push eax
push edi
push ebx
push str.from_socket__d:__N
push 0x8000
call fcn.004090c0
mov ebx, dword [esi + 0x84]
add esp, 0x14
test edi, edi
je 0x40f338
lea ecx, [ebp - 0x1390]
push ecx
push edi
push ebx
push str.to_socket__d:__N
push 0x10
call fcn.004090c0
add esp, 0x14
push 0
push edi
lea edx, [ebp - 0x1390]
push edx
push ebx
call dword [sym.imp.WS2_32.dll_send]
xor ecx, ecx
cmp eax, edi
setne cl
mov eax, ecx
test eax, eax
je 0x40f338
call fcn.0040e440
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045d3b4
mov esp, ebp
pop ebp
ret