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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff004
push eax
add esp, 0xfffffb64
push 0
movzx eax, word [ebp + 0xc]
push eax
push dword [ebp + 8]
push dword [0x486674]
call sub.WSOCK32.DLL_send
xor edx, edx
mov dword [ebp - 0x114], edx
cmp dword [ebp - 0x114], 0x40
jae 0x40338e
mov ecx, dword [ebp - 0x114]
inc dword [ebp - 0x114]
mov eax, dword [0x486674]
mov dword [ebp + ecx*4 - 0x110], eax
push dword [ebp + 0x18]
push 0
push 0
lea edx, [ebp - 0x114]
push edx
push 0
call sub.WSOCK32.DLL_select
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x4033d9
push str.ERROR:_JCSIMU_send_receive_timeout
lea ecx, [ebp - 0x149c]
push ecx
call fcn.00464204
add esp, 8
lea eax, [ebp - 0x149c]
push eax
call fcn.0040305c
pop ecx
call fcn.00403214
xor eax, eax
jmp 0x40359a
lea edx, [ebp - 0x114]
push edx
push dword [0x486674]
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
jne 0x40341c
push str.ERROR:_JCSIMU_send_receive_fd_is_not_set
lea ecx, [ebp - 0x149c]
push ecx
call fcn.00464204
add esp, 8
lea eax, [ebp - 0x149c]
push eax
call fcn.0040305c
pop ecx
call fcn.00403214
xor eax, eax
jmp 0x40359a
mov edx, dword [ebp + 0x14]
movzx ecx, word [edx]
mov dword [ebp - 8], ecx
push dword [ebp - 8]
push 0
push dword [ebp + 0x10]
call fcn.00462628
add esp, 0xc
push 0
push dword [ebp - 8]
push dword [ebp + 0x10]
push dword [0x486674]
call sub.WSOCK32.DLL_recv
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jge 0x403484
call sub.WSOCK32.DLL_WSAGetLastError
push eax
push 0x486765
lea eax, [ebp - 0x149c]
push eax
call fcn.00464204
add esp, 0xc
lea edx, [ebp - 0x149c]
push edx
call fcn.0040305c
pop ecx
call fcn.00403214
xor eax, eax
jmp 0x40359a
push dword [ebp - 4]
push 0x486798
lea edx, [ebp - 0x149c]
push edx
call fcn.00464204
add esp, 0xc
lea ecx, [ebp - 0x149c]
push ecx
call fcn.004030c0
pop ecx
push dword [ebp - 4]
push dword [ebp + 0x10]
call fcn.00403130
add esp, 8
mov eax, dword [ebp + 0x10]
movsx edx, byte [eax + 2]
and edx, 0xff
shl edx, 8
mov ecx, dword [ebp + 0x10]
movsx eax, byte [ecx + 3]
and eax, 0xff
add edx, eax
add edx, 4
mov dword [ebp - 0xc], edx
mov dx, word [ebp - 4]
mov word [ebp - 0xe], dx
jmp 0x40354f
movzx ecx, word [ebp - 0xe]
mov eax, dword [ebp - 0xc]
sub eax, ecx
mov dword [ebp - 8], eax
push 0
push dword [ebp - 8]
movzx edx, word [ebp - 0xe]
add edx, dword [ebp + 0x10]
push edx
push dword [0x486674]
call sub.WSOCK32.DLL_recv
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jge 0x403541
call sub.WSOCK32.DLL_WSAGetLastError
push eax
push str.ERROR:_JCSIMU_send_receive_recv_failed__1_:_0x_08X
lea ecx, [ebp - 0x149c]
push ecx
call fcn.00464204
add esp, 0xc
lea eax, [ebp - 0x149c]
push eax
call fcn.0040305c
pop ecx
call fcn.00403214
xor eax, eax
jmp 0x40359a
cmp dword [ebp - 4], 0
je 0x403558
mov dx, word [ebp - 4]
add word [ebp - 0xe], dx
movzx ecx, word [ebp - 0xe]
cmp ecx, dword [ebp - 0xc]
jl 0x4034e4
movzx eax, word [ebp - 0xe]
push eax
push str.DBG:__d_bytes_Received.
lea edx, [ebp - 0x149c]
push edx
call fcn.00464204
add esp, 0xc
lea ecx, [ebp - 0x149c]
push ecx
call fcn.004030c0
pop ecx
movzx eax, word [ebp - 0xe]
push eax
push dword [ebp + 0x10]
call fcn.00403130
add esp, 8
mov edx, dword [ebp + 0x14]
mov cx, word [ebp - 0xe]
mov word [edx], cx
mov al, 1
mov esp, ebp
pop ebp
ret