Function at 0x4a4170
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
cmp word [rcx], 0x5a4d
mov r12, rcx
mov r15, rdx
mov r14, r8
mov rsi, r9
jne 0x4a4600
movsxd rbp, dword [rcx + 0x3c]
add rbp, rcx
cmp dword [rbp], 0x4550
jne 0x4a4600
mov edx, dword [rbp + 0x50]
mov r9d, 4
mov r8d, 0x3000
mov rcx, qword [rbp + 0x30]
mov r13, qword [sym.imp.KERNEL32.dll_VirtualAlloc]
call r13
test rax, rax
mov rdi, rax
je 0x4a4621
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
xor edx, edx
mov r8d, 0x40
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
test rax, rax
mov rbx, rax
je 0x4a4690
mov qword [rax + 0x20], r15
mov r9d, 4
mov edx, dword [rbp + 0x54]
mov rcx, rdi
mov qword [rax + 0x30], rsi
mov r8d, 0x1000
mov qword [rax + 8], rdi
mov qword [rax + 0x10], 0
mov qword [rax + 0x18], 0
mov qword [rax + 0x28], r14
mov rax, qword [rsp + 0xb0]
mov qword [rbx + 0x38], rax
call r13
mov r8d, dword [rbp + 0x54]
mov rdx, r12
add r8d, dword [r12 + 0x3c]
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rsi, qword [rbx + 8]
mov r9, rax
movsxd rax, dword [r12 + 0x3c]
add rax, r9
movzx edx, word [rax + 0x14]
mov qword [rbx], rax
cmp word [rax + 6], 0
mov qword [rax + 0x30], rdi
lea r15, [rax + rdx + 0x18]
je 0x4a4314
xor r14d, r14d
jmp 0x4a42d1
movsxd r10, dword [rbp + 0x38]
test r10d, r10d
jle 0x4a42bd
mov ecx, dword [r15 + 0xc]
mov rdx, r10
mov qword [rsp + 0x28], r10
mov r8d, 0x1000
mov r9d, 4
add rcx, rsi
call r13
mov r10, qword [rsp + 0x28]
xor edx, edx
mov dword [r15 + 8], eax
mov rcx, rax
mov r8, r10
call sub.msvcrt.dll_memset
mov rax, qword [rbx]
add r14d, 1
add r15, 0x28
movzx edx, word [rax + 6]
cmp r14d, edx
jge 0x4a4310
mov edx, dword [r15 + 0x10]
test edx, edx
je 0x4a4280
mov ecx, dword [r15 + 0xc]
mov r9d, 4
mov r8d, 0x1000
add rcx, rsi
call r13
mov edx, dword [r15 + 0x14]
mov r8d, dword [r15 + 0x10]
mov rcx, rax
add rdx, r12
call sub.msvcrt.dll_memcpy
mov dword [r15 + 8], eax
jmp 0x4a42bd
mov rsi, qword [rbx + 8]
mov r10, rdi
sub r10, qword [rbp + 0x30]
je 0x4a43ac
mov edx, dword [rax + 0xb4]
test edx, edx
je 0x4a43ac
mov ecx, dword [rax + 0xb0]
add rcx, rsi
mov r8d, dword [rcx]
test r8d, r8d
je 0x4a43ac
mov r9d, dword [rcx + 4]
add r8, rsi
lea edx, [r9 - 8]
shr edx, 1
je 0x4a43a1
xor r11d, r11d
jmp 0x4a4370
cmp bp, 0xa
jne 0x4a4361
movzx edx, dx
add qword [r8 + rdx], r10
add r11, 1
lea edx, [r9 - 8]
shr edx, 1
cmp edx, r11d
jbe 0x4a43a1
movzx edx, word [rcx + r11*2 + 8]
mov ebp, edx
and dx, 0xfff
shr bp, 0xc
cmp bp, 3
jne 0x4a4354
movzx edx, dx
add r11, 1
add dword [r8 + rdx], r10d
mov r9d, dword [rcx + 4]
lea edx, [r9 - 8]
shr edx, 1
cmp edx, r11d
ja 0x4a4370
add rcx, r9
mov r8d, dword [rcx]
test r8d, r8d
jne 0x4a4340
mov ecx, dword [rax + 0x94]
test ecx, ecx
je 0x4a44c0
mov ebp, dword [rax + 0x90]
mov r13, qword [sym.imp.KERNEL32.dll_IsBadReadPtr]
add rbp, rsi
nop word [rax + rax]
mov edx, 0x14
mov rcx, rbp
call r13
test eax, eax
jne 0x4a44c0
mov ecx, dword [rbp + 0xc]
test ecx, ecx
je 0x4a44c0
add rcx, rsi
mov rdx, qword [rbx + 0x38]
call qword [rbx + 0x20]
test rax, rax
mov r12, rax
je 0x4a4650
mov eax, dword [rbx + 0x18]
mov rcx, qword [rbx + 0x10]
lea edx, [rax + 1]
movsxd rdx, edx
shl rdx, 3
call sub.msvcrt.dll_realloc
test rax, rax
je 0x4a4670
movsxd rdx, dword [rbx + 0x18]
mov qword [rbx + 0x10], rax
mov r14d, dword [rbp]
mov r15d, dword [rbp + 0x10]
lea ecx, [rdx + 1]
mov dword [rbx + 0x18], ecx
mov qword [rax + rdx*8], r12
mov rax, r14
add r15, rsi
add r14, rsi
test eax, eax
cmove r14, r15
mov rdx, qword [r14]
test rdx, rdx
jne 0x4a4486
jmp 0x4a45c0
lea rdx, [rsi + rdx + 2]
mov rcx, r12
call rax
test rax, rax
mov qword [r15], rax
je 0x4a44a3
add r14, 8
mov rdx, qword [r14]
add r15, 8
test rdx, rdx
je 0x4a45c0
test rdx, rdx
mov rax, qword [rbx + 0x28]
mov r8, qword [rbx + 0x38]
jns 0x4a4460
movzx edx, dx
mov rcx, r12
call rax
test rax, rax
mov qword [r15], rax
jne 0x4a4472
mov rcx, r12
mov rdx, qword [rbx + 0x38]
call qword [rbx + 0x30]
mov ecx, 0x7f
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4a465b
movabs rbp, 0xffffffff00000000
mov r9, qword [rbx]
xor esi, esi
movzx eax, word [r9 + 0x14]
and rbp, qword [r9 + 0x30]
cmp word [r9 + 6], 0
lea r15, [r9 + rax + 0x18]
je 0x4a4590
lea r12, [0x00879320]
mov r13, qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov r14, qword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x4a4522
mov ecx, dword [r15 + 8]
lea r9, [rsp + 0x3c]
or rcx, rbp
call r13
mov r9, qword [rbx]
movzx eax, word [r9 + 6]
add esi, 1
add r15, 0x28
cmp esi, eax
jge 0x4a4590
mov eax, dword [r15 + 0x24]
mov edx, dword [r15 + 0x10]
mov r8d, eax
mov ecx, eax
mov r10d, eax
shr r8d, 0x1d
shr ecx, 0x1e
and r8d, 1
and ecx, 1
shr r10d, 0x1f
test eax, 0x2000000
jne 0x4a45e0
movsxd r8, r8d
movsxd rcx, ecx
lea rcx, [rcx + r8*2]
lea rcx, [r10 + rcx*2]
mov r8d, dword [r12 + rcx*4]
mov ecx, r8d
or ch, 2
test eax, 0x4000000
cmovne r8d, ecx
test edx, edx
jne 0x4a4500
test al, 0x40
je 0x4a45d0
mov edx, dword [r9 + 0x20]
test edx, edx
jne 0x4a4500
movzx eax, word [r9 + 6]
add esi, 1
add r15, 0x28
cmp esi, eax
jl 0x4a4522
mov eax, dword [r9 + 0x28]
test eax, eax
je 0x4a460d
add rax, rdi
xor r8d, r8d
mov edx, 1
mov rcx, rdi
call rax
test eax, eax
je 0x4a46b1
mov dword [rbx + 0x1c], 1
jmp 0x4a460d
add rbp, 0x14
jmp 0x4a43d0
test al, 0x80
je 0x4a4512
mov edx, dword [r9 + 0x24]
jmp 0x4a457c
mov ecx, dword [r15 + 8]
mov r8d, 0x4000
or rcx, rbp
call r14
mov r9, qword [rbx]
jmp 0x4a4512
mov ecx, 0xc1
xor ebx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor ecx, ecx
mov edx, dword [rbp + 0x50]
mov r9d, 4
mov r8d, 0x3000
call r13
test rax, rax
mov rdi, rax
jne 0x4a41d4
mov ecx, 0xe
xor ebx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4a460d
mov ecx, 0x7e
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rbx
xor ebx, ebx
call fcn.004a40b0
jmp 0x4a460d
mov rcx, r12
mov rdx, qword [rbx + 0x38]
call qword [rbx + 0x30]
mov ecx, 0xe
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4a465b
mov ecx, 0xe
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov r8d, 0x8000
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x4a460d
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4a465b