Function at 0x14003e870
Capabilities:
Initialize winhttp library
Prepare http request
Set http header

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xf0
mov rdi, rdx
mov rbp, rcx
mov edx, 1
mov ecx, 0x98
mov rsi, r8
call fcn.1401762f4
lea r12, [rsp + 0x118]
or r14d, 0xffffffff
add r12, 0xfffffffffffffff8
mov dword [rsp + 0x138], r14d
xor r15d, r15d
lea r8, [fcn.14003e000]
mov rcx, r12
mov dword [rsp + 0x40], r15d
lea rdx, [rsp + 0x58]
mov rbx, rax
call fcn.140029110
lea r8, [fcn.14002ae10]
mov qword [rsp + 0x58], rax
lea rdx, [rsp + 0x60]
mov rcx, r12
call fcn.140029110
lea r8, [fcn.14002ae10]
mov qword [rsp + 0x60], rax
lea rdx, [rsp + 0x48]
mov rcx, r12
call fcn.140029110
xor edx, edx
mov qword [rsp + 0x48], rax
lea r8d, [r14 + 0x79]
lea rcx, [rsp + 0x70]
call fcn.140174d10
cmp dword [0x140279468], r15d
jne 0x14003e93c
xor edx, edx
lea rcx, [0x140279470]
call sub.KERNEL32.dll_InitializeCriticalSection
lea rcx, [rbx + 0x70]
mov dword [0x140279468], 1
xor edx, edx
call sub.KERNEL32.dll_InitializeCriticalSection
lea r8, [0x14003ee30]
mov rdx, rbx
lea rcx, [rbx + 0x58]
call fcn.14003aa70
lea rcx, [rbx + 0x28]
call fcn.1400444a0
test eax, eax
jne 0x14003ed44
lea edx, [rax + 1]
lea ecx, [rax + 0x60]
call fcn.1401762f4
mov qword [rbx + 0x38], rax
mov dword [rax + 0x58], r14d
test rsi, rsi
je 0x14003e999
mov rcx, rsi
call fcn.14003e7d0
mov qword [rbx + 0x30], rsi
mov rax, qword gs:[0x58]
lea rsi, [rsp + 0x70]
test rdi, rdi
mov rdx, rbp
cmovne rsi, rdi
xor r8d, r8d
mov r14, qword [rax]
mov eax, 0x120
mov qword [rax + r14], rdi
mov rdi, rsi
mov qword [rbx + 0x48], rsi
mov rcx, qword [rsp + 0x58]
call fcn.140059460
test eax, eax
jne 0x14003ea99
mov rax, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x58]
mov qword [rax], r15
mov rdi, qword [rsi + 0x70]
test rdi, rdi
je 0x14003ea1c
mov rcx, r12
mov r15d, 3
call fcn.140029530
mov rcx, rax
lea rdx, str.http:___s
mov r8, rdi
call fcn.14002a330
mov rcx, qword [rsp + 0x48]
mov rdx, qword [rax]
call fcn.14002ae40
mov rdx, qword [rsi + 0x68]
test rdx, rdx
je 0x14003ea32
mov rcx, r12
call fcn.1400296d0
mov rcx, qword [rax]
jmp 0x14003ea39
lea rcx, str.wget
mov r8, qword [rsp + 0x48]
xor r9d, r9d
mov edx, r15d
mov dword [rsp + 0x20], 0x10000000
mov r8, qword [r8]
call qword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov qword [rbx + 0x20], rax
mov rdi, rsi
test rax, rax
je 0x14003ea99
xor r9d, r9d
lea rdx, [0x14003ef30]
mov r8d, 0x6f0c00
mov rcx, rax
call qword [sym.imp.WINHTTP.dll_WinHttpSetStatusCallback]
mov rcx, rax
call fcn.1401712b0
cmp rax, 0xffffffffffffffff
jne 0x14003eaa9
lea rdx, str.WinHttpSetStatusCallback_failed__m
mov ecx, 0x5d0003
call fcn.14002d450
mov ebp, dword [rsp + 0x138]
or r14d, 0xffffffff
jmp 0x14003ed47
mov r9d, 4
mov dword [rsp + 0x40], 0x800
mov rcx, qword [rbx + 0x20]
lea r8, [rsp + 0x40]
lea edx, [r9 + 0x50]
call qword [sym.imp.WINHTTP.dll_WinHttpSetOption]
movsxd rcx, eax
call fcn.140171260
test rax, rax
jne 0x14003eae8
lea rdx, str.WinHttpSetOption_tls_failed__m
mov ecx, 0x5d0003
call fcn.14002d450
lea rdx, str.PORT
mov rcx, rbp
call fcn.14003e0e0
mov edi, eax
mov eax, pe_nt_image_headers64
mov dword [rax + r14], edi
lea r14, [0x1401aaeb0]
test edi, edi
jne 0x14003eb46
lea rdx, str.PROTOCOL
mov rcx, rbp
call fcn.14003e080
xor ecx, ecx
nop
movzx edx, byte [rax + rcx]
inc rcx
cmp dl, byte [r14 + rcx - 1]
jne 0x14003eb39
cmp rcx, 6
jne 0x14003eb20
cmp dl, byte [r14 + rcx - 1]
mov edi, 0x50
mov eax, 0x1bb
cmove edi, eax
lea rdx, str.HOSTNAME
mov rcx, rbp
call fcn.14003e080
mov rdx, rax
mov rcx, r12
call fcn.1400296d0
mov rcx, qword [rbx + 0x20]
xor r9d, r9d
movzx r8d, di
mov rdx, qword [rax]
call qword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov rcx, rax
call fcn.1401712b0
mov qword [rbx + 0x18], rax
test rax, rax
jne 0x14003eba9
lea rdx, str.WinHttpConnect_failed__m
mov ecx, 0x5d0003
call fcn.14002d450
mov ebp, dword [rsp + 0x138]
or r14d, 0xffffffff
mov rdi, rsi
jmp 0x14003ed47
lea rdx, [0x1401aaef4]
mov rcx, rbp
call fcn.14003e080
mov rdx, rax
mov rcx, r12
call fcn.1400296d0
lea rdx, str.PROTOCOL
mov rcx, rbp
mov rdi, rax
call fcn.14003e080
xor ecx, ecx
nop word [rax + rax]
movzx edx, byte [rax + rcx]
inc rcx
cmp dl, byte [r14 + rcx - 1]
jne 0x14003ebf9
cmp rcx, 6
jne 0x14003ebe0
cmp dl, byte [r14 + rcx - 1]
mov r8, qword [rdi]
lea rdx, [0x1401aaf08]
mov eax, 0
mov ecx, 0x800000
cmove eax, ecx
cmp qword [rsi + 8], 0
mov dword [rsp + 0x30], eax
lea rcx, [0x1401aaef8]
cmovne rdx, rcx
mov qword [rsp + 0x28], 0
mov rcx, qword [rbx + 0x18]
xor r9d, r9d
mov qword [rsp + 0x20], 0
call qword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov rcx, rax
call fcn.1401712b0
mov qword [rbx + 0x10], rax
test rax, rax
jne 0x14003ec78
lea rdx, str.WinHttpOpenRequest_failed__m
mov ecx, 0x5d0003
call fcn.14002d450
mov ebp, dword [rsp + 0x138]
or r14d, 0xffffffff
mov rdi, rsi
jmp 0x14003ed47
lock inc dword [rbx + 0x58]
mov rcx, qword [rsp + 0x60]
lea rdx, str.Connection:_close
call fcn.14002ae40
mov rcx, qword [rbx + 0x10]
mov r9d, 0xa0000000
or r8d, 0xffffffff
mov rdx, qword [rax]
call qword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
mov rax, qword [rsi]
test rax, rax
je 0x14003ece8
mov rdi, rsi
mov r9, qword [rax + 0x10]
lea rdx, str._s:__s
mov r8, qword [rax + 8]
mov rcx, r12
call fcn.140029660
mov rcx, qword [rbx + 0x10]
mov r9d, 0xa0000000
or r8d, 0xffffffff
mov rdx, qword [rax]
call qword [sym.imp.WINHTTP.dll_WinHttpAddRequestHeaders]
mov rdi, qword [rdi]
mov rax, qword [rdi]
test rax, rax
jne 0x14003ecaf
mov eax, dword [rsi + 0x10]
xor r8d, r8d
mov r9, qword [rsi + 8]
xor edx, edx
mov rcx, qword [rbx + 0x10]
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], eax
call qword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
movsxd rcx, eax
call fcn.140171260
test rax, rax
jne 0x14003ed39
lea rdx, str.WinHttpSendRequest_failed__m
mov ecx, 0x5d0003
call fcn.14002d450
mov ebp, dword [rsp + 0x138]
or r14d, 0xffffffff
mov rdi, rsi
jmp 0x14003ed47
xor ebp, ebp
mov rdi, rsi
or r14d, 0xffffffff
jmp 0x14003ed47
mov ebp, r14d
lea rcx, [0x140279470]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x140279460]
test rax, rax
je 0x14003ed78
mov rax, qword [rax]
mov qword [rbx], rax
mov rax, qword [0x140279460]
mov qword [rax], rbx
mov rax, qword [rbx]
mov qword [rax + 8], rbx
jmp 0x14003ed82
mov qword [rbx], rbx
mov qword [0x140279460], rbx
xor esi, esi
lea rcx, [0x140279470]
mov qword [rbx + 8], rsi
call sub.KERNEL32.dll_LeaveCriticalSection
test ebp, ebp
jne 0x14003edcd
test rdi, rdi
je 0x14003ede0
cmp dword [rdi + 0x30], esi
je 0x14003ede0
mov rax, qword [rbx + 0x48]
mov dword [rsp + 0x50], 5
test rax, rax
je 0x14003edcd
mov r8d, dword [rax + 0x30]
test r8d, r8d
je 0x14003edcd
mov ecx, dword [rbx + 0x28]
lea rdx, [rsp + 0x50]
call fcn.140044c10
test eax, eax
jne 0x14003ede0
mov rcx, qword [rbx + 0x10]
test rcx, rcx
je 0x14003ede0
call qword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov qword [rbx + 0x10], rsi
lea rcx, [rbx + 0x70]
call sub.KERNEL32.dll_EnterCriticalSection
lea rcx, [rbx + 0x70]
mov dword [rbx + 0x50], 1
call sub.KERNEL32.dll_LeaveCriticalSection
lock xadd dword [rbx + 0x58], r14d
cmp r14d, 1
jne 0x14003ee0c
mov rcx, qword [rbx + 0x60]
call qword [rbx + 0x68]
lea r11, [rsp + 0xf0]
mov eax, ebp
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret