Function at 0x4d1280
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 edi, [esp + 0x50]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x88], 0
mov dword [esp + 0x44], 8
sub eax, edx
mov dword [esp + 0x90], eax
mov al, 1
nop word cs:[eax + eax]
nop dword [eax + eax]
mov ebx, eax
call sub.kernel32.dll_GetCurrentProcessId
mov dword [esp + 0x94], eax
mov eax, dword [0x5880e4]
test eax, eax
je 0x4d132e
jmp 0x4d13b8
mov esi, eax
push 0
push dword [esp + 0x54]
call sub.bcrypt.dll_BCryptCloseAlgorithmProvider
nop dword [eax]
xorps xmm0, xmm0
movaps xmmword [esp + 0x50], xmm0
push 0
push 0x10
push edi
push esi
call sub.bcrypt.dll_BCryptGenRandom
test eax, eax
js 0x4d1390
mov eax, dword [esp + 0x50]
xchg dword [0x5880e4], eax
mov eax, dword [0x5880e4]
test eax, eax
jne 0x4d13b8
mov esi, dword [0x5880ec]
cmp esi, 0xffffffff
mov dword [esp + 0x50], esi
je 0x4d1370
test esi, esi
jne 0x4d1300
push 0
push 0
push 0x568dd4
push edi
call sub.bcrypt.dll_BCryptOpenAlgorithmProvider
test eax, eax
js 0x4d1377
mov ecx, dword [esp + 0x50]
xor eax, eax
lock cmpxchg dword [0x5880ec], ecx
jne 0x4d12ec
mov esi, dword [esp + 0x50]
jmp 0x4d1300
mov eax, 0xc00000bb
jmp 0x4d1390
mov dword [0x5880ec], 0xffffffff
nop word cs:[eax + eax]
nop dword [eax + eax]
lea ecx, [esp + 0x98]
mov edx, eax
call fcn.004d5bb0
mov eax, dword [esp + 0x98]
xchg dword [0x5880e4], eax
mov eax, dword [0x5880e4]
test eax, eax
je 0x4d132e
mov eax, 1
lock xadd dword [0x5880e4], eax
mov dword [esp + 0x50], 0x568c7c
mov dword [esp + 0x54], 2
mov dword [esp + 0x58], 0
mov dword [esp + 0x28], eax
lea eax, [esp + 0x94]
mov dword [esp + 0x78], eax
lea eax, [esp + 0x28]
mov dword [esp + 0x7c], 0x41b090
mov dword [esp + 0x80], eax
lea eax, [esp + 0x78]
mov dword [esp + 0x84], 0x41b090
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], 2
push edi
lea eax, [esp + 0x18]
push eax
call fcn.004089e0
add esp, 8
movsd xmm0, qword [esp + 0x14]
mov eax, dword [esp + 0x1c]
test bl, 1
movsd qword [esp + 0x50], xmm0
mov dword [esp + 0x58], eax
jne 0x4d1459
cmp dword [esp + 0x34], 0
je 0x4d1459
push dword [esp + 0x30]
push 0
push dword [0x5880e0]
call sub.kernel32.dll_HeapFree
movsd xmm0, qword [esp + 0x50]
mov ecx, dword [esp + 0x58]
movsd qword [esp + 0x30], xmm0
test ecx, ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 8], ecx
mov edi, dword [esp + 0x30]
lea eax, [edi + ecx]
mov dword [esp + 0x48], eax
je 0x4d1490
movzx ebx, byte [edi]
test bl, bl
js 0x4d14b0
inc edi
mov dword [esp + 0xc], edi
jmp 0x4d150c
xor ebx, ebx
mov dword [esp + 0x20], 0
xor ecx, ecx
mov dword [esp + 0xc], 0
xor esi, esi
jmp 0x4d1535
movzx edx, byte [edi + 1]
mov eax, ebx
and eax, 0x1f
and edx, 0x3f
cmp bl, 0xdf
jbe 0x4d14fe
movzx ecx, byte [edi + 2]
shl edx, 6
and ecx, 0x3f
or ecx, edx
cmp bl, 0xf0
jb 0x4d18d3
movzx ebx, byte [edi + 3]
and eax, 7
shl ecx, 6
add edi, 4
shl eax, 0x12
mov dword [esp + 0xc], edi
and ebx, 0x3f
or ebx, ecx
or ebx, eax
cmp ebx, 0xffff
jbe 0x4d150c
jmp 0x4d18ed
shl eax, 6
add edi, 2
or eax, edx
mov dword [esp + 0xc], edi
mov ebx, eax
mov eax, 1
xor edi, edi
mov esi, dword [esp + 0x48]
mov ecx, 0xffffffff
sub esi, dword [esp + 0xc]
add esi, 3
cmovb esi, ecx
mov ecx, edi
shr esi, 2
add esi, eax
mov ax, 1
mov dword [esp + 0x20], eax
cmp esi, 4
mov eax, 3
cmovb esi, eax
cmp esi, 0x3ffffffe
ja 0x4d1a9a
lea edi, [esi + esi + 2]
test edi, edi
js 0x4d1a9a
mov dword [esp + 0x2c], ecx
mov eax, dword [0x5880e0]
test eax, eax
jne 0x4d1577
call sub.kernel32.dll_GetProcessHeap
test eax, eax
je 0x4d1a8d
mov dword [0x5880e0], eax
push edi
push 0
push eax
call sub.kernel32.dll_HeapAlloc
test eax, eax
je 0x4d1a8d
mov edx, esi
mov esi, dword [esp + 0xc]
mov word [eax], bx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x14], eax
inc edx
cmp dword [esp + 8], 0
mov dword [esp + 0x18], edx
mov dword [esp + 0x28], esi
je 0x4d1830
mov ecx, dword [esp + 0x2c]
lea edi, [esp + 0x50]
mov dword [esp + 8], 1
jmp 0x4d15d9
mov ebx, edx
mov edx, dword [esp + 0x4c]
mov word [edx + eax*2], cx
inc eax
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x4c], edx
mov edx, ebx
mov dword [esp + 8], eax
test esi, esi
lea eax, [esp + 0x28]
cmovne esi, eax
je 0x4d1630
test cx, cx
je 0x4d1600
mov dword [esp + 0x24], 0
jmp 0x4d164a
mov eax, ecx
mov ecx, dword [esi]
cmp ecx, dword [esp + 0x48]
je 0x4d1621
lea eax, [ecx + 1]
mov dword [esi], eax
movzx eax, byte [ecx]
test al, al
js 0x4d1755
mov ecx, eax
jmp 0x4d17c5
mov ecx, eax
mov dword [esp + 0x28], 0
nop dword [eax + eax]
cmp word [esp + 0x20], 1
jne 0x4d1820
mov dword [esp + 0x24], ecx
xor ecx, ecx
mov dword [esp + 0x20], 0
mov eax, dword [esp + 8]
mov esi, dword [esp + 0x28]
cmp eax, edx
jne 0x4d15c0
test esi, esi
mov dword [esp + 0x2c], ecx
je 0x4d1696
mov eax, dword [esp + 0x48]
mov ecx, 0xffffffff
sub eax, esi
add eax, 3
cmovb eax, ecx
xor ebx, ebx
shr eax, 2
cmp word [esp + 0x20], 0
setne bl
cmp word [esp + 0x24], 1
sbb ebx, 0xffffffff
add ebx, eax
inc ebx
add ebx, edx
jae 0x4d16aa
jmp 0x4d1a72
xor ebx, ebx
cmp word [esp + 0x20], 0
setne bl
inc ebx
add ebx, edx
jb 0x4d1a72
mov dword [esp + 0xc], esi
mov esi, dword [esp + 0x18]
mov eax, 4
mov dword [esp + 0x10], edx
lea ecx, [esi + esi]
cmp ecx, ebx
cmova ebx, ecx
cmp ebx, 5
cmovb ebx, eax
xor eax, eax
cmp ebx, 0x40000000
lea edx, [ebx + ebx]
setb al
add eax, eax
test esi, esi
je 0x4d16f4
mov edi, dword [esp + 0x14]
mov dword [esp + 0x50], edi
mov dword [esp + 0x54], ecx
lea edi, [esp + 0x50]
mov ecx, 2
jmp 0x4d16f6
xor ecx, ecx
mov dword [esp + 0x58], ecx
lea ecx, [esp + 0x78]
push edi
push eax
call fcn.004b1750
add esp, 8
cmp dword [esp + 0x78], 0
mov edx, dword [esp + 0x7c]
je 0x4d173c
mov eax, dword [esp + 0x80]
mov ecx, dword [esp + 0x2c]
cmp eax, 0x80000001
jne 0x4d1a68
mov ebx, esi
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0xc]
mov eax, dword [esp + 8]
jmp 0x4d15c6
mov esi, dword [esp + 0xc]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 8]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ebx
jmp 0x4d15c6
mov dword [esp + 0x10], edx
lea edx, [ecx + 2]
mov ebx, eax
mov dword [esi], edx
mov edx, esi
and ebx, 0x1f
movzx esi, byte [ecx + 1]
and esi, 0x3f
cmp al, 0xdf
jbe 0x4d17ba
mov edi, edx
lea edx, [ecx + 3]
shl esi, 6
mov dword [edi], edx
mov dword [esp + 0xc], edi
movzx edx, byte [ecx + 2]
and edx, 0x3f
or edx, esi
cmp al, 0xf0
jb 0x4d17e2
mov eax, dword [esp + 0xc]
lea esi, [ecx + 4]
and ebx, 7
shl edx, 6
shl ebx, 0x12
mov dword [eax], esi
movzx ecx, byte [ecx + 3]
and ecx, 0x3f
or ecx, edx
or ecx, ebx
mov edx, dword [esp + 0x10]
lea edi, [esp + 0x50]
cmp ecx, 0xffff
jbe 0x4d17c5
jmp 0x4d17f9
mov edx, dword [esp + 0x10]
shl ebx, 6
or ebx, esi
mov ecx, ebx
mov eax, dword [esp + 8]
mov dword [esp + 0x24], 0
mov esi, dword [esp + 0x28]
cmp eax, edx
jne 0x4d15c0
jmp 0x4d165a
shl ebx, 0xc
or edx, ebx
mov ecx, edx
mov edx, dword [esp + 0x10]
lea edi, [esp + 0x50]
cmp ecx, 0xffff
jbe 0x4d17c5
add ecx, 0xffff0000
mov eax, ecx
and ecx, 0x3ff
shr eax, 0xa
or ecx, 0xdc00
mov dword [esp + 0x24], ecx
or eax, 0xd800
mov ecx, eax
jmp 0x4d164a
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x10], ecx
jmp 0x4d183c
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x10], edx
lea edi, [esp + 0x50]
push 0
push 0
push 0x10000
push 0x10000
push 1
push dword [esp + 0x58]
push dword [esp + 0xa8]
mov ebx, eax
push eax
call sub.kernel32.dll_CreateNamedPipeW
cmp eax, 0xffffffff
mov dword [esp + 8], eax
jne 0x4d196d
mov eax, dword [esp + 0x88]
lea esi, [eax + 1]
call sub.kernel32.dll_GetLastError
mov edx, dword [esp + 0x10]
cmp esi, 0xa
jge 0x4d1918
cmp eax, 5
jne 0x4d18a0
mov dword [esp + 0x88], esi
jmp 0x4d18b4
cmp dword [esp + 0x44], 0
je 0x4d1918
cmp eax, 0x57
mov dword [esp + 0x44], 0
jne 0x4d1918
xor eax, eax
test edx, edx
je 0x4d12d0
push ebx
push 0
push dword [0x5880e0]
call sub.kernel32.dll_HeapFree
xor eax, eax
jmp 0x4d12d0
shl eax, 0xc
add edi, 3
or ecx, eax
mov dword [esp + 0xc], edi
mov ebx, ecx
cmp ebx, 0xffff
jbe 0x4d150c
add ebx, 0xffff0000
mov eax, 2
mov ecx, ebx
and ebx, 0x3ff
shr ecx, 0xa
or ebx, 0xdc00
or ecx, 0xd800
mov edi, ebx
mov ebx, ecx
jmp 0x4d1513
mov ecx, dword [esp + 0x40]
movsd xmm0, qword [0x566650]
test edx, edx
mov dword [ecx + 8], eax
movsd qword [ecx], xmm0
je 0x4d193d
push ebx
push 0
push dword [0x5880e0]
call sub.kernel32.dll_HeapFree
cmp dword [esp + 0x34], 0
mov esi, dword [esp + 8]
je 0x4d1959
push dword [esp + 0x30]
push 0
push dword [0x5880e0]
call sub.kernel32.dll_HeapFree
cmp esi, 0xffffffff
je 0x4d1a27
push esi
call sub.kernel32.dll_CloseHandle
jmp 0x4d1a27
cmp dword [esp + 0x10], 0
je 0x4d1982
push ebx
push 0
push dword [0x5880e0]
call sub.kernel32.dll_HeapFree
mov eax, dword [esp + 0x8c]
xorps xmm0, xmm0
lea esi, [esp + 0x78]
mov dword [esp + 0x78], 0xc
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 1
movlps qword [esp + 0x50], xmm0
mov dword [esp + 0x6c], 0
mov word [esp + 0x70], 0
mov dword [esp + 0x64], 0
mov byte [esp + 0x6d], al
xor al, 1
mov byte [esp + 0x6c], al
movlps qword [esp + 0x5c], xmm0
mov dword [esp + 0x68], esi
mov esi, dword [esp + 0x30]
mov edx, esi
lea ecx, [esp + 0x14]
push edi
push dword [esp + 0x3c]
call fcn.004ceae0
add esp, 8
movzx eax, byte [esp + 0x14]
cmp al, 4
jne 0x4d1a2f
cmp dword [esp + 0x34], 0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 8]
mov dword [ecx + 4], edx
mov dword [ecx + 8], eax
mov dword [ecx], 0
je 0x4d1a27
push esi
push 0
push dword [0x5880e0]
call sub.kernel32.dll_HeapFree
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x18]
movzx edx, byte [esp + 0x17]
mov esi, dword [esp + 0x40]
movzx edi, word [esp + 0x15]
mov byte [esi + 7], dl
mov word [esi + 5], di
mov byte [esi + 4], al
mov dword [esi + 8], ecx
mov dword [esi], 1
cmp dword [esp + 0x34], 0
mov esi, dword [esp + 8]
jne 0x4d1948
jmp 0x4d1959
mov ecx, edx
mov edx, dword [esp + 0x10]
test eax, eax
jne 0x4d1a7d
mov dword [esp + 0x1c], edx
call fcn.004085b0
jmp 0x4d1a9f
mov dword [esp + 0x1c], edx
push eax
push ecx
call fcn.004085f0
add esp, 8
jmp 0x4d1a9f
push 2
push edi
call fcn.004085f0
add esp, 8
jmp 0x4d1a9f
call fcn.004085b0
ud2