Function at 0x40b020
Capabilities:
Check http status code
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5ae9c1
mov eax, dword fs:[0]
push eax
mov eax, 0x2268
call fcn.0047dba0
mov eax, dword [0x629214]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
xor ebx, ebx
push esi
mov edi, edx
mov dword [ebp - 0x225c], eax
mov dword [ebp - 0x2270], ecx
mov dword [ebp - 0x226c], ebx
call fcn.00408f10
add esp, 4
push 0x6193e8
push esi
call fcn.0047978e
add esp, 8
mov dword [ebp - 0x2258], eax
cmp eax, ebx
je 0x40b19d
xor edx, edx
mov eax, edi
mov word [ebp - 0x2230], dx
mov dword [ebp - 0x221c], 7
mov dword [ebp - 0x2220], ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40b0b1
sub eax, edx
sar eax, 1
push eax
mov eax, edi
lea esi, [ebp - 0x2230]
call fcn.00406130
mov al, byte [ebp + 0x10]
mov dword [ebp - 4], ebx
mov byte [ebp - 0x2260], al
call fcn.0040adc0
mov ecx, esi
lea edi, [ebp - 0x2268]
mov dword [ebp - 0x2268], eax
call fcn.0040ae70
mov edi, eax
mov dword [ebp - 0x2264], edi
mov byte [ebp - 4], 2
cmp dword [ebp - 0x221c], 8
jb 0x40b116
mov ecx, dword [ebp - 0x2230]
push ecx
call fcn.00478c1a
add esp, 4
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push ebx
lea eax, [ebp - 0x2254]
push eax
lea ecx, [ebp - 0x2250]
push ecx
push 0x20000013
xor edx, edx
push edi
mov dword [ebp - 0x221c], 7
mov dword [ebp - 0x2220], ebx
mov word [ebp - 0x2230], dx
mov dword [ebp - 0x2254], 4
call esi
test eax, eax
je 0x40b1a4
mov eax, dword [ebp - 0x2250]
cmp eax, 0xc8
je 0x40b1a4
cmp eax, 0xc9
je 0x40b1a4
cmp eax, 0xca
je 0x40b1a4
cmp eax, 0xcb
je 0x40b1a4
mov edx, dword [ebp - 0x2258]
push edx
call fcn.00479f11
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 4
push edi
call esi
mov eax, dword [ebp - 0x2268]
push eax
call esi
xor eax, eax
jmp 0x40b368
push ebx
lea ecx, [ebp - 0x2254]
push ecx
lea edx, [ebp - 0x2250]
push edx
push 0x20000005
push edi
mov dword [ebp - 0x2250], ebx
mov dword [ebp - 0x2254], 4
call esi
mov edi, eax
neg edi
sbb edi, edi
and edi, dword [ebp - 0x2250]
mov dword [ebp - 0x2254], ebx
lea ecx, [ecx]
push 0x10
push 0x6193d4
lea ecx, [ebp - 0x224c]
mov dword [ebp - 0x2250], ebx
mov dword [ebp - 0x2238], 0xf
mov dword [ebp - 0x223c], ebx
mov byte [ebp - 0x224c], bl
call fcn.00402c50
lea eax, [ebp - 0x2250]
push eax
push 0x2000
lea ecx, [ebp - 0x2214]
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x2264]
push ecx
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, ebx
jne 0x40b245
lea eax, [ebp - 0x224c]
push eax
call fcn.0040b930
add esp, 4
mov byte [ebp - 4], 2
cmp dword [ebp - 0x2238], 0x10
mov esi, eax
jb 0x40b263
mov ecx, dword [ebp - 0x224c]
push ecx
call fcn.00478c1a
add esp, 4
cmp esi, ebx
je 0x40b339
mov esi, dword [ebp - 0x2250]
cmp esi, ebx
jl 0x40b339
je 0x40b31d
mov edx, dword [ebp - 0x2258]
push edx
push esi
lea eax, [ebp - 0x2214]
push 1
push eax
call fcn.00479b48
mov eax, dword [ebp - 0x2254]
add eax, esi
add esp, 0x10
mov dword [ebp - 0x2254], eax
cmp edi, 0xffffffff
je 0x40b2f6
mov ecx, edi
cmp edi, ebx
jne 0x40b2b6
mov ecx, 1
imul eax, eax, 0x64
xor edx, edx
div ecx
lea ecx, [ebp - 0x214]
push eax
push str.Downloaded:__d__
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
cmp dword [ebp - 0x225c], ebx
je 0x40b1e0
mov edx, dword [ebp - 0x2270]
push edx
push edi
push esi
call dword [ebp - 0x225c]
add esp, 0xc
jmp 0x40b1e0
cdq
and edx, 0x3ff
add eax, edx
sar eax, 0xa
push eax
lea eax, [ebp - 0x214]
push str.Downloaded:__dK
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
jmp 0x40b1e0
lea ecx, [ebp - 0x214]
push str.Download_complete.
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 8
mov edi, 1
jmp 0x40b33f
mov edi, dword [ebp - 0x226c]
mov edx, dword [ebp - 0x2258]
push edx
call fcn.00479f11
mov eax, dword [ebp - 0x2264]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 4
push eax
call esi
mov ecx, dword [ebp - 0x2268]
push ecx
call esi
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00478c25
mov esp, ebp
pop ebp
ret