Function at 0x401032
Capabilities:
Get socket status
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
jmp 0x4037c0
sub esp, 0x24
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x20]
xor edi, edi
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], 0x3e8
call fcn.00405799
push 1
call fcn.00405773
add esp, 8
test eax, eax
jne 0x4037fc
push 0x8000
push 1
call fcn.004056fd
add esp, 8
push edi
call fcn.00405773
add esp, 4
cmp eax, edi
mov dword [esp + 0x28], eax
jne 0x40381b
push 0x8000
push edi
call fcn.004056fd
add esp, 8
mov edx, dword [0x412ee8]
mov eax, dword [edx]
cmp eax, 0x40
jae 0x40383d
mov ecx, dword [esp + 0x38]
mov dword [edx + eax*4 + 4], ecx
mov eax, dword [0x412ee8]
inc dword [eax]
mov edx, dword [0x412ee8]
mov eax, dword [0x412b74]
xor ebp, ebp
cmp eax, edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edi
je 0x4038c3
cmp word [0x411a68], di
mov ebx, dword [0x412e98]
mov ebp, eax
mov dword [esp + 0x18], 1
je 0x403871
mov dword [0x412b74], edi
jmp 0x4038c7
mov ecx, dword [edx]
xor eax, eax
cmp ecx, edi
jbe 0x4038b8
lea esi, [edx + 4]
lea esp, [esp]
cmp dword [esi], edi
je 0x403897
inc eax
add esi, 4
cmp eax, ecx
jb 0x403880
push edi
call fcn.0040a9d5
add esp, 4
jmp 0x4038c7
dec ecx
cmp eax, ecx
jae 0x4038b6
lea esp, [esp]
mov ecx, dword [edx + eax*4 + 8]
mov dword [edx + eax*4 + 4], ecx
mov edx, dword [0x412ee8]
mov ecx, dword [edx]
inc eax
dec ecx
cmp eax, ecx
jb 0x4038a0
dec dword [edx]
push edi
call fcn.0040a9d5
add esp, 4
jmp 0x4038c7
mov ebx, dword [esp + 0x28]
mov eax, dword [0x412ba4]
cmp eax, edi
je 0x4038d9
push eax
call fcn.004052c8
add esp, 4
push edi
mov dword [0x412be8], edi
call sub.WSOCK32.dll_WSASetLastError
mov edx, dword [0x412ee8]
mov eax, dword [esp + 0x38]
push edx
push eax
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x403c3f
mov edi, edi
cmp word [esp + 0x18], 0
mov dword [esp + 0x1c], 0x2008
je 0x40391d
mov dword [esp + 0x18], 0
jmp 0x403b0a
mov esi, dword [0x412ee8]
mov edi, dword [0x412e78]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x412b80]
test eax, eax
je 0x40394f
mov ecx, dword [eax]
mov edx, dword [0x412b84]
mov dword [edx], ecx
mov eax, dword [eax + 4]
mov ecx, dword [0x412b84]
mov dword [ecx + 4], eax
mov eax, dword [0x412e78]
lea edx, [esp + 0x2c]
push edx
push 0
push 0
push eax
push 0x10
call sub.WSOCK32.dll_select
mov esi, eax
test esi, esi
jge 0x40397d
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2714
jne 0x403c53
test esi, esi
jne 0x4039ae
lea ecx, [esp + 0x24]
push ecx
call fcn.00405799
mov eax, dword [0x412bc0]
add esp, 4
test eax, eax
jbe 0x4039ae
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
mov eax, dword [0x412b80]
mov ecx, dword [eax]
sub edx, esi
cmp edx, ecx
jg 0x403c7c
mov ecx, dword [0x412e78]
mov edi, dword [esp + 0x38]
push ecx
push edi
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x403a5e
lea edx, [esp + 0x20]
push edx
call fcn.00405799
mov eax, dword [0x412ee0]
add esp, 4
push 0
push 0x2000
push eax
push edi
call sub.WSOCK32.dll_recv
test eax, eax
jg 0x403a3c
mov esi, dword [0x412ee8]
mov ecx, dword [esi]
xor eax, eax
test ecx, ecx
jbe 0x403a38
lea edx, [esi + 4]
lea esp, [esp]
cmp dword [edx], edi
je 0x403a10
inc eax
add edx, 4
cmp eax, ecx
jb 0x403a00
xor ebp, ebp
jmp 0x403a66
dec ecx
cmp eax, ecx
jae 0x403a36
jmp 0x403a20
mov ecx, dword [esi + eax*4 + 8]
mov dword [esi + eax*4 + 4], ecx
mov esi, dword [0x412ee8]
mov edx, dword [esi]
inc eax
dec edx
cmp eax, edx
jb 0x403a20
dec dword [esi]
xor ebp, ebp
jmp 0x403a66
cmp word [0x412bcc], 0
mov ecx, dword [0x412ee0]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ecx
je 0x403a5e
push eax
push ecx
call fcn.0040101e
add esp, 8
test ebp, ebp
jne 0x403b0a
mov eax, dword [esp + 0x28]
test eax, eax
je 0x403acf
call fcn.0040b104
test eax, eax
je 0x403b0a
mov eax, dword [0x412e98]
push eax
call fcn.004056b3
mov edi, dword [0x412e98]
add esp, 4
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403a90
mov cx, word [0x40f68c]
mov word [edi], cx
mov edx, dword [0x412e98]
mov eax, edx
lea esi, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403ab0
sub eax, esi
cmp word [0x411a68], 0
mov ebp, eax
mov ebx, edx
jne 0x403b0a
mov dword [0x412b74], ebp
jmp 0x403b00
mov edx, dword [0x412e98]
push 0x2000
push edx
push 0
call fcn.00409983
add esp, 0xc
test eax, eax
jle 0x403b00
cmp word [0x411a68], 0
mov ebx, dword [0x412e98]
mov ebp, eax
jne 0x403b0a
mov dword [0x412b74], eax
push 0
call fcn.0040a9d5
add esp, 4
mov edi, dword [esp + 0x14]
mov edi, edi
cmp ebp, 0x2008
ja 0x403b20
cmp edi, 0x2008
jbe 0x403b37
push edi
push ebp
push 0x40fa7c
call fcn.0040107d
xor edi, edi
add esp, 0xc
mov dword [esp + 0x14], edi
xor ebp, ebp
cmp word [esp + 0x1c], 0
je 0x403cba
test edi, edi
je 0x403b93
mov eax, dword [esp + 0x10]
push edi
push eax
push 1
call fcn.004077b5
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x403b93
cmp word [0x412bb0], 0
je 0x403b77
mov ecx, dword [esp + 0x10]
push esi
push ecx
push 1
call fcn.00401069
add esp, 0xc
mov edx, dword [esp + 0x10]
mov eax, dword [0x412b78]
add edx, esi
sub edi, esi
add eax, esi
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], edi
mov dword [0x412b78], eax
test ebp, ebp
je 0x403bf1
mov eax, dword [0x412ba4]
test eax, eax
je 0x403bcb
test ebx, ebx
jne 0x403ba8
xor eax, eax
jmp 0x403bcd
cmp ebp, 0x2000
jbe 0x403bb4
xor eax, eax
jmp 0x403bcd
test ebp, ebp
mov ecx, ebp
mov eax, ebx
jle 0x403bcb
lea esp, [esp]
cmp byte [eax], 0xa
je 0x403c0f
inc eax
dec ecx
test ecx, ecx
jg 0x403bc0
mov eax, ebp
mov edx, dword [esp + 0x38]
push 0
push eax
push ebx
push edx
call sub.WSOCK32.dll_send
test eax, eax
jle 0x403bf1
mov ecx, dword [0x412b7c]
add ebx, eax
sub ebp, eax
add ecx, eax
mov dword [0x412b7c], ecx
mov eax, dword [0x412ba4]
test eax, eax
jne 0x403c14
test ebp, ebp
jne 0x403c02
test edi, edi
je 0x403c27
add dword [esp + 0x1c], 0xffff
jmp 0x403b10
sub eax, ebx
inc eax
jmp 0x403bcd
push eax
call fcn.004052c8
add esp, 4
mov dword [0x412be8], 0
mov eax, dword [0x412ee8]
mov ecx, dword [esp + 0x38]
push eax
push ecx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x403900
mov edx, dword [esp + 0x38]
push edx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
call sub.WSOCK32.dll_WSAGetLastError
push str.select_fuxored
call fcn.0040107d
mov edx, dword [esp + 0x3c]
add esp, 4
push edx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
cmp word [0x412bbc], 1
jbe 0x403c93
push 0x40fa5c
call fcn.0040107d
add esp, 4
mov eax, dword [esp + 0x38]
push eax
call sub.WSOCK32.dll_closesocket
mov ecx, dword [0x412ee8]
push 0
mov dword [ecx], 0
call sub.WSOCK32.dll_WSASetLastError
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
push 0x40fa4c
call fcn.0040107d
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret