Function at 0x140022dc0
Capabilities:
Check os version

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x1c0
mov qword [rsp + 0x88], 0xfffffffffffffffe
mov qword [rsp + 0x218], rbx
mov rax, qword [0x140098b90]
xor rax, rsp
mov qword [rsp + 0x1b0], rax
mov rdi, r8
mov r14, rdx
mov r15, rcx
mov qword [rsp + 0x80], rdx
xor ebp, ebp
mov dword [rsp + 0x58], ebp
call fcn.1400280cc
mov rcx, rax
mov eax, ebp
test rcx, rcx
setne al
test eax, eax
jne 0x140022e2f
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rcx]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x38], rbx
call fcn.1400280cc
mov rcx, rax
mov eax, ebp
test rcx, rcx
setne al
test eax, eax
jne 0x140022e5d
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rcx]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x48], rax
call fcn.1400280cc
mov rcx, rax
mov eax, ebp
test rcx, rcx
setne al
test eax, eax
jne 0x140022e8b
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rcx]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
or rsi, 0xffffffffffffffff
test rdi, rdi
je 0x1400230aa
cmp word [rdi], 0
je 0x1400230aa
mov qword [rsp + 0x50], rbp
xor eax, eax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
mov dword [rsp + 0x78], 8
lea r8, [rsp + 0x68]
lea rdx, [rsp + 0x50]
mov rcx, rdi
call sub.WINSPOOL.DRV_OpenPrinterW
cmp eax, 1
jne 0x1400230aa
mov dword [rsp + 0x30], ebp
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ebp
xor r9d, r9d
xor edx, edx
lea r8d, [rsi + 3]
mov r12, qword [rsp + 0x50]
mov rcx, r12
call sub.WINSPOOL.DRV_GetPrinterDriverW
mov edx, dword [rsp + 0x30]
test edx, edx
je 0x14002300b
mov rdi, rdx
test edx, edx
je 0x14002300b
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r13, rax
test rax, rax
je 0x14002300b
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
je 0x14002300b
mov r8, rax
xor edx, edx
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_HeapSize]
mov r8, rax
xor edx, edx
mov rcx, rdi
call fcn.140056260
lea r11, [rsp + 0x30]
mov qword [rsp + 0x28], r11
mov eax, dword [rsp + 0x30]
mov dword [rsp + 0x20], eax
mov r9, rdi
xor edx, edx
lea r8d, [rsi + 3]
mov rcx, r12
call sub.WINSPOOL.DRV_GetPrinterDriverW
cmp eax, 1
jne 0x140022ff2
mov r8, qword [rdi + 0x20]
test r8, r8
je 0x140022ff2
lea rdx, [rsp + 0x60]
mov rcx, r15
call fcn.140022790
nop
mov rdx, rax
lea rcx, [rsp + 0x38]
call fcn.140003600
nop
mov rdx, qword [rsp + 0x60]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, esi
test eax, eax
jg 0x140022fe8
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rbx, qword [rsp + 0x38]
mov r12, qword [rsp + 0x50]
jmp 0x140022ff2
mov rbx, qword [rsp + 0x38]
mov r12, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
test rax, rax
je 0x14002300b
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [rbx - 0x10], 0
je 0x1400230a2
mov rcx, r12
call fcn.1400225d0
mov r13, rax
test rax, rax
je 0x14002305d
xor eax, eax
mov rcx, rsi
mov rdi, r13
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
mov rdx, r13
lea rcx, [rsp + 0x48]
call fcn.1400036f0
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
test rax, rax
je 0x14002305d
mov r8, r13
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
call fcn.140022470
mov r13, rax
test rax, rax
je 0x1400230a2
xor eax, eax
mov rcx, rsi
mov rdi, r13
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
mov rdx, r13
lea rcx, [rsp + 0x40]
call fcn.1400036f0
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
test rax, rax
je 0x1400230a2
mov r8, r13
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, r12
call sub.WINSPOOL.DRV_ClosePrinter
call fcn.1400280cc
mov rcx, rax
test rax, rax
setne bpl
test ebp, ebp
jne 0x1400230c8
mov ecx, 0x80004005
call fcn.140003280
int3
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [r14], rax
mov dword [rsp + 0x58], 1
cmp dword [rbx - 0x10], 0
je 0x1400231ba
mov rax, qword [rsp + 0x48]
cmp dword [rax - 0x10], 0
je 0x1400231ba
mov rax, qword [rsp + 0x40]
cmp dword [rax - 0x10], 0
je 0x1400231ba
lea rdx, str.EBAPI.DLL
mov rcx, rbx
call fcn.140052880
test eax, eax
je 0x1400231a2
lea rdx, str.EBAPI2.DLL
mov rcx, rbx
call fcn.140052880
test eax, eax
je 0x1400231a2
lea rdx, str.EBAPI3.DLL
mov rcx, rbx
call fcn.140052880
test eax, eax
je 0x1400231a2
xor edx, edx
mov r8d, 0x114
lea rcx, [rsp + 0x90]
call fcn.140056260
mov dword [rsp + 0x90], 0x114
lea rcx, [rsp + 0x90]
call qword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp eax, 1
jne 0x1400231a2
cmp dword [rsp + 0xa0], 2
jne 0x1400231a2
cmp dword [rsp + 0x94], 5
jb 0x1400231a2
mov r9, rbx
mov r8, qword [rsp + 0x48]
lea rdx, str._s_s
mov rcx, r14
call fcn.140009290
jmp 0x1400231ba
mov r9, rbx
mov r8, qword [rsp + 0x40]
lea rdx, str._s_s
mov rcx, r14
call fcn.140009290
nop
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x1400231db
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x1400231fc
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x38]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x14002321a
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, r14
mov rcx, qword [rsp + 0x1b0]
xor rcx, rsp
call fcn.140052690
mov rbx, qword [rsp + 0x218]
add rsp, 0x1c0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret