Function at 0x40108a
Capabilities:
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x510
mov eax, dword [0x418004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [ebp - 0x510], eax
xor eax, eax
push esi
push edi
cmp dword [ebx + 0x14], 8
mov dword [ebp - 0x504], eax
jb 0x4010bd
mov esi, dword [ebx]
jmp 0x4010bf
mov esi, ebx
push 0x3c
pop edi
push edi
push eax
lea eax, [ebp - 0x4f8]
push eax
call fcn.00403dc0
or eax, 0xffffffff
mov dword [ebp - 0x4f8], edi
mov ecx, esi
mov dword [ebp - 0x4f0], eax
add esp, 0xc
mov dword [ebp - 0x4e4], eax
mov dword [ebp - 0x4c8], eax
xor edi, edi
mov dword [ebp - 0x4c0], eax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x4010fb
lea eax, [ebp - 0x4f8]
sub ecx, edx
push eax
push edi
sar ecx, 1
push ecx
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x401124
inc eax
jmp 0x401474
xor eax, eax
push eax
push eax
push eax
push 1
mov esi, eax
mov dword [ebp - 0x4bc], eax
push str.WinHTTP_DownLoader_1.0
mov dword [ebp - 0x4b8], eax
mov dword [ebp - 0x508], esi
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
push 0x258
mov dword [ebp - 0x50c], eax
lea eax, [ebp - 0x25c]
push esi
push eax
call fcn.00403dc0
push dword [ebp - 0x4e4]
lea eax, [ebp - 0x25c]
push dword [ebp - 0x4e8]
push eax
call fcn.00405167
mov eax, dword [ebp - 0x50c]
add esp, 0x18
test eax, eax
je 0x4011a4
push esi
push dword [ebp - 0x4e0]
lea ecx, [ebp - 0x25c]
push ecx
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov esi, eax
mov dword [ebp - 0x508], eax
push 0x258
lea eax, [ebp - 0x4b4]
push 0
push eax
call fcn.00403dc0
push dword [ebp - 0x4c8]
lea eax, [ebp - 0x4b4]
push dword [ebp - 0x4cc]
push eax
call fcn.00405167
add esp, 0x18
test esi, esi
je 0x401441
lea eax, [ebx + 0x18]
cmp dword [eax + 0x14], 8
jb 0x4011e5
mov eax, dword [eax]
push 0x100
xor ecx, ecx
push ecx
push ecx
push ecx
lea ecx, [ebp - 0x4b4]
push ecx
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
test edi, edi
je 0x401441
xor esi, esi
push esi
push esi
push esi
push esi
push esi
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x401441
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov dword [ebp - 0x500], eax
test eax, eax
je 0x401441
push esi
lea eax, [ebp - 0x4bc]
mov dword [ebp - 0x4fc], esi
push eax
push esi
push esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
push 0x13
push edi
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x4012b1
mov eax, dword [ebp - 0x4bc]
xor ecx, ecx
shr eax, 1
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00401a03
mov ecx, eax
mov eax, dword [ebp - 0x4bc]
shr eax, 1
inc eax
mov dword [ebp - 0x4fc], ecx
push eax
push 0
push ecx
call fcn.00403dc0
add esp, 0x10
lea eax, [ebp - 0x4bc]
xor ecx, ecx
push ecx
push eax
push dword [ebp - 0x4fc]
push ecx
push 0x13
push edi
call esi
mov dword [ebp - 0x500], eax
push dword [ebp - 0x4fc]
call fcn.004059a7
push dword [ebp - 0x4fc]
mov esi, eax
mov dword [ebx + 0x30], esi
call fcn.00401a0c
pop ecx
pop ecx
xor ecx, ecx
lea eax, [ebp - 0x4bc]
push ecx
push eax
push ecx
push ecx
push 5
push edi
mov dword [ebp - 0x4fc], ecx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
lea eax, [esi - 0xc8]
cmp eax, 0x64
sbb eax, eax
and dword [ebp - 0x500], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x401356
mov eax, dword [ebp - 0x4bc]
xor ecx, ecx
shr eax, 1
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00401a03
mov esi, eax
mov eax, dword [ebp - 0x4bc]
shr eax, 1
inc eax
push eax
push 0
push esi
call fcn.00403dc0
add esp, 0x10
lea eax, [ebp - 0x4bc]
xor ecx, ecx
push ecx
push eax
push esi
push ecx
push 5
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov dword [ebp - 0x500], eax
jmp 0x40135c
mov esi, dword [ebp - 0x4fc]
push esi
call fcn.004059a7
push esi
mov dword [ebx + 0x34], eax
call fcn.00401a0c
cmp dword [ebp - 0x500], 0
pop ecx
pop ecx
je 0x401441
xor eax, eax
mov dword [ebx + 0x38], eax
mov dword [ebp - 0x4bc], eax
lea eax, [ebp - 0x4bc]
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x40143a
mov eax, dword [ebp - 0x4bc]
test eax, eax
je 0x401445
inc eax
push eax
call fcn.00401a03
mov esi, eax
pop ecx
test esi, esi
je 0x40142e
mov eax, dword [ebp - 0x4bc]
inc eax
push eax
push 0
push esi
call fcn.00403dc0
add esp, 0xc
lea eax, [ebp - 0x4b8]
push eax
push dword [ebp - 0x4bc]
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x401429
mov eax, dword [ebp - 0x4bc]
test eax, eax
jle 0x40140f
mov ecx, dword [ebp - 0x510]
cmp dword [ecx], 0
je 0x40140f
push dword [ecx]
add dword [ecx + 4], eax
push eax
push 1
push esi
call fcn.00404ee5
mov eax, dword [ebp - 0x4bc]
add esp, 0x10
add dword [ebx + 0x38], eax
push esi
call fcn.00401a0c
cmp dword [ebp - 0x4bc], 0
pop ecx
jbe 0x401445
xor eax, eax
jmp 0x40137f
push 4
pop ebx
jmp 0x40144b
and dword [ebp - 0x4bc], 0
push 3
pop ebx
jmp 0x40144b
push 2
pop eax
mov ebx, eax
jmp 0x40144b
push 5
jmp 0x40142b
mov ebx, dword [ebp - 0x504]
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test edi, edi
je 0x401458
push edi
call esi
mov eax, dword [ebp - 0x508]
test eax, eax
je 0x401465
push eax
call esi
mov eax, dword [ebp - 0x50c]
test eax, eax
je 0x401472
push eax
call esi
mov eax, ebx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004019f2
mov esp, ebp
pop ebp
ret 8