Function at 0x1400058a0
Capabilities:
Allocate or change rwx memory
Resolve function by parsing pe exports

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
movsxd r12, dword [rdx + 0x3c]
mov rdi, r8
add r12, rdx
mov dword [rsp + 0x20], 0x40
mov rbx, rdx
mov r9d, 0x3000
xor edx, edx
mov r13, rcx
mov r8d, dword [r12 + 0x50]
mov qword [rsp + 0x78], r8
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov rdx, qword [rsp + 0x78]
mov r9d, 0x40
mov r8d, 0x3000
mov qword [rsp + 0x80], rax
xor ecx, ecx
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r15, rax
test rdi, rdi
je 0x14000590f
mov qword [rdi], rsi
mov edx, dword [r12 + 0x54]
mov rcx, rbx
test rdx, rdx
je 0x140005941
mov r8, r15
sub r8, rbx
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [rcx]
mov byte [r8 + rcx], al
lea rcx, [rcx + 1]
sub rdx, 1
jne 0x140005930
movzx r9d, word [r12 + 0x14]
movzx r10d, word [r12 + 6]
add r9, 0x2c
test r10, r10
je 0x14000599b
add r9, r12
nop dword [rax]
mov ecx, dword [r9 - 8]
dec r10
mov edx, dword [r9]
add rcx, r15
mov r8d, dword [r9 - 4]
add rdx, rbx
test r8, r8
je 0x140005992
nop dword [rax]
movzx eax, byte [rdx]
inc rdx
mov byte [rcx], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x140005980
add r9, 0x28
test r10, r10
jne 0x140005960
mov r14d, dword [r12 + 0x90]
add r14, r15
mov qword [rsp + 0x70], rbp
mov eax, dword [r14 + 0xc]
test eax, eax
je 0x140005a80
nop word [rax + rax]
mov ebx, eax
mov rcx, r13
add rbx, r15
mov rdx, rbx
call fcn.1400056a0
mov rbp, rax
test rax, rax
je 0x140005afb
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, dword [r14 + 0x10]
mov rsi, rax
mov ebx, dword [r14]
add rdi, r15
add rbx, r15
cmp qword [rdi], 0
je 0x140005a68
nop dword [rax + rax]
test rbx, rbx
je 0x140005a31
mov rdx, qword [rbx]
test rdx, rdx
jns 0x140005a31
movsxd rax, dword [rsi + 0x3c]
movzx edx, dx
mov ecx, dword [rax + rsi + 0x88]
mov eax, dword [rcx + rsi + 0x10]
mov ecx, dword [rcx + rsi + 0x1c]
sub rdx, rax
add rcx, rsi
mov eax, dword [rcx + rdx*4]
add rax, rbp
jmp 0x140005a4d
mov rdx, qword [rdi]
mov rcx, rsi
add rdx, 2
add rdx, r15
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, rbp
sub rcx, rsi
add rax, rcx
mov qword [rdi], rax
add rdi, 8
test rbx, rbx
lea rax, [rbx + 8]
cmove rax, rbx
cmp qword [rdi], 0
mov rbx, rax
jne 0x140005a00
mov eax, dword [r14 + 0x20]
add r14, 0x14
test eax, eax
jne 0x1400059c0
mov rsi, qword [rsp + 0x80]
mov r9, rsi
sub r9, qword [r12 + 0x30]
cmp dword [r12 + 0xb4], 0
je 0x140005b53
mov ebx, dword [r12 + 0xb0]
add rbx, r15
mov eax, dword [rbx + 4]
test eax, eax
je 0x140005b53
nop dword [rax]
mov r8d, dword [rbx]
lea r11, [rbx + 8]
mov r10d, eax
add r8, r15
sub r10, 8
shr r10, 1
je 0x140005b45
nop word [rax + rax]
movzx edx, word [r11]
dec r10
movzx ecx, dx
movzx eax, dx
shr cx, 0xc
cmp cx, 0xa
jne 0x140005afd
and edx, 0xfff
mov rax, qword [r8 + rdx]
lea rcx, [r9 + rax]
mov qword [r8 + rdx], rcx
jmp 0x140005b39
jmp 0x140005b74
cmp cx, 3
jne 0x140005b0e
and eax, 0xfff
add dword [rax + r8], r9d
jmp 0x140005b39
cmp cx, 1
jne 0x140005b29
and eax, 0xfff
lea rcx, [rax + r8]
mov rax, r9
shr rax, 0x10
add word [rcx], ax
jmp 0x140005b39
cmp cx, 2
jne 0x140005b39
and eax, 0xfff
add word [rax + r8], r9w
add r11, 2
test r10, r10
jne 0x140005ad0
mov eax, dword [rbx + 4]
add rbx, rax
mov eax, dword [rbx + 4]
test eax, eax
jne 0x140005ab0
mov r9, qword [rsp + 0x78]
lea rax, [rsp + 0x78]
mov r8, r15
mov qword [rsp + 0x20], rax
mov rdx, rsi
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov rax, r15
mov rbp, qword [rsp + 0x70]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret