Function at 0x180005db0
Capabilities:
Allocate or change rwx memory
Parse pe header
Read file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x350]
sub rsp, 0x450
xor ebx, ebx
mov r14d, edx
mov rdi, rcx
test dl, 8
jne 0x180005fdf
mov r8d, edx
xor edx, edx
and r8d, 1
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov r15, rax
test rax, rax
je 0x180006483
xor r8d, r8d
lea rdx, [rbp - 0x60]
mov rcx, rax
call fcn.180002bf0
test eax, eax
je 0x180005fd1
mov r12d, r14d
and r12d, 4
je 0x180005e42
mov edx, dword [rbp - 0xc]
lea r9, [rbp - 0x54]
mov rcx, qword [rbp - 0x60]
lea r8d, [rbx + 4]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180005fd1
mov esi, ebx
test r14b, 2
je 0x180005f81
test rdi, rdi
je 0x180005f81
xor r9d, r9d
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov edx, 0x80000000
mov rcx, rdi
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x40], rax
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x180005f81
mov r14d, dword [rbp - 0xc]
lea r9, [rbp + 0x3a8]
mov r13, qword [rbp - 0x60]
mov edx, r14d
mov rcx, r13
mov r8d, 0x40
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180005f70
cmp rdi, 0xffffffffffffffff
je 0x180005f70
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x180005f70
lea r9, [rbp + 0x398]
mov qword [rsp + 0x20], rbx
mov r8d, r14d
mov rdx, r13
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180005f70
cmp r14d, dword [rbp + 0x398]
jne 0x180005f70
mov r8d, dword [rbp + 0x3a8]
lea r9, [rbp + 0x3a8]
mov edx, r14d
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180005f70
mov rdi, qword [rbp + 8]
cmp rdi, qword [rbp + 0x10]
jae 0x180005f6c
nop dword [rax]
mov edx, dword [rdi + 0x14]
test edx, edx
je 0x180005f5e
mov r9d, dword [rdi + 0x10]
test r9d, r9d
je 0x180005f5e
mov r8d, dword [rdi + 0xc]
add r8, qword [rbp - 0x60]
mov rcx, qword [rsp + 0x40]
mov dword [rsp + 0x20], 1
call fcn.180005a60
test eax, eax
je 0x180005f68
add rdi, 0x28
cmp rdi, qword [rbp + 0x10]
jb 0x180005f30
cmp rdi, qword [rbp + 0x10]
setb sil
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x180005f81
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r12d, r12d
je 0x180005fc5
mov rdi, qword [rbp + 8]
cmp rdi, qword [rbp + 0x10]
jae 0x180005fbb
mov ecx, dword [rdi + 0xc]
lea r9, [rbp + 0x3b0]
add rcx, qword [rbp - 0x60]
mov r8d, 0x40
mov edx, dword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180005fbb
add rdi, 0x28
cmp rdi, qword [rbp + 0x10]
jb 0x180005f90
cmp rdi, qword [rbp + 0x10]
mov esi, ebx
setb sil
test esi, esi
jne 0x180005fd1
mov rax, r15
jmp 0x180006483
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x180006480
test rdi, rdi
je 0x180006480
xor r9d, r9d
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x40], rax
cmp rax, 0xffffffffffffffff
je 0x180006480
lea r9, [rbp + 0x3a8]
mov qword [rsp + 0x20], rbx
mov r8d, 0x40
lea rdx, [rsp + 0x60]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000646f
cmp dword [rbp + 0x3a8], 0x40
jne 0x18000646f
mov eax, 0x5a4d
cmp word [rsp + 0x60], ax
jne 0x18000646f
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x180006480
mov edx, dword [rbp - 0x64]
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000646f
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x180006480
lea r9, [rbp + 0x3a8]
mov qword [rsp + 0x20], rbx
mov r8d, 4
lea rdx, [rbp + 0x3a0]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000646f
cmp dword [rbp + 0x3a8], 4
jne 0x18000646f
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x180006480
lea r9, [rbp + 0x3a8]
mov qword [rsp + 0x20], rbx
mov r8d, 0x14
lea rdx, [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000646f
cmp dword [rbp + 0x3a8], 0x14
jne 0x18000646f
cmp dword [rbp + 0x3a0], 0x4550
jne 0x18000646f
movzx eax, word [rsp + 0x58]
mov esi, 0xe0
lea edi, [rsi + 0x10]
lea edx, [rsi + 0x6c]
cmp ax, si
jne 0x180006147
movzx eax, word [rsp + 0x48]
cmp ax, dx
jne 0x18000646f
test r14b, 0x10
je 0x18000616d
jmp 0x18000646f
cmp ax, di
jne 0x18000646f
movzx eax, word [rsp + 0x48]
mov ecx, 0x8664
cmp ax, cx
jne 0x18000646f
test r14b, 0x20
jne 0x18000646f
mov rcx, qword [rsp + 0x40]
cmp ax, dx
jne 0x180006210
cmp rcx, 0xffffffffffffffff
je 0x180006480
lea r9, [rbp + 0x3a8]
mov qword [rsp + 0x20], rbx
mov r8d, esi
lea rdx, [rbp + 0x180]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000646f
cmp dword [rbp + 0x3a8], esi
jne 0x18000646f
movzx eax, word [rsp + 0x4a]
mov r8d, dword [rbp + 0x1bc]
lea ecx, [rax + rax*4]
mov eax, dword [rbp - 0x64]
lea ecx, [rcx + 0x1f]
lea edx, [rax + rcx*8]
mov ecx, dword [rbp + 0x1a4]
cmp r8d, edx
cmovb r8d, edx
test ecx, ecx
je 0x18000646f
xor edx, edx
lea eax, [rcx - 1]
add eax, r8d
div ecx
mov edi, eax
imul edi, ecx
test edi, edi
je 0x18000646f
mov eax, 0x10b
cmp word [rbp + 0x180], ax
je 0x1800062a0
jmp 0x18000646f
cmp rcx, 0xffffffffffffffff
je 0x180006480
lea r9, [rbp + 0x3a8]
mov qword [rsp + 0x20], rbx
mov r8d, edi
lea rdx, [rbp + 0x260]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000646f
cmp dword [rbp + 0x3a8], edi
jne 0x18000646f
movzx eax, word [rsp + 0x4a]
mov r8d, dword [rbp + 0x29c]
lea ecx, [rax + rax*4]
mov eax, dword [rbp - 0x64]
lea ecx, [rcx + 0x21]
lea edx, [rax + rcx*8]
mov ecx, dword [rbp + 0x284]
cmp r8d, edx
cmovb r8d, edx
test ecx, ecx
je 0x18000646f
xor edx, edx
lea eax, [rcx - 1]
add eax, r8d
div ecx
mov edi, eax
imul edi, ecx
test edi, edi
je 0x18000646f
mov eax, 0x20b
cmp word [rbp + 0x260], ax
jne 0x18000646f
mov r9d, 4
mov edx, edi
mov r8d, 0x3000
mov esi, edi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r13, rax
test rax, rax
je 0x18000646f
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x18000645e
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000645e
mov rcx, qword [rsp + 0x40]
mov r8d, edi
mov rdx, r13
call fcn.180001e20
test eax, eax
je 0x18000645e
mov r8d, 1
lea rdx, [rbp - 0x60]
mov rcx, r13
call fcn.180002bf0
test eax, eax
je 0x18000645e
mov rax, qword [rbp + 0xd0]
mov ecx, 0xffffffff
cmp rax, rcx
jae 0x18000645e
xor ecx, ecx
mov edx, eax
mov r8d, 0x3000
lea r9d, [rcx + 0x40]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r12, rax
test rax, rax
je 0x18000645e
cmp edi, dword [rbp + 0x14c]
jne 0x180006369
mov r8d, esi
mov rdx, r13
mov rcx, rax
call fcn.180048a80
jmp 0x1800063b2
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x18000644d
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000644d
mov r8d, dword [rbp + 0x13c]
mov rdx, r12
mov rcx, qword [rsp + 0x40]
call fcn.180001e20
test eax, eax
mov ecx, ebx
sete cl
test ecx, ecx
jne 0x18000644d
xor r8d, r8d
lea rdx, [rbp - 0x60]
mov rcx, r12
call fcn.180002bf0
mov rax, qword [rbp + 0x10]
mov rdi, qword [rbp + 8]
cmp rdi, rax
jae 0x180006448
mov edx, dword [rdi + 0x14]
test edx, edx
je 0x180006431
mov esi, dword [rdi + 0x10]
test esi, esi
je 0x180006431
mov r14d, dword [rdi + 0xc]
add r14, qword [rbp - 0x60]
mov r15, qword [rsp + 0x40]
cmp r15, 0xffffffffffffffff
je 0x180006443
xor r9d, r9d
xor r8d, r8d
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000643f
lea r9, [rbp + 0x3a8]
mov qword [rsp + 0x20], rbx
mov r8d, esi
mov rdx, r14
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000643f
cmp esi, dword [rbp + 0x3a8]
jne 0x18000643f
mov rax, qword [rbp + 0x10]
add rdi, 0x28
cmp rdi, rax
jb 0x1800063d2
mov rbx, r12
jmp 0x18000645e
mov rax, qword [rbp + 0x10]
cmp rdi, rax
jb 0x18000644d
mov rbx, r12
jmp 0x18000645e
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor edx, edx
mov r8d, 0x8000
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x180006480
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, rbx
mov rbx, qword [rsp + 0x490]
add rsp, 0x450
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret