Function at 0x437820
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 [0x4a86f0]
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.0046a330
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x414], ax
lea eax, [ebp - 0x412]
push eax
call fcn.0046a330
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x824], ax
lea eax, [ebp - 0x822]
push eax
call fcn.0046a330
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x61c], ax
lea eax, [ebp - 0x61a]
push eax
call fcn.0046a330
push ebx
lea eax, [ebp - 0x824]
push 0x104
push eax
call fcn.0046befa
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.0042e500
add esp, 0x10
lea eax, [ebp - 0x824]
cmp word [ebp - 0x61c], 0
je 0x43791d
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.0045f4c0
lea eax, [ebp - 0x20c]
push eax
push str.DownloadFTPFile____TargetFile_s
call fcn.0045f4c0
add esp, 0x20
cmp dword [0x4c2e50], 0
jne 0x437df0
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 0x437dbd
cmp dword [0x4c2e50], 0
jne 0x437dbd
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 0x437d97
cmp dword [0x4c2e50], 0
jne 0x437d97
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.0046a330
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 0x437a55
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.0045f4c0
add esp, 0xc
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x437a61
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 0x437d6d
mov ecx, dword [0x4c2e50]
test ecx, ecx
jne 0x437d6d
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 0x437ac1
cmp dword [ebp - 0xa80], ecx
jne 0x437aee
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.0045f4c0
mov ecx, dword [0x4c2e50]
add esp, 0xc
test ebx, ebx
jne 0x437afa
test edi, edi
je 0x437d53
test ecx, ecx
jne 0x437d53
mov eax, dword [0x4a808d]
or eax, dword [0x4a8091]
jne 0x437b1b
push ebx
push edi
mov ecx, 0x4a8038
call fcn.00430290
test ebx, ebx
ja 0x437b2d
jb 0x437b29
cmp edi, 0x1000
jae 0x437b2d
mov ebx, edi
jmp 0x437b32
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.00464d8a
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 0x437b75
lea eax, [ebp - 0x414]
push eax
call fcn.0042c370
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 0x437d39
mov ecx, dword [0x4c2e50]
test ecx, ecx
jne 0x437d39
cmp dword [ebp - 0xa80], ecx
je 0x437bd6
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 [0x4c2e50]
test esi, esi
je 0x437bfe
test ecx, ecx
jne 0x437bfe
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 0x437bfe
mov esi, 1
jmp 0x437c00
xor esi, esi
push esi
push dword [ebp - 0xa84]
push ebx
push str.DownloadFTPFile____InternetReadFile_BUFLEN_d_BytesRead_d__d
call fcn.0045f4c0
mov eax, dword [ebp - 0xa84]
add esp, 0x10
test eax, eax
je 0x437cae
test esi, esi
je 0x437cae
cmp dword [0x4c2e50], 0
jne 0x437c56
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 0x437c56
mov esi, 1
jmp 0x437c58
xor esi, esi
push esi
push dword [ebp - 0xa7c]
push str.DownloadFTPFile____WriteFile_Byteswritten_d__d
call fcn.0045f4c0
mov eax, dword [ebp - 0xa7c]
add esp, 0xc
cmp eax, dword [ebp - 0xa84]
jne 0x437c85
test esi, esi
je 0x437c85
mov esi, 1
jmp 0x437c87
xor esi, esi
mov ecx, dword [0x4a80a9]
add ecx, eax
mov eax, dword [0x4a80ad]
mov dword [0x4a80a9], ecx
adc eax, 0
push eax
push ecx
mov ecx, 0x4a8038
mov dword [0x4a80ad], eax
call fcn.00430700
cmp dword [ebp - 0xa84], 0
je 0x437cc9
test esi, esi
je 0x437cc9
mov ecx, dword [0x4c2e50]
test ecx, ecx
je 0x437bd6
push edi
call fcn.0046d735
add esp, 4
test esi, esi
jne 0x437cfd
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 0x437d84
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 0x437d84
push 0
push 0
push 0
push str.CreateFile
push 0
call fcn.0042e900
mov esi, dword [ebp - 0xa78]
jmp 0x437d7f
push 0
push 0
push 0
push 0x48c32c
push 0
call fcn.0042e900
mov esi, dword [ebp - 0xa78]
jmp 0x437d7f
push 0
push 0
push 0
push str.FtpOpenFile
push 0
call fcn.0042e900
add esp, 0x14
mov ebx, eax
mov eax, dword [ebp - 0xa8c]
test eax, eax
je 0x437dae
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x437dae
push 0
push 0
push 0
push str.InternetConnect
push 0
call fcn.0042e900
add esp, 0x14
mov ebx, eax
test esi, esi
je 0x437dd4
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
jmp 0x437dda
push 0
push 0
push 0
push str.InternetOpen
push 0
call fcn.0042e900
add esp, 0x14
mov ebx, eax
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [ebp - 0xa98]
test eax, eax
je 0x437de7
push eax
call esi
cmp dword [0x4c2e50], 0
je 0x437df5
mov ebx, 0x4c7
push ebx
push str.DownloadFTPFile____End__d_
call fcn.0045f4c0
mov ecx, dword [ebp - 4]
add esp, 8
mov eax, ebx
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0046984a
mov esp, ebp
pop ebp
ret