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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x708
mov eax, dword [0x4fb2a0]
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 - 0x708], eax
mov dword [ebp - 0x6fc], ecx
call dword [sym.imp.ole32.dll_CoInitialize]
cmp dword [0x50012c], ebx
jne 0x40656d
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x406567
mov esi, eax
call fcn.004112e0
mov dword [0x50012c], eax
jmp 0x40656d
mov dword [0x50012c], ebx
push str.GameBuffInterUninstallMutex
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x406931
push edi
xor edi, edi
jmp 0x406593
xor ebx, ebx
cmp dword [0x50012c], ebx
jne 0x4065c0
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x4065ba
mov esi, eax
call fcn.004112e0
mov dword [0x50012c], eax
jmp 0x4065c0
mov dword [0x50012c], ebx
call fcn.00411670
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [0x50012c], ebx
jne 0x4065fa
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, ebx
je 0x4065f4
mov esi, eax
call fcn.004112e0
mov dword [0x50012c], eax
jmp 0x4065fa
mov dword [0x50012c], ebx
mov ebx, 0x4d5e1c
call fcn.00411740
test eax, eax
je 0x40660e
inc edi
cmp edi, 0xa
jb 0x406591
mov eax, dword [0x50012c]
xor edi, edi
cmp eax, edi
jne 0x40663a
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, edi
je 0x406633
mov esi, eax
call fcn.004112e0
jmp 0x406635
xor eax, eax
mov dword [0x50012c], eax
mov edx, dword [ebp - 0x6fc]
mov ecx, eax
call fcn.00411460
mov esi, dword [0x500130]
cmp esi, edi
jne 0x40669f
push 0x18
call fcn.0042ec5c
mov esi, eax
add esp, 4
cmp esi, edi
je 0x406697
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov edx, dword [0x4fc44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fc44c
call eax
add eax, 0x10
mov dword [esi + 0x10], eax
mov edx, dword [0x4fc44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fc44c
call eax
add eax, 0x10
mov dword [esi + 0x14], eax
jmp 0x406699
xor esi, esi
mov dword [0x500130], esi
mov edx, dword [0x4fc44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fc44c
mov dword [ebp - 0x704], esi
call eax
mov ecx, str._replace
lea esi, [eax + 0x10]
mov dword [ebp - 0x6fc], esi
test ecx, 0xffff0000
jne 0x4066e9
mov edx, ecx
movzx edi, dx
call fcn.004030e0
test eax, eax
je 0x406719
push eax
mov eax, edi
lea edi, [ebp - 0x6fc]
call fcn.00403450
jmp 0x406713
mov eax, str._replace
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4066f1
sub eax, edx
sar eax, 1
push str._replace
lea ecx, [ebp - 0x6fc]
push ecx
mov ebx, eax
call fcn.004034f0
mov esi, dword [ebp - 0x6fc]
mov ebx, dword [ebp - 0x704]
lea eax, [ebp - 0x6fc]
call fcn.004048f0
add esi, 0xfffffff0
mov ebx, eax
lea edx, [esi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x406748
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
test ebx, ebx
je 0x4067bc
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x20a]
push edx
mov word [ebp - 0x20c], cx
call fcn.00438200
add esp, 0xc
push 0
push 0x1c
lea eax, [ebp - 0x20c]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x20c]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x406786
mov edi, eax
mov ecx, 0xc
mov esi, str.GameBuff_appconfig.dat
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x20c]
push ecx
push 0x4d5e68
push 0x4d5e6c
push str.generate
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov esi, dword [0x500130]
xor edi, edi
cmp esi, edi
jne 0x406816
push 0x18
call fcn.0042ec5c
mov esi, eax
add esp, 4
cmp esi, edi
je 0x40680e
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov edx, dword [0x4fc44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fc44c
call eax
add eax, 0x10
mov dword [esi + 0x10], eax
mov edx, dword [0x4fc44c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4fc44c
call eax
add eax, 0x10
mov dword [esi + 0x14], eax
jmp 0x406810
xor esi, esi
mov dword [0x500130], esi
mov eax, esi
call fcn.00404bd0
test eax, eax
jne 0x4068ee
mov eax, dword [0x50012c]
cmp eax, edi
jne 0x40684f
push 0x24d4
call fcn.0042ec5c
add esp, 4
cmp eax, edi
je 0x406848
mov esi, eax
call fcn.004112e0
jmp 0x40684a
xor eax, eax
mov dword [0x50012c], eax
add eax, 0xa28
push str.silent
push eax
call fcn.0043050e
add esp, 8
test eax, eax
je 0x4068ee
mov ecx, dword [ebp - 0x708]
push ecx
call sym.Setup.exe_public:_static_void___cdecl_DuiLib::CPaintManagerUI::SetInstance_struct_HINSTANCE____
add esp, 4
lea esi, [ebp - 0x6f8]
call fcn.00406a00
push edi
push edi
push SysReAllocString
push SysReAllocString
push SysReAllocString
push SysReAllocString
push 0x60000
push 0x10cf0000
push 0x4d5dd0
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 0x4068cc
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 - 0x6f8]
call fcn.00407a70
lea esi, [ebp - 0x6f8]
call fcn.00406b00
jmp 0x4068f9
lea edi, [ebp - 0x6fd]
call fcn.0040a690
mov eax, dword [0x50012c]
test eax, eax
jne 0x406923
push 0x24d4
call fcn.0042ec5c
add esp, 4
test eax, eax
je 0x40691c
mov esi, eax
call fcn.004112e0
jmp 0x40691e
xor eax, eax
mov dword [0x50012c], eax
mov edi, eax
call fcn.0040ff90
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.0042e217
mov esp, ebp
pop ebp
ret 0x10