Function at 0x1015b270
Capabilities:
Create pipe
Generate random numbers via winapi
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0xb0
mov eax, 0x40080002
lea esi, [esp + 0x98]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x84], edx
mov dword [esp + 0x50], 0
mov dword [esp + 0x34], 8
sub eax, edx
mov dword [esp + 0x88], eax
mov al, 1
nop word cs:[eax + eax]
nop dword [eax + eax]
mov edi, eax
call sub.KERNEL32.dll_GetCurrentProcessId
mov dword [esp + 0x90], eax
mov eax, dword [0x1038a11c]
test eax, eax
je 0x1015b2f3
jmp 0x1015b32c
mov eax, dword [esp + 0x60]
xchg dword [0x1038a11c], eax
mov eax, dword [0x1038a11c]
test eax, eax
jne 0x1015b32c
xorps xmm0, xmm0
movaps xmmword [esp + 0x60], xmm0
push 2
push 0x10
lea eax, [esp + 0x68]
push eax
push 0
call sub.bcrypt.dll_BCryptGenRandom
test eax, eax
jns 0x1015b2e0
mov ecx, esi
call fcn.10160000
mov eax, dword [esp + 0x98]
xchg dword [0x1038a11c], eax
mov eax, dword [0x1038a11c]
test eax, eax
je 0x1015b2f3
mov eax, 1
lock xadd dword [0x1038a11c], eax
mov dword [esp + 0x60], 0x1034c158
mov dword [esp + 0x64], 2
mov dword [esp + 0x70], 0
mov dword [esp + 0x94], eax
lea eax, [esp + 0x90]
mov dword [esp + 0x40], eax
lea eax, [esp + 0x94]
mov dword [esp + 0x44], 0x1002d590
mov dword [esp + 0x48], eax
lea eax, [esp + 0x40]
mov dword [esp + 0x4c], 0x1002d590
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], 2
lea eax, [esp + 0x60]
push eax
lea eax, [esp + 0x58]
push eax
call fcn.1001ac00
add esp, 8
mov eax, dword [esp + 0x5c]
movsd xmm0, qword [esp + 0x54]
mov dword [esp + 0x68], eax
mov eax, edi
movsd qword [esp + 0x60], xmm0
test al, 1
jne 0x1015b3d2
cmp dword [esp + 0x24], 0
je 0x1015b3d2
push dword [esp + 0x20]
push 0
push dword [0x1038a110]
call sub.KERNEL32.dll_HeapFree
movsd xmm0, qword [esp + 0x60]
mov eax, dword [esp + 0x68]
movsd qword [esp + 0x20], xmm0
test eax, eax
mov dword [esp + 0x28], eax
mov ebx, dword [esp + 0x20]
lea ecx, [ebx + eax]
mov dword [esp + 0x38], ecx
je 0x1015b400
movzx ecx, byte [ebx]
test cl, cl
js 0x1015b420
inc ebx
jmp 0x1015b47a
xor ecx, ecx
mov dword [esp + 8], 0
mov dword [esp + 0xc], 0
xor ebx, ebx
xor edx, edx
jmp 0x1015b4a5
movzx edx, byte [ebx + 1]
mov eax, ecx
and eax, 0x1f
and edx, 0x3f
cmp cl, 0xdf
jbe 0x1015b470
mov esi, ecx
movzx ecx, byte [ebx + 2]
shl edx, 6
and ecx, 0x3f
or ecx, edx
mov edx, esi
cmp dl, 0xf0
jb 0x1015b81a
movzx edx, byte [ebx + 3]
shl ecx, 6
and eax, 7
add ebx, 4
shl eax, 0x12
and edx, 0x3f
or edx, ecx
mov ecx, edx
or ecx, eax
cmp ecx, 0xffff
jbe 0x1015b47a
jmp 0x1015b82e
shl eax, 6
add ebx, 2
or eax, edx
mov ecx, eax
mov dword [esp + 8], ecx
mov eax, 1
xor esi, esi
mov edx, dword [esp + 0x38]
mov ecx, 0xffffffff
sub edx, ebx
add edx, 3
cmovb edx, ecx
mov ecx, esi
shr edx, 2
add edx, eax
mov ax, 1
mov dword [esp + 0xc], eax
cmp edx, 4
mov eax, 3
cmovb edx, eax
cmp edx, 0x3ffffffe
ja 0x1015b9c5
lea esi, [edx + edx + 2]
test esi, esi
js 0x1015b9c5
mov eax, dword [0x103564a0]
mov dword [esp + 0x10], ecx
mov edi, edx
movzx eax, byte [eax]
mov eax, dword [0x1038a110]
test eax, eax
jne 0x1015b4f1
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1015b9b8
mov dword [0x1038a110], eax
push esi
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x1015b9b8
mov ecx, eax
mov eax, dword [esp + 0x50]
mov edx, dword [esp + 0xc]
mov esi, edi
mov dword [esp + 0x18], ecx
inc esi
inc eax
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 8]
mov dword [esp + 8], 1
mov word [ecx], ax
mov eax, ecx
mov ecx, dword [esp + 0x10]
jmp 0x1015b555
mov dword [esp + 0x3c], edi
mov edi, dword [esp + 8]
mov word [eax + edi*2], cx
inc edi
mov ecx, dword [esp + 0x3c]
mov dword [esp + 8], edi
test ebx, ebx
je 0x1015b5c0
test cx, cx
je 0x1015b5a0
xor edi, edi
cmp dword [esp + 8], esi
jne 0x1015b540
mov eax, dword [esp + 0x38]
mov dword [esp + 0x10], ecx
mov ecx, 0xffffffff
sub eax, ebx
add eax, 3
cmovb eax, ecx
xor ecx, ecx
shr eax, 2
test di, di
setne cl
cmp dx, 1
sbb ecx, 0xffffffff
add ecx, eax
inc ecx
add ecx, dword [esp + 8]
jae 0x1015b5eb
jmp 0x1015b9a2
cmp ebx, dword [esp + 0x38]
je 0x1015b5c0
movzx ecx, byte [ebx]
test cl, cl
js 0x1015b6a9
inc ebx
xor edi, edi
cmp dword [esp + 8], esi
jne 0x1015b540
jmp 0x1015b566
cmp dx, 1
jne 0x1015b780
mov edi, ecx
xor ecx, ecx
cmp dword [esp + 8], esi
jne 0x1015b640
xor edx, edx
mov dword [esp + 0x10], 0
xor ebx, ebx
inc ecx
add ecx, dword [esp + 8]
jb 0x1015b9a2
mov dword [esp + 0x1c], ebx
lea ebx, [esi + esi]
mov dword [esp + 0x3c], edi
mov edi, esi
mov eax, 4
mov dword [esp + 0xc], edx
cmp ebx, ecx
mov dword [esp + 0x14], edi
cmova ecx, ebx
cmp ecx, 5
mov esi, ecx
cmovb esi, eax
xor edx, edx
cmp esi, 0x40000000
lea eax, [esi + esi]
setb dl
add edx, edx
test edi, edi
je 0x1015b64d
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x60], ecx
mov ecx, 2
mov dword [esp + 0x68], ebx
jmp 0x1015b64f
xor edx, edx
xor ebx, ebx
mov dword [esp + 0x3c], edi
jmp 0x1015b544
xor ecx, ecx
mov dword [esp + 0x64], ecx
lea ebx, [esp + 0x60]
lea ecx, [esp + 0x40]
push ebx
push eax
call fcn.10133450
add esp, 8
cmp dword [esp + 0x40], 0
mov eax, dword [esp + 0x44]
je 0x1015b694
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
cmp eax, 0x80000001
jne 0x1015b99a
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
jmp 0x1015b544
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], eax
jmp 0x1015b544
mov dword [esp + 0x14], esi
movzx esi, byte [ebx + 1]
mov edi, ecx
mov dword [esp + 0x10], ecx
and edi, 0x1f
and esi, 0x3f
cmp cl, 0xdf
jbe 0x1015b708
movzx ecx, byte [ebx + 2]
shl esi, 6
mov dword [esp + 0xc], edx
and ecx, 0x3f
or ecx, esi
cmp byte [esp + 0x10], 0xf0
jb 0x1015b727
movzx esi, byte [ebx + 3]
and edi, 7
shl ecx, 6
add ebx, 4
shl edi, 0x12
and esi, 0x3f
or esi, ecx
or esi, edi
mov ecx, esi
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0xc]
cmp ecx, 0xffff
jbe 0x1015b55e
jmp 0x1015b743
shl edi, 6
add ebx, 2
or edi, esi
mov esi, dword [esp + 0x14]
mov ecx, edi
xor edi, edi
cmp dword [esp + 8], esi
jne 0x1015b540
jmp 0x1015b566
shl edi, 0xc
add ebx, 3
or ecx, edi
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0xc]
cmp ecx, 0xffff
jbe 0x1015b55e
mov dword [esp + 0x1c], ebx
mov edi, ecx
add ecx, 0xff0000
mov ebx, dword [esp + 0x1c]
shr ecx, 0xa
and edi, 0x3ff
or ecx, 0xd800
or edi, 0xdc00
cmp dword [esp + 8], esi
jne 0x1015b540
jmp 0x1015b566
push 0
push 0
push 0x10000
push 0x10000
push 1
push dword [esp + 0x48]
push dword [esp + 0xa0]
mov eax, dword [esp + 0x34]
mov ebx, eax
push eax
call sub.KERNEL32.dll_CreateNamedPipeW
mov edi, eax
cmp eax, 0xffffffff
jne 0x1015b8ab
call sub.KERNEL32.dll_GetLastError
mov ecx, dword [esp + 0x8c]
cmp ecx, 0xa
jge 0x1015b859
cmp eax, 5
jne 0x1015b7e0
mov eax, ecx
mov dword [esp + 0x50], ecx
jmp 0x1015b7f4
cmp dword [esp + 0x34], 0
je 0x1015b859
cmp eax, 0x57
mov dword [esp + 0x34], 0
jne 0x1015b859
xor eax, eax
test esi, esi
lea esi, [esp + 0x98]
je 0x1015b2c0
push ebx
push 0
push dword [0x1038a110]
call sub.KERNEL32.dll_HeapFree
xor eax, eax
jmp 0x1015b2c0
add ebx, 3
shl eax, 0xc
or ecx, eax
cmp ecx, 0xffff
jbe 0x1015b47a
mov esi, ecx
add ecx, 0xff0000
mov eax, 2
shr ecx, 0xa
and esi, 0x3ff
or ecx, 0xd800
or esi, 0xdc00
mov dword [esp + 8], ecx
jmp 0x1015b485
mov ecx, dword [esp + 0x30]
test esi, esi
mov dword [ecx + 8], eax
mov dword [ecx + 4], 0
mov dword [ecx], 1
je 0x1015b87f
push ebx
push 0
push dword [0x1038a110]
call sub.KERNEL32.dll_HeapFree
cmp dword [esp + 0x24], 0
je 0x1015b897
push dword [esp + 0x20]
push 0
push dword [0x1038a110]
call sub.KERNEL32.dll_HeapFree
cmp edi, 0xffffffff
je 0x1015b95d
push edi
call sub.KERNEL32.dll_CloseHandle
jmp 0x1015b95d
test esi, esi
je 0x1015b8bd
push ebx
push 0
push dword [0x1038a110]
call sub.KERNEL32.dll_HeapFree
mov eax, dword [esp + 0x84]
mov esi, dword [esp + 0x20]
mov dword [esp + 0x60], 0
mov dword [esp + 0x7c], 0
mov word [esp + 0x80], 0
xorps xmm0, xmm0
mov dword [esp + 0x40], 0xc
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 1
mov byte [esp + 0x7d], al
xor al, 1
mov byte [esp + 0x7c], al
lea eax, [esp + 0x40]
movups xmmword [esp + 0x68], xmm0
mov dword [esp + 0x78], eax
mov edx, esi
lea eax, [esp + 0x60]
lea ecx, [esp + 0x54]
push eax
push dword [esp + 0x2c]
call fcn.10158120
add esp, 8
movzx eax, byte [esp + 0x54]
cmp al, 4
jne 0x1015b965
mov ecx, dword [esp + 0x30]
cmp dword [esp + 0x24], 0
mov eax, dword [esp + 0x58]
mov dword [ecx + 4], edi
mov dword [ecx + 8], eax
mov dword [ecx], 0
je 0x1015b95d
push esi
push 0
push dword [0x1038a110]
call sub.KERNEL32.dll_HeapFree
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
movzx ecx, byte [esp + 0x57]
mov edx, dword [esp + 0x30]
movzx ebx, word [esp + 0x55]
mov esi, dword [esp + 0x58]
mov byte [edx + 7], cl
mov word [edx + 5], bx
mov byte [edx + 4], al
mov dword [edx + 8], esi
mov dword [edx], 1
cmp dword [esp + 0x24], 0
jne 0x1015b886
jmp 0x1015b897
mov esi, dword [esp + 0x14]
test eax, eax
jne 0x1015b9a9
call fcn.1001a7a0
jmp 0x1015b9ca
push dword [esp + 0x48]
push eax
call fcn.1001a7e0
add esp, 8
jmp 0x1015b9ca
push esi
push 2
call fcn.1001a7e0
add esp, 8
jmp 0x1015b9ca
call fcn.1001a7a0
ud2