Function at 0x180005e00
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 0x18000602f
mov r8d, edx
xor edx, edx
and r8d, 1
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov r15, rax
test rax, rax
je 0x1800064d3
xor r8d, r8d
lea rdx, [rbp - 0x60]
mov rcx, rax
call fcn.180002c40
test eax, eax
je 0x180006021
mov r12d, r14d
and r12d, 4
je 0x180005e92
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 0x180006021
mov esi, ebx
test r14b, 2
je 0x180005fd1
test rdi, rdi
je 0x180005fd1
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 0x180005fd1
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 0x180005fc0
cmp rdi, 0xffffffffffffffff
je 0x180005fc0
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x180005fc0
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 0x180005fc0
cmp r14d, dword [rbp + 0x398]
jne 0x180005fc0
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 0x180005fc0
mov rdi, qword [rbp + 8]
cmp rdi, qword [rbp + 0x10]
jae 0x180005fbc
nop dword [rax]
mov edx, dword [rdi + 0x14]
test edx, edx
je 0x180005fae
mov r9d, dword [rdi + 0x10]
test r9d, r9d
je 0x180005fae
mov r8d, dword [rdi + 0xc]
add r8, qword [rbp - 0x60]
mov rcx, qword [rsp + 0x40]
mov dword [rsp + 0x20], 1
call fcn.180005ab0
test eax, eax
je 0x180005fb8
add rdi, 0x28
cmp rdi, qword [rbp + 0x10]
jb 0x180005f80
cmp rdi, qword [rbp + 0x10]
setb sil
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x180005fd1
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r12d, r12d
je 0x180006015
mov rdi, qword [rbp + 8]
cmp rdi, qword [rbp + 0x10]
jae 0x18000600b
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 0x18000600b
add rdi, 0x28
cmp rdi, qword [rbp + 0x10]
jb 0x180005fe0
cmp rdi, qword [rbp + 0x10]
mov esi, ebx
setb sil
test esi, esi
jne 0x180006021
mov rax, r15
jmp 0x1800064d3
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x1800064d0
test rdi, rdi
je 0x1800064d0
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 0x1800064d0
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 0x1800064bf
cmp dword [rbp + 0x3a8], 0x40
jne 0x1800064bf
mov eax, 0x5a4d
cmp word [rsp + 0x60], ax
jne 0x1800064bf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800064d0
mov edx, dword [rbp - 0x64]
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1800064bf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800064d0
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 0x1800064bf
cmp dword [rbp + 0x3a8], 4
jne 0x1800064bf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800064d0
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 0x1800064bf
cmp dword [rbp + 0x3a8], 0x14
jne 0x1800064bf
cmp dword [rbp + 0x3a0], 0x4550
jne 0x1800064bf
movzx eax, word [rsp + 0x58]
mov esi, 0xe0
lea edi, [rsi + 0x10]
lea edx, [rsi + 0x6c]
cmp ax, si
jne 0x180006197
movzx eax, word [rsp + 0x48]
cmp ax, dx
jne 0x1800064bf
test r14b, 0x10
je 0x1800061bd
jmp 0x1800064bf
cmp ax, di
jne 0x1800064bf
movzx eax, word [rsp + 0x48]
mov ecx, 0x8664
cmp ax, cx
jne 0x1800064bf
test r14b, 0x20
jne 0x1800064bf
mov rcx, qword [rsp + 0x40]
cmp ax, dx
jne 0x180006260
cmp rcx, 0xffffffffffffffff
je 0x1800064d0
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 0x1800064bf
cmp dword [rbp + 0x3a8], esi
jne 0x1800064bf
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 0x1800064bf
xor edx, edx
lea eax, [rcx - 1]
add eax, r8d
div ecx
mov edi, eax
imul edi, ecx
test edi, edi
je 0x1800064bf
mov eax, 0x10b
cmp word [rbp + 0x180], ax
je 0x1800062f0
jmp 0x1800064bf
cmp rcx, 0xffffffffffffffff
je 0x1800064d0
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 0x1800064bf
cmp dword [rbp + 0x3a8], edi
jne 0x1800064bf
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 0x1800064bf
xor edx, edx
lea eax, [rcx - 1]
add eax, r8d
div ecx
mov edi, eax
imul edi, ecx
test edi, edi
je 0x1800064bf
mov eax, 0x20b
cmp word [rbp + 0x260], ax
jne 0x1800064bf
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 0x1800064bf
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x1800064ae
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x1800064ae
mov rcx, qword [rsp + 0x40]
mov r8d, edi
mov rdx, r13
call fcn.180001e70
test eax, eax
je 0x1800064ae
mov r8d, 1
lea rdx, [rbp - 0x60]
mov rcx, r13
call fcn.180002c40
test eax, eax
je 0x1800064ae
mov rax, qword [rbp + 0xd0]
mov ecx, 0xffffffff
cmp rax, rcx
jae 0x1800064ae
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 0x1800064ae
cmp edi, dword [rbp + 0x14c]
jne 0x1800063b9
mov r8d, esi
mov rdx, r13
mov rcx, rax
call fcn.180048c30
jmp 0x180006402
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x18000649d
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000649d
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 0x18000649d
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 0x180006498
mov edx, dword [rdi + 0x14]
test edx, edx
je 0x180006481
mov esi, dword [rdi + 0x10]
test esi, esi
je 0x180006481
mov r14d, dword [rdi + 0xc]
add r14, qword [rbp - 0x60]
mov r15, qword [rsp + 0x40]
cmp r15, 0xffffffffffffffff
je 0x180006493
xor r9d, r9d
xor r8d, r8d
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x18000648f
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 0x18000648f
cmp esi, dword [rbp + 0x3a8]
jne 0x18000648f
mov rax, qword [rbp + 0x10]
add rdi, 0x28
cmp rdi, rax
jb 0x180006422
mov rbx, r12
jmp 0x1800064ae
mov rax, qword [rbp + 0x10]
cmp rdi, rax
jb 0x18000649d
mov rbx, r12
jmp 0x1800064ae
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 0x1800064d0
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