Function at 0x40a923
Capabilities:
Download and write a file
Get http content length
Query remote server for available data
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x3bc]
sub esp, 0x43c
mov eax, dword [0x445064]
xor eax, ebp
mov dword [ebp + 0x3b8], eax
mov eax, dword [ebp + 0x3c4]
push ebx
push edi
xor edi, edi
push edi
mov dword [ebp - 0x64], ecx
lea ecx, [ebp - 0x7c]
push ecx
lea ecx, [ebp - 0x78]
push ecx
push 0x20000005
mov ebx, edx
push eax
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x70], ebx
mov dword [esi], edi
mov dword [ebp - 0x78], edi
mov dword [ebp - 0x7c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
jne 0x40a97e
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor eax, eax
push 0x206
mov word [ebp - 0x58], ax
lea eax, [ebp - 0x56]
push edi
push eax
mov dword [ebp - 0x5c], edi
call fcn.0041c790
mov eax, dword [ebp - 0x64]
add esp, 0xc
cmp dword [eax + 0xa0], edi
je 0x40aa63
add eax, 0x8c
cmp dword [eax + 0x18], 8
jb 0x40a9b8
mov ebx, dword [eax + 4]
jmp 0x40a9bb
lea ebx, [eax + 4]
cmp word [ebx], 0x5c
jne 0x40a9d6
push 0x103
lea eax, [ebp - 0x58]
push eax
push ebx
call fcn.0040121a
add esp, 0xc
lea ebx, [ebp - 0x58]
xor eax, eax
push 0x206
mov word [ebp + 0x1b0], ax
lea eax, [ebp + 0x1b2]
push edi
push eax
call fcn.0041c790
mov eax, ebx
add esp, 0xc
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, di
jne 0x40a9f9
sub eax, ecx
sar eax, 1
push eax
push ebx
lea eax, [ebp + 0x1b0]
push 0x104
push eax
call fcn.004188df
lea eax, [ebp + 0x1b0]
push 0x5c
push eax
call fcn.00418a8b
add esp, 0x18
cmp eax, edi
je 0x40aa34
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp + 0x1b0]
push eax
call fcn.0040111d
mov dword [esp], 0x43c5d0
lea eax, [ebp - 0x5c]
push ebx
push eax
call fcn.0041a300
add esp, 0xc
cmp dword [ebp - 0x5c], edi
jne 0x40aa60
xor eax, eax
jmp 0x40ab93
mov ebx, dword [ebp - 0x70]
push 0x1000
call fcn.004189b2
mov dword [esp], 0x1000
push edi
push eax
mov dword [ebp - 0x64], eax
call fcn.0041c790
add esp, 0xc
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x6c], edi
push edi
push edi
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 0x74]
mov dword [ebp - 0x68], edi
call dword [sym.imp.WININET.dll_InternetQueryDataAvailable]
cmp dword [ebp - 0x5c], edi
jne 0x40ab12
cmp dword [esi], edi
jne 0x40aac0
mov eax, dword [ebp - 0x60]
cmp eax, edi
jbe 0x40aac0
inc eax
push eax
mov dword [ebx], eax
call fcn.004189b2
mov dword [esi], eax
push dword [ebx]
push edi
push eax
call fcn.0041c790
add esp, 0x10
mov edx, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x60]
mov eax, dword [ebx]
add edx, ecx
mov dword [ebp - 0x80], eax
cmp edx, eax
jb 0x40ab12
mov eax, dword [ebp - 0x6c]
mov ebx, dword [esi]
lea eax, [eax + ecx*2]
mov ecx, dword [ebp - 0x70]
push eax
mov dword [ecx], eax
call fcn.004189b2
pop ecx
mov dword [esi], eax
cmp eax, edi
je 0x40ab77
mov ecx, dword [ebp - 0x70]
push dword [ecx]
push edi
push eax
call fcn.0041c790
push dword [ebp - 0x80]
push ebx
push dword [esi]
call fcn.0041e590
push ebx
call fcn.00418b32
mov ebx, dword [ebp - 0x70]
add esp, 0x1c
mov eax, 0x1000
cmp dword [ebp - 0x60], eax
jbe 0x40ab1f
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0x68]
push eax
push dword [ebp - 0x60]
push dword [ebp - 0x64]
push dword [ebp - 0x74]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40ab83
cmp dword [ebp - 0x68], edi
jbe 0x40ab83
cmp dword [ebp - 0x5c], edi
je 0x40ab58
push dword [ebp - 0x5c]
push dword [ebp - 0x68]
push 1
push dword [ebp - 0x64]
call fcn.0041922e
add esp, 0x10
jmp 0x40aa87
push dword [ebp - 0x68]
mov eax, dword [esi]
add eax, dword [ebp - 0x6c]
push dword [ebp - 0x64]
push eax
call fcn.0041e590
mov eax, dword [ebp - 0x68]
add esp, 0xc
add dword [ebp - 0x6c], eax
jmp 0x40aa87
push ebx
call fcn.00418b32
pop ecx
jmp 0x40aa59
cmp dword [ebp - 0x5c], edi
je 0x40ab91
push dword [ebp - 0x5c]
call fcn.00419327
pop ecx
mov eax, dword [ebx]
mov ecx, dword [ebp + 0x3b8]
pop edi
xor ecx, ebp
pop ebx
call fcn.0041887e
add ebp, 0x3bc
leave
ret 4