Function at 0x437830
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.0046a390
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x414], ax
lea eax, [ebp - 0x412]
push eax
call fcn.0046a390
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x824], ax
lea eax, [ebp - 0x822]
push eax
call fcn.0046a390
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x61c], ax
lea eax, [ebp - 0x61a]
push eax
call fcn.0046a390
push ebx
lea eax, [ebp - 0x824]
push 0x104
push eax
call fcn.0046bf5a
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 0x43792d
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.0045f520
lea eax, [ebp - 0x20c]
push eax
push str.DownloadFTPFile____TargetFile_s
call fcn.0045f520
add esp, 0x20
cmp dword [0x4c2e50], 0
jne 0x437e00
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 0x437dcd
cmp dword [0x4c2e50], 0
jne 0x437dcd
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 0x437da7
cmp dword [0x4c2e50], 0
jne 0x437da7
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.0046a390
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 0x437a65
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.0045f520
add esp, 0xc
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x437a71
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 0x437d7d
mov ecx, dword [0x4c2e50]
test ecx, ecx
jne 0x437d7d
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 0x437ad1
cmp dword [ebp - 0xa80], ecx
jne 0x437afe
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.0045f520
mov ecx, dword [0x4c2e50]
add esp, 0xc
test ebx, ebx
jne 0x437b0a
test edi, edi
je 0x437d63
test ecx, ecx
jne 0x437d63
mov eax, dword [0x4a808d]
or eax, dword [0x4a8091]
jne 0x437b2b
push ebx
push edi
mov ecx, 0x4a8038
call fcn.00430290
test ebx, ebx
ja 0x437b3d
jb 0x437b39
cmp edi, 0x1000
jae 0x437b3d
mov ebx, edi
jmp 0x437b42
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.00464dea
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 0x437b85
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 0x437d49
mov ecx, dword [0x4c2e50]
test ecx, ecx
jne 0x437d49
cmp dword [ebp - 0xa80], ecx
je 0x437be6
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 0x437c0e
test ecx, ecx
jne 0x437c0e
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 0x437c0e
mov esi, 1
jmp 0x437c10
xor esi, esi
push esi
push dword [ebp - 0xa84]
push ebx
push str.DownloadFTPFile____InternetReadFile_BUFLEN_d_BytesRead_d__d
call fcn.0045f520
mov eax, dword [ebp - 0xa84]
add esp, 0x10
test eax, eax
je 0x437cbe
test esi, esi
je 0x437cbe
cmp dword [0x4c2e50], 0
jne 0x437c66
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 0x437c66
mov esi, 1
jmp 0x437c68
xor esi, esi
push esi
push dword [ebp - 0xa7c]
push str.DownloadFTPFile____WriteFile_Byteswritten_d__d
call fcn.0045f520
mov eax, dword [ebp - 0xa7c]
add esp, 0xc
cmp eax, dword [ebp - 0xa84]
jne 0x437c95
test esi, esi
je 0x437c95
mov esi, 1
jmp 0x437c97
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 0x437cd9
test esi, esi
je 0x437cd9
mov ecx, dword [0x4c2e50]
test ecx, ecx
je 0x437be6
push edi
call fcn.0046d795
add esp, 4
test esi, esi
jne 0x437d0d
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 0x437d94
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 0x437d94
push 0
push 0
push 0
push str.CreateFile
push 0
call fcn.0042e900
mov esi, dword [ebp - 0xa78]
jmp 0x437d8f
push 0
push 0
push 0
push 0x48c33c
push 0
call fcn.0042e900
mov esi, dword [ebp - 0xa78]
jmp 0x437d8f
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 0x437dbe
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x437dbe
push 0
push 0
push 0
push str.InternetConnect
push 0
call fcn.0042e900
add esp, 0x14
mov ebx, eax
test esi, esi
je 0x437de4
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
jmp 0x437dea
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 0x437df7
push eax
call esi
cmp dword [0x4c2e50], 0
je 0x437e05
mov ebx, 0x4c7
push ebx
push str.DownloadFTPFile____End__d_
call fcn.0045f520
mov ecx, dword [ebp - 4]
add esp, 8
mov eax, ebx
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004698aa
mov esp, ebp
pop ebp
ret