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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x14ac
call fcn.00463a90
mov eax, dword [0x4b9430]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, ecx
mov ecx, dword [esi + 0x134]
mov dword [ebp - 0x14a0], eax
mov eax, dword [esi + 0x13c]
push edi
cmp ecx, eax
jb 0x40f56a
mov eax, dword [esi + 0xd8]
test eax, 0x1000
je 0x40f54f
test eax, 0x40000
jne 0x40f54f
mov ecx, dword [esi + 0x90]
push ecx
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
sub eax, ecx
mov edi, eax
mov eax, dword [esi + 0x154]
cmp eax, dword [esi + 0x158]
jae 0x40f596
mov cl, 0xd
mov edi, edi
cmp byte [eax], 0
jne 0x40f58d
cmp byte [eax - 1], cl
jne 0x40f58d
mov byte [eax], 0xa
inc eax
cmp eax, dword [esi + 0x158]
jb 0x40f580
mov edx, dword [esi + 0x154]
mov eax, dword [esi + 0x84]
mov ebx, dword [esi + 0x134]
mov dword [esi + 0x158], edx
mov dword [ebp - 0x149c], eax
test edi, edi
je 0x40f610
push ebx
push edi
push eax
push str.to_socket__d:__N
push 0x10
call fcn.004090c0
mov eax, dword [ebp - 0x149c]
add esp, 0x14
push 0
push edi
push ebx
push eax
call dword [sym.imp.WS2_32.dll_send]
xor ecx, ecx
cmp eax, edi
setne cl
mov eax, ecx
test eax, eax
je 0x40f610
mov eax, dword [esi + 0xd8]
test eax, 0x1000
je 0x40f54f
test eax, 0x40000
jne 0x40f54f
mov edx, dword [esi + 0x90]
push edx
jmp 0x40f540
mov edi, dword [ebp + 0xc]
mov ebx, dword [esi + 0x84]
test edi, edi
je 0x40f657
mov eax, dword [ebp - 0x14a0]
push eax
push edi
push ebx
push str.to_socket__d:__N
push 0x10
call fcn.004090c0
mov ecx, dword [ebp - 0x14a0]
add esp, 0x14
push 0
push edi
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 0x40f80e
mov eax, dword [esi + 0x84]
mov ecx, dword [esi + 0x90]
cmp eax, ecx
ja 0x40f669
mov eax, ecx
inc eax
mov dword [ebp - 0x149c], eax
mov ecx, dword [esi + 0x90]
mov eax, dword [esi + 0x84]
mov edx, dword [esi]
mov dword [ebp - 0x1490], ecx
lea ecx, [ebp - 0x14a8]
push ecx
push 0
mov dword [ebp - 0x1494], eax
mov dword [ebp - 0x1498], 2
mov eax, dword [edx + 0x74]
push 0
lea edx, [ebp - 0x1498]
mov dword [ebp - 0x14a8], eax
mov eax, dword [ebp - 0x149c]
push edx
push eax
mov dword [ebp - 0x14a4], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x40f80e
mov edx, dword [esi + 0x84]
lea ecx, [ebp - 0x1498]
push ecx
push edx
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x40f76e
mov ebx, dword [esi + 0x84]
push 0
push 0x1387
lea eax, [ebp - 0x1390]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
jle 0x40f80e
lea ecx, [ebp - 0x1390]
push ecx
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 0x40f76e
lea edx, [ebp - 0x1390]
push edx
push edi
push ebx
push str.to_socket__d:__N
push 0x10
call fcn.004090c0
add esp, 0x14
push 0
push edi
lea eax, [ebp - 0x1390]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
xor ecx, ecx
cmp eax, edi
setne cl
mov eax, ecx
test eax, eax
jne 0x40f80e
mov eax, dword [esi + 0x90]
lea edx, [ebp - 0x1498]
push edx
push eax
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x40f670
mov ebx, dword [esi + 0x90]
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 0x40f80e
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 + 0x84]
add esp, 0x14
test edi, edi
je 0x40f670
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
je 0x40f670
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