Function at 0x1400318a0
Capabilities:
Parse pe header
Resolve function by parsing pe exports

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0x20
xor esi, esi
lea rax, [rdx - 1]
mov rbp, rdx
mov r12, rcx
mov r8d, esi
mov edi, esi
cmp rax, 0x3e
jbe 0x1400318e9
mov eax, 0x5a4d
cmp word [rcx], ax
jne 0x140031ed8
test rdx, rdx
je 0x140031907
movsxd rax, dword [rcx + 0x3c]
add rax, 0x108
cmp rdx, rax
jae 0x140031907
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
mov rbx, qword [rsp + 0x60]
add rsp, 0x20
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
movsxd r13, dword [rcx + 0x3c]
add r13, r12
cmp dword [r13], 0x4550
jne 0x140031ed8
mov eax, 0x8664
cmp word [r13 + 4], ax
jne 0x140031ed8
mov eax, dword [r13 + 0x38]
test al, 1
jne 0x140031ed8
movzx ecx, word [r13 + 0x14]
mov r10d, eax
movzx eax, word [r13 + 6]
add rcx, 0x24
cmp si, ax
jae 0x140031976
add rcx, r13
mov r9d, eax
mov eax, dword [rcx + 4]
mov edx, dword [rcx]
test eax, eax
jne 0x140031963
lea rax, [r10 + rdx]
jmp 0x140031965
add eax, edx
cmp rax, r8
cmova r8, rax
add rcx, 0x28
sub r9, 1
jne 0x140031954
mov ebx, dword [r13 + 0x50]
lea rcx, [r10 - 1]
dec rbx
lea rax, [r10 - 1]
add rbx, r10
not rcx
add rax, r8
and rbx, rcx
and rax, rcx
cmp rbx, rax
jne 0x140031ed8
mov rcx, qword [r13 + 0x30]
mov r9d, 4
mov qword [rsp + 0x58], r15
mov r8d, 0x3000
mov rdx, rbx
mov qword [rsp + 0x50], r14
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r15, rax
test rax, rax
jne 0x1400319eb
mov r9d, 4
mov r8d, 0x3000
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r15, rax
test rax, rax
je 0x140031ad8
movabs r14, 0xffffffff00000000
lea rcx, [r15 + rbx]
mov rax, r15
and rcx, r14
and rax, r14
cmp rax, rcx
jae 0x140031a65
nop word [rax + rax]
mov ecx, reloc.WSOCK32.dll_recv
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
test rax, rax
je 0x140031b3a
mov qword [rax], rdi
mov r9d, 4
mov r8d, 0x3000
mov qword [rax + 8], r15
mov rdx, rbx
xor ecx, ecx
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r15, rax
test rax, rax
je 0x140031b00
lea rcx, [rax + rbx]
and rax, r14
and rcx, r14
cmp rax, rcx
jb 0x140031a10
xor esi, esi
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
mov r8d, 0x80
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r14, rax
test rax, rax
jne 0x140031b8d
xor edx, edx
mov r8d, 0x8000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_VirtualFree]
test rdi, rdi
je 0x140031ad8
mov rsi, qword [rsp + 0x88]
nop dword [rax]
mov rcx, qword [rdi + 8]
mov r9, rsi
xor edx, edx
mov r8d, 0x8000
call sub.KERNEL32.dll_VirtualFree
mov rbx, qword [rdi]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rdi, rbx
test rbx, rbx
jne 0x140031ab0
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
mov r14, qword [rsp + 0x50]
mov r15, qword [rsp + 0x58]
mov rbx, qword [rsp + 0x60]
add rsp, 0x20
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rdi, qword [rsp + 0x88]
nop dword [rax + rax]
mov rcx, qword [rsi + 8]
mov r9, rdi
xor edx, edx
mov r8d, 0x8000
call sub.KERNEL32.dll_VirtualFree
mov rbx, qword [rsi]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rsi, rbx
test rbx, rbx
jne 0x140031b10
jmp 0x140031ad8
xor edx, edx
mov r8d, 0x8000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_VirtualFree]
test rdi, rdi
je 0x140031ad8
mov rsi, qword [rsp + 0x88]
nop dword [rax + rax]
mov rcx, qword [rdi + 8]
mov r9, rsi
xor edx, edx
mov r8d, 0x8000
call sub.KERNEL32.dll_VirtualFree
mov rbx, qword [rdi]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rdi, rbx
test rbx, rbx
jne 0x140031b60
jmp 0x140031ad8
mov edx, 8
xor r8d, r8d
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_HeapCreate]
mov qword [r14 + 0x18], rax
mov qword [r14], r15
movzx eax, word [r13 + 0x16]
shr eax, 0xd
and eax, 1
mov dword [r14 + 0x28], eax
lea rax, [0x140031850]
mov qword [r14 + 0x30], rax
lea rax, [sub.KERNEL32.dll_VirtualFree]
mov qword [r14 + 0x38], rax
mov rax, qword [rsp + 0x70]
mov qword [r14 + 0x40], rax
mov rax, qword [rsp + 0x78]
mov qword [r14 + 0x48], rax
mov rax, qword [rsp + 0x80]
mov qword [r14 + 0x50], rax
mov rax, qword [rsp + 0x88]
mov qword [r14 + 0x60], rax
mov eax, dword [r13 + 0x38]
mov dword [r14 + 0x70], eax
mov qword [r14 + 0x78], rdi
test rbp, rbp
je 0x140031c25
mov eax, dword [r13 + 0x54]
cmp rbp, rax
jae 0x140031c25
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, r14
call fcn.1400320a0
jmp 0x140031ae3
mov edx, dword [r13 + 0x54]
mov r9d, 4
mov r8d, 0x1000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r8d, dword [r13 + 0x54]
mov rdx, r12
mov rcx, rax
mov rbx, rax
call sub.VCRUNTIME140.dll_memcpy
movsxd rax, dword [r12 + 0x3c]
mov r9, r14
add rax, rbx
mov r8, r13
mov qword [r14 + 8], rax
mov rdx, rbp
mov rcx, r12
mov qword [rax + 0x30], r15
call fcn.1400310c0
test eax, eax
je 0x140031c18
mov rax, qword [r14 + 8]
mov rbp, qword [rax + 0x30]
sub rbp, qword [r13 + 0x30]
je 0x140031d31
cmp dword [rax + 0xb4], 0
mov r12, qword [r14]
jne 0x140031c9a
mov eax, esi
jmp 0x140031d36
mov esi, dword [rax + 0xb0]
add rsi, r12
mov eax, dword [rsi]
test eax, eax
je 0x140031d2f
nop dword [rax]
mov edi, eax
lea rdx, [rsi + 8]
mov eax, dword [rsi + 4]
add rdi, r12
sub rax, 8
xor r8d, r8d
test rax, 0xfffffffffffffffe
jbe 0x140031d0a
nop dword [rax + rax]
movzx eax, word [rdx]
mov ecx, eax
shr eax, 0xc
and ecx, 0xfff
cmp eax, 3
je 0x140031cee
cmp eax, 0xa
jne 0x140031cf1
add qword [rcx + rdi], rbp
jmp 0x140031cf1
add dword [rcx + rdi], ebp
mov ecx, dword [rsi + 4]
inc r8d
sub rcx, 8
mov eax, r8d
shr rcx, 1
add rdx, 2
cmp rax, rcx
jb 0x140031cd0
mov ebx, dword [r14 + 0x70]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r8d, ebx
mov rdx, rdi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov eax, dword [rsi + 4]
add rsi, rax
mov eax, dword [rsi]
test eax, eax
jne 0x140031cb0
xor esi, esi
mov eax, 1
mov rcx, r14
mov dword [r14 + 0x2c], eax
call fcn.1400314a0
test eax, eax
je 0x140031c18
mov rax, qword [r14 + 8]
mov r8, qword [r14]
mov ecx, dword [rax + 0xa0]
mov edx, dword [rax + 0xa4]
add rcx, r8
movabs rax, 0xaaaaaaaaaaaaaaab
mul rdx
shr rdx, 3
call qword [sym.imp.KERNEL32.dll_RtlAddFunctionTable]
test al, al
je 0x140031c18
mov rcx, r14
call fcn.140031210
test eax, eax
je 0x140031c18
mov rax, qword [0x140132b60]
cmp qword [r13 + 0x30], rax
je 0x140031dda
mov rax, qword [r14 + 8]
mov rdi, qword [r14]
mov ecx, dword [rax + 0xd0]
test ecx, ecx
je 0x140031dda
mov rbx, qword [rcx + rdi + 0x18]
test rbx, rbx
je 0x140031dda
mov rax, qword [rbx]
test rax, rax
je 0x140031dda
nop
xor r8d, r8d
mov edx, 1
mov rcx, rdi
call rax
mov rax, qword [rbx + 8]
lea rbx, [rbx + 8]
test rax, rax
jne 0x140031dc0
mov rdx, qword [r14 + 8]
mov ebx, dword [rdx + 0x28]
test ebx, ebx
je 0x140031ecc
cmp dword [r14 + 0x28], 0
je 0x140031ebc
cmp byte [rsp + 0x90], 0
je 0x140031eac
mov rax, qword gs:[0x60]
mov rcx, qword [r14]
mov qword [0x140133b40], rcx
mov rdi, qword [rax + 0x110]
mov eax, dword [rdx + 0x50]
add rax, rcx
mov rcx, rdi
mov qword [0x140133b38], rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rcx, [0x1400f9918]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov rcx, rax
lea rdx, str.RtlPcToFileHeader
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
xor r8d, r8d
lea rdx, [0x140031050]
mov rcx, rax
call sym.AutoHotkey.exe_MinHookEnable
mov qword [0x140133b30], rax
mov r8, r14
lea rax, [r15 + rbx]
mov edx, 1
mov rcx, r15
call rax
mov rcx, qword [0x140133b30]
mov ebx, eax
call sym.AutoHotkey.exe_MinHookDisable
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test ebx, ebx
jne 0x140031eac
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, r14
call fcn.1400320a0
jmp 0x140031ae3
mov dword [r14 + 0x24], 1
mov rax, r14
jmp 0x140031ae5
lea rax, [r15 + rbx]
mov qword [r14 + 0x68], rax
mov rax, r14
jmp 0x140031ae5
mov qword [r14 + 0x68], rsi
mov rax, r14
jmp 0x140031ae5
mov ecx, 0xc1
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbx, qword [rsp + 0x60]
xor eax, eax
add rsp, 0x20
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret