Function at 0x421150
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, 0xadc
mov eax, dword [0x4cd724]
xor eax, ebp
mov dword [ebp - 8], eax
push esi
mov dword [ebp - 0x834], 0
xor eax, eax
mov word [ebp - 0x628], ax
push 0x206
push 0
lea ecx, [ebp - 0x626]
push ecx
call fcn.004677c0
add esp, 0xc
xor edx, edx
mov word [ebp - 0x210], dx
push 0x206
push 0
lea eax, [ebp - 0x20e]
push eax
call fcn.004677c0
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x418], cx
push 0x206
push 0
lea edx, [ebp - 0x416]
push edx
call fcn.004677c0
add esp, 0xc
xor eax, eax
mov word [ebp - 0x830], ax
push 0x206
push 0
lea ecx, [ebp - 0x82e]
push ecx
call fcn.004677c0
add esp, 0xc
mov dword [ebp - 0x83c], 0
mov dword [ebp - 0x838], 0
mov dword [ebp - 0x41c], 0
mov edx, dword [ebp + 0x18]
push edx
push 0x104
lea eax, [ebp - 0x418]
push eax
call fcn.0046a10d
add esp, 0xc
lea ecx, [ebp - 0x418]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathStripPathW]
push 0x5c
lea edx, [ebp - 0x830]
push edx
lea eax, [ebp - 0x210]
push eax
mov ecx, dword [ebp + 0x1c]
push ecx
call fcn.0040b150
add esp, 0x10
movzx edx, word [ebp - 0x830]
test edx, edx
jne 0x421271
lea eax, [ebp - 0x418]
push eax
lea ecx, [ebp - 0x210]
push ecx
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
jmp 0x42128c
lea eax, [ebp - 0x830]
push eax
lea ecx, [ebp - 0x210]
push ecx
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
cmp dword [ebp + 0x14], 0
jne 0x42129b
mov dword [ebp - 4], 0x15
jmp 0x4212a1
mov eax, dword [ebp + 0x14]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
push str.DownloadFTPFile____ServerName_s_LoginFTP_s_PwdFTP_s_SourceFile_s_Port_d
call fcn.00456a00
add esp, 0x18
lea eax, [ebp - 0x628]
push eax
push str.DownloadFTPFile____TargetFile_s
call fcn.00456a00
add esp, 8
cmp dword [0x4e7810], 0
jne 0x4218df
push 0
push 0
push 0
push 0
push str.DownloadFTPFile
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x83c], eax
cmp dword [ebp - 0x83c], 0
je 0x42130e
cmp dword [0x4e7810], 0
je 0x42132e
push 0
push 0
push 0
push 0x4b1504
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], eax
jmp 0x4218df
push 0
mov ecx, dword [ebp + 0x20]
push ecx
push 1
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
movzx ecx, word [ebp - 4]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x83c]
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x838], eax
cmp dword [ebp - 0x838], 0
je 0x42136c
cmp dword [0x4e7810], 0
je 0x42138c
push 0
push 0
push 0
push 0x4b1520
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], eax
jmp 0x4218df
mov dword [ebp - 0x850], 0
mov dword [ebp - 0x84c], 0
mov dword [ebp - 0xaa0], 0
push 0x24c
push 0
lea ecx, [ebp - 0xa9c]
push ecx
call fcn.004677c0
add esp, 0xc
mov dword [ebp - 0x844], 0
push 0
push 0x10
lea edx, [ebp - 0xaa0]
push edx
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp - 0x838]
push ecx
call dword [sym.imp.WININET.dll_FtpFindFirstFileW]
mov dword [ebp - 0x844], eax
mov edx, dword [ebp - 0x844]
mov dword [ebp - 0x840], edx
cmp dword [ebp - 0x844], 0
je 0x421450
mov eax, dword [ebp - 0xa84]
xor edx, edx
mov cl, 0x20
call fcn.0046d470
mov ecx, dword [ebp - 0xa80]
xor esi, esi
or eax, ecx
or edx, esi
mov dword [ebp - 0x850], eax
mov dword [ebp - 0x84c], edx
mov edx, dword [ebp - 0x84c]
push edx
mov eax, dword [ebp - 0x850]
push eax
push str.DownloadFTPFile____finfo:_FileSize___I64u
call fcn.00456a00
add esp, 0xc
mov ecx, dword [ebp - 0x844]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
push 0
push closesocket
push closesocket
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp - 0x838]
push eax
call dword [sym.imp.WININET.dll_FtpOpenFileW]
mov dword [ebp - 0x41c], eax
cmp dword [ebp - 0x41c], 0
je 0x4218bd
cmp dword [0x4e7810], 0
jne 0x4218bd
mov dword [ebp - 0xab8], 0
mov dword [ebp - 0xaa8], 0
mov dword [ebp - 0xaac], 1
mov dword [ebp - 0xaa4], 0
mov dword [ebp - 0xab4], 0
mov ecx, dword [ebp - 0x850]
or ecx, dword [ebp - 0x84c]
je 0x4214d6
cmp dword [ebp - 0x840], 0
jne 0x421532
lea edx, [ebp - 0xaa8]
push edx
mov eax, dword [ebp - 0x41c]
push eax
call dword [sym.imp.WININET.dll_FtpGetFileSize]
mov dword [ebp - 0xab8], eax
mov eax, dword [ebp - 0xaa8]
xor edx, edx
mov cl, 0x20
call fcn.0046d470
mov ecx, dword [ebp - 0xab8]
xor esi, esi
or eax, ecx
or edx, esi
mov dword [ebp - 0x850], eax
mov dword [ebp - 0x84c], edx
mov edx, dword [ebp - 0x84c]
push edx
mov eax, dword [ebp - 0x850]
push eax
push str.DownloadFTPFile____FtpGetFileSize___I64u
call fcn.00456a00
add esp, 0xc
cmp dword [ebp - 0x84c], 0
ja 0x421548
cmp dword [ebp - 0x850], 0
jbe 0x4218a0
cmp dword [0x4e7810], 0
jne 0x4218a0
mov ecx, dword [0x4cfa15]
or ecx, dword [0x4cfa19]
jne 0x42157b
mov edx, dword [ebp - 0x84c]
push edx
mov eax, dword [ebp - 0x850]
push eax
mov ecx, 0x4cf9c0
call fcn.004125a0
mov dword [ebp - 0xac0], 0x1000
mov ecx, dword [ebp - 0xac0]
xor edx, edx
mov dword [ebp - 0xad0], ecx
mov dword [ebp - 0xacc], edx
mov eax, dword [ebp - 0x84c]
cmp eax, dword [ebp - 0xacc]
ja 0x4215c3
jb 0x4215b7
mov ecx, dword [ebp - 0x850]
cmp ecx, dword [ebp - 0xad0]
jae 0x4215c3
mov edx, dword [ebp - 0x850]
mov dword [ebp - 0xac0], edx
xor ecx, ecx
mov eax, dword [ebp - 0xac0]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046664e
add esp, 4
mov dword [ebp - 0xac4], eax
mov eax, dword [ebp - 0xac4]
mov dword [ebp - 0xabc], eax
push 4
push 0
mov ecx, dword [ebp - 0xabc]
push ecx
call fcn.004677c0
add esp, 0xc
lea edx, [ebp - 0x210]
push edx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x421627
lea eax, [ebp - 0x210]
push eax
call fcn.0040d2e0
add esp, 4
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x628]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0xab0], eax
cmp dword [ebp - 0xab0], 0xffffffff
je 0x421883
cmp dword [0x4e7810], 0
jne 0x421883
cmp dword [ebp - 0x840], 0
je 0x42168c
lea edx, [ebp - 0xa8c]
push edx
push 0
lea eax, [ebp - 0xa9c]
push eax
mov ecx, dword [ebp - 0xab0]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp - 0xaac], 0
je 0x4216d0
cmp dword [0x4e7810], 0
jne 0x4216d0
lea edx, [ebp - 0xab4]
push edx
mov eax, dword [ebp - 0xac0]
push eax
mov ecx, dword [ebp - 0xabc]
push ecx
mov edx, dword [ebp - 0x41c]
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4216d0
mov dword [ebp - 0xad4], 1
jmp 0x4216da
mov dword [ebp - 0xad4], 0
mov eax, dword [ebp - 0xad4]
mov dword [ebp - 0xaac], eax
mov ecx, dword [ebp - 0xaac]
push ecx
mov edx, dword [ebp - 0xab4]
push edx
mov eax, dword [ebp - 0xac0]
push eax
push str.DownloadFTPFile____InternetReadFile_BUFLEN_d_BytesRead_d__d
call fcn.00456a00
add esp, 0x10
cmp dword [ebp - 0xab4], 0
jbe 0x42180a
cmp dword [ebp - 0xaac], 0
je 0x42180a
cmp dword [ebp - 0xaac], 0
je 0x421768
cmp dword [0x4e7810], 0
jne 0x421768
push 0
lea ecx, [ebp - 0xaa4]
push ecx
mov edx, dword [ebp - 0xab4]
push edx
mov eax, dword [ebp - 0xabc]
push eax
mov ecx, dword [ebp - 0xab0]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x421768
mov dword [ebp - 0xad8], 1
jmp 0x421772
mov dword [ebp - 0xad8], 0
mov edx, dword [ebp - 0xad8]
mov dword [ebp - 0xaac], edx
mov eax, dword [ebp - 0xaac]
push eax
mov ecx, dword [ebp - 0xaa4]
push ecx
push str.DownloadFTPFile____WriteFile_Byteswritten_d__d
call fcn.00456a00
add esp, 0xc
mov edx, dword [ebp - 0xaa4]
cmp edx, dword [ebp - 0xab4]
jne 0x4217bc
cmp dword [ebp - 0xaac], 0
je 0x4217bc
mov dword [ebp - 0xadc], 1
jmp 0x4217c6
mov dword [ebp - 0xadc], 0
mov eax, dword [ebp - 0xadc]
mov dword [ebp - 0xaac], eax
mov ecx, dword [ebp - 0xaa4]
xor edx, edx
add ecx, dword [0x4cfa31]
mov eax, dword [0x4cfa35]
adc eax, edx
mov dword [0x4cfa31], ecx
mov dword [0x4cfa35], eax
mov ecx, dword [0x4cfa35]
push ecx
mov edx, dword [0x4cfa31]
push edx
mov ecx, 0x4cf9c0
call fcn.004126f0
cmp dword [ebp - 0xab4], 0
je 0x421829
cmp dword [ebp - 0xaac], 0
je 0x421829
cmp dword [0x4e7810], 0
je 0x42168c
mov eax, dword [ebp - 0xabc]
mov dword [ebp - 0xac8], eax
mov ecx, dword [ebp - 0xac8]
push ecx
call fcn.0046a772
add esp, 4
cmp dword [ebp - 0xaac], 0
jne 0x421859
mov dword [ebp - 0x834], 0x17
jmp 0x421874
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x421874
mov dword [ebp - 0x834], 2
mov eax, dword [ebp - 0xab0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x42189e
push 0
push 0
push 0
push 0x4b16d4
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], eax
jmp 0x4218bb
push 0
push 0
push 0
push 0x4b16ec
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], eax
jmp 0x4218d8
push 0
push 0
push 0
push str.FtpOpenFile
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], eax
jmp 0x4218df
cmp dword [ebp - 0x41c], 0
je 0x4218f5
mov ecx, dword [ebp - 0x41c]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x838], 0
je 0x42190b
mov edx, dword [ebp - 0x838]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x83c], 0
je 0x421921
mov eax, dword [ebp - 0x83c]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [0x4e7810], 0
je 0x421934
mov dword [ebp - 0x834], 0x4c7
mov ecx, dword [ebp - 0x834]
push ecx
push str.DownloadFTPFile____End__d_
call fcn.00456a00
add esp, 8
mov eax, dword [ebp - 0x834]
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004677af
mov esp, ebp
pop ebp
ret