Function at 0x140030030
Capabilities:
Access peb ldr_data
Encode data using xor
Generate random numbers using the delphi lcg
Get kernel32 base address
Hash data with crc32
Parse pe header
Resolve function by parsing pe exports

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r15
sub rsp, 0x88
mov rax, qword [0x140181020]
xor rax, rsp
mov qword [rsp + 0x78], rax
cmp byte [rcx + 0x41], 0
mov r12, rdx
mov r15d, r8d
mov rbx, rcx
je 0x140030145
mov rcx, qword [rcx + 0x50]
mov rax, rcx
test rcx, rcx
je 0x140030083
cmp dword [rbx + 0x58], r15d
jae 0x140030083
call fcn.14012f66c
mov qword [rbx + 0x50], 0
jmp 0x140030088
test rax, rax
jne 0x140030099
lea ecx, [r15 + r15]
call fcn.14012fbb0
mov qword [rbx + 0x50], rax
mov dword [rbx + 0x58], r15d
mov r8, r15
mov rdx, r12
mov rcx, rax
mov rdi, r15
call fcn.140131900
test r15d, r15d
je 0x14003013f
xor r11d, r11d
lea rbp, [0x14015f7b0]
mov rsi, r15
mov rax, qword [rbx + 0x50]
lea r11, [r11 + 1]
mov edx, dword [rbx + 0x44]
mov ecx, edx
mov r9d, dword [rbx + 0x4c]
mov r8d, r9d
shr edx, 8
movsx r10, byte [r11 + rax - 1]
and r9d, 0xfffd
xor rcx, r10
or r9d, 2
movzx eax, cl
xor edx, dword [rbp + rax*4]
movzx eax, dl
add eax, dword [rbx + 0x48]
imul eax, eax, 0x8088405
mov dword [rbx + 0x44], edx
inc eax
mov ecx, eax
shr rcx, 0x18
mov dword [rbx + 0x48], eax
movzx eax, r8b
xor rcx, rax
shr r8d, 8
xor r8d, dword [rbp + rcx*4]
mov ecx, r9d
xor ecx, 1
mov dword [rbx + 0x4c], r8d
mov rax, qword [rbx + 0x50]
imul ecx, r9d
shr ecx, 8
xor cl, r10b
mov byte [r11 + rax - 1], cl
sub rsi, 1
jne 0x1400300c0
mov r12, qword [rbx + 0x50]
jmp 0x140030148
mov rdi, r15
mov rdx, qword [rbx + 0x30]
test rdx, rdx
je 0x140030185
mov ecx, dword [rbx + 0x38]
lea eax, [rcx + r15]
cmp eax, dword [rbx + 0x3c]
jb 0x14003016b
mov dword [rbx + 0x24], 0x30000
xor eax, eax
jmp 0x1400302e7
add rcx, rdx
mov r8, rdi
mov rdx, r12
call fcn.140131900
add dword [rbx + 0x38], r15d
mov eax, r15d
jmp 0x1400302e7
mov qword [rsp + 0xd8], r13
mov r13, qword [rbx + 8]
test r13, r13
je 0x1400302d6
lea rdx, [0x14015f748]
mov qword [rsp + 0x80], r14
lea rcx, [rsp + 0x30]
call fcn.140034cc0
mov rcx, rax
call fcn.14001c8d0
mov rcx, qword gs:[0x60]
mov rsi, rax
mov rdx, qword [rcx + 0x18]
mov rcx, qword [rdx + 0x10]
mov rdi, qword [rcx]
cmp qword [rdi + 0x60], 0
je 0x1400302ad
mov eax, 0x5a4d
nop dword [rax]
nop word [rax + rax]
mov r11, qword [rdi + 0x30]
mov rdi, qword [rdi]
test r11, r11
je 0x1400302a2
cmp word [r11], ax
jne 0x1400302ad
movsxd rax, dword [r11 + 0x3c]
cmp dword [rax + r11], 0x4550
jne 0x1400302ad
mov ecx, dword [rax + r11 + 0x88]
test ecx, ecx
je 0x1400302ad
mov ebp, dword [r11 + rcx + 0x1c]
lea rax, [r11 + rcx]
mov r9d, dword [rax + 0x20]
add rbp, r11
mov r14d, dword [rax + 0x24]
add r9, r11
mov ebx, dword [rax + 0x18]
add r14, r11
xor r10d, r10d
test ebx, ebx
je 0x14003029d
mov eax, dword [r9]
xor r8b, r8b
add rax, r11
cmp byte [rax], r8b
je 0x140030291
mov rdx, rsi
sub rdx, rax
movzx ecx, byte [rax + rdx]
test cl, cl
je 0x14003028c
cmp byte [rax], cl
jne 0x140030291
inc rax
mov r8b, 1
cmp byte [rax], 0
jne 0x140030264
movsxd rax, r10d
movzx ecx, word [r14 + rax*2]
mov eax, dword [rbp + rcx*4]
add rax, r11
jmp 0x1400302af
test r8b, r8b
jne 0x14003027b
inc r10d
add r9, 4
cmp r10d, ebx
jb 0x140030250
mov eax, 0x5a4d
cmp qword [rdi + 0x60], 0
jne 0x1400301f0
xor eax, eax
lea r9, [rsp + 0x70]
mov qword [rsp + 0x20], 0
mov r8d, r15d
mov rdx, r12
mov rcx, r13
call rax
mov eax, dword [rsp + 0x70]
mov r14, qword [rsp + 0x80]
jmp 0x1400302df
mov dword [rbx + 0x24], 0x1000000
xor eax, eax
mov r13, qword [rsp + 0xd8]
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.14012f610
add rsp, 0x88
pop r15
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret