Function at 0x402c80
Capabilities:
Parse pe header

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x18
lea rbp, [rsp + 0x10]
cmp byte [0x004090ac], 0
jne 0x402e05
mov byte [0x004090ac], 1
mov rdi, qword [0x00405008]
movzx eax, word [rdi]
cmp eax, 0x5a4d
jne 0x402ce2
movsxd rax, dword [rdi + 0x3c]
cmp dword [rdi + rax], 0x4550
jne 0x402ce2
movzx ecx, word [rdi + rax + 0x18]
cmp ecx, 0x20b
jne 0x402ce2
movzx eax, word [rdi + rax + 6]
shl eax, 3
lea rax, [rax + rax*4]
jmp 0x402ce4
xor eax, eax
add eax, 0xf
and eax, 0xfffffff0
call fcn.0040149e
sub rsp, rax
mov rax, rsp
mov qword [0x004090d0], rax
mov dword [0x004090c0], 0
lea r14, [0x00407344]
lea rbx, [0x00407344]
mov rax, rbx
sub rax, r14
cmp rax, 7
jle 0x402e05
cmp rax, 0xc
jl 0x402d5c
lea r14, [0x00407344]
cmp dword [0x00407344], 0
jne 0x402d6d
cmp dword [0x00407348], 0
jne 0x402d6d
cmp dword [0x0040734c], 0
lea rax, [0x00407344]
lea r14, [0x00407350]
cmovne r14, rax
cmp dword [r14], 0
jne 0x402d6d
cmp dword [r14 + 4], 0
je 0x402e16
cmp r14, rbx
jae 0x402da5
lea rsi, [rbp + 4]
mov eax, dword [r14]
mov ecx, dword [r14 + 4]
add eax, dword [rcx + rdi]
add rcx, rdi
mov dword [rbp + 4], eax
sub rsp, 0x20
mov r8d, 4
mov rdx, rsi
call fcn.00402f52
add rsp, 0x20
add r14, 8
cmp r14, rbx
jb 0x402d76
mov eax, dword [0x004090c0]
test eax, eax
jle 0x402e05
mov edi, 0x10
mov rdx, qword [0x004090d0]
xor ebx, ebx
lea rsi, [rbp - 8]
mov r14, qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov r8d, dword [rdx + rdi - 0x10]
test r8d, r8d
je 0x402df6
mov rcx, qword [rdx + rdi - 8]
mov rdx, qword [rdx + rdi]
sub rsp, 0x20
mov r9, rsi
call r14
add rsp, 0x20
mov rdx, qword [0x004090d0]
mov eax, dword [0x004090c0]
inc rbx
movsxd rcx, eax
add rdi, 0x28
cmp rbx, rcx
jl 0x402dc8
lea rsp, [rbp + 8]
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov edx, dword [r14 + 8]
cmp edx, 1
jne 0x402f41
add r14, 0xc
cmp r14, rbx
jae 0x402da5
lea r15, [0x004072e8]
mov r12, 0xffffffffffffffff
mov r13d, 0x8b
lea rsi, [rbp - 8]
movzx edx, byte [r14 + 8]
lea eax, [rdx - 8]
rorx ecx, eax, 3
cmp ecx, 7
ja case.0x402e74.2
mov r10d, dword [r14]
mov eax, dword [r14 + 4]
add rax, rdi
mov r9, qword [r10 + rdi]
movsxd r8, dword [r15 + rcx*4]
add r8, r15
jmp r8
movzx r11d, byte [rax]
lea r8, [r11 - 0x100]
test r11b, r11b
jmp 0x402eb0
mov r11d, dword [rax]
movabs r8, 0xffffffff00000000
add r8, r11
test r11d, r11d
jmp 0x402eb0
mov r8, qword [rax]
jmp 0x402eb4
movzx r11d, word [rax]
lea r8, [r11 - 0x10000]
test r11w, r11w
cmovns r8, r11
add r10, rdi
sub r8, r10
add r8, r9
mov qword [rbp - 8], r8
cmp edx, 0x3f
ja 0x402ee1
shlx r10, r12, rdx
not r10
cmp r8, r10
jg 0x402f19
lea r10d, [rdx - 1]
shlx r10, r12, r10
cmp r8, r10
jl 0x402f19
bt r13d, ecx
jae 0x402f07
mov ecx, ecx
lea rdx, [0x00407240]
mov r8, qword [rdx + rcx*8]
sub rsp, 0x20
mov rcx, rax
mov rdx, rsi
call fcn.00402f52
add rsp, 0x20
add r14, 0xc
cmp r14, rbx
jb 0x402e48
jmp 0x402da5
sub rsp, 0x30
mov qword [rsp + 0x20], r8
lea rcx, str._d_bit_pseudo_relocation_at__p_out_of_range__targeting__p__yielding_the_value__p._n
mov r8, rax
call fcn.0040310d
sub rsp, 0x20
lea rcx, str.__Unknown_pseudo_relocation_bit_size__d._n
call fcn.0040310d
sub rsp, 0x20
lea rcx, str.__Unknown_pseudo_relocation_protocol_version__d._n
call fcn.0040310d
int3