Function at 0x140051060
Capabilities:
Check http status code
Check os version
Initialize winhttp library
Prepare http request
Read http header
Receive http response

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x168]
sub rsp, 0x268
mov rax, qword [0x140095040]
xor rax, rsp
mov qword [rbp + 0x150], rax
mov r14, r9
mov rdi, r8
mov rbx, rdx
mov rsi, rcx
mov rax, qword [rbp + 0x1e0]
mov qword [rsp + 0x68], rax
mov rax, qword [rbp + 0x1e8]
mov qword [rsp + 0x70], rax
mov rax, qword [rbp + 0x1f0]
mov qword [rsp + 0x50], rax
mov rcx, qword [rbp + 0x1f8]
mov qword [rsp + 0x78], rcx
mov rax, qword [rbp + 0x200]
mov qword [rsp + 0x48], rax
mov rax, qword [rbp + 0x208]
mov qword [rbp - 0x80], rax
mov r15, qword [rbp + 0x210]
mov rax, qword [rbp + 0x218]
mov qword [rsp + 0x58], rax
mov rcx, qword [rbp + 0x220]
mov qword [rsp + 0x60], rcx
mov rax, qword [rbp + 0x228]
mov qword [rbp - 0x70], rax
mov rax, qword [rbp + 0x230]
mov qword [rbp - 0x78], rax
xor eax, eax
mov r12d, eax
mov dword [rbp - 0xc], eax
mov dword [rsp + 0x44], eax
mov dword [rbp - 0x38], eax
mov dword [rbp - 8], eax
mov r13d, eax
mov dword [rbp], 0x11c
lea rcx, [rbp]
call qword [sym.imp.ntdll.dll_RtlGetVersion]
xor ecx, ecx
test eax, eax
mov eax, ecx
jne 0x14005114d
cmp dword [rbp + 0xc], 0x2580
setbe al
lea edx, [rax*4]
mov rax, qword [rsp + 0x48]
mov dword [rax], ecx
cmp qword [rbx + 0x18], 7
jbe 0x140051165
mov rbx, qword [rbx]
mov dword [rsp + 0x20], ecx
xor r9d, r9d
xor r8d, r8d
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov rbx, rax
mov qword [rbp - 0x60], rax
test rax, rax
je 0x140051ae2
cmp qword [rdi + 0x18], 7
jbe 0x140051192
mov rdi, qword [rdi]
xor r9d, r9d
movzx r8d, word [rbp + 0x1d0]
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov rdi, rax
mov qword [rbp - 0x68], rax
test rax, rax
je 0x140051a9c
movzx ecx, byte [rbp + 0x1d8]
shl ecx, 0x17
cmp qword [r14 + 0x18], 7
jbe 0x1400511cd
mov r14, qword [r14]
cmp qword [rsi + 0x18], 7
jbe 0x1400511d7
mov rsi, qword [rsi]
bts ecx, 8
mov dword [rsp + 0x30], ecx
xor eax, eax
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rax
xor r9d, r9d
mov r8, r14
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov r14, rax
test rax, rax
jne 0x14005121c
mov rcx, rdi
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
jmp 0x140051b25
xor ebx, ebx
mov edi, ebx
mov dword [rsp + 0x40], ebx
mov r10d, 1
test r13d, r13d
je 0x1400512be
mov rcx, qword [rsp + 0x58]
cmp qword [rcx + 0x10], 0
je 0x1400512be
mov rdx, qword [rsp + 0x60]
mov rax, rdx
cmp qword [rdx + 0x18], 7
jbe 0x140051251
mov rax, qword [rdx]
mov r9, rcx
cmp qword [rcx + 0x18], 7
jbe 0x14005125e
mov r9, qword [rcx]
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
mov r8d, r13d
mov edx, r10d
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpSetCredentials]
test eax, eax
jne 0x1400512be
cmp qword [r15 + 0x18], 0x1c
jb 0x1400512aa
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x1c
lea r8d, [rax + 0x38]
lea rdx, str.WinHttpSetCredentials_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x38], ax
xor ebx, ebx
jmp 0x1400512be
lea r9, str.WinHttpSetCredentials_fails_
mov edx, 0x1c
mov rcx, r15
call fcn.140052460
mov r10, qword [rsp + 0x68]
mov r8, qword [r10 + 0x10]
mov rdx, qword [rsp + 0x70]
mov ecx, dword [rdx + 0x10]
mov rax, qword [rdx + 0x18]
mov r9, rdx
test r8, r8
jne 0x1400512eb
cmp rax, 0xf
jbe 0x1400512e4
mov r9, qword [rdx]
xor r8d, r8d
xor edx, edx
jmp 0x140051301
cmp rax, 0xf
jbe 0x1400512f4
mov r9, qword [rdx]
mov rdx, r10
cmp qword [r10 + 0x18], 7
jbe 0x140051301
mov rdx, qword [r10]
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], ecx
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
mov esi, eax
test eax, eax
jne 0x14005135a
cmp qword [r15 + 0x18], 0x19
jb 0x14005134c
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x19
lea r8d, [rax + 0x32]
lea rdx, str.WinHttpSendRequest_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x32], ax
xor ebx, ebx
jmp 0x1400513ae
lea r9, str.WinHttpSendRequest_fails_
mov edx, 0x19
jmp 0x1400513a6
xor edx, edx
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
mov esi, eax
test eax, eax
jne 0x1400513c7
cmp qword [r15 + 0x18], 0x1d
jb 0x14005139a
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x1d
lea r8d, [rax + 0x3a]
lea rdx, str.WinHttpReceiveResponse_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x3a], ax
xor ebx, ebx
jmp 0x1400513ae
lea r9, str.WinHttpReceiveResponse_fails_
mov edx, 0x1d
mov rcx, r15
call fcn.140052460
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2f00
je 0x140051a57
test esi, esi
je 0x140051a48
mov dword [rbp - 0x38], 4
mov qword [rsp + 0x28], rbx
lea rax, [rbp - 0x38]
mov qword [rsp + 0x20], rax
mov r9, qword [rsp + 0x48]
xor r8d, r8d
mov edx, 0x20000013
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov esi, eax
test eax, eax
jne 0x14005143b
cmp qword [r15 + 0x18], 0x1a
jb 0x140051427
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x1a
lea r8d, [rax + 0x34]
lea rdx, str.WinHttpQueryHeaders_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x34], ax
xor ebx, ebx
jmp 0x14005143b
lea r9, str.WinHttpQueryHeaders_fails_
mov edx, 0x1a
mov rcx, r15
call fcn.140052460
mov qword [rsp + 0x28], rbx
lea rax, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 0x16]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x1400514a7
mov edx, dword [rbp - 0x38]
inc edx
mov rbx, qword [rsp + 0x78]
mov rcx, rbx
call fcn.140051c20
mov r9, rbx
cmp qword [rbx + 0x18], 7
jbe 0x140051486
mov r9, qword [rbx]
xor ebx, ebx
mov qword [rsp + 0x28], rbx
lea rax, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor r8d, r8d
lea edx, [rbx + 0x16]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
mov esi, eax
test esi, esi
je 0x140051a48
xorps xmm0, xmm0
movups xmmword [rbp - 0x30], xmm0
mov qword [rbp - 0x20], rbx
mov qword [rbp - 0x18], 0xf
mov byte [rbp - 0x30], 0
mov rdi, qword [rsp + 0x50]
mov rax, rdi
cmp qword [rdi + 0x18], 0xf
jbe 0x1400514d8
mov rax, qword [rdi]
mov qword [rdi + 0x10], rbx
mov byte [rax], 0
jmp 0x1400514e3
xor ebx, ebx
mov dword [rbp - 0x38], ebx
lea rdx, [rbp - 0x38]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpQueryDataAvailable]
test eax, eax
jne 0x1400515e6
cmp qword [r15 + 0x18], 0x24
jb 0x14005152a
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x24
lea r8d, [rax + 0x48]
lea rdx, str.Error_in_WinHttpQueryDataAvailable:
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x48], ax
xor ebx, ebx
jmp 0x14005153e
lea r9, str.Error_in_WinHttpQueryDataAvailable:
mov edx, 0x24
mov rcx, r15
call fcn.140052460
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r10, [rbp + 0x14a]
nop
sub r10, 2
mov eax, 0xcccccccd
mul r9d
shr edx, 3
movzx ecx, dx
shl cx, 2
lea r8d, [rcx + rdx]
add r8w, r8w
sub r9w, r8w
add r9w, 0x30
mov word [r10], r9w
mov r9d, edx
test edx, edx
jne 0x140051550
lea r8, [rbp + 0x14a]
mov rdx, r10
lea rcx, [rbp - 0x58]
call fcn.140052e00
or r12d, 3
lea rdx, [rbp - 0x58]
mov rcx, r15
call fcn.140052150
nop
mov rdx, qword [rbp - 0x40]
cmp rdx, 7
jbe 0x1400515e6
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x58]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400515e1
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140051a62
call fcn.140072944
mov eax, dword [rbp - 0x38]
mov rcx, qword [rbp - 0x80]
add dword [rcx], eax
test eax, eax
je 0x1400517d9
lea rax, [rbp - 0x30]
cmp qword [rbp - 0x18], 0xf
cmova rax, qword [rbp - 0x30]
mov qword [rbp - 0x20], rbx
mov byte [rax], 0
mov ecx, dword [rbp - 0x38]
mov rdx, qword [rbp - 0x20]
cmp rcx, rdx
ja 0x140051630
lea rax, [rbp - 0x30]
cmp qword [rbp - 0x18], 0xf
cmova rax, qword [rbp - 0x30]
mov qword [rbp - 0x20], rcx
mov byte [rax + rcx], 0
jmp 0x140051685
mov rdi, rcx
sub rdi, rdx
mov r8, qword [rbp - 0x18]
mov rax, r8
sub rax, rdx
cmp rdi, rax
ja 0x14005166c
mov qword [rbp - 0x20], rcx
lea rbx, [rbp - 0x30]
cmp r8, 0xf
cmova rbx, qword [rbp - 0x30]
add rbx, rdx
mov r8, rdi
xor edx, edx
mov rcx, rbx
call sub.VCRUNTIME140.dll_memset
mov byte [rbx + rdi], 0
jmp 0x140051680
mov byte [rsp + 0x20], 0
mov r9, rdi
mov rdx, rdi
lea rcx, [rbp - 0x30]
call fcn.1400527a0
mov rdi, qword [rsp + 0x50]
lea rcx, [rbp - 0x30]
cmp qword [rbp - 0x18], 0xf
cmova rcx, qword [rbp - 0x30]
mov r8d, dword [rbp - 0x38]
xor edx, edx
call sub.VCRUNTIME140.dll_memset
lea rdx, [rbp - 0x30]
cmp qword [rbp - 0x18], 0xf
cmova rdx, qword [rbp - 0x30]
lea r9, [rbp - 8]
mov r8d, dword [rbp - 0x38]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpReadData]
test eax, eax
jne 0x1400517b5
cmp qword [r15 + 0x18], 0x1a
jb 0x1400516f2
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x1a
lea r8d, [rax + 0x34]
lea rdx, str.Error_in_WinHttpReadData:
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x34], ax
jmp 0x140051706
lea r9, str.Error_in_WinHttpReadData:
mov edx, 0x1a
mov rcx, r15
call fcn.140052460
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
lea r9, [rbp + 0x14a]
nop word [rax + rax]
sub r9, 2
mov eax, 0xcccccccd
mul ecx
shr edx, 3
movzx eax, dx
shl ax, 2
lea r8d, [rax + rdx]
add r8w, r8w
sub cx, r8w
add cx, 0x30
mov word [r9], cx
mov ecx, edx
test edx, edx
jne 0x140051720
lea r8, [rbp + 0x14a]
mov rdx, r9
lea rcx, [rbp - 0x58]
call fcn.140052e00
or r12d, 0xc
lea rdx, [rbp - 0x58]
mov rcx, r15
call fcn.140052150
nop
mov rdx, qword [rbp - 0x40]
cmp rdx, 7
jbe 0x1400517cf
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x58]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400517ae
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140051a62
call fcn.140072944
jmp 0x1400517cf
lea rdx, [rbp - 0x30]
cmp qword [rbp - 0x18], 0xf
cmova rdx, qword [rbp - 0x30]
mov r8, qword [rbp - 0x20]
mov rcx, rdi
call fcn.140052350
cmp dword [rbp - 0x38], 0
ja 0x1400514e1
mov rcx, qword [rsp + 0x48]
mov ecx, dword [rcx]
sub ecx, 0x191
je 0x1400518b8
cmp ecx, 6
je 0x140051801
mov eax, 1
mov edi, eax
mov dword [rsp + 0x40], eax
jmp 0x140051a11
lea r9, [rbp - 0x10]
lea r8, [rbp - 0xc]
lea rdx, [rbp - 0x34]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpQueryAuthSchemes]
mov esi, eax
test eax, eax
jne 0x14005185f
cmp qword [r15 + 0x18], 0x2a
jb 0x140051849
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x2a
lea r8d, [rax + 0x54]
lea rdx, str.WinHttpQueryAuthSchemes_in_case_407_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x54], ax
jmp 0x14005189a
lea r9, str.WinHttpQueryAuthSchemes_in_case_407_fails_
mov edx, 0x2a
mov rcx, r15
call fcn.140052460
jmp 0x14005189a
mov eax, dword [rbp - 0x34]
test al, 0x10
je 0x14005186e
mov r13d, 0x10
jmp 0x14005189a
test al, 2
je 0x14005187a
mov r13d, 2
jmp 0x14005189a
test al, 4
je 0x140051886
mov r13d, 4
jmp 0x14005189a
test al, 8
je 0x140051892
mov r13d, 8
jmp 0x14005189a
movzx r13d, al
and r13d, 1
cmp dword [rsp + 0x44], 0x197
jne 0x140051a0d
mov eax, 1
mov edi, eax
mov dword [rsp + 0x40], eax
jmp 0x140051a11
lea r9, [rbp - 0x10]
lea r8, [rbp - 0xc]
lea rdx, [rbp - 0x34]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpQueryAuthSchemes]
mov esi, eax
test eax, eax
jne 0x140051931
cmp qword [r15 + 0x18], 0x2a
jb 0x140051900
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x2a
lea r8d, [rax + 0x54]
lea rdx, str.WinHttpQueryAuthSchemes_in_case_401_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x54], ax
jmp 0x140051914
lea r9, str.WinHttpQueryAuthSchemes_in_case_401_fails_
mov edx, 0x2a
mov rcx, r15
call fcn.140052460
mov edi, dword [rsp + 0x40]
mov eax, 1
cmp dword [rsp + 0x44], 0x191
cmove edi, eax
mov dword [rsp + 0x40], edi
jmp 0x140051a11
mov eax, dword [rbp - 0x34]
test al, 0x10
je 0x140051940
mov r8d, 0x10
jmp 0x140051972
test al, 2
je 0x14005194c
mov r8d, 2
jmp 0x140051972
test al, 4
je 0x140051958
mov r8d, 4
jmp 0x140051972
test al, 8
je 0x140051964
mov r8d, 8
jmp 0x140051972
test al, 1
je 0x1400519f5
mov r8d, 1
mov rcx, qword [rbp - 0x78]
mov rax, rcx
cmp qword [rcx + 0x18], 7
jbe 0x140051983
mov rax, qword [rcx]
mov rcx, qword [rbp - 0x70]
mov r9, rcx
cmp qword [rcx + 0x18], 7
jbe 0x140051994
mov r9, qword [rcx]
xor edi, edi
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rax
mov edx, dword [rbp - 0x10]
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpSetCredentials]
mov esi, eax
test eax, eax
jne 0x140051914
cmp qword [r15 + 0x18], 0x28
jb 0x1400519e4
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x28
lea r8d, [rdi + 0x50]
lea rdx, str.WinHttpSetCredentials_in_case_401_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
mov word [rbx + 0x50], di
jmp 0x140051914
lea r9, str.WinHttpSetCredentials_in_case_401_fails_
mov edx, 0x28
jmp 0x14005190c
mov eax, 1
mov edi, eax
cmp dword [rsp + 0x44], 0x191
cmove edi, eax
mov dword [rsp + 0x40], edi
jmp 0x140051a11
mov edi, dword [rsp + 0x40]
mov rdx, qword [rbp - 0x18]
cmp rdx, 0xf
jbe 0x140051a48
inc rdx
mov rcx, qword [rbp - 0x30]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140051a43
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140051a69
call fcn.140072944
mov rax, qword [rsp + 0x48]
mov eax, dword [rax]
mov dword [rsp + 0x44], eax
test esi, esi
je 0x140051a70
test edi, edi
jne 0x140051a70
xor ebx, ebx
jmp 0x140051224
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
nop
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, r14
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov rcx, qword [rbp - 0x60]
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
test esi, esi
je 0x140051b25
mov al, 1
jmp 0x140051b27
mov rcx, rbx
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
cmp qword [r15 + 0x18], 0x15
jb 0x140051ad4
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x15
mov r8d, 0x2a
lea rdx, str.WinHttpConnect_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x2a], ax
jmp 0x140051b25
lea r9, str.WinHttpConnect_fails_
mov edx, 0x15
jmp 0x140051b1d
cmp qword [r15 + 0x18], 0x12
jb 0x140051b11
mov rbx, qword [r15]
mov qword [r15 + 0x10], 0x12
mov r8d, 0x24
lea rdx, str.WinHttpOpen_fails_
mov rcx, rbx
call sub.VCRUNTIME140.dll_memmove
xor eax, eax
mov word [rbx + 0x24], ax
jmp 0x140051b25
lea r9, str.WinHttpOpen_fails_
mov edx, 0x12
mov rcx, r15
call fcn.140052460
xor al, al
mov rcx, qword [rbp + 0x150]
xor rcx, rsp
call fcn.140072530
add rsp, 0x268
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret