Function at 0x1003a8f0
Capabilities:
Initialize winhttp library
Prepare http request
Print debug messages
Receive http response
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x10090fc0
push 0x1005aa50
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x103c
call fcn.10055c30
mov eax, dword [0x1009cbc0]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x20], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov dword [ebp - 0x104c], edx
mov dword [ebp - 0x1050], ecx
mov edi, dword [ebp + 8]
mov dword [ebp - 0x1048], 0
mov dword [ebp - 0x1044], 0
mov dword [ebp - 0x1040], 0
mov dword [ebp - 0x1038], 0xffffffff
mov dword [ebp - 0x102c], 0
xor eax, eax
mov dword [ebp - 0x103c], eax
xor esi, esi
mov dword [ebp - 0x1028], esi
mov dword [ebp - 0x1034], eax
mov dword [ebp - 0x1030], eax
mov dword [ebp - 4], eax
mov dword [ebp - 4], 1
push 0x2f
push ecx
call fcn.1005204d
add esp, 8
mov ebx, eax
test ebx, ebx
jne 0x1003a9c3
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
lea eax, [esi + 8]
jmp 0x1003b00b
xor eax, eax
mov word [ebx], ax
push dword [ebp - 0x1050]
push 0x400
lea eax, [ebp - 0x1024]
push eax
call fcn.10053320
add esp, 0xc
mov eax, 0x2f
mov word [ebx], ax
push ebx
push 0x400
lea eax, [ebp - 0x824]
push eax
call fcn.10053320
add esp, 0xc
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ecx, eax
mov dword [ebp - 0x1048], ecx
test ecx, ecx
jne 0x1003aad2
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
jne 0x1003aa5b
push str.Memory_allocation_error_in_log_file_n
call fcn.10052604
add esp, 4
push str.Memory_allocation_error_in_log_file_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x1003aab7
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x199
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
push str.Error__d_in_swprintf_s_n
call fcn.10052604
add esp, 8
push str.Error_in_swprintf_s_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push esi
call fcn.10052152
add esp, 4
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
lea eax, [ebx + 0x1e]
jmp 0x1003b00b
push 0
mov eax, edi
neg eax
sbb eax, eax
and eax, 0x16b
add eax, 0x50
push eax
lea eax, [ebp - 0x1024]
push eax
push ecx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [ebp - 0x1044], eax
test eax, eax
jne 0x1003ab63
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
je 0x1003aa41
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x19d
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
neg edi
sbb edi, edi
and edi, 0x800000
push edi
push 0
push 0
push 0
lea ecx, [ebp - 0x824]
push ecx
push 0x1008efc8
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebx, eax
mov dword [ebp - 0x1040], ebx
test ebx, ebx
jne 0x1003abfb
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
je 0x1003aa41
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x1a2
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x1003ac7a
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
je 0x1003aa41
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x1a5
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
push 0
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x1003acef
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
je 0x1003aa41
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x1a8
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp - 0x104c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1038], eax
cmp eax, 0xffffffff
jne 0x1003ad80
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
je 0x1003aa41
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x1ac
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
lea eax, [ebp - 0x102c]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
je 0x1003af17
mov edi, dword [ebp - 0x102c]
test edi, edi
je 0x1003af17
lea eax, [edi + 0x14]
push eax
call fcn.1005218a
add esp, 4
mov esi, eax
mov dword [ebp - 0x1028], esi
test esi, esi
jne 0x1003ae67
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
jne 0x1003aded
push str.Memory_allocation_error_in_log_file_n
call fcn.10052604
add esp, 4
push str.Memory_allocation_error_in_log_file_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x1003ae4a
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push 5
test eax, eax
jle 0x1003ae29
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x1b2
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003ae41
push str.Error__d_in_swprintf_s_n
call fcn.10052604
add esp, 8
push str.Error_in_swprintf_s_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push esi
call fcn.10052152
add esp, 4
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, 5
jmp 0x1003b00b
lea eax, [edi + 0xa]
push eax
push 0
push esi
call fcn.10055aa0
add esp, 0xc
lea eax, [ebp - 0x1034]
push eax
push dword [ebp - 0x102c]
push esi
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x1003aef4
mov eax, dword [ebp - 0x1034]
cmp dword [ebp - 0x102c], eax
jne 0x1003aef4
push 0
lea ecx, [ebp - 0x1030]
push ecx
push eax
push esi
push dword [ebp - 0x1038]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1003aef4
mov eax, dword [ebp - 0x1030]
cmp eax, dword [ebp - 0x1034]
jne 0x1003aef4
push esi
call fcn.10052152
add esp, 4
xor esi, esi
mov dword [ebp - 0x1028], esi
mov eax, dword [ebp - 0x103c]
add eax, dword [ebp - 0x1030]
mov dword [ebp - 0x103c], eax
mov dword [ebp - 0x1054], eax
jmp 0x1003ad80
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
lea eax, [esi + 0x1e]
jmp 0x1003b00b
mov eax, dword [ebp - 0x103c]
test eax, eax
jne 0x1003af89
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov ebx, eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
je 0x1003aa41
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x1003aa96
mov byte [esi + 0xffff], 0
push esi
push str.DownloadFile
push 1
mov edx, 0x1c2
mov ecx, str...StandAloneSvcUpgrade.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x1003aaae
mov dword [ebp - 4], 0
call fcn.1003afa3
jmp 0x1003b002
mov dword [ebp - 4], 0xfffffffe
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x20]
xor ecx, ebp
call fcn.1005132c
mov esp, ebp
pop ebp
ret