Function at 0x409d06
Capabilities:
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Timestomp file
Write file on windows

Disassembly:
push ebp
mov eax, 0x27f0
lea ebp, [esp - 0x2770]
call fcn.0040d820
mov eax, dword [0x4153c0]
push 1
push dword [ebp + 0x2778]
mov dword [ebp + 0x276c], eax
call fcn.0040bb00
test eax, eax
pop ecx
pop ecx
je 0x40a024
push ebx
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
push esi
push edi
xor esi, esi
push 4
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x18], esi
pop edi
mov dword [ebp - 0x2c], esi
push 0x1f01ff
push dword [ebp + 0x2778]
call fcn.0040b94c
pop ecx
pop ecx
push esi
push esi
push edi
push esi
push 1
push 0x12019f
push dword [ebp + 0x2778]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x1c], eax
je 0x40a00a
lea ecx, [ebp - 0x80]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
je 0x409ffb
cmp dword [ebp - 0x5c], esi
mov edi, dword [ebp - 0x60]
mov word [ebp + 0x1f2c], si
jne 0x409daf
cmp edi, esi
je 0x409e2e
mov esi, dword [ebp - 0x5c]
add esi, 0xffffffff
adc edi, 0xffffffff
push edi
push esi
lea eax, [ebp + 0x1f2c]
push str.Range:_bytes_I64d__r_n
push eax
call dword [sym.imp.MSVCR71.dll_swprintf]
lea eax, [ebp + eax*2 + 0x1f2c]
mov dword [ebp - 0x20], eax
add esp, 0x10
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x6c]
push eax
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x5c], esi
call dword [sym.imp.KERNEL32.dll_FileTimeToLocalFileTime]
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
push 0x3e
lea eax, [ebp + 0x272c]
push eax
push 0
lea eax, [ebp - 0x4c]
push eax
call dword [sym.imp.WININET.dll_InternetTimeFromSystemTimeW]
test eax, eax
je 0x409e2c
lea eax, [ebp + 0x272c]
push eax
push str.If_Modified_Since:__s_r_n
push dword [ebp - 0x20]
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0xc
xor esi, esi
push esi
push esi
push esi
push esi
push str.update
call dword [sym.imp.WININET.dll_InternetOpenW]
cmp eax, esi
mov dword [ebp - 0x24], eax
je 0x40a037
push esi
push 0xc4000000
push 0xffffffffffffffff
lea ecx, [ebp + 0x1f2c]
push ecx
push dword [ebp + 0x277c]
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
cmp eax, esi
mov dword [ebp - 0x18], eax
je 0x40a044
push esi
lea ecx, [ebp - 0x34]
push ecx
lea ecx, [ebp - 0x30]
push ecx
push 0x20000013
push eax
mov dword [ebp - 0x34], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x40a04b
mov eax, dword [ebp - 0x30]
mov edi, 0xc8
cmp eax, edi
je 0x409ed9
cmp eax, 0xce
je 0x409ed9
cmp eax, 0x19c
je 0x409eb8
cmp eax, 0x1a0
jne 0x40a052
push dword [ebp - 0x18]
call ebx
push dword [ebp - 0x24]
call ebx
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x18], esi
pop edi
jmp 0x409f8b
push eax
push str.get_status_code__d_r_n
call dword [sym.imp.MSVCR71.dll_printf]
cmp dword [ebp - 0x30], edi
pop ecx
pop ecx
push esi
push esi
jne 0x409f07
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
jne 0x409f20
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x409f18
mov ecx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x5c]
push ecx
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x409ffb
mov edi, dword [sym.imp.WININET.dll_InternetReadFile]
jmp 0x409f4a
cmp dword [ebp - 0x20], esi
push esi
je 0x409f9d
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x20]
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409ffb
lea eax, [ebp - 0x20]
push eax
push 0x1f40
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x18]
mov dword [ebp - 0x20], esi
call edi
test eax, eax
jne 0x409f28
push dword [ebp - 0x18]
call ebx
push dword [ebp - 0x24]
call ebx
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
pop edi
push str.receive_data_failed_r_n
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x18], esi
call dword [sym.imp.MSVCR71.dll_printf]
pop ecx
inc dword [ebp - 0x2c]
cmp dword [ebp - 0x2c], 5
jl 0x409d54
jmp 0x40a01e
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x4c]
push eax
push 0x4000000b
push dword [ebp - 0x18]
mov dword [ebp - 0x28], 0x10
call edi
test eax, eax
jne 0x409fd7
push esi
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x4c]
push eax
push 0x40000009
push dword [ebp - 0x18]
call edi
test eax, eax
je 0x409ff4
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x3c]
push eax
push esi
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov dword [ebp - 0x28], 1
cmp dword [ebp - 0x1c], 0xffffffff
je 0x40a00a
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x24], esi
je 0x40a014
push dword [ebp - 0x24]
call ebx
cmp dword [ebp - 0x18], esi
je 0x40a01e
push dword [ebp - 0x18]
call ebx
mov eax, dword [ebp - 0x28]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x276c]
call fcn.0040d4b1
add ebp, 0x2770
leave
ret
push str.cant_open_session_r_n
call dword [sym.imp.MSVCR71.dll_printf]
jmp 0x40a066
push str.cant_open_url_r_n
jmp 0x40a03c
push str.cant_query_status_code_r_n
jmp 0x40a03c
cmp eax, 0x130
je 0x409ff4
push eax
push str.bad_status_code__d_r_n
call dword [sym.imp.MSVCR71.dll_printf]
pop ecx
pop ecx
jmp 0x409ffb