Function at 0x40c590
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 0x42b848
mov eax, dword fs:[0]
push eax
sub esp, 0xa8
mov eax, dword [0x43800c]
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 0x4335d8
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 7
mov word [ebp - 0x50], ax
call fcn.00409f20
xor eax, eax
mov byte [ebp - 4], 1
push eax
mov dword [ebp - 0x38], 0
lea ecx, [ebp - 0x38]
push 0x4335d8
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 7
mov word [ebp - 0x38], ax
call fcn.00409f20
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 0x40cbe2
mov esi, dword [ebp + 0x18]
test esi, esi
je 0x40cbe2
cmp dword [ebp + 0x1c], 8
lea ecx, [ebp + 8]
mov edi, dword [ebp + 8]
mov edx, esi
push 2
push 0x433818
cmovae ecx, edi
setae byte [ebp - 0x59]
push 0
call fcn.0040b9f0
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 0x40ccd2
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.00409f20
mov edx, dword [ebp + 0x1c]
cmp edx, 8
jb 0x40c704
mov ecx, dword [ebp + 8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c6fa
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push edx
push ecx
call fcn.004165af
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
push 1
movd edi, xmm1
push 0x433820
push 0
cmovae ecx, edi
movq qword [ebp + 0x18], xmm0
movups xmmword [ebp + 8], xmm1
call fcn.0040b9f0
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.00409f20
mov edx, dword [ebp - 0x3c]
cmp edx, 8
jb 0x40c7b6
mov ecx, dword [ebp - 0x50]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c7ac
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push edx
push ecx
call fcn.004165af
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 0x40ccd2
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.00409f20
mov edx, dword [ebp - 0x24]
cmp edx, 8
jb 0x40c85d
mov ecx, dword [ebp - 0x38]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c853
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push edx
push ecx
call fcn.004165af
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 0x433824
movq qword [ebp - 0x28], xmm0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
je 0x40c8e6
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 0x40c8e6
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 0x433844
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov esi, eax
mov dword [ebp - 0x18], 0xa80
mov dword [ebp - 0x6c], esi
jmp 0x40c8f6
xor esi, esi
mov dword [ebp - 0x18], 0xa80
mov dword [ebp - 0x6c], esi
test edi, edi
je 0x40c92f
push 4
lea eax, [ebp - 0x18]
push eax
push 0x54
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
test esi, esi
je 0x40c92f
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 0x40c92f
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 0x40cbdb
cmp dword [ebp - 0x1c], 0x190
jae 0x40cbdb
mov ecx, dword [ebp - 0x60]
push 0
push 0x4335d8
call fcn.00409f20
lea eax, [ebp - 0x54]
mov dword [ebp - 0x54], 0
push eax
push esi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x40cbdb
mov eax, dword [ebp - 0x54]
test eax, eax
je 0x40cba2
inc eax
push eax
call fcn.00416ab1
mov ecx, dword [ebp - 0x54]
mov edi, eax
inc ecx
mov dword [ebp - 0x70], edi
push ecx
push 0
push edi
call fcn.00417e70
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 0x40ca16
cmp ecx, 0xffffffff
je 0x40ca16
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 0x40cbdb
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x54]
jne 0x40cbdb
mov ecx, dword [ebp - 0x74]
mov eax, dword [ebp - 0x58]
test eax, eax
je 0x40cba2
test ecx, ecx
jne 0x40cb8f
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.00416ab1
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 0x40ca96
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x8c]
call fcn.00409f20
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 0x40cb30
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 0x40cb09
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.00418010
mov eax, dword [ebp - 0x64]
add esp, 0xc
mov ecx, dword [ebp - 0x98]
xor edx, edx
mov word [eax + ecx*2], dx
jmp 0x40cb51
push edx
push ecx
mov ecx, dword [ebp - 0x60]
mov byte [ebp - 0x9c], 0
push dword [ebp - 0x9c]
push edx
call fcn.00409190
mov edi, dword [ebp - 0x78]
mov esi, dword [ebp - 0x8c]
mov byte [ebp - 4], 2
cmp edi, 8
jb 0x40cb89
lea ecx, [edi*2 + 2]
mov eax, esi
cmp ecx, 0x1000
jb 0x40cb7f
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push ecx
push esi
call fcn.004165af
add esp, 8
mov esi, dword [ebp - 0x6c]
mov edi, dword [ebp - 0x70]
push edi
call fcn.00416aba
add esp, 4
cmp dword [ebp - 0x54], 0
ja 0x40c974
mov edi, dword [ebp - 0x68]
test esi, esi
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
je 0x40cbb4
push dword [ebp - 0x6c]
call esi
mov eax, dword [ebp - 0x90]
test eax, eax
je 0x40cbc1
push eax
call esi
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40cbcb
push eax
call esi
mov eax, dword [ebp - 0x74]
test eax, eax
je 0x40cbe7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40cbe7
mov edi, 0x80004005
jmp 0x40cba5
mov edi, 0x80004005
mov edx, dword [ebp - 0x24]
cmp edx, 8
jb 0x40cc21
mov ecx, dword [ebp - 0x38]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cc17
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push edx
push ecx
call fcn.004165af
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 0x40cc6b
mov ecx, dword [ebp - 0x50]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cc61
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push edx
push ecx
call fcn.004165af
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 0x40ccb5
mov ecx, dword [ebp + 8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40ccab
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40ccd7
push edx
push ecx
call fcn.004165af
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.004165a1
mov esp, ebp
pop ebp
ret
call fcn.00408920
call fcn.00419a7c
int3