Function at 0x421a40
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 [0x4cd724]
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.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 - 0x420], cx
push 0x206
push 0
lea edx, [ebp - 0x41e]
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 - 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.0046a10d
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.0040b150
add esp, 0x10
movzx eax, word [ebp - 0x830]
test eax, eax
jne 0x421b69
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 0x421b84
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 0x421ba2
cmp dword [ebp + 0x24], 0
je 0x421b99
mov dword [ebp - 4], 0x1bb
jmp 0x421ba0
mov dword [ebp - 4], 0x50
jmp 0x421ba8
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.00456a00
add esp, 0x1c
lea edx, [ebp - 0x628]
push edx
push str.DownloadHTMLFile____TargetFile_s
call fcn.00456a00
add esp, 8
cmp dword [0x4e7810], 0
jne 0x4225af
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 0x421c1c
cmp dword [0x4e7810], 0
je 0x421c3c
push 0
push 0
push 0
push str.InternetOpen
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x4225af
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 0x421c7a
cmp dword [0x4e7810], 0
je 0x421c9a
push 0
push 0
push 0
push str.InternetConnect
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x4225af
mov dword [ebp - 0x878], 0x80400100
cmp dword [ebp + 0x24], 0
je 0x421cb4
mov dword [ebp - 0x878], 0x803000
cmp dword [ebp - 0x834], 0
jne 0x421cce
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 0x4b196c
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 0x421d0b
cmp dword [0x4e7810], 0
je 0x421d2b
push 0
push 0
push 0
push str.HttpOpenRequest
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x4225af
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.00456a00
add esp, 8
lea eax, [ebp - 0x838]
push eax
mov ecx, dword [ebp - 0x214]
push ecx
call fcn.00421960
add esp, 8
mov dword [ebp - 0x890], eax
cmp dword [ebp - 0x838], 0
je 0x421d9e
push 0
push 0
push 0
push 0x4b19ec
mov edx, dword [ebp - 0x838]
push edx
call fcn.0040ec80
add esp, 0x14
jmp 0x4225af
cmp dword [ebp - 0x890], 0x12c
jb 0x421dca
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 0x4225af
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 0x421eb1
lea edx, [ebp - 0x880]
push edx
lea eax, [ebp - 0x854]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
jmp 0x421ec5
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 0x4b1a10
call fcn.00456a00
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 0x42258d
mov eax, dword [ebp - 0x868]
push eax
push str.DownloadHTMLFile____FileSize_d
call fcn.00456a00
add esp, 8
cmp dword [ebp - 0x868], 0
jbe 0x42256d
mov ecx, dword [ebp - 0x868]
push ecx
push 0x4b1ad0
call fcn.00456a00
add esp, 8
lea edx, [ebp - 0x210]
push edx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x421fab
lea eax, [ebp - 0x210]
push eax
call fcn.0040d2e0
add esp, 4
mov dword [ebp - 0x89c], 0
mov dword [ebp - 0x898], 0
cmp dword [ebp - 0x834], 0
je 0x422106
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 0x4220e7
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.00456a00
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 0x4220a0
push str.DownloadHTMLFile____Files_are_not_on_the_same_date_
call fcn.00456a00
add esp, 4
mov dword [ebp - 0x834], 0
jmp 0x4220e5
lea eax, [ebp - 0x8c8]
push eax
mov ecx, dword [ebp - 0x89c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x4220c6
mov edx, dword [ebp - 0x8c8]
mov dword [ebp - 0x898], edx
jmp 0x4220e5
push 0
push 0
push 0
push 0x4b1c20
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], 0
jmp 0x422106
push 0
push 0
push 0
push 0x4b1c3c
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], 0
cmp dword [ebp - 0x834], 0
je 0x4221a7
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 0x422169
push 0
push 0
push 0
push 0x4b1c54
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], 0
jmp 0x4221a7
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 0x4221a7
push 0
push 0
push 0
push 0x4b1c78
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x834], 0
cmp dword [ebp - 0x834], 0
jne 0x42224e
push str.DownloadHTMLFile____Mode_resume_disabled_
call fcn.00456a00
add esp, 4
mov dword [ebp - 0x898], 0
cmp dword [ebp - 0x89c], 0
je 0x4221e1
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 0x422231
push 0
push 0
push 0
push 0x4b1cfc
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x4225af
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.00456a00
add esp, 8
mov eax, dword [ebp - 0x868]
sub eax, dword [ebp - 0x898]
mov dword [ebp - 0x894], eax
mov ecx, dword [0x4cfa15]
or ecx, dword [0x4cfa19]
jne 0x422296
mov edx, dword [ebp - 0x868]
xor eax, eax
push eax
push edx
mov ecx, 0x4cf9c0
call fcn.004125a0
mov ecx, dword [ebp - 0x898]
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
mov dword [ebp - 0x8a4], 0x100000
cmp dword [ebp - 0x894], 0
je 0x4222fb
mov eax, dword [ebp - 0x894]
cmp eax, dword [ebp - 0x8a4]
jae 0x4222fb
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.0046664e
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.004677c0
add esp, 0xc
cmp dword [ebp - 0x89c], 0xffffffff
je 0x422550
cmp dword [0x4e7810], 0
jne 0x422550
cmp dword [ebp - 0x870], 0
je 0x42239d
cmp dword [0x4e7810], 0
jne 0x42239d
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 0x42239d
mov dword [ebp - 0x8dc], 1
jmp 0x4223a7
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.00456a00
add esp, 0x10
cmp dword [ebp - 0x884], 0
jbe 0x4224d7
cmp dword [ebp - 0x870], 0
je 0x4224d7
cmp dword [ebp - 0x870], 0
je 0x422435
cmp dword [0x4e7810], 0
jne 0x422435
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 0x422435
mov dword [ebp - 0x8e0], 1
jmp 0x42243f
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.00456a00
add esp, 0xc
mov edx, dword [ebp - 0x844]
cmp edx, dword [ebp - 0x884]
jne 0x422489
cmp dword [ebp - 0x870], 0
je 0x422489
mov dword [ebp - 0x8e4], 1
jmp 0x422493
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 [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 - 0x884], 0
je 0x4224f6
cmp dword [ebp - 0x870], 0
je 0x4224f6
cmp dword [0x4e7810], 0
je 0x422359
mov eax, dword [ebp - 0x8a0]
mov dword [ebp - 0x8d8], eax
mov ecx, dword [ebp - 0x8d8]
push ecx
call fcn.0046a772
add esp, 4
cmp dword [ebp - 0x870], 0
jne 0x422526
mov dword [ebp - 0x838], 0x17
jmp 0x422541
lea edx, [ebp - 0x628]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x422541
mov dword [ebp - 0x838], 2
mov eax, dword [ebp - 0x89c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x42256b
push 0
push 0
push 0
push 0x4b1e44
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x42258b
mov ecx, dword [ebp - 0x868]
push ecx
push str.DownloadHTMLFile____HttpQueryInfo_dwFileSize__d
call fcn.00456a00
add esp, 8
mov dword [ebp - 0x838], 0x2efc
jmp 0x4225a8
push 0
push 0
push 0
push str.HttpQueryInfo
push 0
call fcn.0040ec80
add esp, 0x14
mov dword [ebp - 0x838], eax
jmp 0x4225af
cmp dword [ebp - 0x214], 0
je 0x4225c5
mov edx, dword [ebp - 0x214]
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x83c], 0
je 0x4225db
mov eax, dword [ebp - 0x83c]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x840], 0
je 0x4225f1
mov ecx, dword [ebp - 0x840]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [0x4e7810], 0
je 0x422604
mov dword [ebp - 0x838], 0x4c7
mov edx, dword [ebp - 0x838]
push edx
push str.DownloadHTMLFile____End__d_
call fcn.00456a00
add esp, 8
mov eax, dword [ebp - 0x838]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004677af
mov esp, ebp
pop ebp
ret