Function at 0x40e1e0
Capabilities:
Download and write a file
Get http content length
Get http response content encoding
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
mov eax, 0x202c
call fcn.00416a30
mov eax, dword [0x42202c]
xor eax, esp
mov dword [esp + 0x2028], eax
mov eax, dword [esp + 0x2030]
push ebx
push ebp
push esi
mov dword [esp + 0x28], eax
xor eax, eax
push eax
mov esi, ecx
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x24]
push edx
mov dword [esp + 0x18], eax
mov dword [edi], 0x28
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x10]
push 0x20000005
push eax
mov dword [esp + 0x2c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
push 0x1d
mov ebx, 0x41c108
call fcn.0040df40
push 0x1fff
lea ecx, [esp + 0x35]
push 0
push ecx
mov dword [esp + 0x38], eax
mov byte [esp + 0x3c], 0
call sub.MSVCR80.dll_memset
mov eax, dword [esi + 0x2c]
mov ebx, dword [esp + 0x28]
add esp, 0xc
test eax, eax
je 0x40e287
cmp dword [eax + 4], 0
je 0x40e287
mov edx, eax
mov ecx, dword [edx + 4]
mov edx, dword [esi + 0x28]
mov eax, dword [ecx]
mov edx, dword [edx]
mov eax, dword [eax + 4]
push ebx
push edx
call eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor ebp, ebp
test ebx, ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ebp
jbe 0x40e302
mov ecx, dword [esi + 0x28]
cmp dword [ecx + 0xc0], 0
jne 0x40e481
cmp ebx, 0x2000
lea edx, [esp + 0x30]
mov dword [edi + 0x14], edx
mov eax, ebx
jb 0x40e2c1
mov eax, 0x2000
mov dword [edi + 0x18], eax
mov eax, dword [esi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [esi + 0x10]
push esi
push 1
push edi
push ecx
call dword [sym.imp.WININET.dll_InternetReadFileExA]
test eax, eax
jne 0x40e347
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x40e2fa
mov edx, dword [esi]
mov eax, dword [edx + 0xc]
mov ecx, esi
call eax
test eax, eax
je 0x40e357
mov dword [esp + 0xc], 1
cmp dword [esp + 0x2c], 0
je 0x40e317
mov eax, dword [esp + 0x28]
push eax
call fcn.0040dfd0
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40e329
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
mov ecx, dword [esp + 0x2034]
mov eax, dword [esp + 0xc]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004158da
add esp, 0x202c
ret 4
mov ecx, dword [esi + 0x24]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40e2fa
mov eax, dword [edi + 0x18]
test eax, eax
je 0x40e2fa
cmp dword [esp + 0x2c], 0
je 0x40e399
mov edx, dword [esp + 0x14]
add ebp, eax
push ebp
push edx
call dword [sym.imp.MSVCR80.dll_realloc]
add esp, 8
test eax, eax
je 0x40e48e
mov ecx, dword [edi + 0x18]
mov edx, dword [edi + 0x14]
mov dword [esp + 0x14], eax
push ecx
sub eax, ecx
push edx
add eax, ebp
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
jmp 0x40e3b7
mov ecx, dword [esp + 0x28]
mov edx, dword [edi + 0x14]
push ecx
push eax
push 1
push edx
call dword [sym.imp.MSVCR80.dll_fwrite]
add esp, 0x10
cmp eax, dword [edi + 0x18]
jne 0x40e4b5
sub ebx, dword [edi + 0x18]
mov dword [esp + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x10]
test eax, eax
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
jge 0x40e3da
fadd qword [0x41d7c0]
fcomp qword [0x41d7b8]
fnstsw ax
test ah, 0x41
jne 0x40e474
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x40e46a
cmp dword [eax + 4], 0
je 0x40e46a
mov ecx, dword [eax + 4]
mov eax, dword [esp + 0x1c]
mov edx, dword [ecx]
mov ebx, eax
sub ebx, dword [esp + 0x18]
push 0x19000
test ebx, ebx
mov dword [esp + 0x24], ebx
fild dword [esp + 0x24]
jge 0x40e41e
fadd qword [0x41d7c0]
test eax, eax
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
jge 0x40e430
fadd qword [0x41d7c0]
fdivp st(1)
mov edx, dword [edx + 0xc]
fmul qword [0x41d7b0]
fnstcw word [esp + 0x14]
movzx eax, word [esp + 0x14]
or eax, 0xc00
mov dword [esp + 0x24], eax
fldcw word [esp + 0x24]
fistp qword [esp + 0x24]
mov eax, dword [esp + 0x24]
push eax
mov eax, dword [esi + 0x28]
mov eax, dword [eax]
fldcw word [esp + 0x18]
push eax
call edx
mov ebx, dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x10], eax
test ebx, ebx
ja 0x40e29b
jmp 0x40e302
mov dword [esp + 0xc], 7
jmp 0x40e302
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40e4a8
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], 3
jmp 0x40e302
mov dword [esp + 0xc], 3
jmp 0x40e317