Function at 0x446370
Capabilities:
Check if file exists
Connect to http server
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa98
mov eax, dword [0x4af6f0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x18]
mov dword [ebp - 0xa78], eax
mov eax, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 0x1c]
mov dword [ebp - 0xa7c], eax
mov eax, dword [ebp + 0x20]
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0xa8c], eax
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
mov dword [ebp - 0xa88], ebx
call fcn.0046f6e0
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x414], ax
lea eax, [ebp - 0x412]
push eax
call fcn.0046f6e0
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x824], ax
lea eax, [ebp - 0x822]
push eax
call fcn.0046f6e0
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x61c], ax
lea eax, [ebp - 0x61a]
push eax
call fcn.0046f6e0
push ebx
lea eax, [ebp - 0x824]
push 0x104
push eax
call fcn.0046fd12
add esp, 0x3c
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.SHLWAPI.dll_PathStripPathW]
push 0x5c
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
push esi
call fcn.0043dae0
add esp, 0x10
lea eax, [ebp - 0x824]
cmp word [ebp - 0x61c], 0
je 0x44646d
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
mov esi, dword [ebp + 0x14]
mov eax, 0x15
test esi, esi
cmove esi, eax
push esi
push ebx
push dword [ebp - 0xa7c]
push dword [ebp - 0xa78]
push edi
push str.DownloadFTPFile____ServerName_s_LoginFTP_s_PwdFTP_s_SourceFile_s_Port_d
call fcn.00469290
lea eax, [ebp - 0x20c]
push eax
push str.DownloadFTPFile____TargetFile_s
call fcn.00469290
add esp, 0x20
cmp dword [0x4b552c], 0
jne 0x446940
push 0
push 0
push 0
push 0
push str.DownloadFTPFile
call dword [sym.imp.WININET.dll_InternetOpenW]
mov ecx, eax
mov dword [ebp - 0xa98], ecx
test ecx, ecx
je 0x44690d
cmp dword [0x4b552c], 0
jne 0x44690d
push 0
push dword [ebp - 0xa8c]
push 1
push dword [ebp - 0xa7c]
push dword [ebp - 0xa78]
push esi
push edi
push ecx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov esi, eax
mov dword [ebp - 0xa78], esi
test esi, esi
je 0x4468e7
cmp dword [0x4b552c], 0
jne 0x4468e7
push 0x24c
lea eax, [ebp - 0xa70]
mov dword [ebp - 0xa74], 0
xorps xmm0, xmm0
push 0
push eax
movlpd qword [ebp - 0xa90], xmm0
call fcn.0046f6e0
add esp, 0xc
lea eax, [ebp - 0xa74]
push 0
push 0x10
push eax
push ebx
push esi
call dword [sym.imp.WININET.dll_FtpFindFirstFileW]
mov esi, eax
mov dword [ebp - 0xa80], esi
test esi, esi
je 0x4465a5
mov ebx, dword [ebp - 0xa58]
xor edi, edi
or edi, dword [ebp - 0xa54]
push ebx
push edi
push str.DownloadFTPFile____finfo:_FileSize___I64u
call fcn.00469290
add esp, 0xc
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x4465b1
mov ebx, dword [ebp - 0xa8c]
mov edi, dword [ebp - 0xa90]
mov esi, dword [ebp - 0xa78]
push 0
push closesocket
push closesocket
push dword [ebp - 0xa88]
push esi
call dword [sym.imp.WININET.dll_FtpOpenFileW]
mov edx, eax
mov dword [ebp - 0xa8c], edx
test edx, edx
je 0x4468bd
mov ecx, dword [0x4b552c]
test ecx, ecx
jne 0x4468bd
mov eax, edi
mov dword [ebp - 0xa94], ecx
or eax, ebx
mov dword [ebp - 0xa7c], ecx
lea esi, [ecx + 1]
mov dword [ebp - 0xa84], ecx
je 0x446611
cmp dword [ebp - 0xa80], ecx
jne 0x44663e
lea eax, [ebp - 0xa94]
push eax
push edx
call dword [sym.imp.WININET.dll_FtpGetFileSize]
mov ebx, dword [ebp - 0xa94]
xor edi, edi
or edi, eax
push ebx
push edi
push str.DownloadFTPFile____FtpGetFileSize___I64u
call fcn.00469290
mov ecx, dword [0x4b552c]
add esp, 0xc
test ebx, ebx
jne 0x44664a
test edi, edi
je 0x4468a3
test ecx, ecx
jne 0x4468a3
mov eax, dword [0x4af065]
or eax, dword [0x4af069]
jne 0x44666b
push ebx
push edi
mov ecx, 0x4af010
call fcn.00428f60
test ebx, ebx
ja 0x44667d
jb 0x446679
cmp edi, 0x1000
jae 0x44667d
mov ebx, edi
jmp 0x446682
mov ebx, 0x1000
xor ecx, ecx
mov eax, ebx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046a04a
add esp, 4
mov edi, eax
lea eax, [ebp - 0x414]
push eax
mov dword [edi], 0
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x4466c5
lea eax, [ebp - 0x414]
push eax
call fcn.0043b250
add esp, 4
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0xa88], eax
cmp eax, 0xffffffff
je 0x446889
mov ecx, dword [0x4b552c]
test ecx, ecx
jne 0x446889
cmp dword [ebp - 0xa80], ecx
je 0x446726
lea ecx, [ebp - 0xa60]
push ecx
push 0
lea ecx, [ebp - 0xa70]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov ecx, dword [0x4b552c]
test esi, esi
je 0x44674e
test ecx, ecx
jne 0x44674e
lea eax, [ebp - 0xa84]
push eax
push ebx
push edi
push dword [ebp - 0xa8c]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x44674e
mov esi, 1
jmp 0x446750
xor esi, esi
push esi
push dword [ebp - 0xa84]
push ebx
push str.DownloadFTPFile____InternetReadFile_BUFLEN_d_BytesRead_d__d
call fcn.00469290
mov eax, dword [ebp - 0xa84]
add esp, 0x10
test eax, eax
je 0x4467fe
test esi, esi
je 0x4467fe
cmp dword [0x4b552c], 0
jne 0x4467a6
push 0
lea ecx, [ebp - 0xa7c]
push ecx
push eax
push edi
push dword [ebp - 0xa88]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4467a6
mov esi, 1
jmp 0x4467a8
xor esi, esi
push esi
push dword [ebp - 0xa7c]
push str.DownloadFTPFile____WriteFile_Byteswritten_d__d
call fcn.00469290
mov eax, dword [ebp - 0xa7c]
add esp, 0xc
cmp eax, dword [ebp - 0xa84]
jne 0x4467d5
test esi, esi
je 0x4467d5
mov esi, 1
jmp 0x4467d7
xor esi, esi
mov ecx, dword [0x4af081]
add ecx, eax
mov eax, dword [0x4af085]
mov dword [0x4af081], ecx
adc eax, 0
push eax
push ecx
mov ecx, 0x4af010
mov dword [0x4af085], eax
call fcn.004293d0
cmp dword [ebp - 0xa84], 0
je 0x446819
test esi, esi
je 0x446819
mov ecx, dword [0x4b552c]
test ecx, ecx
je 0x446726
push edi
call fcn.00470bd4
add esp, 4
test esi, esi
jne 0x44684d
push dword [ebp - 0xa88]
mov dword [ebp - 0xa80], 0x17
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0xa80]
mov esi, dword [ebp - 0xa78]
jmp 0x4468d4
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push dword [ebp - 0xa88]
test eax, eax
mov ecx, 2
mov eax, 0
cmove eax, ecx
mov dword [ebp - 0xa80], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0xa80]
mov esi, dword [ebp - 0xa78]
jmp 0x4468d4
push 0
push 0
push 0
push str.CreateFile
push 0
call fcn.0043fb20
mov esi, dword [ebp - 0xa78]
jmp 0x4468cf
push 0
push 0
push 0
push 0x49572c
push 0
call fcn.0043fb20
mov esi, dword [ebp - 0xa78]
jmp 0x4468cf
push 0
push 0
push 0
push str.FtpOpenFile
push 0
call fcn.0043fb20
add esp, 0x14
mov ebx, eax
mov eax, dword [ebp - 0xa8c]
test eax, eax
je 0x4468fe
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x4468fe
push 0
push 0
push 0
push str.InternetConnect
push 0
call fcn.0043fb20
add esp, 0x14
mov ebx, eax
test esi, esi
je 0x446924
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
jmp 0x44692a
push 0
push 0
push 0
push str.InternetOpen
push 0
call fcn.0043fb20
add esp, 0x14
mov ebx, eax
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [ebp - 0xa98]
test eax, eax
je 0x446937
push eax
call esi
cmp dword [0x4b552c], 0
je 0x446945
mov ebx, 0x4c7
push ebx
push str.DownloadFTPFile____End__d_
call fcn.00469290
mov ecx, dword [ebp - 4]
add esp, 8
mov eax, ebx
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0046ebfa
mov esp, ebp
pop ebp
ret