Function at 0x408c20
Capabilities:
Check http status code
Create http request
Get http content length
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x473b1c
mov eax, dword fs:[0]
push eax
mov eax, 0x103c
call fcn.004679e0
mov eax, dword [0x48d034]
xor eax, esp
mov dword [esp + 0x1038], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x48d034]
xor eax, esp
push eax
lea eax, [esp + 0x1050]
mov dword fs:[0], eax
mov eax, dword [esp + 0x1064]
mov ebp, dword [esp + 0x1060]
push 0
push 0
push 0
push 0
push 0
mov esi, ecx
mov dword [esp + 0x40], eax
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [esp + 0x20], eax
mov ebx, 4
push ebx
lea ecx, [esp + 0x1c]
push ecx
mov dword [esp + 0x1060], 0
mov edi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 2
push eax
mov dword [esp + 0x28], 0x7d0
call edi
mov eax, dword [esp + 0x20]
push ebx
lea edx, [esp + 0x1c]
push edx
push 3
push eax
mov dword [esp + 0x28], 3
call edi
cmp dword [esi + 0x18], 8
jb 0x408cd2
mov esi, dword [esi + 4]
jmp 0x408cd4
add esi, ebx
mov ecx, dword [esp + 0x20]
push 0
push 0x400000
push 0xffffffffffffffff
push 0
push esi
push ecx
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov edi, eax
mov dword [esp + 0x18], edi
test edi, edi
mov byte [esp + 0x1058], 1
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
mov dword [esp + 0x24], ebx
je 0x408d1b
push 0
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x30]
push eax
push 0x20000013
push edi
call esi
cmp dword [esp + 0x28], 0xc8
je 0x408d44
test edi, edi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
je 0x408d32
push edi
call esi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x408d3d
push eax
call esi
xor al, al
jmp 0x408f77
test edi, edi
mov byte [esp + 0x16], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], ebx
je 0x408d76
push 0
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x24]
push edx
push 0x20000005
push edi
call esi
test eax, eax
setne al
test al, al
jne 0x408dd6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2f76
jne 0x408d25
mov byte [esp + 0x16], 1
mov dword [esp + 0x1c], 0x3200000
push ebp
lea esi, [esp + 0x34]
call fcn.0040c450
add esp, 4
mov eax, esi
push eax
mov byte [esp + 0x105c], 2
call fcn.00409bb0
add esp, 4
test al, al
jne 0x408dbf
mov ecx, esi
push ecx
call fcn.00409dc0
add esp, 4
mov esi, 8
mov byte [esp + 0x1058], 3
cmp dword [ebp + 0x18], esi
jb 0x408de8
mov eax, dword [ebp + 4]
jmp 0x408deb
cmp dword [esp + 0x1c], 0
jne 0x408d90
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x408d2f
lea eax, [ebp + 4]
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x24], ebx
jne 0x408e4d
cmp dword [esp + 0x48], esi
jb 0x408e22
mov edx, dword [esp + 0x34]
push edx
call fcn.0045ca7a
add esp, 4
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
xor ebx, ebx
cmp edi, ebx
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], ebx
mov word [esp + 0x34], bx
je 0x408e42
push edi
call esi
mov eax, dword [esp + 0x20]
cmp eax, ebx
jmp 0x408d38
push 0x20
call fcn.0045ca98
mov esi, eax
add esp, 4
test esi, esi
je 0x408e6a
mov eax, dword [esp + 0x1c]
call fcn.00408b90
mov esi, eax
jmp 0x408e6c
xor esi, esi
mov eax, dword [esi + 0xc]
xor ebp, ebp
cmp eax, dword [esp + 0x1c]
mov byte [esp + 0x17], 1
jae 0x408f0f
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x408e95
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x408f0f
cmp byte [esp + 0x16], 0
mov edx, 0x1000
jne 0x408eae
mov eax, dword [esp + 0x1c]
sub eax, dword [esi + 0xc]
cmp eax, edx
jae 0x408eae
mov edx, eax
lea ecx, [esp + 0x4c]
push ecx
lea eax, [esp + 0x1c]
call fcn.004140c0
mov edi, eax
test edi, edi
jne 0x408ed7
cmp byte [esp + 0x16], al
jne 0x408f0b
push 0xa
call sub.KERNEL32.dll_Sleep
add ebp, 1
cmp ebp, 3
ja 0x408f0b
push 0
lea edx, [esp + 0x28]
push edx
push edi
lea eax, [esp + 0x58]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x408f05
cmp edi, dword [esp + 0x24]
jne 0x408f05
mov ecx, dword [esi + 0xc]
mov edi, dword [esp + 0x18]
cmp ecx, dword [esp + 0x1c]
jmp 0x408e7a
mov edi, dword [esp + 0x18]
jmp 0x408f1f
mov edi, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
cmp dword [esi + 0xc], edx
je 0x408f24
cmp byte [esp + 0x16], 0
jne 0x408f24
mov byte [esp + 0x17], 0
push esi
call fcn.0045ca7a
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x48], 8
jb 0x408f48
mov eax, dword [esp + 0x34]
push eax
call fcn.0045ca7a
add esp, 4
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
xor ebx, ebx
cmp edi, ebx
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], ebx
mov word [esp + 0x34], bx
je 0x408f68
push edi
call esi
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x408f73
push eax
call esi
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0x1050]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1038]
xor ecx, esp
call fcn.0045ca6b
add esp, 0x1048
ret