Function at 0x421aa0
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 [0x4ce724]
xor eax, ebp
mov dword [ebp - 8], eax
mov dword [ebp - 0x838], 0
xor eax, eax
mov word [ebp - 0x628], ax
push 0x206
push 0
lea ecx, [ebp - 0x626]
push ecx
call fcn.00468010
add esp, 0xc
xor edx, edx
mov word [ebp - 0x210], dx
push 0x206
push 0
lea eax, [ebp - 0x20e]
push eax
call fcn.00468010
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x420], cx
push 0x206
push 0
lea edx, [ebp - 0x41e]
push edx
call fcn.00468010
add esp, 0xc
xor eax, eax
mov word [ebp - 0x830], ax
push 0x206
push 0
lea ecx, [ebp - 0x82e]
push ecx
call fcn.00468010
add esp, 0xc
mov dword [ebp - 0x840], 0
mov dword [ebp - 0x83c], 0
mov dword [ebp - 0x214], 0
mov edx, dword [ebp + 0x28]
mov dword [ebp - 0x834], edx
mov eax, dword [ebp + 0x18]
push eax
push 0x104
lea ecx, [ebp - 0x420]
push ecx
call fcn.0046a95d
add esp, 0xc
lea edx, [ebp - 0x420]
push edx
call dword [sym.imp.SHLWAPI.dll_PathStripPathW]
push 0x5c
lea eax, [ebp - 0x830]
push eax
lea ecx, [ebp - 0x210]
push ecx
mov edx, dword [ebp + 0x1c]
push edx
call fcn.0040b1b0
add esp, 0x10
movzx eax, word [ebp - 0x830]
test eax, eax
jne 0x421bc9
lea ecx, [ebp - 0x420]
push ecx
lea edx, [ebp - 0x210]
push edx
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
jmp 0x421be4
lea ecx, [ebp - 0x830]
push ecx
lea edx, [ebp - 0x210]
push edx
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
cmp dword [ebp + 0x14], 0
jne 0x421c02
cmp dword [ebp + 0x24], 0
je 0x421bf9
mov dword [ebp - 4], 0x1bb
jmp 0x421c00
mov dword [ebp - 4], 0x50
jmp 0x421c08
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 0x834]
push edx
mov eax, dword [ebp + 0x24]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
push str.DownloadHTMLFile____ServerName_s_Login_s_Pwd_s_SourceFile_s_Secure_d_Resume_d
call fcn.00457270
add esp, 0x1c
lea edx, [ebp - 0x628]
push edx
push str.DownloadHTMLFile____TargetFile_s
call fcn.00457270
add esp, 8
cmp dword [0x4e8c5c], 0
jne 0x42260f
push 0
push 0
push 0
push 0
push str.DownloadHTMLFile
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x840], eax
cmp dword [ebp - 0x840], 0
je 0x421c7c
cmp dword [0x4e8c5c], 0
je 0x421c9c
push 0
push 0
push 0
push str.InternetOpen
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x42260f
push 0
mov eax, dword [ebp + 0x20]
push eax
push 3
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
movzx eax, word [ebp - 4]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x840]
push edx
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x83c], eax
cmp dword [ebp - 0x83c], 0
je 0x421cda
cmp dword [0x4e8c5c], 0
je 0x421cfa
push 0
push 0
push 0
push str.InternetConnect
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x42260f
mov dword [ebp - 0x878], 0x80400100
cmp dword [ebp + 0x24], 0
je 0x421d14
mov dword [ebp - 0x878], 0x803000
cmp dword [ebp - 0x834], 0
jne 0x421d2e
mov eax, dword [ebp - 0x878]
or eax, 0x4000000
mov dword [ebp - 0x878], eax
push 0
mov ecx, dword [ebp - 0x878]
push ecx
push 0
push 0
push 0
mov edx, dword [ebp + 0x18]
push edx
push 0x4b298c
mov eax, dword [ebp - 0x83c]
push eax
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp - 0x214], eax
cmp dword [ebp - 0x214], 0
je 0x421d6b
cmp dword [0x4e8c5c], 0
je 0x421d8b
push 0
push 0
push 0
push str.HttpOpenRequest
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x42260f
push 0
push 0
push 0
push 0
mov ecx, dword [ebp - 0x214]
push ecx
call dword [sym.imp.WININET.dll_HttpSendRequestW]
mov dword [ebp - 0x86c], eax
mov edx, dword [ebp - 0x86c]
push edx
push str.DownloadHTMLFile____HttpSendRequest____d
call fcn.00457270
add esp, 8
lea eax, [ebp - 0x838]
push eax
mov ecx, dword [ebp - 0x214]
push ecx
call fcn.004219c0
add esp, 8
mov dword [ebp - 0x890], eax
cmp dword [ebp - 0x838], 0
je 0x421dfe
push 0
push 0
push 0
push 0x4b2a0c
mov edx, dword [ebp - 0x838]
push edx
call fcn.0040ece0
add esp, 0x14
jmp 0x42260f
cmp dword [ebp - 0x890], 0x12c
jb 0x421e2a
mov eax, dword [ebp - 0x890]
sub eax, 0x194
neg eax
sbb eax, eax
and eax, 3
add eax, 2
mov dword [ebp - 0x838], eax
jmp 0x42260f
mov dword [ebp - 0x868], 0
mov dword [ebp - 0x870], 1
mov dword [ebp - 0x844], 0
mov dword [ebp - 0x884], 0
xor ecx, ecx
mov word [ebp - 0x864], cx
xor edx, edx
mov dword [ebp - 0x862], edx
mov dword [ebp - 0x85e], edx
mov dword [ebp - 0x85a], edx
mov word [ebp - 0x856], dx
xor eax, eax
mov word [ebp - 0x854], ax
xor ecx, ecx
mov dword [ebp - 0x852], ecx
mov dword [ebp - 0x84e], ecx
mov dword [ebp - 0x84a], ecx
mov word [ebp - 0x846], cx
mov dword [ebp - 0x88c], 0
xor edx, edx
mov dword [ebp - 0x888], edx
mov dword [ebp - 0x880], 0
xor eax, eax
mov dword [ebp - 0x87c], eax
mov dword [ebp - 0x874], 0x10
lea ecx, [ebp - 0x864]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
push 0
lea edx, [ebp - 0x874]
push edx
lea eax, [ebp - 0x854]
push eax
push 0x4000000b
mov ecx, dword [ebp - 0x214]
push ecx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x421f11
lea edx, [ebp - 0x880]
push edx
lea eax, [ebp - 0x854]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
jmp 0x421f25
lea ecx, [ebp - 0x880]
push ecx
lea edx, [ebp - 0x864]
push edx
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
mov eax, dword [ebp - 0x880]
mov dword [ebp - 0x88c], eax
mov ecx, dword [ebp - 0x87c]
mov dword [ebp - 0x888], ecx
movzx edx, word [ebp - 0x846]
push edx
movzx eax, word [ebp - 0x848]
push eax
movzx ecx, word [ebp - 0x84a]
push ecx
movzx edx, word [ebp - 0x84c]
push edx
movzx eax, word [ebp - 0x854]
push eax
movzx ecx, word [ebp - 0x852]
push ecx
movzx edx, word [ebp - 0x84e]
push edx
push 0x4b2a30
call fcn.00457270
add esp, 0x20
mov dword [ebp - 0x874], 4
push 0
lea eax, [ebp - 0x874]
push eax
lea ecx, [ebp - 0x868]
push ecx
push 0x20000005
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x4225ed
mov eax, dword [ebp - 0x868]
push eax
push str.DownloadHTMLFile____FileSize_d
call fcn.00457270
add esp, 8
cmp dword [ebp - 0x868], 0
jbe 0x4225cd
mov ecx, dword [ebp - 0x868]
push ecx
push 0x4b2af0
call fcn.00457270
add esp, 8
lea edx, [ebp - 0x210]
push edx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x42200b
lea eax, [ebp - 0x210]
push eax
call fcn.0040d340
add esp, 4
mov dword [ebp - 0x89c], 0
mov dword [ebp - 0x898], 0
cmp dword [ebp - 0x834], 0
je 0x422166
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 - 0x89c], eax
cmp dword [ebp - 0x89c], 0xffffffff
je 0x422147
lea edx, [ebp - 0x8bc]
push edx
push 0
push 0
mov eax, dword [ebp - 0x89c]
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.00457270
add esp, 0x20
lea ecx, [ebp - 0x880]
push ecx
lea edx, [ebp - 0x8bc]
push edx
call dword [sym.imp.KERNEL32.dll_CompareFileTime]
test eax, eax
je 0x422100
push str.DownloadHTMLFile____Files_are_not_on_the_same_date_
call fcn.00457270
add esp, 4
mov dword [ebp - 0x834], 0
jmp 0x422145
lea eax, [ebp - 0x8c8]
push eax
mov ecx, dword [ebp - 0x89c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x422126
mov edx, dword [ebp - 0x8c8]
mov dword [ebp - 0x898], edx
jmp 0x422145
push 0
push 0
push 0
push 0x4b2c40
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x834], 0
jmp 0x422166
push 0
push 0
push 0
push 0x4b2c5c
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x834], 0
cmp dword [ebp - 0x834], 0
je 0x422207
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 - 0x89c]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x4221c9
push 0
push 0
push 0
push 0x4b2c74
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x834], 0
jmp 0x422207
push 0
push 0
push 0
mov ecx, dword [ebp - 0x898]
push ecx
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetSetFilePointer]
cmp eax, 0xffffffff
jne 0x422207
push 0
push 0
push 0
push 0x4b2c98
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x834], 0
cmp dword [ebp - 0x834], 0
jne 0x4222ae
push str.DownloadHTMLFile____Mode_resume_disabled_
call fcn.00457270
add esp, 4
mov dword [ebp - 0x898], 0
cmp dword [ebp - 0x89c], 0
je 0x422241
mov eax, dword [ebp - 0x89c]
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 - 0x89c], eax
cmp dword [ebp - 0x89c], 0xffffffff
jne 0x422291
push 0
push 0
push 0
push 0x4b2d1c
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x42260f
lea edx, [ebp - 0x880]
push edx
push 0
lea eax, [ebp - 0x88c]
push eax
mov ecx, dword [ebp - 0x89c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov edx, dword [ebp - 0x89c]
push edx
push str.DownloadHTMLFile____CreateFile_d
call fcn.00457270
add esp, 8
mov eax, dword [ebp - 0x868]
sub eax, dword [ebp - 0x898]
mov dword [ebp - 0x894], eax
mov ecx, dword [0x4d0a15]
or ecx, dword [0x4d0a19]
jne 0x4222f6
mov edx, dword [ebp - 0x868]
xor eax, eax
push eax
push edx
mov ecx, 0x4d09c0
call fcn.00412610
mov ecx, dword [ebp - 0x898]
xor edx, edx
add ecx, dword [0x4d0a31]
mov eax, dword [0x4d0a35]
adc eax, edx
mov dword [0x4d0a31], ecx
mov dword [0x4d0a35], eax
mov ecx, dword [0x4d0a35]
push ecx
mov edx, dword [0x4d0a31]
push edx
mov ecx, 0x4d09c0
call fcn.00412760
mov dword [ebp - 0x8a4], 0x100000
cmp dword [ebp - 0x894], 0
je 0x42235b
mov eax, dword [ebp - 0x894]
cmp eax, dword [ebp - 0x8a4]
jae 0x42235b
mov ecx, dword [ebp - 0x894]
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.00466e9e
add esp, 4
mov dword [ebp - 0x8d4], eax
mov eax, dword [ebp - 0x8d4]
mov dword [ebp - 0x8a0], eax
push 4
push 0
mov ecx, dword [ebp - 0x8a0]
push ecx
call fcn.00468010
add esp, 0xc
cmp dword [ebp - 0x89c], 0xffffffff
je 0x4225b0
cmp dword [0x4e8c5c], 0
jne 0x4225b0
cmp dword [ebp - 0x870], 0
je 0x4223fd
cmp dword [0x4e8c5c], 0
jne 0x4223fd
lea edx, [ebp - 0x884]
push edx
mov eax, dword [ebp - 0x8a4]
push eax
mov ecx, dword [ebp - 0x8a0]
push ecx
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4223fd
mov dword [ebp - 0x8dc], 1
jmp 0x422407
mov dword [ebp - 0x8dc], 0
mov eax, dword [ebp - 0x8dc]
mov dword [ebp - 0x870], eax
mov ecx, dword [ebp - 0x870]
push ecx
mov edx, dword [ebp - 0x884]
push edx
mov eax, dword [ebp - 0x8a4]
push eax
push str.DownloadHTMLFile____InternetReadFile_BUFLEN_d_BytesRead_d__d
call fcn.00457270
add esp, 0x10
cmp dword [ebp - 0x884], 0
jbe 0x422537
cmp dword [ebp - 0x870], 0
je 0x422537
cmp dword [ebp - 0x870], 0
je 0x422495
cmp dword [0x4e8c5c], 0
jne 0x422495
push 0
lea ecx, [ebp - 0x844]
push ecx
mov edx, dword [ebp - 0x884]
push edx
mov eax, dword [ebp - 0x8a0]
push eax
mov ecx, dword [ebp - 0x89c]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x422495
mov dword [ebp - 0x8e0], 1
jmp 0x42249f
mov dword [ebp - 0x8e0], 0
mov edx, dword [ebp - 0x8e0]
mov dword [ebp - 0x870], edx
mov eax, dword [ebp - 0x870]
push eax
mov ecx, dword [ebp - 0x844]
push ecx
push str.DownloadHTMLFile____WriteFile_BytesWritten_d__d
call fcn.00457270
add esp, 0xc
mov edx, dword [ebp - 0x844]
cmp edx, dword [ebp - 0x884]
jne 0x4224e9
cmp dword [ebp - 0x870], 0
je 0x4224e9
mov dword [ebp - 0x8e4], 1
jmp 0x4224f3
mov dword [ebp - 0x8e4], 0
mov eax, dword [ebp - 0x8e4]
mov dword [ebp - 0x870], eax
mov ecx, dword [ebp - 0x844]
xor edx, edx
add ecx, dword [0x4d0a31]
mov eax, dword [0x4d0a35]
adc eax, edx
mov dword [0x4d0a31], ecx
mov dword [0x4d0a35], eax
mov ecx, dword [0x4d0a35]
push ecx
mov edx, dword [0x4d0a31]
push edx
mov ecx, 0x4d09c0
call fcn.00412760
cmp dword [ebp - 0x884], 0
je 0x422556
cmp dword [ebp - 0x870], 0
je 0x422556
cmp dword [0x4e8c5c], 0
je 0x4223b9
mov eax, dword [ebp - 0x8a0]
mov dword [ebp - 0x8d8], eax
mov ecx, dword [ebp - 0x8d8]
push ecx
call fcn.0046afc2
add esp, 4
cmp dword [ebp - 0x870], 0
jne 0x422586
mov dword [ebp - 0x838], 0x17
jmp 0x4225a1
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4225a1
mov dword [ebp - 0x838], 2
mov eax, dword [ebp - 0x89c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4225cb
push 0
push 0
push 0
push 0x4b2e64
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x4225eb
mov ecx, dword [ebp - 0x868]
push ecx
push str.DownloadHTMLFile____HttpQueryInfo_dwFileSize__d
call fcn.00457270
add esp, 8
mov dword [ebp - 0x838], 0x2efc
jmp 0x422608
push 0
push 0
push 0
push str.HttpQueryInfo
push 0
call fcn.0040ece0
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x42260f
cmp dword [ebp - 0x214], 0
je 0x422625
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x83c], 0
je 0x42263b
mov eax, dword [ebp - 0x83c]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x840], 0
je 0x422651
mov ecx, dword [ebp - 0x840]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [0x4e8c5c], 0
je 0x422664
mov dword [ebp - 0x838], 0x4c7
mov edx, dword [ebp - 0x838]
push edx
push str.DownloadHTMLFile____End__d_
call fcn.00457270
add esp, 8
mov eax, dword [ebp - 0x838]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00467fff
mov esp, ebp
pop ebp
ret