Function at 0x140001640
Capabilities:
Check os version
Enumerate pe sections
Parse pe header
Resolve function by parsing pe exports

Disassembly:
sub rsp, 0xf8
mov rax, qword gs:[0x60]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x60], 0
je 0x140001673
cmp qword [rsp + 0x60], 0
je 0x14000167a
mov rax, qword [rsp + 0x60]
cmp dword [rax + 0x118], 0xa
je 0x14000167a
xor eax, eax
jmp 0x140001c74
mov qword [rsp + 0xc0], 0
mov qword [rsp + 0x58], 0
mov dword [rsp + 0x30], 0
mov qword [rsp + 0x98], 0
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0xc8], 0
mov qword [rsp + 0x48], 0
mov dword [rsp + 0x38], 0
mov rax, qword [rsp + 0x60]
mov rax, qword [rax + 0x18]
add rax, 0x20
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0xc0]
cmp qword [rsp + 0x58], rax
je 0x140001c6f
mov rax, qword [rsp + 0x58]
sub rax, 0x10
mov qword [rsp + 0xd0], rax
mov rax, qword [rsp + 0xd0]
add rax, 0x58
mov qword [rsp + 0xe0], rax
mov rax, qword [rsp + 0xe0]
mov rcx, qword [rax + 8]
call fcn.140001270
mov qword [rsp + 0x98], rax
mov rax, qword [rsp + 0xd0]
mov rax, qword [rax + 0x30]
mov qword [rsp + 0x40], rax
cmp qword [rsp + 0x98], 0
je 0x140001c5d
cmp qword [rsp + 0x40], 0
je 0x140001c5d
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0xd8], rax
mov rax, qword [rsp + 0xd8]
movzx eax, word [rax]
cmp eax, 0x5a4d
je 0x14000179a
xor eax, eax
jmp 0x140001c74
mov rax, qword [rsp + 0xd8]
movsxd rax, dword [rax + 0x3c]
mov rcx, qword [rsp + 0x40]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0x68]
cmp dword [rax], 0x4550
je 0x1400017ca
xor eax, eax
jmp 0x140001c74
mov dword [rsp + 0x34], 0
jmp 0x1400017de
mov eax, dword [rsp + 0x34]
inc eax
mov dword [rsp + 0x34], eax
mov rax, qword [rsp + 0x68]
movzx eax, word [rax + 6]
cmp dword [rsp + 0x34], eax
jge 0x14000186c
mov rax, qword [rsp + 0x68]
movzx eax, word [rax + 0x14]
mov rcx, qword [rsp + 0x68]
lea rax, [rcx + rax + 0x18]
movsxd rcx, dword [rsp + 0x34]
imul rcx, rcx, 0x28
add rax, rcx
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x70]
mov eax, dword [rax]
or eax, 0x20202020
cmp eax, 0x7865742e
jne 0x140001867
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 8]
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 0xc]
mov rcx, qword [rsp + 0x40]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x50], rax
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 0xc]
mov rcx, qword [rsp + 0x98]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0xc8], rax
jmp 0x1400017d4
cmp qword [rsp + 0x48], 0
je 0x140001887
cmp qword [rsp + 0x50], 0
je 0x140001887
cmp qword [rsp + 0xc8], 0
jne 0x14000188e
xor eax, eax
jmp 0x140001c74
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
mov r9d, 0x80
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x50]
mov rcx, 0xffffffffffffffff
call fcn.1400021f0
mov dword [rsp + 0x38], eax
cmp dword [rsp + 0x30], 0
jge 0x14000195d
xor eax, eax
cmp eax, 1
je 0x140001956
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, 0x400
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x78], rax
cmp qword [rsp + 0x78], 0
je 0x140001956
mov r8d, dword [rsp + 0x30]
lea rdx, str._t____NtProtectVirtualMemory__1__Failed_:_0x_0.8X__main.c:127__n
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.USER32.dll_wsprintfW]
mov dword [rsp + 0xa8], eax
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0xa8]
mov rdx, qword [rsp + 0x78]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x78]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
xor eax, eax
jmp 0x140001c74
xor eax, eax
cmp eax, 1
je 0x140001a06
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, 0x400
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x80], rax
cmp qword [rsp + 0x80], 0
je 0x140001a06
mov rax, qword [rsp + 0xe0]
mov r8, qword [rax + 8]
lea rdx, str._t_i__Replacing_.txt_of__s_...
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.USER32.dll_wsprintfW]
mov dword [rsp + 0xac], eax
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0xac]
mov rdx, qword [rsp + 0x80]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x80]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0xc8]
mov rcx, qword [rsp + 0x50]
call fcn.1400010b0
xor eax, eax
cmp eax, 1
je 0x140001aba
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, 0x400
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x88], rax
cmp qword [rsp + 0x88], 0
je 0x140001aba
lea rdx, str.___DONE__n
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.USER32.dll_wsprintfW]
mov dword [rsp + 0xb0], eax
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0xb0]
mov rdx, qword [rsp + 0x88]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x88]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x38]
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x50]
mov rcx, 0xffffffffffffffff
call fcn.1400021f0
cmp dword [rsp + 0x30], 0
jge 0x140001b93
xor eax, eax
cmp eax, 1
je 0x140001b8c
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, 0x400
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x90], rax
cmp qword [rsp + 0x90], 0
je 0x140001b8c
mov r8d, dword [rsp + 0x30]
lea rdx, str._t____NtProtectVirtualMemory__2__Failed_:_0x_0.8X__main.c:141__n
mov rcx, qword [rsp + 0x90]
call qword [sym.imp.USER32.dll_wsprintfW]
mov dword [rsp + 0xb4], eax
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0xb4]
mov rdx, qword [rsp + 0x90]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x90]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
xor eax, eax
jmp 0x140001c74
lea r8, [rsp + 0x30]
mov rdx, qword [rsp + 0x98]
mov rcx, 0xffffffffffffffff
call fcn.1400022e0
cmp dword [rsp + 0x30], 0
jge 0x140001c5d
xor eax, eax
cmp eax, 1
je 0x140001c59
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, 0x400
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0xa0], rax
cmp qword [rsp + 0xa0], 0
je 0x140001c59
mov r8d, dword [rsp + 0x30]
lea rdx, str._t____NtUnmapViewOfSection__Failed_:_0x_0.8X__main.c:148__n
mov rcx, qword [rsp + 0xa0]
call qword [sym.imp.USER32.dll_wsprintfW]
mov dword [rsp + 0xb8], eax
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, dword [rsp + 0xb8]
mov rdx, qword [rsp + 0xa0]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0xa0]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
xor eax, eax
jmp 0x140001c74
mov rax, qword [rsp + 0x58]
mov rax, qword [rax]
mov qword [rsp + 0x58], rax
jmp 0x1400016f7
mov eax, 1
add rsp, 0xf8
ret