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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x203c
call fcn.004174d0
mov eax, dword [0x420004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, edx
push edi
mov edi, dword [ebp + 0xc]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x202c], eax
cmp eax, 0xffffffff
jne 0x4020f9
push edi
push str.Could_not_create_destination_file___s_
lea eax, [ebp - 0x2008]
push 0x2000
push eax
call fcn.004010d0
add esp, 0x10
lea eax, [ebp - 0x2008]
push 0x30
push str.Scopevisio_Launcher_Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004031d7
mov esp, ebp
pop ebp
ret
xor edi, edi
mov dword [ebp - 0x2020], 0
push edi
push edi
push edi
xor eax, eax
mov dword [ebp - 0x2024], 0
push edi
push str.WinHTTP_Example_1.0
mov dword [ebp - 0x200c], 4
mov dword [ebp - 0x2010], 0
mov dword [ebp - 0x2018], 0
mov dword [ebp - 0x2014], eax
mov dword [ebp - 0x2028], eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov edx, eax
mov dword [ebp - 0x2034], edx
test edx, edx
je 0x40244b
mov eax, 0x1bb
test esi, esi
mov ecx, 0x50
push edi
cmovne ecx, eax
movzx eax, cx
push eax
push 0x47d930
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x2028], eax
test eax, eax
je 0x40244b
neg esi
sbb esi, esi
and esi, 0x800000
push esi
push edi
push edi
push edi
push ebx
push 0x41ddec
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
test edi, edi
je 0x40244b
xor esi, esi
nop
test esi, esi
je 0x4021ca
push 0
push 0x47a5f0
push 0x479650
push esi
push 1
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSetCredentials]
push 0
push 0
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov ebx, eax
test ebx, ebx
je 0x4021f2
push 0
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov ebx, eax
test ebx, ebx
jne 0x402207
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2f00
je 0x4021b0
test ebx, ebx
je 0x402423
push 0
lea eax, [ebp - 0x200c]
push eax
lea eax, [ebp - 0x2020]
push eax
push 0
push 0x20000013
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov ebx, eax
test ebx, ebx
je 0x402423
mov ecx, dword [ebp - 0x2020]
mov eax, ecx
mov dword [ebp - 0x201c], 0
sub eax, 0xc8
je 0x4022fe
sub eax, 0xc9
je 0x402423
sub eax, 6
je 0x40227a
push ecx
push str.Error._Status_code__d_returned._n
call fcn.00401090
mov eax, 1
add esp, 8
mov dword [ebp - 0x2010], eax
jmp 0x402429
lea eax, [ebp - 0x2038]
push eax
lea eax, [ebp - 0x203c]
push eax
lea eax, [ebp - 0x2030]
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryAuthSchemes]
mov ebx, eax
test ebx, ebx
je 0x4022de
mov eax, dword [ebp - 0x2030]
test al, 0x10
je 0x4022b2
mov dword [ebp - 0x2014], 0x10
jmp 0x4022de
test al, 2
je 0x4022c2
mov dword [ebp - 0x2014], 2
jmp 0x4022de
test al, 4
je 0x4022d2
mov dword [ebp - 0x2014], 4
jmp 0x4022de
movzx esi, al
and esi, 8
mov dword [ebp - 0x2014], esi
cmp dword [ebp - 0x2024], 0x197
jne 0x402423
mov eax, 1
mov dword [ebp - 0x2010], eax
jmp 0x402429
lea eax, [ebp - 0x200c]
mov dword [ebp - 0x200c], 0
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x4023cf
nop
mov eax, dword [ebp - 0x200c]
test eax, eax
je 0x4023e1
inc eax
push eax
call fcn.004033e8
mov esi, eax
add esp, 4
test esi, esi
je 0x4023f8
mov ecx, dword [ebp - 0x200c]
inc ecx
push ecx
push 0
push esi
call fcn.004044b0
add esp, 0xc
lea eax, [ebp - 0x201c]
push eax
push dword [ebp - 0x200c]
push esi
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x40239d
cmp dword [ebp - 0x200c], 0
mov dword [ebp - 0x2018], 0
jbe 0x40239d
push 0
lea eax, [ebp - 0x2018]
push eax
push dword [ebp - 0x201c]
push esi
push dword [ebp - 0x202c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call fcn.004031e8
add esp, 4
cmp dword [ebp - 0x201c], 0
je 0x4023e1
lea eax, [ebp - 0x200c]
mov dword [ebp - 0x200c], 0
push eax
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x402320
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, str.Keine_Daten_vorhanden
mov ecx, eax
call fcn.00401840
mov eax, 1
mov dword [ebp - 0x2018], 1
mov dword [ebp - 0x2010], eax
jmp 0x402429
push 0x30
push str.Scopevisio_Launcher_Error
push str.Out_of_memory
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, 1
mov dword [ebp - 0x2018], 1
mov dword [ebp - 0x2010], eax
jmp 0x402429
mov eax, dword [ebp - 0x2010]
mov ecx, dword [ebp - 0x2020]
mov dword [ebp - 0x2024], ecx
test ebx, ebx
je 0x40244b
mov esi, dword [ebp - 0x2014]
test eax, eax
je 0x4021b0
test ebx, ebx
jne 0x40245f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d_has_occurred._n
call fcn.00401090
add esp, 8
mov esi, dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test edi, edi
je 0x40246c
push edi
call esi
mov eax, dword [ebp - 0x2028]
test eax, eax
je 0x402479
push eax
call esi
mov eax, dword [ebp - 0x2034]
test eax, eax
je 0x402486
push eax
call esi
push dword [ebp - 0x202c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x4024bc
push 0x30
push str.Scopevisio_Launcher_Error
push str.Could_not_close_temp_file
push eax
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004031d7
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x2018]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004031d7
mov esp, ebp
pop ebp
ret