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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b5f3d
mov eax, dword fs:[0]
push eax
sub esp, 0x240
mov eax, dword [0x4e43e0]
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 0x421d5b
mov esi, dword [esi]
mov ecx, SysReAllocString
or edx, 0xffffffff
mov dword [ebp - 0x234], ecx
cmp eax, 0x10
jae 0x421d79
movups xmm0, xmmword [esi]
lea eax, [edx + 0x10]
movups xmmword [edi], xmm0
jmp 0x421de6
or eax, 0xf
cmp eax, 0x7fffffff
cmova eax, ecx
mov dword [ebp - 0x23c], eax
lea ecx, [eax + 1]
cmp ecx, 0x1000
jb 0x421db9
lea eax, [ecx + 0x23]
cmp eax, ecx
cmovbe eax, edx
push eax
call fcn.0042a2d7
add esp, 4
test eax, eax
je 0x4220ce
lea ecx, [eax + 0x23]
and ecx, 0xffffffe0
mov dword [ecx - 4], eax
jmp 0x421dcc
test ecx, ecx
je 0x421dca
push ecx
call fcn.0042a2d7
add esp, 4
mov ecx, eax
jmp 0x421dcc
xor ecx, ecx
mov eax, dword [ebp - 0x238]
inc eax
mov dword [edi], ecx
push eax
push esi
push ecx
call fcn.00441c60
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.004421e0
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 0x421ef7
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.00421520
add esp, 8
test eax, eax
je 0x421eec
cmp dword [ebp - 0x220], 0
je 0x421eec
cmp dword [ebp - 0x21c], 0x10
lea eax, [ebp - 0x230]
cmovae eax, dword [ebp - 0x230]
push eax
call fcn.00411780
mov esi, eax
add esp, 4
mov dword [ebp - 0x23c], esi
test esi, esi
je 0x42208f
mov eax, dword [ebp - 0x240]
cmp dword [eax + 0x14], 0x10
jb 0x421ed3
mov eax, dword [eax]
push eax
push esi
call fcn.00411670
mov ecx, eax
add esp, 8
test ecx, ecx
jne 0x421f14
push esi
call fcn.00411490
add esp, 4
lea ecx, [ebp - 0x230]
call fcn.00409d40
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.0042a265
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x244]
cmp dword [eax + 0x14], 0x10
jb 0x421f22
mov eax, dword [eax]
push eax
push ecx
call fcn.00411670
add esp, 8
test eax, eax
je 0x421ee3
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 0x421f40
mov eax, dword [edi + 0x14]
sub esi, ecx
mov dword [ebp - 0x240], eax
cmp esi, eax
ja 0x421f88
mov dword [ebp - 0x234], edi
mov ecx, edi
cmp eax, 0x10
jb 0x421f6b
mov ecx, dword [edi]
mov dword [ebp - 0x234], ecx
push esi
push edx
push ecx
mov dword [edi + 0x10], esi
call fcn.00442cd0
mov eax, dword [ebp - 0x234]
add esp, 0xc
mov byte [eax + esi], 0
jmp 0x422081
cmp esi, 0x7fffffff
ja 0x4220d3
mov ecx, esi
or ecx, 0xf
cmp ecx, 0x7fffffff
jbe 0x421fa8
mov ecx, SysReAllocString
jmp 0x421fc8
mov edx, eax
shr edx, 1
sub dword [ebp - 0x234], edx
cmp eax, dword [ebp - 0x234]
jbe 0x421fc1
mov ecx, SysReAllocString
jmp 0x421fc8
add eax, edx
cmp ecx, eax
cmovb ecx, eax
lea edx, [ecx + 1]
mov dword [ebp - 0x238], ecx
cmp edx, 0x1000
jb 0x42200a
lea eax, [edx + 0x23]
mov ecx, 0xffffffff
cmp eax, edx
cmovbe eax, ecx
push eax
call fcn.0042a2d7
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x4220d8
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
mov ecx, dword [ebp - 0x238]
jmp 0x422021
test edx, edx
je 0x42201f
push edx
call fcn.0042a2d7
mov ecx, dword [ebp - 0x238]
add esp, 4
jmp 0x422021
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.00441c60
mov eax, dword [ebp - 0x234]
add esp, 0xc
mov ecx, dword [ebp - 0x240]
mov byte [eax + esi], 0
cmp ecx, 0x10
jb 0x42207f
mov eax, dword [edi]
inc ecx
cmp ecx, 0x1000
jb 0x42206f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4220d8
mov eax, edx
push ecx
push eax
call fcn.00429e5a
mov eax, dword [ebp - 0x234]
add esp, 8
mov dword [edi], eax
push dword [ebp - 0x23c]
call fcn.00411490
add esp, 4
mov edx, dword [ebp - 0x21c]
cmp edx, 0x10
jb 0x421ef7
mov ecx, dword [ebp - 0x230]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4220bf
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4220d8
push edx
push ecx
call fcn.00429e5a
add esp, 8
jmp 0x421ef7
call fcn.0044b1e9
call fcn.0040b370
call fcn.0044b1e9
int3