Function at 0x140037950
Capabilities:
Create pipe
Generate random numbers via winapi

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x128
lea rbp, [rsp + 0x80]
movaps xmmword [rbp + 0x90], xmm6
mov qword [rbp + 0x88], 0xfffffffffffffffe
mov qword [rbp + 0x38], rcx
mov byte [rbp + 0x85], dl
movzx eax, dl
mov ecx, 0x40080002
sub ecx, eax
mov dword [rbp + 0x34], ecx
xor edi, edi
mov ebx, 8
mov sil, 1
xorps xmm6, xmm6
mov r14, qword [sym.imp.bcrypt.dll_BCryptGenRandom]
xor eax, eax
mov qword [rbp - 0x18], rax
nop
call qword [sym.imp.kernel32.dll_GetCurrentProcessId]
mov dword [rbp + 0x28], eax
jmp 0x1400379cb
mov rax, qword [rbp + 0x40]
xchg qword [0x14165a008], rax
mov rax, qword [0x14165a008]
test rax, rax
jne 0x140037a10
movaps xmmword [rbp + 0x40], xmm6
xor ecx, ecx
lea rdx, [rbp + 0x40]
mov r8d, 0x10
mov r9d, 2
call r14
test eax, eax
jns 0x1400379c0
mov byte [rbp + 0x87], dil
mov byte [rbp + 0x86], 1
call fcn.1400391b0
jmp 0x1400379c4
mov eax, 1
lock xadd qword [0x14165a008], rax
mov qword [rbp - 0x20], rax
lea rax, [rbp + 0x28]
mov qword [rbp - 0x10], rax
lea rax, [0x140010c40]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x20]
mov qword [rbp], rax
lea rax, [fcn.14000f5b0]
mov qword [rbp + 8], rax
lea rax, [0x14163f670]
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x48], 2
mov qword [rbp + 0x60], 0
lea rax, [rbp - 0x10]
mov qword [rbp + 0x50], rax
mov qword [rbp + 0x58], 2
mov byte [rbp + 0x87], dil
mov byte [rbp + 0x86], 1
lea rcx, [rbp - 0x40]
lea rdx, [rbp + 0x40]
call fcn.14000eac0
movups xmm0, xmmword [rbp - 0x40]
movaps xmmword [rbp + 0x40], xmm0
mov rax, qword [rbp - 0x30]
cmp qword [rbp + 0x18], 0
mov qword [rbp + 0x50], rax
sete al
or sil, al
test sil, 1
jne 0x140037ac2
mov r8, qword [rbp + 0x10]
mov rcx, qword [0x14165a000]
xor edx, edx
call qword [sym.imp.kernel32.dll_HeapFree]
mov rax, qword [rbp + 0x50]
mov qword [rbp + 0x20], rax
movaps xmm0, xmmword [rbp + 0x40]
movaps xmmword [rbp + 0x10], xmm0
mov r14, qword [rbp + 0x10]
lea r12, [r14 + rax]
test rax, rax
mov dword [rbp + 0x2c], ebx
je 0x140037b00
movzx ecx, byte [r14]
movzx edi, cl
test dil, dil
js 0x140037b20
inc r14
jmp 0x140037b7c
xor ebx, ebx
xor r13d, r13d
xor edi, edi
xor r14d, r14d
xor r15d, r15d
jmp 0x140037ba4
mov eax, edi
and eax, 0x1f
movzx edx, byte [r14 + 1]
and edx, 0x3f
cmp dil, 0xdf
jbe 0x140037b71
movzx edi, byte [r14 + 2]
shl edx, 6
and edi, 0x3f
or edi, edx
cmp cl, 0xf0
jb 0x140037eaa
movzx ecx, byte [r14 + 3]
add r14, 4
and eax, 7
shl eax, 0x12
shl edi, 6
and ecx, 0x3f
or ecx, edi
or ecx, eax
mov edi, ecx
cmp edi, 0xffff
jbe 0x140037b7c
jmp 0x140037ebf
add r14, 2
shl eax, 6
or eax, edx
mov edi, eax
mov eax, 1
xor ebx, ebx
mov r15, r12
sub r15, r14
add r15, 3
mov rcx, 0xffffffffffffffff
cmovb r15, rcx
shr r15, 2
add r15, rax
mov r13w, 1
cmp r15, 4
mov eax, 3
cmovb r15, rax
movabs rax, 0x3fffffffffffffff
cmp r15, rax
jae 0x140038070
inc r15
lea rsi, [r15 + r15]
movzx eax, byte [0x14165a0a0]
mov edx, 2
mov rcx, rsi
call fcn.14000e2d0
test rax, rax
je 0x140038053
mov rcx, rax
mov rax, qword [rbp - 0x18]
inc eax
mov dword [rbp + 0x30], eax
mov word [rcx], di
mov esi, 1
mov qword [rbp + 0x78], rcx
jmp 0x140037c11
mov qword [rbp + 0x78], rcx
mov eax, ebx
mov word [rcx + rsi*2], ax
inc rsi
mov ebx, edi
test r14, r14
je 0x140037c80
test bx, bx
je 0x140037c60
xor edi, edi
cmp rsi, r15
jne 0x140037c06
mov qword [rbp + 0x70], r15
mov r15, r12
sub r15, r14
add r15, 3
mov rax, 0xffffffffffffffff
cmovb r15, rax
shr r15, 2
cmp di, 1
sbb r15, 0xffffffffffffffff
cmp r13w, 1
sbb r15, 0xffffffffffffffff
jmp 0x140037ca3
cmp r14, r12
je 0x140037c80
movzx edx, byte [r14]
movzx ebx, dl
test bl, bl
js 0x140037d45
inc r14
jmp 0x140037c1b
cmp r13w, 1
jne 0x140037df0
xor r14d, r14d
xor eax, eax
cmp rsi, r15
jne 0x140037cf0
mov qword [rbp + 0x70], r15
xor r13d, r13d
mov edi, ebx
xor ebx, ebx
xor r15d, r15d
inc r15
add r15, rsi
jb 0x140038041
mov rax, qword [rbp + 0x70]
add rax, rax
cmp rax, r15
cmova r15, rax
cmp r15, 5
jae 0x140037cc9
mov r15d, 4
xor edx, edx
mov rcx, r15
shr rcx, 0x3e
sete cl
cmp qword [rbp + 0x70], 0
je 0x140037cfa
mov r8, qword [rbp + 0x78]
mov qword [rbp + 0x40], r8
mov qword [rbp + 0x50], rax
mov eax, 2
jmp 0x140037cfc
mov edi, ebx
xor r13d, r13d
jmp 0x140037c08
xor eax, eax
lea r8, [r15 + r15]
mov dl, cl
add rdx, rdx
mov qword [rbp + 0x48], rax
lea rcx, [rbp - 0x10]
lea r9, [rbp + 0x40]
call fcn.140024530
cmp qword [rbp - 0x10], 0
mov rcx, qword [rbp - 8]
je 0x140037c02
movabs rax, 0x8000000000000001
cmp rcx, rax
jne 0x14003803c
mov r15, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
jmp 0x140037c06
mov eax, ebx
and eax, 0x1f
movzx r8d, byte [r14 + 1]
and r8d, 0x3f
cmp bl, 0xdf
jbe 0x140037d95
movzx ebx, byte [r14 + 2]
shl r8d, 6
and ebx, 0x3f
or ebx, r8d
cmp dl, 0xf0
jb 0x140037da6
movzx edx, byte [r14 + 3]
add r14, 4
and eax, 7
shl eax, 0x12
shl ebx, 6
and edx, 0x3f
or edx, ebx
or edx, eax
mov ebx, edx
cmp ebx, 0xffff
jbe 0x140037c1b
jmp 0x140037dbb
add r14, 2
shl eax, 6
or eax, r8d
mov ebx, eax
jmp 0x140037c1b
add r14, 3
shl eax, 0xc
or ebx, eax
cmp ebx, 0xffff
jbe 0x140037c1b
lea eax, [rbx + 0xff0000]
shr eax, 0xa
or eax, 0xd800
and ebx, 0x3ff
or ebx, 0xdc00
mov edi, ebx
mov ebx, eax
cmp rsi, r15
jne 0x140037c06
jmp 0x140037c22
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x10000
mov dword [rsp + 0x20], 0x10000
mov rcx, qword [rbp + 0x78]
mov edx, dword [rbp + 0x34]
mov ebx, dword [rbp + 0x2c]
mov r8d, ebx
mov r9d, 1
call qword [sym.imp.kernel32.dll_CreateNamedPipeW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140037f5a
call qword [sym.imp.kernel32.dll_GetLastError]
mov rcx, rax
shl rcx, 0x20
or rcx, 2
mov edx, dword [rbp + 0x30]
cmp edx, 0xa
jge 0x140037ee8
cmp eax, 5
jne 0x140037e70
mov eax, edx
mov qword [rbp - 0x18], rax
mov r14, qword [sym.imp.bcrypt.dll_BCryptGenRandom]
jmp 0x140037e82
test ebx, ebx
mov r14, qword [sym.imp.bcrypt.dll_BCryptGenRandom]
je 0x140037ee8
xor ebx, ebx
cmp eax, 0x57
jne 0x140037ee8
mov dil, 1
xor esi, esi
test r15, r15
je 0x1400379b0
mov rcx, qword [0x14165a000]
xor esi, esi
xor edx, edx
mov r8, qword [rbp + 0x78]
call qword [sym.imp.kernel32.dll_HeapFree]
jmp 0x1400379b0
add r14, 3
shl eax, 0xc
or edi, eax
cmp edi, 0xffff
jbe 0x140037b7c
lea ecx, [rdi + 0xff0000]
shr ecx, 0xa
or ecx, 0xd800
and edi, 0x3ff
or edi, 0xdc00
mov eax, 2
mov ebx, edi
mov edi, ecx
jmp 0x140037b83
mov rax, qword [rbp + 0x38]
mov qword [rax + 8], rcx
mov qword [rax], 1
mov rdi, 0xffffffffffffffff
test r15, r15
je 0x140037f16
mov rcx, qword [0x14165a000]
xor edx, edx
mov r8, qword [rbp + 0x78]
call qword [sym.imp.kernel32.dll_HeapFree]
cmp qword [rbp + 0x18], 0
je 0x140037f30
mov r8, qword [rbp + 0x10]
mov rcx, qword [0x14165a000]
xor edx, edx
call qword [sym.imp.kernel32.dll_HeapFree]
cmp rsi, 0xffffffffffffffff
je 0x140037f3f
mov rcx, rdi
call qword [sym.imp.kernel32.dll_CloseHandle]
movaps xmm6, xmmword [rbp + 0x90]
add rsp, 0x128
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
test r15, r15
je 0x140037f72
mov rcx, qword [0x14165a000]
xor edx, edx
mov r8, qword [rbp + 0x78]
call qword [sym.imp.kernel32.dll_HeapFree]
mov dword [rbp + 0x40], 0
mov dword [rbp + 0x60], 0
mov word [rbp + 0x64], 0
movzx eax, byte [rbp + 0x85]
mov byte [rbp + 0x61], al
xor al, 1
mov byte [rbp + 0x60], al
xorps xmm0, xmm0
movups xmmword [rbp + 0x50], xmm0
mov dword [rbp - 0x10], 0x18
mov qword [rbp - 8], 0
mov dword [rbp], 1
lea rax, [rbp - 0x10]
mov qword [rbp + 0x48], rax
mov rdi, qword [rbp + 0x10]
mov rdx, qword [rbp + 0x20]
mov qword [rbp - 0x28], rsi
mov byte [rbp + 0x87], 1
mov byte [rbp + 0x86], 0
lea r8, [rbp + 0x40]
mov rcx, rdi
call fcn.14002b3b0
test rax, rax
je 0x140038007
mov rax, qword [rbp + 0x38]
mov qword [rax + 8], rdx
mov qword [rax], 1
mov rdi, rsi
cmp qword [rbp + 0x18], 0
jne 0x140037f1d
jmp 0x140037f30
mov rax, qword [rbp + 0x38]
mov qword [rax + 8], rsi
mov qword [rax + 0x10], rdx
mov qword [rax], 0
cmp qword [rbp + 0x18], 0
je 0x140037f3f
mov rcx, qword [0x14165a000]
xor edx, edx
mov r8, rdi
call qword [sym.imp.kernel32.dll_HeapFree]
jmp 0x140037f3f
test rcx, rcx
jne 0x140038048
call fcn.14000e490
jmp 0x140038083
mov rdx, qword [rbp]
call fcn.14007a3f0
jmp 0x140038083
mov byte [rbp + 0x87], 1
mov byte [rbp + 0x86], 1
mov ecx, 2
mov rdx, rsi
call fcn.14007a3f0
jmp 0x140038083
mov byte [rbp + 0x87], 1
mov byte [rbp + 0x86], 1
call fcn.14000e490
ud2