Function at 0x40b3fa
Capabilities:
Download and write a file
Get file size
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
sub esp, 0x2c
push ebx
push esi
push edi
xor edi, edi
push edi
push 0x80000100
push edi
mov esi, eax
push edi
mov ebx, ecx
call fcn.00401000
push eax
push dword [ebp + 8]
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
cmp eax, edi
mov dword [ebp - 0xc], eax
push edi
jne 0x40b438
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, 0x405
jmp 0x40b6f9
lea ecx, [ebp - 0x10]
push ecx
lea ecx, [ebp - 4]
push ecx
push 0x20000005
push eax
mov dword [ebp - 4], edi
mov dword [ebp - 0x10], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
jne 0x40b4fe
cmp byte [ebx + 0x24], al
mov dword [ebp - 4], edi
je 0x40b482
mov dword [esi + 4], 0xfa
mov eax, dword [ebx + 0x1c]
cmp eax, edi
je 0x40b482
push edi
push edi
push 0x402
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
lea eax, [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
movzx edi, word [ebp - 0x24]
movzx eax, word [ebp - 0x22]
imul edi, edi, 0x3c
push dword [ebx + 0x20]
add edi, eax
movzx eax, word [ebp - 0x20]
imul edi, edi, 0x3c
add edi, eax
movzx eax, word [ebp - 0x1e]
imul edi, edi, 0x3e8
add edi, eax
call fcn.004068bd
mov esi, dword [ebp + 0xc]
mov dword [ebp - 8], eax
xor eax, eax
cmp eax, dword [ebp - 4]
pop ecx
sbb eax, eax
xor ecx, ecx
push ecx
and eax, 2
push 0x80
inc eax
inc eax
push eax
push ecx
push ecx
push 0x40000000
call fcn.00401000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x40b533
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, 0x406
jmp 0x40b6e5
cmp byte [ebx + 0x25], 0
je 0x40b482
mov eax, dword [ebp - 4]
cmp dword [esi + 4], eax
je 0x40b482
mov ebx, dword [ebx + 0x1c]
cmp ebx, edi
je 0x40b529
push edi
push eax
push 0x40a
push ebx
call dword [sym.imp.USER32.dll_PostMessageA]
mov esi, 0x40c
jmp 0x40b6ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor esi, esi
cmp eax, 0xb7
jne 0x40b5b2
cmp dword [ebp - 4], esi
jbe 0x40b5b2
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, dword [ebp - 4]
mov dword [ebp + 8], eax
jne 0x40b57b
mov ebx, dword [ebx + 0x1c]
cmp ebx, esi
je 0x40b571
push esi
push eax
push 0x403
push ebx
call dword [sym.imp.USER32.dll_PostMessageA]
mov esi, 0x401
jmp 0x40b6dc
push esi
push esi
push esi
push eax
push dword [ebp - 0xc]
call dword [sym.imp.WININET.dll_InternetSetFilePointer]
cmp eax, 0xffffffff
je 0x40b5b2
push esi
push esi
push dword [ebp + 8]
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebx + 0x1c]
cmp eax, esi
je 0x40b5b2
push esi
push dword [ebp + 8]
push 0x403
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
mov eax, dword [ebx + 0xc]
push 0xffffffffffffffff
mov dword [ebp + 8], 4
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebx + 8]
test byte [eax], 2
jne 0x40b6c9
jmp 0x40b5d6
xor esi, esi
lea eax, [ebp + 8]
push eax
push dword [ebx + 0x20]
push dword [ebp - 8]
push dword [ebp - 0xc]
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40b6d0
cmp dword [ebp + 8], esi
je 0x40b571
lea eax, [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
push esi
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 8]
push dword [ebp - 8]
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp + 8]
jne 0x40b6d7
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
fild dword [ebp + 8]
movzx eax, word [ebp - 0x24]
movzx ecx, word [ebp - 0x22]
imul eax, eax, 0x3c
add eax, ecx
movzx ecx, word [ebp - 0x20]
imul eax, eax, 0x3c
add eax, ecx
movzx ecx, word [ebp - 0x1e]
imul eax, eax, 0x3e8
add eax, ecx
mov ecx, dword [ebp + 8]
test ecx, ecx
jge 0x40b65f
fadd dword [0x40ee38]
fmul dword [0x40ee34]
mov ecx, eax
sub ecx, edi
test ecx, ecx
mov dword [ebp - 0x1c], ecx
fild dword [ebp - 0x1c]
jge 0x40b679
fadd dword [0x40ee38]
fmul dword [0x40ee30]
mov esi, dword [ebx + 0x1c]
test esi, esi
mov edi, eax
fdivp st(1)
je 0x40b6a7
fmul dword [0x40ee2c]
call fcn.0040cf04
push eax
push dword [ebp + 8]
push 0x403
push esi
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x40b6a9
fstp st(0)
mov eax, dword [ebx + 0xc]
push 0xffffffffffffffff
mov dword [ebp + 8], 4
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebx + 8]
test byte [eax], 2
je 0x40b5d4
mov esi, 0x408
jmp 0x40b6dc
mov esi, 0x407
jmp 0x40b6dc
mov esi, 0x406
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 8]
call fcn.004068c2
pop ecx
push dword [ebp - 0xc]
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret 8