Function at 0x180005f10
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 0x18000613f
mov r8d, edx
xor edx, edx
and r8d, 1
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov r15, rax
test rax, rax
je 0x1800065e3
xor r8d, r8d
lea rdx, [rbp - 0x60]
mov rcx, rax
call fcn.180002c40
test eax, eax
je 0x180006131
mov r12d, r14d
and r12d, 4
je 0x180005fa2
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 0x180006131
mov esi, ebx
test r14b, 2
je 0x1800060e1
test rdi, rdi
je 0x1800060e1
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 0x1800060e1
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 0x1800060d0
cmp rdi, 0xffffffffffffffff
je 0x1800060d0
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1800060d0
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 0x1800060d0
cmp r14d, dword [rbp + 0x398]
jne 0x1800060d0
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 0x1800060d0
mov rdi, qword [rbp + 8]
cmp rdi, qword [rbp + 0x10]
jae 0x1800060cc
nop dword [rax]
mov edx, dword [rdi + 0x14]
test edx, edx
je 0x1800060be
mov r9d, dword [rdi + 0x10]
test r9d, r9d
je 0x1800060be
mov r8d, dword [rdi + 0xc]
add r8, qword [rbp - 0x60]
mov rcx, qword [rsp + 0x40]
mov dword [rsp + 0x20], 1
call fcn.180005c00
test eax, eax
je 0x1800060c8
add rdi, 0x28
cmp rdi, qword [rbp + 0x10]
jb 0x180006090
cmp rdi, qword [rbp + 0x10]
setb sil
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800060e1
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r12d, r12d
je 0x180006125
mov rdi, qword [rbp + 8]
cmp rdi, qword [rbp + 0x10]
jae 0x18000611b
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 0x18000611b
add rdi, 0x28
cmp rdi, qword [rbp + 0x10]
jb 0x1800060f0
cmp rdi, qword [rbp + 0x10]
mov esi, ebx
setb sil
test esi, esi
jne 0x180006131
mov rax, r15
jmp 0x1800065e3
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x1800065e0
test rdi, rdi
je 0x1800065e0
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 0x1800065e0
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 0x1800065cf
cmp dword [rbp + 0x3a8], 0x40
jne 0x1800065cf
mov eax, 0x5a4d
cmp word [rsp + 0x60], ax
jne 0x1800065cf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800065e0
mov edx, dword [rbp - 0x64]
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1800065cf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800065e0
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 0x1800065cf
cmp dword [rbp + 0x3a8], 4
jne 0x1800065cf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800065e0
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 0x1800065cf
cmp dword [rbp + 0x3a8], 0x14
jne 0x1800065cf
cmp dword [rbp + 0x3a0], 0x4550
jne 0x1800065cf
movzx eax, word [rsp + 0x58]
mov esi, 0xe0
lea edi, [rsi + 0x10]
lea edx, [rsi + 0x6c]
cmp ax, si
jne 0x1800062a7
movzx eax, word [rsp + 0x48]
cmp ax, dx
jne 0x1800065cf
test r14b, 0x10
je 0x1800062cd
jmp 0x1800065cf
cmp ax, di
jne 0x1800065cf
movzx eax, word [rsp + 0x48]
mov ecx, 0x8664
cmp ax, cx
jne 0x1800065cf
test r14b, 0x20
jne 0x1800065cf
mov rcx, qword [rsp + 0x40]
cmp ax, dx
jne 0x180006370
cmp rcx, 0xffffffffffffffff
je 0x1800065e0
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 0x1800065cf
cmp dword [rbp + 0x3a8], esi
jne 0x1800065cf
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 0x1800065cf
xor edx, edx
lea eax, [rcx - 1]
add eax, r8d
div ecx
mov edi, eax
imul edi, ecx
test edi, edi
je 0x1800065cf
mov eax, 0x10b
cmp word [rbp + 0x180], ax
je 0x180006400
jmp 0x1800065cf
cmp rcx, 0xffffffffffffffff
je 0x1800065e0
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 0x1800065cf
cmp dword [rbp + 0x3a8], edi
jne 0x1800065cf
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 0x1800065cf
xor edx, edx
lea eax, [rcx - 1]
add eax, r8d
div ecx
mov edi, eax
imul edi, ecx
test edi, edi
je 0x1800065cf
mov eax, 0x20b
cmp word [rbp + 0x260], ax
jne 0x1800065cf
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 0x1800065cf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800065be
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1800065be
mov rcx, qword [rsp + 0x40]
mov r8d, edi
mov rdx, r13
call fcn.180001e70
test eax, eax
je 0x1800065be
mov r8d, 1
lea rdx, [rbp - 0x60]
mov rcx, r13
call fcn.180002c40
test eax, eax
je 0x1800065be
mov rax, qword [rbp + 0xd0]
mov ecx, 0xffffffff
cmp rax, rcx
jae 0x1800065be
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 0x1800065be
cmp edi, dword [rbp + 0x14c]
jne 0x1800064c9
mov r8d, esi
mov rdx, r13
mov rcx, rax
call fcn.180048b70
jmp 0x180006512
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800065ad
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1800065ad
mov r8d, dword [rbp + 0x13c]
mov rdx, r12
mov rcx, qword [rsp + 0x40]
call fcn.180001e70
test eax, eax
mov ecx, ebx
sete cl
test ecx, ecx
jne 0x1800065ad
xor r8d, r8d
lea rdx, [rbp - 0x60]
mov rcx, r12
call fcn.180002c40
mov rax, qword [rbp + 0x10]
mov rdi, qword [rbp + 8]
cmp rdi, rax
jae 0x1800065a8
mov edx, dword [rdi + 0x14]
test edx, edx
je 0x180006591
mov esi, dword [rdi + 0x10]
test esi, esi
je 0x180006591
mov r14d, dword [rdi + 0xc]
add r14, qword [rbp - 0x60]
mov r15, qword [rsp + 0x40]
cmp r15, 0xffffffffffffffff
je 0x1800065a3
xor r9d, r9d
xor r8d, r8d
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000659f
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 0x18000659f
cmp esi, dword [rbp + 0x3a8]
jne 0x18000659f
mov rax, qword [rbp + 0x10]
add rdi, 0x28
cmp rdi, rax
jb 0x180006532
mov rbx, r12
jmp 0x1800065be
mov rax, qword [rbp + 0x10]
cmp rdi, rax
jb 0x1800065ad
mov rbx, r12
jmp 0x1800065be
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 0x1800065e0
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