Function at 0x4068af
Capabilities:
Check http status code
Check if file exists
Delete file
Download and write a file
Get http content length
Move file
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Send http request with host header
Set file attributes
Timestomp file
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x68]
sub esp, 0x3c4
mov eax, dword [0x46a470]
xor eax, ebp
mov dword [ebp + 0x64], eax
mov eax, dword [ebp + 0x7c]
push ebx
mov ebx, dword [ebp + 0x74]
push esi
mov esi, ecx
push edi
mov edi, dword [ebp + 0x70]
lea ecx, [esi + 0x4c]
mov dword [ebp - 0x34c], ebx
mov dword [ebp - 0x334], eax
call fcn.00405307
push ebx
lea ecx, [ebp - 0x308]
call fcn.00406052
mov eax, dword [ebp - 0x308]
xor ebx, ebx
cmp dword [eax - 0xc], ebx
je 0x40690f
push 0x45d884
lea ecx, [ebp - 0x308]
call fcn.00405c24
push edi
mov ecx, esi
call fcn.00405efa
test eax, eax
jne 0x406935
mov esi, SysReAllocStringLen
mov ecx, dword [ebp - 0x308]
add ecx, 0xfffffff0
call fcn.00404f7d
mov eax, esi
jmp 0x40746c
cmp dword [esi + 0x48], ebx
je 0x406941
mov ecx, esi
call fcn.00404cf3
cmp dword [esi + 0x44], ebx
je 0x406952
mov ecx, esi
call fcn.00404cf3
push 2
pop esi
jmp 0x406920
push 0x46d5d8
lea ecx, [ebp - 0x30c]
call fcn.0040537a
lea edi, [esi + 0x28]
push 0x2f
mov ecx, edi
mov dword [ebp - 0x314], ebx
mov dword [ebp - 0x310], ebx
call fcn.0040524c
inc eax
push eax
lea eax, [ebp - 0x31c]
push eax
mov ecx, edi
call fcn.00405d36
push eax
lea ecx, [ebp - 0x30c]
call fcn.00405bd7
mov ecx, dword [ebp - 0x31c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov eax, dword [ebp - 0x308]
mov dword [ebp - 0x318], 1
cmp dword [eax - 0xc], ebx
je 0x4069e1
mov eax, dword [esi + 0x50]
cmp eax, ebx
je 0x4069e1
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4069e1
lea eax, [ebp - 0x318]
push eax
push ebx
push 0xbd8
push dword [esi + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, esi
call fcn.0040544b
test eax, eax
jne 0x406a02
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
or esi, 0xffffffff
jmp 0x406920
cmp dword [esi + 0x44], ebx
je 0x406a21
mov ecx, esi
call fcn.00404cf3
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
jmp 0x40694d
mov dword [ebp - 0x338], 0x4400010
cmp dword [ebp + 0x78], ebx
jne 0x406a3a
mov dword [ebp - 0x338], 0x4600010
mov edi, dword [edi]
push ebx
push dword [ebp - 0x338]
push 0x469520
push ebx
push str.HTTP_1.0
push edi
push 0x45d84c
push dword [esi + 8]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [esi + 0xc], eax
cmp eax, ebx
jne 0x406a79
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x54], eax
mov ecx, esi
call fcn.00404cf3
jmp 0x4069ec
push 0x10f
lea eax, [ebp - 0x1bb]
push ebx
push eax
mov byte [ebp - 0x1bc], bl
call fcn.00429d40
add esp, 0xc
cmp dword [ebp - 0x334], ebx
je 0x406ad8
push str.Host:
lea eax, [ebp - 0x1bc]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 0x334]
lea eax, [ebp - 0x1bc]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x20000000
push 0xffffffffffffffff
lea eax, [ebp - 0x1bc]
push eax
push dword [esi + 0xc]
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersA]
push 0x40
lea eax, [ebp + 0x21]
push ebx
push eax
mov byte [ebp + 0x20], bl
call fcn.00429d40
add esp, 0xc
lea eax, [ebp - 0x348]
push eax
mov dword [ebp - 0x31c], ebx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov edi, dword [ebp - 0x308]
cmp dword [edi - 0xc], ebx
je 0x406b97
push 0x13c
lea eax, [ebp - 0x2f8]
push ebx
push eax
mov dword [ebp - 0x2fc], ebx
call fcn.00429d40
add esp, 0xc
lea eax, [ebp - 0x2fc]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
je 0x406b97
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
lea eax, [ebp - 0x35c]
push eax
lea eax, [ebp - 0x2e8]
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
mov eax, dword [ebp - 0x2dc]
mov dword [ebp - 0x310], eax
cmp eax, ebx
jbe 0x406b84
push eax
lea eax, [ebp + 0x20]
push str.Range:_bytes_d_
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov dword [ebp - 0x31c], 1
jmp 0x406b97
push 0x80
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
cmp dword [esi + 0x44], ebx
jne 0x406a07
push ebx
push ebx
lea eax, [ebp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [ebp + 0x20]
push eax
push dword [esi + 0xc]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x406c17
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
mov dword [esi + 0x54], eax
call fcn.00404cf3
mov esi, dword [esi + 0x54]
sub esi, 0x2ee2
je 0x406bff
sub esi, 5
je 0x406be7
sub esi, 0x16
jne 0x4069ec
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov esi, reloc.OLEAUT32.dll_VariantClear
jmp 0x406920
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov esi, VariantInit
jmp 0x406920
cmp dword [esi + 0x44], ebx
jne 0x406a07
mov edi, dword [sym.imp.WININET.dll_HttpQueryInfoA]
push ebx
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x32c]
push eax
push 0x20000013
push dword [esi + 0xc]
mov dword [ebp - 0x32c], ebx
mov dword [ebp - 0x304], 4
call edi
test eax, eax
je 0x406a64
mov eax, dword [ebp - 0x32c]
mov dword [ebp - 0x300], ebx
cmp eax, 0x12e
ja 0x406e3f
cmp eax, 0x12d
jae 0x406db9
sub eax, 0xc8
je 0x406d7e
sub eax, 3
je 0x406c92
sub eax, 3
jne 0x406e5a
push 0x40
lea eax, [ebp - 0xab]
push ebx
push eax
mov byte [ebp - 0xac], bl
call fcn.00429d40
add esp, 0xc
push ebx
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0xac]
push eax
push 0xb
push dword [esi + 0xc]
mov dword [ebp - 0x304], 0x40
call edi
test eax, eax
jne 0x406cee
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x308]
mov dword [esi + 0x54], eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov dword [ebp - 0x310], ebx
jmp 0x406a6d
lea eax, [ebp - 0x348]
push eax
lea eax, [ebp - 0xac]
push eax
mov ecx, esi
call fcn.00406625
mov ax, word [ebp - 0x33c]
cmp ax, word [ebp - 0x350]
jne 0x406d67
mov ax, word [ebp - 0x33e]
cmp ax, word [ebp - 0x352]
jne 0x406d67
mov ax, word [ebp - 0x340]
cmp ax, word [ebp - 0x354]
jne 0x406d67
mov ax, word [ebp - 0x342]
cmp ax, word [ebp - 0x356]
jne 0x406d67
mov ax, word [ebp - 0x346]
cmp ax, word [ebp - 0x35a]
jne 0x406d67
mov ax, word [ebp - 0x348]
cmp ax, word [ebp - 0x35c]
je 0x406e70
push dword [ebp - 0x308]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov dword [ebp - 0x310], ebx
jmp 0x406e66
mov eax, dword [ebp - 0x308]
cmp dword [eax - 0xc], ebx
jne 0x406da8
mov ecx, esi
call fcn.00404cf3
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov esi, reloc.OLEAUT32.dll_SysReAllocString
jmp 0x406920
push dword [ebp - 0x308]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x406e70
push 0x401
call fcn.00429ad5
mov dword [esp], 0x401
push ebx
push eax
mov dword [ebp - 0x300], eax
call fcn.00429d40
add esp, 0xc
push ebx
lea eax, [ebp - 0x304]
push eax
push dword [ebp - 0x300]
mov dword [ebp - 0x304], 0x400
push 0x21
push dword [esi + 0xc]
call edi
push dword [ebp - 0x300]
test eax, eax
jne 0x406e0e
call fcn.0042892c
pop ecx
jmp 0x406a64
lea ecx, [esi + 0x4c]
call fcn.00405cbc
mov ecx, esi
call fcn.00404cf3
push dword [ebp - 0x300]
call fcn.0042892c
pop ecx
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
xor esi, esi
inc esi
jmp 0x406920
sub eax, 0x193
je 0x40743b
dec eax
je 0x407413
sub eax, 0x60
je 0x4073f2
cmp dword [ebp - 0x31c], ebx
je 0x4073e4
mov dword [ebp - 0x300], 1
cmp dword [esi + 0x44], ebx
jne 0x406a07
cmp dword [ebp - 0x300], ebx
je 0x406f3c
push dword [esi + 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esi + 0x28]
push ebx
push dword [ebp - 0x338]
push 0x469520
push ebx
push str.HTTP_1.0
push eax
push 0x45d84c
push dword [esi + 8]
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov dword [esi + 0xc], eax
cmp eax, ebx
je 0x406a64
cmp dword [ebp - 0x334], ebx
je 0x406eda
push 0x1000000
push 0xffffffffffffffff
lea ecx, [ebp - 0x1bc]
push ecx
push eax
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersA]
cmp dword [esi + 0x44], ebx
jne 0x406a07
push ebx
push ebx
push ebx
push ebx
push dword [esi + 0xc]
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
je 0x406a64
cmp dword [esi + 0x44], ebx
jne 0x406a07
push ebx
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x32c]
push eax
push 0x20000013
push dword [esi + 0xc]
mov dword [ebp - 0x304], 4
call edi
test eax, eax
je 0x406a64
cmp dword [ebp - 0x32c], 0xc8
jne 0x406a64
push 0x40
lea eax, [ebp - 0x67]
push ebx
push eax
mov byte [ebp - 0x68], bl
call fcn.00429d40
add esp, 0xc
push ebx
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x68]
push eax
push 0xb
push dword [esi + 0xc]
mov dword [ebp - 0x304], 0x40
call edi
test eax, eax
je 0x406f81
lea eax, [ebp - 0x348]
push eax
lea eax, [ebp - 0x68]
push eax
mov ecx, esi
call fcn.00406625
push ebx
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x330]
push eax
push 0x20000005
push dword [esi + 0xc]
mov dword [ebp - 0x330], ebx
mov dword [ebp - 0x304], 4
call edi
test eax, eax
jne 0x406fbe
mov dword [ebp - 0x330], 0x32000
mov dword [ebp - 0x310], ebx
mov eax, dword [ebp - 0x330]
mov ecx, dword [ebp - 0x310]
mov edi, dword [ebp - 0x308]
add eax, ecx
mov dword [ebp - 0x314], eax
mov dword [esi + 0x5c], eax
mov dword [ebp - 0x318], 2
cmp dword [edi - 0xc], ebx
je 0x407012
mov eax, dword [esi + 0x50]
cmp eax, ebx
je 0x407012
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x407012
lea eax, [ebp - 0x318]
push eax
push ebx
push 0xbd8
push dword [esi + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [esi + 0x44], ebx
jne 0x406a07
push ebx
push 1
mov ecx, edi
call fcn.00405102
pop ecx
pop ecx
test eax, eax
jne 0x40704a
mov ecx, esi
call fcn.00404cf3
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov esi, reloc.WSOCK32.dll_closesocket
jmp 0x406920
push ebx
push 0x80
push 4
push ebx
push 1
push 0xc0000000
push dword [ebp - 0x308]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40702b
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x328]
push eax
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp - 0x300], ebx
je 0x4070ac
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x4070b7
push 2
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x1001
call fcn.00429ad5
pop ecx
mov dword [ebp - 0x300], eax
mov dword [ebp - 0x320], ebx
mov dword [ebp - 0x318], 3
push 0x1001
push ebx
push dword [ebp - 0x300]
call fcn.00429d40
add esp, 0xc
cmp dword [esi + 0x44], ebx
jne 0x4071e4
lea eax, [ebp - 0x320]
push eax
push 0x1000
push dword [ebp - 0x300]
push dword [esi + 0xc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x407235
mov eax, dword [ebp - 0x320]
add dword [ebp - 0x310], eax
mov eax, dword [esi + 0x50]
cmp eax, ebx
je 0x40714c
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x40714c
lea eax, [ebp - 0x318]
push eax
push ebx
push 0xbd8
push dword [esi + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [ebp - 0x320], ebx
jbe 0x407181
push ebx
lea eax, [ebp - 0x31c]
push eax
push dword [ebp - 0x320]
mov dword [ebp - 0x31c], ebx
push dword [ebp - 0x300]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0x320], ebx
ja 0x4070d8
mov eax, dword [ebp - 0x310]
cmp eax, dword [ebp - 0x314]
jae 0x4072ab
mov ecx, esi
call fcn.00404cf3
push dword [ebp - 0x300]
call fcn.0042892c
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x328]
push eax
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4069ec
push dword [ebp - 0x300]
call fcn.0042892c
pop ecx
mov ecx, esi
call fcn.00404cf3
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x328]
push eax
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406a0e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x300]
mov dword [esi + 0x54], eax
call fcn.0042892c
pop ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
mov dword [esi + 0x54], eax
call fcn.00404cf3
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x328]
push eax
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov esi, reloc.OLEAUT32.dll_VariantCopy
jmp 0x406920
mov eax, dword [esi + 0x50]
cmp eax, ebx
je 0x4072d3
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4072d3
lea eax, [ebp - 0x318]
push eax
push ebx
push 0xbd8
push dword [esi + 0x50]
call dword [sym.imp.USER32.dll_SendMessageA]
push 0x40
lea eax, [ebp - 0x23]
push ebx
push eax
mov byte [ebp - 0x24], bl
call fcn.00429d40
add esp, 0xc
push ebx
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x24]
push eax
push 0x17
push dword [esi + 0xc]
mov dword [ebp - 0x304], 0x40
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x407315
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x54], eax
jmp 0x407328
push str.close
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x407331
mov ecx, esi
call fcn.00404cf3
jmp 0x40733d
push dword [esi + 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esi + 0xc], ebx
push dword [ebp - 0x300]
call fcn.0042892c
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
lea eax, [ebp - 0x328]
push eax
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x34c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x4073a6
push 0x80
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push esi
mov esi, dword [ebp - 0x308]
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileA]
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
test eax, eax
jne 0x4073d0
call fcn.00404f7d
mov esi, reloc.OLEAUT32.dll_SysReAllocStringLen
jmp 0x406920
call fcn.00404f7d
lea ecx, [esi - 0x10]
call fcn.00404f7d
xor eax, eax
jmp 0x40746c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x54], eax
jmp 0x4069ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
mov dword [esi + 0x54], eax
call fcn.00404f7d
mov esi, SafeArrayLock
jmp 0x406920
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
mov dword [esi + 0x54], eax
call fcn.00404cf3
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov esi, reloc.OLEAUT32.dll_VariantInit
jmp 0x406920
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, esi
mov dword [esi + 0x54], eax
call fcn.00404cf3
mov ecx, dword [ebp - 0x30c]
add ecx, 0xfffffff0
call fcn.00404f7d
mov ecx, dword [ebp - 0x308]
add ecx, 0xfffffff0
call fcn.00404f7d
mov eax, reloc.OLEAUT32.dll_SafeArrayGetDim
mov ecx, dword [ebp + 0x64]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00429649
add ebp, 0x68
leave
ret 0x10