Function at 0x406520
Capabilities:
Check mutex on windows
Get common file path
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6f4
mov eax, dword [0x4fa2a0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
push ebx
push esi
xor ebx, ebx
push ebx
mov dword [ebp - 0x6f0], eax
mov dword [ebp - 0x6ec], ecx
call dword [sym.imp.ole32.dll_CoInitialize]
cmp dword [0x4ff104], ebx
jne 0x40657d
push 0x24d8
call fcn.0042d9bc
add esp, 4
cmp eax, ebx
je 0x406577
mov esi, eax
call fcn.00411420
mov dword [0x4ff104], eax
jmp 0x40657d
mov dword [0x4ff104], ebx
push str.NeoCellInterUninstallMutex
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x406a4a
push edi
xor edi, edi
jmp 0x4065a3
xor ebx, ebx
cmp dword [0x4ff104], ebx
jne 0x4065d0
push 0x24d8
call fcn.0042d9bc
add esp, 4
cmp eax, ebx
je 0x4065ca
mov esi, eax
call fcn.00411420
mov dword [0x4ff104], eax
jmp 0x4065d0
mov dword [0x4ff104], ebx
call fcn.004117c0
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [0x4ff104], ebx
jne 0x40660a
push 0x24d8
call fcn.0042d9bc
add esp, 4
cmp eax, ebx
je 0x406604
mov esi, eax
call fcn.00411420
mov dword [0x4ff104], eax
jmp 0x40660a
mov dword [0x4ff104], ebx
mov ebx, str.NeoCell.exe
call fcn.00411890
test eax, eax
je 0x40661e
inc edi
cmp edi, 0xa
jb 0x4065a1
mov eax, dword [0x4ff104]
test eax, eax
jne 0x406648
push 0x24d8
call fcn.0042d9bc
add esp, 4
test eax, eax
je 0x406641
mov esi, eax
call fcn.00411420
jmp 0x406643
xor eax, eax
mov dword [0x4ff104], eax
mov ecx, dword [ebp - 0x6ec]
mov ebx, eax
call fcn.004115b0
mov esi, dword [0x4ff108]
xor edi, edi
cmp esi, edi
jne 0x4066af
push 0x18
call fcn.0042d9bc
mov esi, eax
add esp, 4
cmp esi, edi
je 0x4066a7
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
call eax
add eax, 0x10
mov dword [esi + 0x10], eax
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
call eax
add eax, 0x10
mov dword [esi + 0x14], eax
jmp 0x4066a9
xor esi, esi
mov dword [0x4ff108], esi
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
mov dword [ebp - 0x6f4], esi
call eax
mov ecx, str._replace
lea esi, [eax + 0x10]
mov dword [ebp - 0x6ec], esi
test ecx, 0xffff0000
jne 0x4067fe
mov edx, ecx
movzx edi, dx
call fcn.004030e0
test eax, eax
je 0x406701
push eax
mov eax, edi
lea edi, [ebp - 0x6ec]
call fcn.004034a0
mov esi, dword [ebp - 0x6ec]
xor edi, edi
mov ebx, dword [ebp - 0x6f4]
lea eax, [ebp - 0x6ec]
call fcn.00404900
add esi, 0xfffffff0
mov ebx, eax
lea edx, [esi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x406732
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
cmp ebx, edi
je 0x4067aa
push 0x206
lea edx, [ebp - 0x20a]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x20c], cx
call fcn.00436fe0
add esp, 0xc
push edi
push 0x1c
lea eax, [ebp - 0x20c]
push eax
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x20c]
add eax, 0xfffffffe
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
cmp cx, di
jne 0x406770
mov edi, eax
mov ecx, 0xb
mov esi, str.NeoCell_appconfig.dat
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x20c]
push ecx
push 0x4d4e70
push 0x4d4e74
push str.generate
movsw word es:[edi], word [esi]
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
xor edi, edi
mov esi, dword [0x4ff108]
cmp esi, edi
jne 0x40683b
push 0x18
call fcn.0042d9bc
mov esi, eax
add esp, 4
cmp esi, edi
je 0x406833
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
call eax
add eax, 0x10
mov dword [esi + 0x10], eax
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
call eax
add eax, 0x10
mov dword [esi + 0x14], eax
jmp 0x406835
mov eax, str._replace
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x406806
sub eax, edx
sar eax, 1
push str._replace
lea ecx, [ebp - 0x6ec]
push ecx
mov ebx, eax
call fcn.00403540
mov esi, dword [ebp - 0x6ec]
jmp 0x406703
xor esi, esi
mov dword [0x4ff108], esi
mov eax, esi
call fcn.00404be0
test eax, eax
jne 0x406916
mov eax, dword [0x4ff104]
cmp eax, edi
jne 0x406874
push 0x24d8
call fcn.0042d9bc
add esp, 4
cmp eax, edi
je 0x40686d
mov esi, eax
call fcn.00411420
jmp 0x40686f
xor eax, eax
mov dword [0x4ff104], eax
add eax, 0xa28
push str.silent
push eax
call fcn.0042f26e
add esp, 8
test eax, eax
je 0x406916
mov ecx, dword [ebp - 0x6f0]
push ecx
call sym.Setup.exe_public:_static_void___cdecl_DuiLib::CPaintManagerUI::SetInstance_struct_HINSTANCE____
add esp, 4
lea esi, [ebp - 0x6e8]
call fcn.00406b10
push edi
push edi
push SysReAllocString
push SysReAllocString
push SysReAllocString
push SysReAllocString
push 0x60000
push 0x10cf0000
push 0x4d4de0
push edi
mov ecx, esi
call sym.Setup.exe_protected_virtual:_int___thiscall_DuiLib::WindowImplBase::CreateMainFrame_struct_HWND_____wchar_t_const___unsigned_long_int__unsigned_long_int__int__int__int__int__struct_HMENU_____bool_
test eax, eax
je 0x4068f1
mov ecx, esi
call sym.Setup.exe_public:_void___thiscall_DuiLib::CWindowWnd::CenterWindow_void_
push 1
mov ecx, esi
call sym.Setup.exe_public:_struct_HWND______thiscall_DuiLib::CWindowWnd::operator_struct_HWND____void_const
push eax
call dword [sym.imp.USER32.dll_ShowWindow]
call sym.Setup.exe_public:_static_void___cdecl_DuiLib::CPaintManagerUI::MessageLoop_void_
call sym.Setup.exe_public:_static_void___cdecl_DuiLib::CPaintManagerUI::Term_void_
lea eax, [ebp - 0x6e8]
call fcn.00407be0
lea esi, [ebp - 0x6e8]
call fcn.00406c00
jmp 0x406a12
call fcn.0040a590
call fcn.0040a8f0
call fcn.0040b240
mov eax, dword [0x4ff104]
cmp eax, edi
jne 0x40694f
push 0x24d8
call fcn.0042d9bc
add esp, 4
cmp eax, edi
je 0x406948
mov esi, eax
call fcn.00411420
jmp 0x40694a
xor eax, eax
mov dword [0x4ff104], eax
mov esi, eax
call fcn.0040fcb0
call fcn.0040b4e0
call fcn.0040baa0
mov eax, dword [0x4ff108]
cmp eax, edi
jne 0x4069b8
push 0x18
call fcn.0042d9bc
mov esi, eax
add esp, 4
cmp esi, edi
je 0x4069b1
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
call eax
add eax, 0x10
mov dword [esi + 0x10], eax
mov edx, dword [0x4fb44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fb44c
call eax
add eax, 0x10
mov dword [esi + 0x14], eax
mov eax, esi
jmp 0x4069b3
xor eax, eax
mov dword [0x4ff108], eax
call fcn.00404db0
test eax, eax
je 0x406a07
push 0x206
lea edx, [ebp - 0x20a]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x20c], cx
call fcn.00436fe0
add esp, 0xc
push 0x104
lea eax, [ebp - 0x20c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 4
push edi
lea ecx, [ebp - 0x20c]
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push edi
push 3
jmp 0x406a0a
push edi
push 1
call fcn.00414ca0
add esp, 8
mov eax, dword [0x4ff104]
cmp eax, edi
jne 0x406a3c
push 0x24d8
call fcn.0042d9bc
add esp, 4
cmp eax, edi
je 0x406a35
mov esi, eax
call fcn.00411420
jmp 0x406a37
xor eax, eax
mov dword [0x4ff104], eax
mov edi, eax
call fcn.00410070
call dword [sym.imp.ole32.dll_CoUninitialize]
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0042cf77
mov esp, ebp
pop ebp
ret 0x10