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

Disassembly:
push rbx
push rsi
push rdi
push r15
mov eax, 0x1ad8
call fcn.140031460
sub rsp, rax
mov rax, qword [0x14007b080]
xor rax, rsp
mov qword [rsp + 0x1ac0], rax
mov rsi, rdx
mov rbx, rcx
xor r15d, r15d
lea rcx, str.A_WinHTTP_Example_Program_1.0
xor edx, edx
mov dword [rsp + 0x20], r15d
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov rdi, rax
test rax, rax
je 0x14000446f
xor edx, edx
mov qword [rsp + 0x1b10], rbp
lea rcx, [rsp + 0x50]
lea r8d, [rdx + 0x68]
call fcn.140032df0
lea rax, [rsp + 0xc0]
mov dword [rsp + 0x50], 0x68
mov qword [rsp + 0x68], rax
lea r9, [rsp + 0x50]
lea rax, [rsp + 0x2c0]
mov dword [rsp + 0x70], pe_nt_image_headers64
xor r8d, r8d
mov qword [rsp + 0x98], rax
xor edx, edx
mov dword [rsp + 0xa0], 0x400
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
movzx r8d, word [rsp + 0x74]
lea rdx, [rsp + 0xc0]
xor r9d, r9d
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov rbp, rax
test rax, rax
je 0x140004343
cmp dword [rsp + 0x64], 2
lea r8, [rsp + 0x2c0]
mov eax, r15d
lea rdx, [0x14006dea0]
mov ecx, 0x800000
cmove eax, ecx
xor r9d, r9d
mov dword [rsp + 0x30], eax
mov rcx, rbp
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], r15
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov rbx, rax
test rax, rax
jne 0x140004353
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor al, al
jmp 0x140004467
mov qword [rsp + 0x30], r15
xor r9d, r9d
mov dword [rsp + 0x28], r15d
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], r15d
mov rcx, rbx
mov qword [rsp + 0x1ad0], r14
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
setne r14b
test eax, eax
je 0x140004396
xor edx, edx
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
setne r14b
mov qword [rsp + 0x30], r15
xor r9d, r9d
mov dword [rsp + 0x28], 0x80
xor r8d, r8d
mov edx, 0x40000000
mov dword [rsp + 0x20], 2
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400043e7
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor al, al
jmp 0x14000445f
test r14b, r14b
je 0x140004437
nop dword [rax]
lea r9, [rsp + 0x40]
mov r8d, 0x1000
lea rdx, [rsp + 0xac0]
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
je 0x140004437
mov r8d, dword [rsp + 0x40]
test r8d, r8d
je 0x140004437
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0xac0]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x1400043f0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rbp
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
movzx eax, r14b
mov r14, qword [rsp + 0x1ad0]
mov rbp, qword [rsp + 0x1b10]
mov rcx, qword [rsp + 0x1ac0]
xor rcx, rsp
call fcn.140030cc0
add rsp, 0x1ad8
pop r15
pop rdi
pop rsi
pop rbx
ret