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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x534
mov eax, dword [0x438170]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
lea esi, [edi + 0x60ac]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [edi + 0x60c8]
lea ecx, [edi + 0x60a8]
mov byte [ebp - 0x515], bl
test edx, edx
je 0x40f1e6
mov eax, dword [ecx + 0x1c]
mov ebx, dword [eax + edx*4 - 4]
lea eax, [edx - 1]
mov dword [ecx + 0x20], eax
call fcn.0040f880
mov byte [ebp - 0x515], 1
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [ebp - 0x515], 0
je 0x40f57e
mov eax, dword [ebx + 4]
add eax, 0xfffffffc
cmp eax, 0x10
ja case.0x40f210.5
movzx eax, byte [eax + 0x40f818]
jmp dword [eax*4 + 0x40f800]
cmp dword [ebx + 0x14], 0
je 0x40f245
mov dword [edi + 0x405c], 0
mov ecx, dword [ebx + 0x14]
call fcn.0040a070
push eax
push dword [ebx + 0x10]
push str.Proxy:_Portmap_fail__d___S_n
call fcn.004156af
add esp, 0xc
jmp case.0x40f210.5
mov dword [edi + 0x405c], 1
jmp case.0x40f210.5
mov ecx, 0x400
mov dword [edi + 0x405c], 0
lea esi, [edi + 0x4064]
mov dword [ebp - 0x514], ecx
nop
mov eax, dword [esi]
test eax, eax
je 0x40f283
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 0x514]
add esi, 8
dec ecx
mov dword [ebp - 0x514], ecx
jne 0x40f270
push 0x2000
lea eax, [edi + 0x4060]
push 0
push eax
call fcn.0041e930
add esp, 0xc
jmp case.0x40f210.5
cmp dword [edi + 0x405c], 0
je case.0x40f210.5
push dword [ebx + 0x14]
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push dword [edi + 0x60a4]
lea ecx, [edi + 0x6064]
push ecx
push dword [ebx + 0x18]
push eax
push str.Proxy:_New_PORTMAP_from__s:_d_to__s:_d_n
call fcn.004156af
add esp, 0x14
xor esi, esi
push 0x20
mov dword [ebp - 0x514], esi
call fcn.00414cfb
add esp, 4
test eax, eax
je 0x40f312
xorps xmm0, xmm0
movq qword [eax], xmm0
movq qword [eax + 8], xmm0
movq qword [eax + 0x10], xmm0
movq qword [eax + 0x18], xmm0
mov esi, eax
mov dword [ebp - 0x514], eax
mov dword [esi], 0x20
mov dword [esi + 0xc], 8
mov eax, dword [ebx + 4]
mov dword [esi + 4], eax
movq xmm0, qword [ebx + 0x10]
movq qword [esi + 0x10], xmm0
movq xmm0, qword [ebx + 0x18]
movq qword [esi + 0x18], xmm0
push dword [edi + 0x60a4]
lea eax, [edi + 0x6064]
push eax
push ecx
call fcn.0040a430
add esp, 0xc
mov dword [ebp - 0x520], eax
test eax, eax
jle 0x40f3ec
mov dword [esi + 0x1c], 0
mov eax, dword [ebx + 0x10]
lea esi, [edi + 0x4060]
xor ecx, ecx
mov edx, esi
cmp dword [edx], eax
je 0x40f383
inc ecx
add edx, 8
cmp ecx, 0x400
jb 0x40f371
jmp 0x40f3b7
lea eax, [edi + 0x4064]
mov dword [edi + ecx*8 + 0x4060], 0
lea eax, [eax + ecx*8]
mov dword [ebp - 0x51c], eax
mov eax, dword [eax]
test eax, eax
je 0x40f3ab
push eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
mov eax, dword [ebp - 0x51c]
mov dword [eax], 0
xor ecx, ecx
lea esp, [esp]
cmp dword [esi], 0
je 0x40f3d3
inc ecx
add esi, 8
cmp ecx, 0x400
jb 0x40f3c0
jmp 0x40f3f3
mov eax, dword [ebx + 0x10]
mov dword [edi + ecx*8 + 0x4060], eax
mov eax, dword [ebp - 0x520]
mov dword [edi + ecx*8 + 0x4064], eax
jmp 0x40f3f3
mov dword [esi + 0x1c], 0x274d
lea eax, [edi + 0x60d4]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call eax
lea esi, [edi + 0x60d0]
mov ecx, esi
call fcn.00409c10
test al, al
je 0x40f437
mov eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x1c]
shl eax, 2
push eax
push ecx
lea eax, [ecx + 4]
push eax
call fcn.00414590
mov eax, dword [esi + 0x1c]
mov ecx, dword [ebp - 0x514]
add esp, 0xc
mov dword [eax], ecx
inc dword [esi + 0x20]
lea eax, [edi + 0x60d4]
push eax
jmp 0x40f56e
mov edx, dword [ebx + 0x10]
xor eax, eax
lea ecx, [edi + 0x4060]
mov edi, edi
cmp dword [ecx], edx
je 0x40f464
inc eax
add ecx, 8
cmp eax, 0x400
jb 0x40f450
jmp case.0x40f210.5
lea esi, [edi + eax*8]
mov dword [edi + eax*8 + 0x4060], 0
mov eax, dword [esi + 0x4064]
test eax, eax
je 0x40f484
push eax
mov eax, dword [sym.imp.WS2_32.dll_closesocket]
call eax
mov dword [esi + 0x4064], 0
jmp case.0x40f210.5
cmp dword [edi + 0x405c], 0
je case.0x40f210.5
mov edx, dword [ebx + 0x10]
xor eax, eax
lea ecx, [edi + 0x4060]
jmp 0x40f4b0
cmp dword [ecx], edx
je 0x40f4c4
inc eax
add ecx, 8
cmp eax, 0x400
jb 0x40f4b0
jmp case.0x40f210.5
mov ecx, dword [edi + eax*8 + 0x4064]
test ecx, ecx
je case.0x40f210.5
push 0
push dword [ebx + 0x14]
lea eax, [ebx + 0x18]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jns case.0x40f210.5
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor esi, esi
push 0x20
mov dword [ebp - 0x51c], eax
mov dword [ebp - 0x514], esi
call fcn.00414cfb
add esp, 4
test eax, eax
je 0x40f52b
xorps xmm0, xmm0
movq qword [eax], xmm0
movq qword [eax + 8], xmm0
movq qword [eax + 0x10], xmm0
movq qword [eax + 0x18], xmm0
mov esi, eax
mov dword [ebp - 0x514], eax
mov dword [esi], 0x20
mov dword [esi + 4], 0xc
mov dword [esi + 0xc], 8
mov eax, dword [ebx + 0x10]
mov dword [esi + 0x10], eax
mov eax, dword [ebp - 0x51c]
mov dword [esi + 0x14], eax
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea esi, [edi + 0x60d4]
push esi
call eax
push dword [ebp - 0x514]
lea ecx, [edi + 0x60d0]
call fcn.0040f830
push esi
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call eax
push ebx
call fcn.00414cc3
add esp, 4
cmp dword [edi + 0x405c], 0
je 0x40f7ec
mov eax, 0x400
lea esi, [edi + 0x4060]
mov dword [ebp - 0x520], eax
lea esp, [esp]
cmp dword [esi], 0
je 0x40f7dc
mov ebx, dword [esi + 4]
lea eax, [ebp - 0x530]
push eax
push 0
push 0
lea eax, [ebp - 0x510]
push eax
lea eax, [ebx + 1]
push eax
mov dword [ebp - 0x50c], ebx
mov dword [ebp - 0x510], 1
mov dword [ebp - 0x530], 0
mov dword [ebp - 0x52c], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x40f5fb
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x40f7d6
push 0
push 0x400
lea eax, [ebp - 0x408]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x528], eax
test eax, eax
jg 0x40f6ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x20
mov dword [ebp - 0x51c], eax
xor ebx, ebx
call fcn.00414cfb
add esp, 4
test eax, eax
je 0x40f658
xorps xmm0, xmm0
movq qword [eax], xmm0
movq qword [eax + 8], xmm0
movq qword [eax + 0x10], xmm0
movq qword [eax + 0x18], xmm0
mov ebx, eax
mov dword [ebx], 0x20
mov dword [ebx + 4], 0xc
mov dword [ebx + 0xc], 8
mov eax, dword [esi]
mov dword [ebx + 0x10], eax
mov eax, dword [ebp - 0x51c]
mov dword [ebx + 0x14], eax
lea eax, [edi + 0x60d4]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [edi + 0x60d0]
call fcn.00409c10
test al, al
je 0x40f6c1
mov eax, dword [edi + 0x60f0]
mov ecx, dword [edi + 0x60ec]
shl eax, 2
push eax
push ecx
lea eax, [ecx + 4]
push eax
call fcn.00414590
mov eax, dword [edi + 0x60ec]
add esp, 0xc
mov dword [eax], ebx
inc dword [edi + 0x60f0]
lea eax, [edi + 0x60d4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 4]
test eax, eax
je 0x40f6dc
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi], 0
mov dword [esi + 4], 0
jmp 0x40f7d6
add eax, 0x18
cmp eax, 0x20
mov ecx, 0x20
mov ebx, eax
cmovb ebx, ecx
xor ecx, ecx
mov dword [ebp - 0x51c], eax
mov dword [ebp - 0x514], ecx
test ebx, ebx
je 0x40f749
push ebx
call fcn.00414cfb
add esp, 4
mov dword [ebp - 0x524], eax
test eax, eax
je 0x40f73d
push ebx
push 0
push eax
call fcn.0041e930
mov ecx, dword [ebp - 0x524]
add esp, 0xc
mov dword [ebp - 0x514], ecx
jmp 0x40f743
mov ecx, dword [ebp - 0x514]
mov eax, dword [ebp - 0x51c]
cmp eax, 0x20
mov edx, 0x20
cmovb eax, edx
mov dword [ecx], eax
mov dword [ecx + 4], 8
mov dword [ecx + 0xc], 8
mov eax, dword [esi]
mov dword [ecx + 0x10], eax
mov eax, dword [ebp - 0x528]
push eax
mov dword [ecx + 0x14], eax
lea eax, [ebp - 0x408]
push eax
lea eax, [ecx + 0x18]
push eax
call fcn.0041bfc0
add esp, 0xc
lea eax, [edi + 0x60d4]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ebx, [edi + 0x60d0]
mov ecx, ebx
call fcn.00409c10
test al, al
je 0x40f7c9
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebx + 0x1c]
shl eax, 2
push eax
push ecx
lea eax, [ecx + 4]
push eax
call fcn.00414590
mov eax, dword [ebx + 0x1c]
mov ecx, dword [ebp - 0x514]
add esp, 0xc
mov dword [eax], ecx
inc dword [ebx + 0x20]
lea eax, [edi + 0x60d4]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x520]
add esi, 8
dec eax
mov dword [ebp - 0x520], eax
jne 0x40f5a0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004144c7
mov esp, ebp
pop ebp
ret