Function at 0x140007310
Capabilities:
Enumerate process modules
Execute command
Read file via mapping
Schedule task via at
Terminate process

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push r12
push r15
mov eax, 0x13d0
call fcn.1400086a0
sub rsp, rax
mov rax, qword [0x14000c040]
xor rax, rsp
mov qword [rsp + 0x13c0], rax
call qword [sym.imp.KERNEL32.dll_GetConsoleWindow]
mov rcx, rax
lea rdx, [rsp + 0x48]
mov rbx, rax
call qword [sym.imp.USER32.dll_GetWindowRect]
mov r8d, dword [rsp + 0x4c]
mov r9d, 0x320
mov edx, dword [rsp + 0x48]
mov rcx, rbx
mov dword [rsp + 0x28], 1
mov dword [rsp + 0x20], 0x203
call qword [sym.imp.USER32.dll_MoveWindow]
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_SetConsoleOutputCP]
lea r8, str.14:28:23
lea rdx, str.Jun__3_2024
lea rcx, str._OnlineCTR_Client__press_CTRL__C_to_quit__n_Build__s___s__n_n
call fcn.140005cf0
lea rcx, str._Enter_Your_Online_Name:
call fcn.140005cf0
mov r8d, 0x64
lea rdx, [0x14000c7a0]
lea rcx, [0x140009984]
call fcn.140005d50
lea rcx, [0x140009518]
mov byte [0x14000c7ab], 0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
lea r8, str.14:28:23
lea rdx, str.Jun__3_2024
lea rcx, str._OnlineCTR_Client__press_CTRL__C_to_quit__n_Build__s___s__n_n
call fcn.140005cf0
lea rdx, [0x14000c7a0]
lea rcx, str._Welcome_to_OnlineCTR__s__n
call fcn.140005cf0
lea rcx, reloc.WS2_32.dll_ioctlsocket
call fcn.140005cf0
xor r12d, r12d
lea r8, [rsp + 0x40]
mov edx, 0x1000
lea rcx, [rsp + 0x60]
mov ebp, r12d
lea r15d, [r12 - 1]
call qword [sym.imp.PSAPI.DLL_EnumProcesses]
mov eax, dword [rsp + 0x40]
shr eax, 2
test eax, eax
je 0x140007786
mov qword [rsp + 0x13f0], rsi
lea rsi, [rsp + 0x60]
mov qword [rsp + 0x1400], r14
mov r14d, eax
mov qword [rsp + 0x13f8], rdi
nop
mov ebx, dword [rsi]
test ebx, ebx
je 0x1400074d6
mov r8d, ebx
xor edx, edx
mov ecx, 0x410
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rdi, rax
test rax, rax
je 0x1400074d6
lea r9, [rsp + 0x38]
mov r8d, 8
lea rdx, [rsp + 0x30]
mov rcx, rax
call qword [sym.imp.PSAPI.DLL_EnumProcessModules]
test eax, eax
je 0x1400074d6
mov rdx, qword [rsp + 0x30]
lea r8, [rsp + 0x11b0]
mov r9d, 0x104
mov rcx, rdi
call qword [sym.imp.PSAPI.DLL_GetModuleBaseNameA]
cmp dword [rsp + 0x11b0], 0x6b637564
jne 0x1400074d6
cmp dword [rsp + 0x11b4], 0x74617473
jne 0x1400074d6
inc ebp
mov r15d, ebx
add rsi, 4
sub r14, 1
jne 0x140007460
mov r14, qword [rsp + 0x1400]
mov rdi, qword [rsp + 0x13f8]
mov rsi, qword [rsp + 0x13f0]
test ebp, ebp
je 0x140007786
lea rcx, str.Client:_DuckStation_detected_n
call fcn.140005cf0
cmp ebp, 1
jle 0x140007551
lea rcx, str.Warning:_Multiple_DuckStations_detected_n
call fcn.140005cf0
lea rcx, str.Please_enter_the_PID_manually_n_n
call fcn.140005cf0
lea rcx, str.DuckStation_PID:
call fcn.140005cf0
mov r8d, select
lea rdx, [rsp + 0x1060]
lea rcx, [0x140009984]
call fcn.140005d50
jmp 0x14000756d
mov r9d, r15d
lea r8, [0x140009a34]
mov edx, 0x64
lea rcx, [rsp + 0x1060]
call fcn.140005db0
lea r9, [rsp + 0x1060]
mov edx, 0x64
lea r8, str.duckstation__s
lea rcx, [rsp + 0x1070]
call fcn.140005db0
lea r9, [rsp + 0x1070]
mov edx, 0x64
lea r8, [0x140009a48]
lea rcx, [rsp + 0x10e0]
call fcn.140005c40
xor edx, edx
lea r8, [rsp + 0x10e0]
lea ecx, [rdx + 6]
call qword [sym.imp.KERNEL32.dll_OpenFileMappingW]
xor r9d, r9d
mov qword [rsp + 0x20], 0x800000
xor r8d, r8d
mov rcx, rax
lea edx, [r9 + 6]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov qword [0x14000c818], rax
test rax, rax
jne 0x14000761c
lea rcx, str.Error:_Failed_to_open_DuckStation__n_n
call fcn.140005cf0
lea rcx, str.pause
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
lea rcx, [0x140009518]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
call main
mov rax, qword [0x14000c818]
lea rcx, [rax + 0xc000]
mov qword [0x14000c810], rcx
call fcn.140005a60
test eax, eax
je 0x140007677
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.Error:_Failed_to_initialize_ENet__n
call fcn.140005cf0
mov eax, 1
mov rcx, qword [rsp + 0x13c0]
xor rcx, rsp
call fcn.140007890
mov rbx, qword [rsp + 0x1408]
add rsp, 0x13d0
pop r15
pop r12
pop rbp
ret
lea rcx, [0x140005af0]
call fcn.140007d74
lea rcx, str.Client:_Waiting_for_the_OnlineCTR_binary_to_load...
call fcn.140005cf0
lea rbx, [0x1400094b0]
nop word [rax + rax]
mov rax, qword [0x14000c810]
inc byte [rax + 0x24]
cmp dword [rax], 4
jl 0x14000770e
mov rax, qword [0x14000c818]
test dword [rax + 0x96814], 0x2000
je 0x14000770e
lea rcx, str._b__b_n
call fcn.140005cf0
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]
lea rcx, str.Client:_Disconnected__ID:_DSELECT_...
call fcn.140005cf0
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
mov rax, qword [0x14000c810]
mov byte [0x14000c6f4], r12b
mov dword [rax], r12d
mov byte [rax + 0x13], r12b
mov eax, dword [str.___]
lea rcx, [0x140009614]
mov dword [rsp + 0x38], eax
movzx eax, byte [0x140009610]
mov byte [rsp + 0x3c], al
movsxd rax, dword [0x14000c780]
movsx edx, byte [rsp + rax + 0x38]
call fcn.140005cf0
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 eax, dword [0x14000c780]
inc eax
and eax, 0x80000003
jge 0x140007765
dec eax
or eax, 0xfffffffc
inc eax
mov dword [0x14000c780], eax
mov rax, qword [0x14000c810]
movsxd rcx, dword [rax]
test ecx, ecx
js 0x14000777c
call qword [rbx + rcx*8]
call fcn.140007830
jmp 0x1400076a0
lea rcx, str.Error:_DuckStation_is_not_running__n_n
call fcn.140005cf0
lea rcx, str.pause
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
int3