Function at 0x4209c0
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b46cd
mov eax, dword fs:[0]
push eax
sub esp, 0x240
mov eax, dword [0x4e13b0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x248], 0
mov dword [ebp - 0x240], eax
mov eax, dword [ebp + 0x10]
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 0
cmp dword [esi + 0x14], 0x10
mov dword [ebp - 0x244], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 4], 0
mov dword [ebp - 0x24c], edi
mov dword [ebp - 0x238], eax
jb 0x420a3b
mov esi, dword [esi]
mov ecx, SysReAllocString
or edx, 0xffffffff
mov dword [ebp - 0x234], ecx
cmp eax, 0x10
jae 0x420a59
movups xmm0, xmmword [esi]
lea eax, [edx + 0x10]
movups xmmword [edi], xmm0
jmp 0x420ac6
or eax, 0xf
cmp eax, 0x7fffffff
cmova eax, ecx
mov dword [ebp - 0x23c], eax
lea ecx, [eax + 1]
cmp ecx, 0x1000
jb 0x420a99
lea eax, [ecx + 0x23]
cmp eax, ecx
cmovbe eax, edx
push eax
call fcn.00428cb7
add esp, 4
test eax, eax
je 0x420dae
lea ecx, [eax + 0x23]
and ecx, 0xffffffe0
mov dword [ecx - 4], eax
jmp 0x420aac
test ecx, ecx
je 0x420aaa
push ecx
call fcn.00428cb7
add esp, 4
mov ecx, eax
jmp 0x420aac
xor ecx, ecx
mov eax, dword [ebp - 0x238]
inc eax
mov dword [edi], ecx
push eax
push esi
push ecx
call fcn.00440640
mov eax, dword [ebp - 0x23c]
add esp, 0xc
mov ecx, dword [ebp - 0x238]
mov dword [ebp - 4], 0
mov dword [edi + 0x10], ecx
mov dword [edi + 0x14], eax
lea eax, [ebp - 0x218]
push 0x208
push 0
push eax
mov dword [ebp - 0x248], 1
call fcn.00440bc0
add esp, 0xc
lea eax, [ebp - 0x218]
push 0
push 0x1a
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push str.Ludashi_switch.json
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x420bd7
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 0xf
mov byte [ebp - 0x230], 0
lea eax, [ebp - 0x230]
mov dword [ebp - 4], 1
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.00420200
add esp, 8
test eax, eax
je 0x420bcc
cmp dword [ebp - 0x220], 0
je 0x420bcc
cmp dword [ebp - 0x21c], 0x10
lea eax, [ebp - 0x230]
cmovae eax, dword [ebp - 0x230]
push eax
call fcn.00411760
mov esi, eax
add esp, 4
mov dword [ebp - 0x23c], esi
test esi, esi
je 0x420d6f
mov eax, dword [ebp - 0x240]
cmp dword [eax + 0x14], 0x10
jb 0x420bb3
mov eax, dword [eax]
push eax
push esi
call fcn.00411650
mov ecx, eax
add esp, 8
test ecx, ecx
jne 0x420bf4
push esi
call fcn.00411470
add esp, 4
lea ecx, [ebp - 0x230]
call fcn.00409d20
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00428c45
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x244]
cmp dword [eax + 0x14], 0x10
jb 0x420c02
mov eax, dword [eax]
push eax
push ecx
call fcn.00411650
add esp, 8
test eax, eax
je 0x420bc3
mov edx, dword [eax + 0x10]
mov esi, edx
mov dword [ebp - 0x244], edx
lea ecx, [esi + 1]
nop
mov al, byte [esi]
inc esi
test al, al
jne 0x420c20
mov eax, dword [edi + 0x14]
sub esi, ecx
mov dword [ebp - 0x240], eax
cmp esi, eax
ja 0x420c68
mov dword [ebp - 0x234], edi
mov ecx, edi
cmp eax, 0x10
jb 0x420c4b
mov ecx, dword [edi]
mov dword [ebp - 0x234], ecx
push esi
push edx
push ecx
mov dword [edi + 0x10], esi
call fcn.004416b0
mov eax, dword [ebp - 0x234]
add esp, 0xc
mov byte [eax + esi], 0
jmp 0x420d61
cmp esi, 0x7fffffff
ja 0x420db3
mov ecx, esi
or ecx, 0xf
cmp ecx, 0x7fffffff
jbe 0x420c88
mov ecx, SysReAllocString
jmp 0x420ca8
mov edx, eax
shr edx, 1
sub dword [ebp - 0x234], edx
cmp eax, dword [ebp - 0x234]
jbe 0x420ca1
mov ecx, SysReAllocString
jmp 0x420ca8
add eax, edx
cmp ecx, eax
cmovb ecx, eax
lea edx, [ecx + 1]
mov dword [ebp - 0x238], ecx
cmp edx, 0x1000
jb 0x420cea
lea eax, [edx + 0x23]
mov ecx, 0xffffffff
cmp eax, edx
cmovbe eax, ecx
push eax
call fcn.00428cb7
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x420db8
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
mov ecx, dword [ebp - 0x238]
jmp 0x420d01
test edx, edx
je 0x420cff
push edx
call fcn.00428cb7
mov ecx, dword [ebp - 0x238]
add esp, 4
jmp 0x420d01
xor eax, eax
push esi
push dword [ebp - 0x244]
mov dword [ebp - 0x234], eax
push eax
mov dword [edi + 0x10], esi
mov dword [edi + 0x14], ecx
call fcn.00440640
mov eax, dword [ebp - 0x234]
add esp, 0xc
mov ecx, dword [ebp - 0x240]
mov byte [eax + esi], 0
cmp ecx, 0x10
jb 0x420d5f
mov eax, dword [edi]
inc ecx
cmp ecx, 0x1000
jb 0x420d4f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x420db8
mov eax, edx
push ecx
push eax
call fcn.0042883a
mov eax, dword [ebp - 0x234]
add esp, 8
mov dword [edi], eax
push dword [ebp - 0x23c]
call fcn.00411470
add esp, 4
mov edx, dword [ebp - 0x21c]
cmp edx, 0x10
jb 0x420bd7
mov ecx, dword [ebp - 0x230]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x420d9f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x420db8
push edx
push ecx
call fcn.0042883a
add esp, 8
jmp 0x420bd7
call fcn.00449bc9
call fcn.0040b350
call fcn.00449bc9
int3