Function at 0x140087130
Capabilities:
Read file on windows
Set registry value

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xfd0]
mov eax, 0x10d0
call fcn.1400ad030
sub rsp, rax
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov qword [rsp + 0x1110], rbx
mov rax, qword [0x14011f010]
xor rax, rsp
mov qword [rbp + 0xfc0], rax
mov qword [rsp + 0x60], r9
mov qword [rsp + 0x58], r8
mov rbx, rdx
mov qword [rsp + 0x70], rdx
mov qword [rbp - 0x80], rdx
xor edx, edx
mov r8d, 0x1000
lea rcx, [rbp - 0x40]
call fcn.1400aa8f0
xor r15d, r15d
mov r13d, r15d
mov qword [rsp + 0x68], r15
mov r14d, r15d
xor eax, eax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x60], rax
mov dword [rbp - 0x58], eax
mov qword [rbp - 0x78], r15
mov ecx, 0x8000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__set_fmode]
lea r8, [0x1400e90b8]
mov rdx, qword [rbx]
lea rcx, [rbp - 0x78]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen_s]
mov r9d, eax
lea rdx, str.CRtkBssGen4PresetLoader::LoadPresetFromDATFile2ServiceRegStore
test eax, eax
je 0x140087209
mov rax, qword [rbx]
mov qword [rsp + 0x20], rax
mov r8d, 0x23e
lea rcx, str._s__d__tfopen_s_ret_d_FilePath_s
call fcn.14004c3d0
jmp 0x140087485
mov r9, qword [rbx]
mov r8d, 0x242
lea rcx, str._s__d_DAT_s
call fcn.14004c3d0
xor r8d, r8d
xor edx, edx
mov rcx, qword [rbp - 0x78]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov rcx, qword [rbp - 0x78]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
mov edi, eax
mov dword [rsp + 0x50], eax
mov r9, qword [rbp - 0x78]
mov edx, 1
lea r8d, [rdx + 0x1b]
lea rcx, [rbp - 0x70]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
lea r12d, [rdi - 0x1c]
test rax, rax
je 0x14008746d
lea rdx, [rsp + 0x68]
lea rcx, [rbp - 0x70]
call fcn.140043ce0
mov eax, dword [rbp - 0x5c]
mov esi, eax
shr esi, 0x1f
and eax, 0xfffff
mov dword [rbp - 0x5c], eax
mov ebx, dword [rbp - 0x58]
cmp ebx, 0x1000
jb 0x140087315
cmp r13d, ebx
jae 0x1400872cd
test r15, r15
je 0x1400872a3
mov rcx, r15
call fcn.1400a404c
mov ebx, dword [rbp - 0x58]
mov r13d, ebx
lea ecx, [rbx + 1]
call fcn.1400a4688
mov r15, rax
mov r9d, ebx
mov r8d, 0x25e
lea rdx, str.CRtkBssGen4PresetLoader::LoadPresetFromDATFile2ServiceRegStore
lea rcx, str._s__d_new_HeapBufSize_d
call fcn.14004c3d0
mov rdi, r15
mov r8d, 0x263
lea rdx, str.CRtkBssGen4PresetLoader::LoadPresetFromDATFile2ServiceRegStore
lea rcx, [0x1400c4050]
call fcn.14004c3d0
lea r8d, [r13 + 1]
xor edx, edx
mov rcx, r15
call fcn.1400aa8f0
mov r8d, 0x267
lea rdx, str.CRtkBssGen4PresetLoader::LoadPresetFromDATFile2ServiceRegStore
lea rcx, [0x1400c4050]
call fcn.14004c3d0
mov ebx, dword [rbp - 0x58]
jmp 0x14008732a
lea rdi, [rbp - 0x40]
xor edx, edx
mov r8d, 0x1000
lea rcx, [rbp - 0x40]
call fcn.1400aa8f0
mov r8d, ebx
mov r9, qword [rbp - 0x78]
mov edx, 1
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov ecx, dword [rbp - 0x58]
sub r12d, ecx
mov rbx, qword [rsp + 0x68]
mov eax, dword [rbp - 0x5c]
cmp eax, 0x10001
jne 0x14008738f
mov eax, dword [rdi]
mov dword [rsp + 0x28], 4
mov r9d, 4
xor r8d, r8d
mov rdx, rbx
test esi, esi
je 0x140087381
mov dword [rbp - 0x50], eax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x20], rax
mov rax, qword [rsp + 0x58]
jmp 0x1400873de
mov dword [rbp - 0x48], eax
lea rax, [rbp - 0x48]
mov qword [rsp + 0x20], rax
jmp 0x1400873d9
cmp eax, 0x10000
jne 0x1400873b8
mov r8, rdi
mov rdx, rbx
test esi, esi
je 0x1400873ac
mov rcx, qword [rsp + 0x58]
call fcn.140021de0
jmp 0x1400873e7
mov rcx, qword [rsp + 0x60]
call fcn.140021de0
jmp 0x1400873e7
cmp eax, 1
jne 0x1400873ea
mov dword [rsp + 0x28], ecx
lea r9d, [rax + 2]
xor r8d, r8d
mov rdx, rbx
mov qword [rsp + 0x20], rdi
test esi, esi
mov rax, qword [rsp + 0x58]
jne 0x1400873de
mov rax, qword [rsp + 0x60]
mov rcx, qword [rax]
call qword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegSetValueExW]
mov r14d, eax
test rbx, rbx
je 0x1400873f8
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
mov r9, qword [rbp - 0x78]
mov edx, 1
lea r8d, [rdx + 0x1b]
lea rcx, [rbp - 0x70]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov rdi, rax
test rax, rax
jne 0x14008741b
sub r12d, 0x1c
call fcn.14004c1f0
test eax, eax
je 0x14008745f
mov eax, dword [rsp + 0x50]
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x38], r12d
mov dword [rsp + 0x30], r14d
mov eax, dword [rbp - 0x58]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rbx
mov r9d, dword [rbp - 0x5c]
mov r8d, 0x28d
lea rdx, str.CRtkBssGen4PresetLoader::LoadPresetFromDATFile2ServiceRegStore
lea rcx, str._s__d_Type_x_Key_s_DataSize_d_RegRet_d_RemindFileSize_d_FileSize_d
call fcn.14004c3d0
test rdi, rdi
jne 0x140087261
mov rbx, qword [rsp + 0x70]
mov rcx, qword [rbp - 0x78]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
test r15, r15
je 0x140087485
mov rcx, r15
call fcn.1400a404c
nop
mov rdx, qword [rbx]
sub rdx, 0x18
mov eax, 0xffffffff
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x1400874a4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rcx, qword [rbp + 0xfc0]
xor rcx, rsp
call fcn.1400a4020
mov rbx, qword [rsp + 0x1110]
add rsp, 0x10d0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret