Function at 0x408f20
Capabilities:
Get http content length
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x481ddb
mov eax, dword fs:[0]
push eax
mov eax, 0x1020
call fcn.0047a990
mov eax, dword [0x4a02b4]
xor eax, esp
mov dword [esp + 0x1018], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4a02b4]
xor eax, esp
push eax
lea eax, [esp + 0x1034]
mov dword fs:[0], eax
mov ebx, dword [esp + 0x1044]
mov eax, dword [esp + 0x1048]
mov ebp, dword [esp + 0x104c]
xor esi, esi
cmp ebx, esi
mov edi, ecx
mov dword [esp + 0x24], eax
je 0x409017
mov eax, dword [ebx]
cmp eax, esi
mov byte [esp + 0x19], 0
mov dword [esp + 0x20], 4
mov dword [esp + 0x1c], esi
je 0x408fbb
push esi
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x24]
push edx
push 0x20000005
push eax
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
setne al
test al, al
jne 0x408fd7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2f76
jne 0x409017
mov byte [esp + 0x19], 1
mov dword [esp + 0x1c], 0x3200000
jmp 0x408fdd
cmp dword [esp + 0x1c], esi
je 0x409017
mov dword [esp + 0x20], 0xffffffff
push 0x80
push 2
push 3
mov dword [esp + 0x1048], esi
push 0x40000000
lea esi, [esp + 0x30]
call fcn.0040f220
test al, al
jne 0x40901e
mov eax, dword [esp + 0x20]
cmp eax, 0xffffffff
je 0x409017
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x409137
test ebp, ebp
mov byte [esp + 0x1b], 0
je 0x409032
mov eax, dword [esp + 0x1c]
mov esi, ebp
mov dword [ebp + 8], eax
jmp 0x409056
push 0x30
mov byte [esp + 0x1f], 1
call fcn.00468c53
mov esi, eax
add esp, 4
test esi, esi
je 0x409052
mov eax, dword [esp + 0x1c]
call fcn.00403790
jmp 0x409054
xor eax, eax
mov esi, eax
mov ecx, dword [esp + 0x1c]
xor ebp, ebp
cmp dword [esi + 0xc], ecx
mov byte [esp + 0x1a], 1
jae 0x4090fe
lea ebx, [ebx]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x409085
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x4090fe
cmp byte [esp + 0x19], 0
mov edx, 0x1000
jne 0x40909e
mov eax, dword [esp + 0x1c]
sub eax, dword [esi + 0xc]
cmp eax, edx
jae 0x40909e
mov edx, eax
lea eax, [esp + 0x2c]
push eax
mov eax, ebx
call fcn.0040f460
mov edi, eax
cmp edi, 0xffffffff
je 0x4090fe
test edi, edi
jne 0x4090ca
cmp byte [esp + 0x19], al
jne 0x4090fe
push 0xa
call sub.KERNEL32.dll_Sleep
add ebp, 1
cmp ebp, 3
ja 0x4090fe
mov eax, dword [esp + 0x20]
cmp eax, 0xffffffff
je 0x40910e
push 0
lea ecx, [esp + 0x2c]
push ecx
push edi
lea edx, [esp + 0x38]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40910e
cmp edi, dword [esp + 0x28]
jne 0x40910e
mov eax, dword [esi + 0xc]
cmp eax, dword [esp + 0x1c]
jb 0x409070
mov ecx, dword [esp + 0x1c]
cmp dword [esi + 0xc], ecx
je 0x409113
cmp byte [esp + 0x19], 0
jne 0x409113
mov byte [esp + 0x1a], 0
cmp byte [esp + 0x1b], 0
je 0x409123
push esi
call fcn.00468cbd
add esp, 4
mov eax, dword [esp + 0x20]
cmp eax, 0xffffffff
je 0x409133
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [esp + 0x1a]
mov ecx, dword [esp + 0x1034]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1018]
xor ecx, esp
call fcn.00468c2b
add esp, 0x102c
ret