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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x480e6c
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x1044
call fcn.0047b4a0
mov eax, dword [0x49b1b0]
xor eax, esp
mov dword [esp + 0x1040], eax
push ebx
push esi
push edi
mov eax, dword [0x49b1b0]
xor eax, esp
push eax
lea eax, [esp + 0x1058]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
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 + 0x14], eax
push 4
lea ecx, [esp + 0x1c]
push ecx
mov dword [esp + 0x1068], 0
mov edi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 2
push eax
mov dword [esp + 0x28], 0x7d0
call edi
mov eax, dword [esp + 0x14]
push 4
lea edx, [esp + 0x1c]
push edx
push 3
push eax
mov dword [esp + 0x28], 3
call edi
cmp dword [esi + 0x18], 8
mov dword [esp + 0x28], 0
jb 0x418785
mov esi, dword [esi + 4]
jmp 0x418788
add esi, 4
mov edx, dword [esp + 0x14]
push 4
lea ecx, [esp + 0x1c]
push ecx
push 2
push edx
mov dword [esp + 0x28], 0xbb8
call edi
test eax, eax
jne 0x4187aa
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x14]
push 0
push 0x400000
push 0xffffffffffffffff
push 0
push esi
push eax
call dword [sym.imp.WININET.dll_InternetOpenUrlW]
mov edi, eax
mov dword [esp + 0x20], edi
test edi, edi
mov byte [esp + 0x1060], 1
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
mov dword [esp + 0x24], 4
je 0x4187f5
push 0
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x30]
push edx
push 0x20000013
push edi
call esi
cmp dword [esp + 0x28], 0xc8
je 0x41881e
test edi, edi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
je 0x41880c
push edi
call esi
mov eax, dword [esp + 0x14]
test eax, eax
je 0x418817
push eax
call esi
xor al, al
jmp 0x418a57
test edi, edi
mov byte [esp + 0x12], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], 4
je 0x418854
push 0
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x24]
push ecx
push 0x20000005
push edi
call esi
test eax, eax
setne al
test al, al
jne 0x4188b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2f76
jne 0x4187ff
mov byte [esp + 0x12], 1
mov dword [esp + 0x1c], 0x3200000
push ebx
lea esi, [esp + 0x34]
call fcn.00416c70
add esp, 4
mov edx, esi
push edx
mov byte [esp + 0x1064], 2
call fcn.0041d860
add esp, 4
test al, al
jne 0x41889d
mov eax, esi
push eax
call fcn.0041df80
add esp, 4
mov esi, 8
mov byte [esp + 0x1060], 3
cmp dword [ebx + 0x18], esi
jb 0x4188c6
mov eax, dword [ebx + 4]
jmp 0x4188c9
cmp dword [esp + 0x1c], 0
jne 0x41886e
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x418809
lea eax, [ebx + 4]
xor ebx, ebx
push ebx
push 0x80
push 2
push ebx
push 3
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
jne 0x418927
cmp dword [esp + 0x48], esi
jb 0x4188fe
mov ecx, dword [esp + 0x34]
push ecx
call fcn.00469d48
add esp, 4
cmp edi, ebx
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], ebx
mov word [esp + 0x34], bx
je 0x41891c
push edi
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
jmp 0x418812
push 0x20
call fcn.00469d66
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x418944
mov eax, dword [esp + 0x1c]
call fcn.00418690
mov esi, eax
jmp 0x418946
xor esi, esi
mov edx, dword [esi + 0xc]
cmp edx, dword [esp + 0x1c]
mov byte [esp + 0x13], 1
jae 0x4189eb
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x41896d
push 0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x4189eb
cmp byte [esp + 0x12], 0
mov edx, 0x1000
jne 0x418986
mov eax, dword [esp + 0x1c]
sub eax, dword [esi + 0xc]
cmp eax, edx
jae 0x418986
mov edx, eax
lea eax, [esp + 0x4c]
push eax
lea eax, [esp + 0x24]
call fcn.00420570
mov edi, eax
test edi, edi
jne 0x4189af
cmp byte [esp + 0x12], al
jne 0x4189e7
push 0xa
call sub.KERNEL32.dll_Sleep
add ebx, 1
cmp ebx, 3
ja 0x4189e7
mov eax, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x28]
push ecx
push edi
lea edx, [esp + 0x58]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4189e1
cmp edi, dword [esp + 0x24]
jne 0x4189e1
mov ecx, dword [esi + 0xc]
mov edi, dword [esp + 0x20]
cmp ecx, dword [esp + 0x1c]
jmp 0x418952
mov edi, dword [esp + 0x20]
jmp 0x4189fb
mov edi, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
cmp dword [esi + 0xc], edx
je 0x418a00
cmp byte [esp + 0x12], 0
jne 0x418a00
mov byte [esp + 0x13], 0
push esi
call fcn.00469d48
mov eax, dword [esp + 0x1c]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x48], 8
jb 0x418a28
mov ecx, dword [esp + 0x34]
push ecx
call fcn.00469d48
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 0x418a48
push edi
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x418a53
push eax
call esi
mov al, byte [esp + 0x13]
mov ecx, dword [esp + 0x1058]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1040]
xor ecx, esp
call fcn.00469ab5
mov esp, ebp
pop ebp
ret