Function at 0x40aa00
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 0x4b7391
mov eax, dword fs:[0]
push eax
mov eax, 0x2270
call fcn.0047e4b0
mov eax, dword [0x4e0214]
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 - 0x2270], eax
mov dword [ebp - 0x2278], ecx
mov dword [ebp - 0x2260], ebx
call fcn.00408f00
add esp, 4
push 0x4d03bc
push esi
call fcn.00479239
add esp, 8
mov dword [ebp - 0x2258], eax
cmp eax, ebx
je 0x40ab7d
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 0x40aa91
sub eax, edx
sar eax, 1
push eax
mov eax, edi
lea esi, [ebp - 0x2230]
call fcn.00403870
mov al, byte [ebp + 0x10]
mov dword [ebp - 4], ebx
mov byte [ebp - 0x2264], al
call fcn.0040a7a0
mov ecx, esi
lea edi, [ebp - 0x226c]
mov dword [ebp - 0x226c], eax
call fcn.0040a850
mov esi, eax
mov dword [ebp - 0x2268], esi
mov byte [ebp - 4], 2
cmp dword [ebp - 0x221c], 8
jb 0x40aaf6
mov ecx, dword [ebp - 0x2230]
push ecx
call fcn.004790ec
add esp, 4
mov edi, 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 esi
mov dword [ebp - 0x221c], 7
mov dword [ebp - 0x2220], ebx
mov word [ebp - 0x2230], dx
mov dword [ebp - 0x2254], 4
call edi
test eax, eax
je 0x40ab84
mov eax, dword [ebp - 0x2250]
cmp eax, 0xc8
je 0x40ab84
cmp eax, 0xc9
je 0x40ab84
cmp eax, 0xca
je 0x40ab84
cmp eax, 0xcb
je 0x40ab84
mov edx, dword [ebp - 0x2258]
push edx
call fcn.0047a0bb
add esp, 4
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
mov eax, dword [ebp - 0x226c]
push eax
call esi
xor eax, eax
jmp 0x40ae6d
push ebx
lea ecx, [ebp - 0x2250]
push ecx
lea edx, [ebp - 0x2254]
push edx
push 0x20000005
push esi
mov dword [ebp - 0x2254], ebx
mov dword [ebp - 0x2250], 4
call edi
neg eax
sbb edi, edi
and edi, dword [ebp - 0x2254]
lea esi, [ebp - 0x226c]
mov dword [ebp - 0x227c], edi
mov dword [ebp - 0x2254], ebx
call fcn.0040a700
test eax, eax
je 0x40ac10
call fcn.0044bc92
test byte [0x4e4944], 1
mov dword [ebp - 0x2254], eax
jne 0x40abfd
or dword [0x4e4944], 1
call section..text
push 0x4b86a0
call fcn.004793ba
add esp, 4
push str.gzip_init.
push ebx
mov esi, 0x4e4928
call fcn.00401150
add esp, 8
xor esi, esi
jmp 0x40ac19
add esp, 0xc
xor ebx, ebx
push 0x10
push 0x4d03a8
lea ecx, [ebp - 0x224c]
mov dword [ebp - 0x2250], ebx
mov dword [ebp - 0x2238], 0xf
mov dword [ebp - 0x223c], ebx
mov byte [ebp - 0x224c], 0
call fcn.00403f80
lea eax, [ebp - 0x2250]
push eax
push 0x2000
lea ecx, [ebp - 0x2214]
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x2268]
push ecx
push edx
call dword [sym.imp.WININET.dll_InternetReadFile]
cmp eax, ebx
jne 0x40ac7f
lea eax, [ebp - 0x224c]
push eax
call fcn.0040b760
add esp, 4
mov byte [ebp - 4], 2
cmp dword [ebp - 0x2238], 0x10
mov ebx, eax
jb 0x40ac9d
mov ecx, dword [ebp - 0x224c]
push ecx
call fcn.004790ec
add esp, 4
test ebx, ebx
je 0x40ae2d
mov ebx, dword [ebp - 0x2250]
test ebx, ebx
js 0x40ae2d
xor ecx, ecx
cmp ebx, ecx
je 0x40ae0e
mov eax, dword [ebp - 0x2254]
add esi, ebx
mov dword [ebp - 0x2274], esi
cmp eax, ecx
je 0x40ad7f
lea edx, [ebp - 0x225c]
push edx
mov dword [ebp - 0x2250], ecx
mov dword [ebp - 0x225c], ecx
lea ecx, [ebp - 0x2250]
push ecx
push ebx
lea edx, [ebp - 0x2214]
push edx
push eax
call fcn.0044d759
add esp, 0x14
test byte [0x4e4944], 1
mov edi, eax
jne 0x40ad22
or dword [0x4e4944], 1
call section..text
push 0x4b86a0
call fcn.004793ba
add esp, 4
mov eax, dword [ebp - 0x225c]
push eax
push edi
push str.gzip_update__d___d_bytes
push 0
mov esi, 0x4e4928
call fcn.00401150
add esp, 0x10
test edi, edi
js 0x40ae2d
mov ecx, dword [ebp - 0x2258]
mov edx, dword [ebp - 0x225c]
mov eax, dword [ebp - 0x2250]
push ecx
push edx
push 1
push eax
call fcn.004795f3
mov ecx, dword [ebp - 0x2250]
push ecx
call fcn.0047aba7
mov esi, dword [ebp - 0x2274]
mov edi, dword [ebp - 0x227c]
add esp, 0x14
jmp 0x40ad98
mov edx, dword [ebp - 0x2258]
push edx
push ebx
lea eax, [ebp - 0x2214]
push 1
push eax
call fcn.004795f3
add esp, 0x10
cmp edi, 0xffffffff
je 0x40ade8
mov ecx, edi
test edi, edi
jne 0x40ada8
mov ecx, 1
mov eax, esi
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 - 0x2270], 0
je 0x40ac17
mov edx, dword [ebp - 0x2278]
push edx
push edi
push ebx
call dword [ebp - 0x2270]
jmp 0x40ac14
mov eax, esi
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]
jmp 0x40ac14
lea ecx, [ebp - 0x214]
push str.Download_complete.
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 8
mov dword [ebp - 0x2260], 1
mov eax, dword [ebp - 0x2254]
test eax, eax
je 0x40ae40
push eax
call fcn.0044bcca
add esp, 4
mov edx, dword [ebp - 0x2258]
push edx
call fcn.0047a0bb
mov eax, dword [ebp - 0x2268]
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 4
push eax
call esi
mov ecx, dword [ebp - 0x226c]
push ecx
call esi
mov eax, dword [ebp - 0x2260]
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.004790f7
mov esp, ebp
pop ebp
ret