Function at 0x40da70
Capabilities:
Check http status code
Initialize winhttp library
Prepare http request
Read http header
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42dad8
mov eax, dword fs:[0]
push eax
sub esp, 0xa8
mov eax, dword [0x43a00c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x60], edx
mov dword [ebp - 0x74], ecx
xor eax, eax
mov dword [ebp - 4], 0
push eax
mov dword [ebp - 0x50], 0
lea ecx, [ebp - 0x50]
push 0x4354f8
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 7
mov word [ebp - 0x50], ax
call fcn.0040c560
xor eax, eax
mov byte [ebp - 4], 1
push eax
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x38]
push 0x4354f8
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 7
mov word [ebp - 0x38], ax
call fcn.0040c560
lea eax, [ebp - 0x20]
mov byte [ebp - 4], 2
xor edi, edi
mov dword [ebp - 0x14], 0
push eax
mov dword [ebp - 0x54], 4
mov dword [ebp - 0x68], edi
call dword [sym.imp.SensApi.dll_IsNetworkAlive]
test eax, eax
je 0x40e0c0
mov esi, dword [ebp + 0x18]
test esi, esi
je 0x40e0c0
cmp dword [ebp + 0x1c], 8
lea ecx, [ebp + 8]
mov edi, dword [ebp + 8]
mov edx, esi
push 2
cmovae ecx, edi
setae byte [ebp - 0x59]
push 0x43572c
push ecx
call fcn.0040cea0
add esp, 0xc
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 7
lea edx, [eax + 2]
cmp esi, edx
jb 0x40e1b0
sub esi, edx
lea eax, [ebp + 8]
or ecx, 0xffffffff
cmp esi, 0xffffffff
cmovb ecx, esi
cmp byte [ebp - 0x59], 0
push ecx
cmovne eax, edi
lea ecx, [ebp - 0x8c]
lea eax, [eax + edx*2]
push eax
call fcn.0040c560
mov edx, dword [ebp + 0x1c]
cmp edx, 8
jb 0x40dbe3
mov ecx, dword [ebp + 8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40dbd9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push edx
push ecx
call fcn.00417807
add esp, 8
movups xmm1, xmmword [ebp - 0x8c]
cmp dword [ebp - 0x78], 8
lea ecx, [ebp + 8]
movq xmm0, qword [ebp - 0x7c]
mov esi, dword [ebp - 0x7c]
mov edx, esi
movd edi, xmm1
push 1
push 0x435734
cmovae ecx, edi
movq qword [ebp + 0x18], xmm0
push ecx
movups xmmword [ebp + 8], xmm1
call fcn.0040cea0
add esp, 0xc
mov dword [ebp - 0x70], eax
cmp esi, eax
mov dword [ebp - 0xb4], 0
mov ecx, eax
mov dword [ebp - 0xa4], 0
cmovb ecx, esi
mov dword [ebp - 0xa0], 7
cmp dword [ebp - 0x78], 8
lea eax, [ebp + 8]
push ecx
cmovae eax, edi
lea ecx, [ebp - 0xb4]
push eax
call fcn.0040c560
mov edx, dword [ebp - 0x3c]
cmp edx, 8
jb 0x40dc94
mov ecx, dword [ebp - 0x50]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40dc8a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push edx
push ecx
call fcn.00417807
add esp, 8
movups xmm0, xmmword [ebp - 0xb4]
mov ecx, dword [ebp - 0x70]
mov eax, dword [ebp + 0x18]
inc ecx
mov dword [ebp - 0xb4], 0
movups xmmword [ebp - 0x50], xmm0
movq xmm0, qword [ebp - 0xa4]
movq qword [ebp - 0x40], xmm0
mov dword [ebp - 0xa4], 0
mov dword [ebp - 0xa0], 7
cmp eax, ecx
jb 0x40e1b0
sub eax, ecx
mov edx, 0xffffffff
cmp eax, 0xffffffff
cmovb edx, eax
cmp dword [ebp + 0x1c], 8
lea eax, [ebp + 8]
cmovae eax, dword [ebp + 8]
push edx
lea eax, [eax + ecx*2]
push eax
lea ecx, [ebp - 0xb4]
call fcn.0040c560
mov edx, dword [ebp - 0x24]
cmp edx, 8
jb 0x40dd3b
mov ecx, dword [ebp - 0x38]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40dd31
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push edx
push ecx
call fcn.00417807
add esp, 8
movups xmm0, xmmword [ebp - 0xb4]
push 0
push 0
push 0
movups xmmword [ebp - 0x38], xmm0
push 1
movq xmm0, qword [ebp - 0xa4]
push 0x435738
movq qword [ebp - 0x28], xmm0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
je 0x40ddc4
cmp dword [ebp - 0x3c], 8
lea ecx, [ebp - 0x50]
push 0
cmovae ecx, dword [ebp - 0x50]
push 0x1bb
push ecx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x90], eax
test eax, eax
je 0x40ddc4
cmp dword [ebp - 0x24], 8
lea ecx, [ebp - 0x38]
push 0x800000
cmovae ecx, dword [ebp - 0x38]
push 0
push 0
push 0
push ecx
push 0x435758
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
mov dword [ebp - 0x18], 0xa80
mov dword [ebp - 0x6c], esi
jmp 0x40ddd4
xor esi, esi
mov dword [ebp - 0x18], 0xa80
mov dword [ebp - 0x6c], esi
test edi, edi
je 0x40de0d
push 4
lea eax, [ebp - 0x18]
push eax
push 0x54
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
test esi, esi
je 0x40de0d
push 0
push 0
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov dword [ebp - 0x14], eax
test eax, eax
je 0x40de0d
push 0
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov dword [ebp - 0x14], eax
push 0
lea eax, [ebp - 0x54]
mov dword [ebp - 0x1c], 0
push eax
lea eax, [ebp - 0x1c]
push eax
push 0
push 0x20000013
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
cmp dword [ebp - 0x14], 0
je 0x40e0b9
cmp dword [ebp - 0x1c], 0x190
jae 0x40e0b9
mov ecx, dword [ebp - 0x60]
push 0
push 0x4354f8
call fcn.0040c560
lea eax, [ebp - 0x54]
mov dword [ebp - 0x54], 0
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x40e0b9
mov eax, dword [ebp - 0x54]
test eax, eax
je 0x40e080
inc eax
push eax
call fcn.004180e6
mov ecx, dword [ebp - 0x54]
mov edi, eax
inc ecx
mov dword [ebp - 0x70], edi
push ecx
push 0
push edi
call fcn.004195c0
add esp, 0x10
mov dword [ebp - 0x58], 0
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0x54]
push edi
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
mov ecx, dword [ebp - 0x68]
test eax, eax
mov eax, 0x80004005
cmove ecx, eax
mov dword [ebp - 0x68], ecx
mov ecx, dword [ebp - 0x74]
test ecx, ecx
je 0x40def4
cmp ecx, 0xffffffff
je 0x40def4
push 0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
push dword [ebp - 0x54]
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40e0b9
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x54]
jne 0x40e0b9
mov ecx, dword [ebp - 0x74]
mov eax, dword [ebp - 0x58]
test eax, eax
je 0x40e080
test ecx, ecx
jne 0x40e06d
push ecx
push ecx
push 0xffffffffffffffff
push edi
push ecx
push 0xfde9
mov byte [eax + edi], cl
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor ecx, ecx
mov esi, eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004180e6
add esp, 4
mov dword [ebp - 0x64], eax
push esi
push eax
push 0xffffffffffffffff
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edx, dword [ebp - 0x64]
xor eax, eax
mov ecx, edx
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 7
mov word [ebp - 0x8c], ax
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40df74
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x8c]
call fcn.0040c560
mov eax, dword [ebp - 0x60]
lea ecx, [ebp - 0x8c]
mov byte [ebp - 4], 3
cmp dword [ebp - 0x78], 8
mov esi, dword [ebp - 0x8c]
mov edx, dword [eax + 0x10]
cmovae ecx, esi
mov eax, dword [eax + 0x14]
sub eax, edx
mov dword [ebp - 0x64], edx
mov edx, dword [ebp - 0x7c]
mov dword [ebp - 0x94], ecx
cmp edx, eax
ja 0x40e00e
mov ecx, dword [ebp - 0x64]
mov edi, dword [ebp - 0x60]
lea eax, [edx + ecx]
cmp dword [edi + 0x14], 8
mov dword [edi + 0x10], eax
mov dword [ebp - 0x98], eax
mov eax, edi
mov edi, dword [ebp - 0x78]
mov dword [ebp - 0x64], eax
jb 0x40dfe7
mov eax, dword [eax]
mov dword [ebp - 0x64], eax
lea ecx, [eax + ecx*2]
lea eax, [edx + edx]
push eax
push dword [ebp - 0x94]
push ecx
call fcn.00419040
mov eax, dword [ebp - 0x64]
add esp, 0xc
mov ecx, dword [ebp - 0x98]
xor edx, edx
mov word [eax + ecx*2], dx
jmp 0x40e02f
push edx
push ecx
mov ecx, dword [ebp - 0x60]
mov byte [ebp - 0x9c], 0
push dword [ebp - 0x9c]
push edx
call fcn.0040b310
mov edi, dword [ebp - 0x78]
mov esi, dword [ebp - 0x8c]
mov byte [ebp - 4], 2
cmp edi, 8
jb 0x40e067
lea ecx, [edi*2 + 2]
mov eax, esi
cmp ecx, 0x1000
jb 0x40e05d
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push ecx
push esi
call fcn.00417807
add esp, 8
mov esi, dword [ebp - 0x6c]
mov edi, dword [ebp - 0x70]
push edi
call fcn.004180ef
add esp, 4
cmp dword [ebp - 0x54], 0
ja 0x40de52
mov edi, dword [ebp - 0x68]
test esi, esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
je 0x40e092
push dword [ebp - 0x6c]
call esi
mov eax, dword [ebp - 0x90]
test eax, eax
je 0x40e09f
push eax
call esi
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40e0a9
push eax
call esi
mov eax, dword [ebp - 0x74]
test eax, eax
je 0x40e0c5
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40e0c5
mov edi, 0x80004005
jmp 0x40e083
mov edi, 0x80004005
mov edx, dword [ebp - 0x24]
cmp edx, 8
jb 0x40e0ff
mov ecx, dword [ebp - 0x38]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40e0f5
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push edx
push ecx
call fcn.00417807
add esp, 8
mov edx, dword [ebp - 0x3c]
xor eax, eax
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 7
mov word [ebp - 0x38], ax
cmp edx, 8
jb 0x40e149
mov ecx, dword [ebp - 0x50]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40e13f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push edx
push ecx
call fcn.00417807
add esp, 8
mov edx, dword [ebp + 0x1c]
xor eax, eax
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 7
mov word [ebp - 0x50], ax
cmp edx, 8
jb 0x40e193
mov ecx, dword [ebp + 8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40e189
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e1b5
push edx
push ecx
call fcn.00417807
add esp, 8
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004177f9
mov esp, ebp
pop ebp
ret
call fcn.0040a6c0
call fcn.0041af8c
int3