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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b5eed
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 0x421d1b
mov esi, dword [esi]
mov ecx, SysReAllocString
or edx, 0xffffffff
mov dword [ebp - 0x234], ecx
cmp eax, 0x10
jae 0x421d39
movups xmm0, xmmword [esi]
lea eax, [edx + 0x10]
movups xmmword [edi], xmm0
jmp 0x421da6
or eax, 0xf
cmp eax, 0x7fffffff
cmova eax, ecx
mov dword [ebp - 0x23c], eax
lea ecx, [eax + 1]
cmp ecx, 0x1000
jb 0x421d79
lea eax, [ecx + 0x23]
cmp eax, ecx
cmovbe eax, edx
push eax
call fcn.0042a297
add esp, 4
test eax, eax
je 0x42208e
lea ecx, [eax + 0x23]
and ecx, 0xffffffe0
mov dword [ecx - 4], eax
jmp 0x421d8c
test ecx, ecx
je 0x421d8a
push ecx
call fcn.0042a297
add esp, 4
mov ecx, eax
jmp 0x421d8c
xor ecx, ecx
mov eax, dword [ebp - 0x238]
inc eax
mov dword [edi], ecx
push eax
push esi
push ecx
call fcn.00441c20
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.004421a0
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 0x421eb7
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.004214e0
add esp, 8
test eax, eax
je 0x421eac
cmp dword [ebp - 0x220], 0
je 0x421eac
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 0x42204f
mov eax, dword [ebp - 0x240]
cmp dword [eax + 0x14], 0x10
jb 0x421e93
mov eax, dword [eax]
push eax
push esi
call fcn.00411670
mov ecx, eax
add esp, 8
test ecx, ecx
jne 0x421ed4
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.0042a228
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x244]
cmp dword [eax + 0x14], 0x10
jb 0x421ee2
mov eax, dword [eax]
push eax
push ecx
call fcn.00411670
add esp, 8
test eax, eax
je 0x421ea3
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 0x421f00
mov eax, dword [edi + 0x14]
sub esi, ecx
mov dword [ebp - 0x240], eax
cmp esi, eax
ja 0x421f48
mov dword [ebp - 0x234], edi
mov ecx, edi
cmp eax, 0x10
jb 0x421f2b
mov ecx, dword [edi]
mov dword [ebp - 0x234], ecx
push esi
push edx
push ecx
mov dword [edi + 0x10], esi
call fcn.00442c90
mov eax, dword [ebp - 0x234]
add esp, 0xc
mov byte [eax + esi], 0
jmp 0x422041
cmp esi, 0x7fffffff
ja 0x422093
mov ecx, esi
or ecx, 0xf
cmp ecx, 0x7fffffff
jbe 0x421f68
mov ecx, SysReAllocString
jmp 0x421f88
mov edx, eax
shr edx, 1
sub dword [ebp - 0x234], edx
cmp eax, dword [ebp - 0x234]
jbe 0x421f81
mov ecx, SysReAllocString
jmp 0x421f88
add eax, edx
cmp ecx, eax
cmovb ecx, eax
lea edx, [ecx + 1]
mov dword [ebp - 0x238], ecx
cmp edx, 0x1000
jb 0x421fca
lea eax, [edx + 0x23]
mov ecx, 0xffffffff
cmp eax, edx
cmovbe eax, ecx
push eax
call fcn.0042a297
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x422098
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
mov ecx, dword [ebp - 0x238]
jmp 0x421fe1
test edx, edx
je 0x421fdf
push edx
call fcn.0042a297
mov ecx, dword [ebp - 0x238]
add esp, 4
jmp 0x421fe1
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.00441c20
mov eax, dword [ebp - 0x234]
add esp, 0xc
mov ecx, dword [ebp - 0x240]
mov byte [eax + esi], 0
cmp ecx, 0x10
jb 0x42203f
mov eax, dword [edi]
inc ecx
cmp ecx, 0x1000
jb 0x42202f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x422098
mov eax, edx
push ecx
push eax
call fcn.00429e1a
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 0x421eb7
mov ecx, dword [ebp - 0x230]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x42207f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x422098
push edx
push ecx
call fcn.00429e1a
add esp, 8
jmp 0x421eb7
call fcn.0044b1a9
call fcn.0040b370
call fcn.0044b1a9
int3