Function at 0x415d40
Capabilities:
Check if file exists
Connect to http server
Create http request
Download and write a file
Get file size
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Timestomp file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8e4
mov eax, dword [0x4b1120]
xor eax, ebp
mov dword [ebp - 8], eax
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.00447660
add esp, 0xc
xor edx, edx
mov word [ebp - 0x210], dx
push 0x206
push 0
lea eax, [ebp - 0x20e]
push eax
call fcn.00447660
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x420], cx
push 0x206
push 0
lea edx, [ebp - 0x41e]
push edx
call fcn.00447660
add esp, 0xc
xor eax, eax
mov word [ebp - 0x830], ax
push 0x206
push 0
lea ecx, [ebp - 0x82e]
push ecx
call fcn.00447660
add esp, 0xc
mov dword [ebp - 0x83c], 0
mov dword [ebp - 0x838], 0
mov dword [ebp - 0x214], 0
mov edx, dword [ebp + 0x18]
push edx
push 0x104
lea eax, [ebp - 0x420]
push eax
call fcn.0044a00d
add esp, 0xc
lea ecx, [ebp - 0x420]
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.0040af50
add esp, 0x10
movzx edx, word [ebp - 0x830]
test edx, edx
jne 0x415e60
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x210]
push ecx
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
jmp 0x415e7b
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 0x415e99
cmp dword [ebp + 0x24], 0
je 0x415e90
mov dword [ebp - 4], 0x1bb
jmp 0x415e97
mov dword [ebp - 4], 0x50
jmp 0x415e9f
mov eax, dword [ebp + 0x14]
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0x28]
push ecx
mov edx, dword [ebp + 0x24]
push edx
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
push str.DownloadHTMLFile____ServerName_s_Login_s_Pwd_s_SourceFile_s_Secure_d_Resume_d
call fcn.00437970
add esp, 0x1c
lea ecx, [ebp - 0x628]
push ecx
push str.DownloadHTMLFile____TargetFile_s
call fcn.00437970
add esp, 8
cmp dword [0x4c9c48], 0
jne 0x416866
push 0
push 0
push 0
push 1
push str.DownloadHTMLFile
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x83c], eax
cmp dword [ebp - 0x83c], 0
je 0x415f10
cmp dword [0x4c9c48], 0
je 0x415f2a
push 0
push str.InternetOpen
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x834], eax
jmp 0x416866
push 0
mov edx, dword [ebp + 0x20]
push edx
push 3
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
movzx edx, word [ebp - 4]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x83c]
push ecx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x838], eax
cmp dword [ebp - 0x838], 0
je 0x415f68
cmp dword [0x4c9c48], 0
je 0x415f82
push 0
push str.InternetConnect
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x834], eax
jmp 0x416866
mov dword [ebp - 0x874], 0x80400100
cmp dword [ebp + 0x24], 0
je 0x415f9c
mov dword [ebp - 0x874], 0x803000
cmp dword [ebp + 0x28], 0
jne 0x415fb4
mov edx, dword [ebp - 0x874]
or edx, 0x4000000
mov dword [ebp - 0x874], edx
push 0
mov eax, dword [ebp - 0x874]
push eax
push 0
push 0
push 0
mov ecx, dword [ebp + 0x18]
push ecx
push 0x48e13c
mov edx, dword [ebp - 0x838]
push edx
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp - 0x214], eax
cmp dword [ebp - 0x214], 0
je 0x415ff1
cmp dword [0x4c9c48], 0
je 0x41600b
push 0
push str.HttpOpenRequest
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x834], eax
jmp 0x416866
push 0
push 0
push 0
push 0
mov eax, dword [ebp - 0x214]
push eax
call dword [sym.imp.WININET.dll_HttpSendRequestW]
mov dword [ebp - 0x868], eax
mov ecx, dword [ebp - 0x868]
push ecx
push str.DownloadHTMLFile____HttpSendRequest____d
call fcn.00437970
add esp, 8
lea edx, [ebp - 0x834]
push edx
mov eax, dword [ebp - 0x214]
push eax
call fcn.00415c40
add esp, 8
mov dword [ebp - 0x88c], eax
cmp dword [ebp - 0x834], 0
je 0x416078
mov ecx, dword [ebp - 0x834]
push ecx
push str.GetHttpStatusCode
call fcn.0040e620
add esp, 8
jmp 0x416866
cmp dword [ebp - 0x88c], 0x12c
jb 0x4160a5
mov edx, dword [ebp - 0x88c]
sub edx, 0x194
neg edx
sbb edx, edx
and edx, 3
add edx, 2
mov dword [ebp - 0x834], edx
jmp 0x416866
mov dword [ebp - 0x864], 0
mov dword [ebp - 0x86c], 1
mov dword [ebp - 0x840], 0
mov dword [ebp - 0x880], 0
xor eax, eax
mov word [ebp - 0x860], ax
xor ecx, ecx
mov dword [ebp - 0x85e], ecx
mov dword [ebp - 0x85a], ecx
mov dword [ebp - 0x856], ecx
mov word [ebp - 0x852], cx
xor edx, edx
mov word [ebp - 0x850], dx
xor eax, eax
mov dword [ebp - 0x84e], eax
mov dword [ebp - 0x84a], eax
mov dword [ebp - 0x846], eax
mov word [ebp - 0x842], ax
mov dword [ebp - 0x888], 0
xor ecx, ecx
mov dword [ebp - 0x884], ecx
mov dword [ebp - 0x87c], 0
xor edx, edx
mov dword [ebp - 0x878], edx
mov dword [ebp - 0x870], 0x10
lea eax, [ebp - 0x860]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
push 0
lea ecx, [ebp - 0x870]
push ecx
lea edx, [ebp - 0x850]
push edx
push 0x4000000b
mov eax, dword [ebp - 0x214]
push eax
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x41618c
lea ecx, [ebp - 0x87c]
push ecx
lea edx, [ebp - 0x850]
push edx
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
jmp 0x4161a0
lea eax, [ebp - 0x87c]
push eax
lea ecx, [ebp - 0x860]
push ecx
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
mov edx, dword [ebp - 0x87c]
mov dword [ebp - 0x888], edx
mov eax, dword [ebp - 0x878]
mov dword [ebp - 0x884], eax
movzx ecx, word [ebp - 0x842]
push ecx
movzx edx, word [ebp - 0x844]
push edx
movzx eax, word [ebp - 0x846]
push eax
movzx ecx, word [ebp - 0x848]
push ecx
movzx edx, word [ebp - 0x850]
push edx
movzx eax, word [ebp - 0x84e]
push eax
movzx ecx, word [ebp - 0x84a]
push ecx
push 0x48e1e0
call fcn.00437970
add esp, 0x20
mov dword [ebp - 0x870], 4
push 0
lea edx, [ebp - 0x870]
push edx
lea eax, [ebp - 0x864]
push eax
push 0x20000005
mov ecx, dword [ebp - 0x214]
push ecx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x41684a
mov edx, dword [ebp - 0x864]
push edx
push str.DownloadHTMLFile____FileSize_d
call fcn.00437970
add esp, 8
cmp dword [ebp - 0x864], 0
jbe 0x41682a
mov eax, dword [ebp - 0x864]
push eax
push 0x48e2a0
call fcn.00437970
add esp, 8
lea ecx, [ebp - 0x210]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x416286
lea edx, [ebp - 0x210]
push edx
call fcn.0040cdb0
add esp, 4
mov dword [ebp - 0x898], 0
mov eax, dword [ebp + 0x28]
mov dword [ebp - 0x8a0], eax
mov dword [ebp - 0x894], 0
cmp dword [ebp + 0x28], 0
je 0x4163db
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x628]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x898], eax
cmp dword [ebp - 0x898], 0xffffffff
je 0x4163c2
lea edx, [ebp - 0x8bc]
push edx
push 0
push 0
mov eax, dword [ebp - 0x898]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileTime]
lea ecx, [ebp - 0x8b4]
push ecx
lea edx, [ebp - 0x8bc]
push edx
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
movzx eax, word [ebp - 0x8a6]
push eax
movzx ecx, word [ebp - 0x8a8]
push ecx
movzx edx, word [ebp - 0x8aa]
push edx
movzx eax, word [ebp - 0x8ac]
push eax
movzx ecx, word [ebp - 0x8b4]
push ecx
movzx edx, word [ebp - 0x8b2]
push edx
movzx eax, word [ebp - 0x8ae]
push eax
push str.DownloadHTMLFile____stLastWriteTime_d__d__d____d:_d:_d__dms
call fcn.00437970
add esp, 0x20
lea ecx, [ebp - 0x87c]
push ecx
lea edx, [ebp - 0x8bc]
push edx
call dword [sym.imp.KERNEL32.dll_CompareFileTime]
test eax, eax
je 0x416381
push str.DownloadHTMLFile____Files_are_not_on_the_same_date_
call fcn.00437970
add esp, 4
mov dword [ebp - 0x8a0], 0
jmp 0x4163c0
lea eax, [ebp - 0x8c8]
push eax
mov ecx, dword [ebp - 0x898]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4163a7
mov edx, dword [ebp - 0x8c8]
mov dword [ebp - 0x894], edx
jmp 0x4163c0
push 0
push 0x48e3f0
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x8a0], 0
jmp 0x4163db
push 0
push 0x48e40c
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x8a0], 0
cmp dword [ebp - 0x8a0], 0
je 0x416470
mov dword [ebp - 0x8d0], 0
xor eax, eax
mov dword [ebp - 0x8cc], eax
push 2
push 0
mov ecx, dword [ebp - 0x8cc]
push ecx
mov edx, dword [ebp - 0x8d0]
push edx
mov eax, dword [ebp - 0x898]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x416438
push 0
push 0x48e424
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x8a0], 0
jmp 0x416470
push 0
push 0
push 0
mov ecx, dword [ebp - 0x894]
push ecx
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetSetFilePointer]
cmp eax, 0xffffffff
jne 0x416470
push 0
push 0x48e448
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x8a0], 0
cmp dword [ebp - 0x8a0], 0
jne 0x416511
push str.DownloadHTMLFile____Mode_resume_disabled_
call fcn.00437970
add esp, 4
mov dword [ebp - 0x894], 0
cmp dword [ebp - 0x898], 0
je 0x4164aa
mov eax, dword [ebp - 0x898]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
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 - 0x898], eax
cmp dword [ebp - 0x898], 0xffffffff
jne 0x4164f4
push 0
push 0x48e4cc
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x834], eax
jmp 0x416866
lea edx, [ebp - 0x87c]
push edx
push 0
lea eax, [ebp - 0x888]
push eax
mov ecx, dword [ebp - 0x898]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov edx, dword [ebp - 0x898]
push edx
push str.DownloadHTMLFile____CreateFile_d
call fcn.00437970
add esp, 8
mov eax, dword [ebp - 0x864]
sub eax, dword [ebp - 0x894]
mov dword [ebp - 0x890], eax
mov ecx, dword [0x4b3500]
or ecx, dword [0x4b3504]
jne 0x416559
mov edx, dword [ebp - 0x864]
xor eax, eax
push eax
push edx
mov ecx, 0x4b34a8
call fcn.0040fb10
mov ecx, dword [ebp - 0x894]
xor edx, edx
add ecx, dword [0x4b3520]
mov eax, dword [0x4b3524]
adc eax, edx
mov dword [0x4b3520], ecx
mov dword [0x4b3524], eax
mov ecx, dword [0x4b3524]
push ecx
mov edx, dword [0x4b3520]
push edx
mov ecx, 0x4b34a8
call fcn.0040fc60
mov dword [ebp - 0x8a4], 0x100000
cmp dword [ebp - 0x890], 0
je 0x4165be
mov eax, dword [ebp - 0x890]
cmp eax, dword [ebp - 0x8a4]
jae 0x4165be
mov ecx, dword [ebp - 0x890]
mov dword [ebp - 0x8a4], ecx
xor ecx, ecx
mov eax, dword [ebp - 0x8a4]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0044763a
add esp, 4
mov dword [ebp - 0x8d4], eax
mov eax, dword [ebp - 0x8d4]
mov dword [ebp - 0x89c], eax
push 4
push 0
mov ecx, dword [ebp - 0x89c]
push ecx
call fcn.00447660
add esp, 0xc
cmp dword [ebp - 0x898], 0xffffffff
je 0x416813
cmp dword [0x4c9c48], 0
jne 0x416813
cmp dword [ebp - 0x86c], 0
je 0x416660
cmp dword [0x4c9c48], 0
jne 0x416660
lea edx, [ebp - 0x880]
push edx
mov eax, dword [ebp - 0x8a4]
push eax
mov ecx, dword [ebp - 0x89c]
push ecx
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x416660
mov dword [ebp - 0x8dc], 1
jmp 0x41666a
mov dword [ebp - 0x8dc], 0
mov eax, dword [ebp - 0x8dc]
mov dword [ebp - 0x86c], eax
mov ecx, dword [ebp - 0x86c]
push ecx
mov edx, dword [ebp - 0x880]
push edx
mov eax, dword [ebp - 0x8a4]
push eax
push str.DownloadHTMLFile____InternetReadFile_BUFLEN_d_BytesRead_d__d
call fcn.00437970
add esp, 0x10
cmp dword [ebp - 0x880], 0
jbe 0x41679a
cmp dword [ebp - 0x86c], 0
je 0x41679a
cmp dword [ebp - 0x86c], 0
je 0x4166f8
cmp dword [0x4c9c48], 0
jne 0x4166f8
push 0
lea ecx, [ebp - 0x840]
push ecx
mov edx, dword [ebp - 0x880]
push edx
mov eax, dword [ebp - 0x89c]
push eax
mov ecx, dword [ebp - 0x898]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4166f8
mov dword [ebp - 0x8e0], 1
jmp 0x416702
mov dword [ebp - 0x8e0], 0
mov edx, dword [ebp - 0x8e0]
mov dword [ebp - 0x86c], edx
mov eax, dword [ebp - 0x86c]
push eax
mov ecx, dword [ebp - 0x840]
push ecx
push str.DownloadHTMLFile____WriteFile_BytesWritten_d__d
call fcn.00437970
add esp, 0xc
mov edx, dword [ebp - 0x840]
cmp edx, dword [ebp - 0x880]
jne 0x41674c
cmp dword [ebp - 0x86c], 0
je 0x41674c
mov dword [ebp - 0x8e4], 1
jmp 0x416756
mov dword [ebp - 0x8e4], 0
mov eax, dword [ebp - 0x8e4]
mov dword [ebp - 0x86c], eax
mov ecx, dword [ebp - 0x840]
xor edx, edx
add ecx, dword [0x4b3520]
mov eax, dword [0x4b3524]
adc eax, edx
mov dword [0x4b3520], ecx
mov dword [0x4b3524], eax
mov ecx, dword [0x4b3524]
push ecx
mov edx, dword [0x4b3520]
push edx
mov ecx, 0x4b34a8
call fcn.0040fc60
cmp dword [ebp - 0x880], 0
je 0x4167b9
cmp dword [ebp - 0x86c], 0
je 0x4167b9
cmp dword [0x4c9c48], 0
je 0x41661c
mov eax, dword [ebp - 0x89c]
mov dword [ebp - 0x8d8], eax
mov ecx, dword [ebp - 0x8d8]
push ecx
call fcn.0044a25c
add esp, 4
cmp dword [ebp - 0x86c], 0
jne 0x4167e9
mov dword [ebp - 0x834], 0x17
jmp 0x416804
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x416804
mov dword [ebp - 0x834], 2
mov eax, dword [ebp - 0x898]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x416828
push 0
push 0x48e614
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x834], eax
jmp 0x416848
mov ecx, dword [ebp - 0x864]
push ecx
push str.DownloadHTMLFile____HttpQueryInfo_dwFileSize__d
call fcn.00437970
add esp, 8
mov dword [ebp - 0x834], 0x2efc
jmp 0x41685f
push 0
push str.HttpQueryInfo
call fcn.0040e620
add esp, 8
mov dword [ebp - 0x834], eax
jmp 0x416866
cmp dword [ebp - 0x214], 0
je 0x41687c
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x838], 0
je 0x416892
mov eax, dword [ebp - 0x838]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x83c], 0
je 0x4168a8
mov ecx, dword [ebp - 0x83c]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [0x4c9c48], 0
je 0x4168bb
mov dword [ebp - 0x834], 0x4c7
mov edx, dword [ebp - 0x834]
push edx
push str.DownloadHTMLFile____End__d_
call fcn.00437970
add esp, 8
mov eax, dword [ebp - 0x834]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00447645
mov esp, ebp
pop ebp
ret