Function at 0x140021d80
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0xc8]
sub rsp, 0x1a0
mov qword [rsp + 0x28], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x1400a8650]
xor rax, rsp
mov qword [rbp + 0x98], rax
mov rsi, rcx
xor r13d, r13d
mov r12d, r13d
mov dword [rsp + 0x20], r13d
mov qword [rbp - 0x10], 7
mov qword [rbp - 0x18], r13
mov word [rbp - 0x28], r13w
lea rcx, [rbp + 0x18]
call fcn.140014b30
nop
lea r8, str.TrainerSettings.ini
lea rdx, [rbp + 0x18]
lea rcx, [rbp - 0x68]
call fcn.140020650
mov rbx, rax
lea rax, [rbp - 0x28]
cmp rax, rbx
je 0x140021e36
cmp qword [rbp - 0x10], 8
jb 0x140021e19
mov rcx, qword [rbp - 0x28]
call fcn.140046688
mov qword [rbp - 0x10], 7
mov qword [rbp - 0x18], r13
mov word [rbp - 0x28], r13w
mov rdx, rbx
lea rcx, [rbp - 0x28]
call fcn.14000a850
cmp qword [rbp - 0x50], 8
jb 0x140021e46
mov rcx, qword [rbp - 0x68]
call fcn.140046688
lea rcx, [rbp + 0x18]
cmp qword [rbp + 0x30], 8
cmovae rcx, qword [rbp + 0x18]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x140021e72
lea rcx, [rbp + 0x18]
cmp qword [rbp + 0x30], 8
cmovae rcx, qword [rbp + 0x18]
call fcn.1400482b8
mov ecx, 0x20
call fcn.1400466c0
mov rdi, rax
mov qword [rsp + 0x20], rax
or rbx, 0xffffffffffffffff
test rax, rax
je 0x140021ebb
mov qword [rax + 0x18], 7
mov qword [rax + 0x10], r13
mov word [rax], r13w
lea rax, [rbp - 0x28]
cmp rdi, rax
je 0x140021eb9
mov r9, rbx
xor r8d, r8d
lea rdx, [rbp - 0x28]
mov rcx, rdi
call fcn.14000cae0
nop
jmp 0x140021ebe
mov rdi, r13
mov qword [rsi + 0xc0], rdi
mov ecx, 0x28
call fcn.1400466c0
mov rdi, rax
mov qword [rsp + 0x30], rax
test rax, rax
je 0x140021f4d
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
mov r8d, 7
lea rdx, str.Trainer
lea rcx, [rsp + 0x38]
call fcn.14000cea0
nop
mov r12d, 1
mov dword [rsp + 0x20], r12d
mov r14, qword [rsi + 0xc0]
lea rcx, [rdi + 8]
mov qword [rcx + 0x18], 7
mov qword [rcx + 0x10], r13
mov word [rcx], r13w
lea rax, [rsp + 0x38]
cmp rcx, rax
je 0x140021f48
mov r9, rbx
xor r8d, r8d
lea rdx, [rsp + 0x38]
call fcn.14000cae0
mov qword [rdi], r14
jmp 0x140021f50
mov rdi, r13
mov qword [rsi + 0xc8], rdi
test r12b, 1
je 0x140021f73
and r12d, 0xfffffffe
cmp qword [rsp + 0x50], 8
jb 0x140021f73
mov rcx, qword [rsp + 0x38]
call fcn.140046688
lea rcx, [rbp - 0x28]
cmp qword [rbp - 0x10], 8
cmovae rcx, qword [rbp - 0x28]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x140022221
lea rdx, [0x14008fa08]
mov ecx, 2
call fcn.1400482ec
mov qword [rbp - 0x30], 0xf
mov qword [rbp - 0x38], r13
mov byte [rbp - 0x48], 0
cmp byte [rax], 0
jne 0x140021fbb
mov r8, r13
jmp 0x140021fca
mov r8, rbx
nop
inc r8
cmp byte [rax + r8], 0
jne 0x140021fc0
mov rdx, rax
lea rcx, [rbp - 0x48]
call fcn.14000c8c0
nop
mov qword [rsp + 0x70], 7
mov qword [rsp + 0x68], r13
mov word [rsp + 0x58], r13w
mov r9d, 7
xor r8d, r8d
lea rdx, str.Chinese
lea rcx, [rbp - 0x48]
call fcn.140005370
cmp rax, 0xffffffffffffffff
je 0x140022053
mov r9d, 0xb
xor r8d, r8d
lea rdx, str.Traditional
lea rcx, [rbp - 0x48]
call fcn.140005370
lea rcx, str.Chinese_Traditional
lea rdx, str.Chinese_Simplified
cmp rax, 0xffffffffffffffff
cmovne rdx, rcx
cmp word [rdx], 0
jne 0x140022044
mov rbx, r13
jmp 0x14002204e
inc rbx
cmp word [rdx + rbx*2], 0
jne 0x140022044
mov r8, rbx
jmp 0x140022060
mov r8d, 7
lea rdx, str.English
lea rcx, [rsp + 0x58]
call fcn.14000cea0
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
mov r8d, 8
lea rdx, str.Language
lea rcx, [rsp + 0x38]
call fcn.14000cea0
mov rax, qword [rsi + 0xc8]
lea rcx, [rax + 8]
mov r9, qword [rax]
cmp qword [r9 + 0x18], 8
jb 0x1400220ad
mov r9, qword [r9]
lea r8, [rsp + 0x58]
cmp qword [rsp + 0x70], 8
cmovae r8, qword [rsp + 0x58]
lea rdx, [rsp + 0x38]
cmp qword [rsp + 0x50], 8
cmovae rdx, qword [rsp + 0x38]
cmp qword [rcx + 0x18], 8
jb 0x1400220d9
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp qword [rsp + 0x50], 8
jb 0x1400220f1
mov rcx, qword [rsp + 0x38]
call fcn.140046688
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
mov r8d, 0xa
lea rdx, str.ShowAVHint
lea rcx, [rsp + 0x38]
call fcn.14000cea0
nop
mov r8b, 1
lea rdx, [rsp + 0x38]
mov rcx, qword [rsi + 0xc8]
call fcn.140021370
nop
cmp qword [rsp + 0x50], 8
jb 0x140022144
mov rcx, qword [rsp + 0x38]
call fcn.140046688
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
mov r8d, 0xb
lea rdx, str.OnLoadMusic
lea rcx, [rsp + 0x38]
call fcn.14000cea0
nop
mov r8b, 1
lea rdx, [rsp + 0x38]
mov rcx, qword [rsi + 0xc8]
call fcn.140021370
nop
cmp qword [rsp + 0x50], 8
jb 0x140022197
mov rcx, qword [rsp + 0x38]
call fcn.140046688
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
mov r8d, 0x11
lea rdx, str.IgnoreGameVersion
lea rcx, [rsp + 0x38]
call fcn.14000cea0
nop
xor r8d, r8d
lea rdx, [rsp + 0x38]
mov rcx, qword [rsi + 0xc8]
call fcn.140021370
nop
cmp qword [rsp + 0x50], 8
jb 0x1400221eb
mov rcx, qword [rsp + 0x38]
call fcn.140046688
nop
cmp qword [rsp + 0x70], 8
jb 0x1400221fd
mov rcx, qword [rsp + 0x58]
call fcn.140046688
mov qword [rsp + 0x70], 7
mov qword [rsp + 0x68], r13
mov word [rsp + 0x58], r13w
cmp qword [rbp - 0x30], 0x10
jb 0x140022221
mov rcx, qword [rbp - 0x48]
call fcn.140046688
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
mov r8d, 7
lea rdx, str.ENGLISH
lea rcx, [rsp + 0x38]
call fcn.14000cea0
nop
mov qword [rbp - 0x30], 7
mov qword [rbp - 0x38], r13
mov word [rbp - 0x48], r13w
mov r8d, 8
lea rdx, str.Language
lea rcx, [rbp - 0x48]
call fcn.14000cea0
nop
lea r9, [rsp + 0x38]
lea r8, [rbp - 0x48]
lea rdx, [rbp - 8]
mov rcx, qword [rsi + 0xc8]
call fcn.140021090
nop
cmp qword [rbp - 0x30], 8
jb 0x14002229f
mov rcx, qword [rbp - 0x48]
call fcn.140046688
mov qword [rbp - 0x30], 7
mov qword [rbp - 0x38], r13
mov word [rbp - 0x48], r13w
cmp qword [rsp + 0x50], 8
jb 0x1400222c2
mov rcx, qword [rsp + 0x38]
call fcn.140046688
mov qword [rsp + 0x50], 7
mov qword [rsp + 0x48], r13
mov word [rsp + 0x38], r13w
lea rbx, [rbp - 8]
mov r8, qword [rbp - 8]
mov rdx, qword [rbp + 0x10]
cmp rdx, 8
cmovae rbx, r8
lea rcx, [rbp - 8]
cmovae rcx, r8
mov rax, qword [rbp + 8]
lea rax, [rcx + rax*2]
lea r15, [rbp - 8]
cmovae r15, r8
cmp r15, rax
je 0x14002233e
mov rdi, r13
mov r14, rax
sub r14, r15
inc r14
shr r14, 1
cmp r15, rax
cmova r14, r13
test r14, r14
je 0x14002233e
sub r15, rbx
movzx ecx, word [r15 + rbx]
call fcn.140047b44
mov word [rbx], ax
add rbx, 2
inc rdi
cmp rdi, r14
jne 0x140022325
mov r9d, 0xa
xor r8d, r8d
lea rdx, str.SIMPLIFIED
lea rcx, [rbp - 8]
call fcn.140015790
cmp rax, 0xffffffffffffffff
je 0x140022362
mov edx, r13d
jmp 0x140022387
mov r9d, 0xb
xor r8d, r8d
lea rdx, str.TRADITIONAL
lea rcx, [rbp - 8]
call fcn.140015790
mov edx, r13d
cmp rax, 0xffffffffffffffff
sete dl
inc edx
mov rcx, rsi
call fcn.140022fd0
mov qword [rbp - 0x70], 7
mov qword [rbp - 0x78], r13
mov word [rsp + 0x78], r13w
mov r8d, 0xa
lea rdx, str.ShowAVHint
lea rcx, [rsp + 0x78]
call fcn.14000cea0
nop
mov r8b, 1
lea rdx, [rsp + 0x78]
mov rcx, qword [rsi + 0xc8]
call fcn.1400210d0
movzx ebx, al
cmp qword [rbp - 0x70], 8
jb 0x1400223e1
mov rcx, qword [rsp + 0x78]
call fcn.140046688
test bl, bl
je 0x140022630
mov qword [rsp + 0x70], 7
mov qword [rsp + 0x68], r13
mov word [rsp + 0x58], r13w
xor r8d, r8d
lea rdx, [0x14008fc58]
lea rcx, [rsp + 0x58]
call fcn.14000cea0
nop
mov qword [rbp - 0x50], 7
mov qword [rbp - 0x58], r13
mov word [rbp - 0x68], r13w
mov r8d, 0xb
lea rdx, str.360Tray.exe
lea rcx, [rbp - 0x68]
call fcn.14000cea0
lea rcx, [rbp - 0x68]
call fcn.140020240
test eax, eax
je 0x14002245d
mov r8d, 0xb
lea rdx, str.360Tray.exe
lea rcx, [rsp + 0x58]
call fcn.14000cea0
mov qword [rbp - 0x50], 7
mov qword [rbp - 0x58], r13
mov word [rbp - 0x68], r13w
mov r8d, 0xb
lea rdx, str.360Safe.exe
lea rcx, [rbp - 0x68]
call fcn.14000cea0
lea rcx, [rbp - 0x68]
call fcn.140020240
test eax, eax
je 0x1400224a8
mov r8d, 0xb
lea rdx, str.360Safe.exe
lea rcx, [rsp + 0x58]
call fcn.14000cea0
cmp qword [rsp + 0x68], 0
je 0x14002261e
lea r8, [rsp + 0x58]
lea rdx, [0x140092588]
lea rcx, [rbp + 0x78]
call fcn.140007c00
nop
lea r8, [0x140092570]
mov rdx, rax
lea rcx, [rbp - 0x68]
call fcn.140007d30
nop
lea r8, [0x140092520]
mov rdx, rax
lea rcx, [rbp + 0x38]
call fcn.140007d30
nop
lea r8, [0x1400924d0]
mov rdx, rax
lea rcx, [rbp + 0x58]
call fcn.140007d30
nop
lea r8, [0x140092480]
mov rdx, rax
lea rcx, [rsp + 0x78]
call fcn.140007d30
nop
cmp qword [rbp + 0x70], 8
jb 0x14002252b
mov rcx, qword [rbp + 0x58]
call fcn.140046688
mov qword [rbp + 0x70], 7
mov qword [rbp + 0x68], r13
mov word [rbp + 0x58], r13w
cmp qword [rbp + 0x50], 8
jb 0x14002254c
mov rcx, qword [rbp + 0x38]
call fcn.140046688
mov qword [rbp + 0x50], 7
mov qword [rbp + 0x48], r13
mov word [rbp + 0x38], r13w
cmp qword [rbp - 0x50], 8
jb 0x14002256d
mov rcx, qword [rbp - 0x68]
call fcn.140046688
mov qword [rbp - 0x50], 7
mov qword [rbp - 0x58], r13
mov word [rbp - 0x68], r13w
cmp qword [rbp + 0x90], 8
jb 0x140022591
mov rcx, qword [rbp + 0x78]
call fcn.140046688
lea rdx, [rsp + 0x78]
cmp qword [rbp - 0x70], 8
cmovae rdx, qword [rsp + 0x78]
mov r9d, 4
lea r8, [0x1400925a8]
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxW]
cmp eax, 7
jne 0x14002260c
xor r9d, r9d
xor r8d, r8d
lea edx, [rax - 5]
mov rcx, qword [rsi + 0x50]
call qword [sym.imp.USER32.dll_SendMessageW]
cmp qword [rbp - 0x70], 8
jb 0x1400225df
mov rcx, qword [rsp + 0x78]
call fcn.140046688
mov qword [rbp - 0x70], 7
mov qword [rbp - 0x78], r13
mov word [rsp + 0x78], r13w
cmp qword [rsp + 0x70], 8
jb 0x14002275b
mov rcx, qword [rsp + 0x58]
call fcn.140046688
jmp 0x14002275b
cmp qword [rbp - 0x70], 8
jb 0x14002261e
mov rcx, qword [rsp + 0x78]
call fcn.140046688
nop
cmp qword [rsp + 0x70], 8
jb 0x140022630
mov rcx, qword [rsp + 0x58]
call fcn.140046688
lea rcx, [rsi + 0xd0]
call fcn.14001b5c0
lea r8, str.TrainerBGM.mid
lea rdx, [rbp + 0x18]
lea rcx, [rbp + 0x78]
call fcn.140020650
lea rbx, [rsi + 0x428]
mov rdx, rax
mov rcx, rbx
call fcn.140015970
cmp qword [rbp + 0x90], 8
jb 0x140022675
mov rcx, qword [rbp + 0x78]
call fcn.140046688
cmp qword [rbx + 0x18], 8
jb 0x140022681
mov rcx, qword [rbx]
jmp 0x140022684
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1400226ad
cmp qword [rbx + 0x18], 8
jb 0x140022699
mov rbx, qword [rbx]
mov r8, rbx
lea rdx, [0x1400925d8]
mov ecx, 0xa7
call fcn.140014890
cmp byte [rsi + 0x168], 0
jne 0x140022705
mov qword [rbp - 0x70], 7
mov qword [rbp - 0x78], r13
mov word [rsp + 0x78], r13w
mov r8d, 0xb
lea rdx, str.OnLoadMusic
lea rcx, [rsp + 0x78]
call fcn.14000cea0
nop
or r12d, 2
mov dword [rsp + 0x20], r12d
mov r8b, 1
lea rdx, [rsp + 0x78]
mov rcx, qword [rsi + 0xc8]
call fcn.1400210d0
test al, al
je 0x140022705
mov bl, 1
jmp 0x140022707
xor bl, bl
test r12b, 2
je 0x14002271e
cmp qword [rbp - 0x70], 8
jb 0x14002271e
mov rcx, qword [rsp + 0x78]
call fcn.140046688
test bl, bl
je 0x14002272c
mov dl, 1
mov rcx, rsi
call fcn.1400227e0
xor r9d, r9d
mov edx, 0x2710
lea r8d, [r9 + 0xa]
mov rcx, qword [rsi + 0x50]
call qword [sym.imp.USER32.dll_SetTimer]
xor r9d, r9d
mov edx, 0x2711
mov r8d, 0xc8
mov rcx, qword [rsi + 0x50]
call qword [sym.imp.USER32.dll_SetTimer]
nop
cmp qword [rbp + 0x10], 8
jb 0x14002276b
mov rcx, qword [rbp - 8]
call fcn.140046688
mov qword [rbp + 0x10], 7
mov qword [rbp + 8], r13
mov word [rbp - 8], r13w
cmp qword [rbp + 0x30], 8
jb 0x14002278c
mov rcx, qword [rbp + 0x18]
call fcn.140046688
mov qword [rbp + 0x30], 7
mov qword [rbp + 0x28], r13
mov word [rbp + 0x18], r13w
cmp qword [rbp - 0x10], 8
jb 0x1400227ad
mov rcx, qword [rbp - 0x28]
call fcn.140046688
mov rcx, qword [rbp + 0x98]
xor rcx, rsp
call fcn.1400466a0
lea r11, [rsp + 0x1a0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret