Function at 0x4010f0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xec
mov eax, dword [0x408018]
xor eax, esp
mov dword [esp + 0xe8], eax
push ebx
push esi
push edi
call dword [sym.imp.Common.dll_void___cdecl_InitExceptionHandler_void_]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0xb7
je 0x40156c
push 0x4052cc
xor ebx, ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
mov dword [esp + 0x14], esi
call edi
cmp eax, 0xb7
jne 0x401178
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push str.XBOXERMAINWND
call dword [sym.imp.USER32.dll_FindWindowW]
mov esi, eax
cmp esi, ebx
je 0x40156c
push 5
push esi
call dword [sym.imp.USER32.dll_ShowWindow]
push 1
push esi
call dword [sym.imp.USER32.dll_SwitchToThisWindow]
jmp 0x40156c
push 1
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
cmp eax, ebx
je 0x40118e
mov edi, eax
call section..text
lea eax, [esp + 0xbc]
push eax
call dword [sym.imp.Common.dll_public:_static_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_CFileOperation::GetCurrWorkingDir_void_]
add esp, 4
call dword [sym.imp.King.dll_GetUIEngine]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx]
call eax
call dword [sym.imp.Farmwork.dll_public:_static_class_CConfig____cdecl_CSingleton_class_CConfig_::getSingleton_void_]
mov ecx, eax
call dword [sym.imp.Farmwork.dll_public:_enum_Language___thiscall_CConfig::GetLanguage_void_]
cmp eax, 1
jne 0x4011d3
call dword [sym.imp.King.dll_GetUIRes]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx]
push 0x405304
call eax
call dword [sym.imp.King.dll_GetUIRes]
push str.Resource_framework
lea ecx, [esp + 0xc0]
push ecx
lea edx, [esp + 0x54]
push edx
mov edi, eax
call fcn.00401660
mov esi, 8
add esp, 0xc
cmp dword [eax + 0x14], esi
jb 0x401201
mov eax, dword [eax]
mov edx, dword [edi]
push ebx
push eax
mov eax, dword [edx + 0x18]
mov ecx, edi
call eax
cmp dword [esp + 0x60], esi
jb 0x401220
mov ecx, dword [esp + 0x4c]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
call dword [sym.imp.King.dll_GetUIRes]
push str.ResourceDUIControl
lea edx, [esp + 0xc0]
mov edi, eax
push edx
lea eax, [esp + 0x54]
push eax
call fcn.00401660
add esp, 0xc
cmp dword [eax + 0x14], esi
jb 0x401249
mov eax, dword [eax]
mov edx, dword [edi]
push ebx
push eax
mov eax, dword [edx + 0x18]
mov ecx, edi
call eax
cmp dword [esp + 0x60], esi
jb 0x401268
mov ecx, dword [esp + 0x4c]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
call dword [sym.imp.King.dll_GetUIRes]
push str.Resourcemain
lea edx, [esp + 0xc0]
mov edi, eax
push edx
lea eax, [esp + 0x54]
push eax
call fcn.00401660
add esp, 0xc
cmp dword [eax + 0x14], esi
jb 0x401291
mov eax, dword [eax]
mov edx, dword [edi]
push ebx
push eax
mov eax, dword [edx + 0x18]
mov ecx, edi
call eax
mov edi, dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
cmp dword [esp + 0x60], esi
jb 0x4012b2
mov ecx, dword [esp + 0x4c]
push ecx
call edi
add esp, 4
call dword [sym.imp.King.dll_GetUIRes]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x10]
push 1
call eax
call dword [sym.imp.DUIControl.dll_void___cdecl_InitDuiControl_void_]
call dword [sym.imp.Common.dll_public:_static_class_CCommonManager____cdecl_CSingleton_class_CCommonManager_::getSingleton_void_]
mov ecx, eax
call dword [sym.imp.Common.dll_public:_void___thiscall_CCommonManager::Init_void_]
call dword [sym.imp.Farmwork.dll_public:_static_class_CFarmworkManager____cdecl_CSingleton_class_CFarmworkManager_::getSingleton_void_]
mov ecx, eax
call dword [sym.imp.Farmwork.dll_public:_void___thiscall_CFarmworkManager::Init_void_]
mov dword [esp + 0x10], ebx
mov ecx, dword [esp + 0x10]
push ecx
lea edx, [esp + 0x50]
push edx
call dword [sym.imp.Farmwork.dll_public:_static_class_CModuleManager____cdecl_CSingleton_class_CModuleManager_::getSingleton_void_]
mov ecx, eax
call dword [sym.imp.Farmwork.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_CModuleManager::GetModuleName_enum_ModuleType_]
cmp dword [esp + 0x5c], ebx
je 0x401484
push str.Resource_
lea eax, [esp + 0xc0]
push eax
lea ecx, [esp + 0xa8]
push ecx
call fcn.00401660
mov ecx, eax
add esp, 0xc
lea eax, [esp + 0x4c]
lea ebx, [esp + 0x68]
call fcn.00401750
cmp dword [esp + 0xb4], esi
jb 0x40134d
mov edx, dword [esp + 0xa0]
push edx
call edi
add esp, 4
push str.Resource_
lea eax, [esp + 0xc0]
push eax
lea ecx, [esp + 0xe0]
push ecx
call fcn.00401660
mov ecx, eax
add esp, 0xc
lea eax, [esp + 0x4c]
lea ebx, [esp + 0xa0]
call fcn.00401750
mov ecx, eax
lea eax, [esp + 0x84]
call fcn.00401790
cmp dword [esp + 0xb4], esi
jb 0x4013a0
mov edx, dword [esp + 0xa0]
push edx
call edi
add esp, 4
mov ebx, dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
xor edi, edi
xor eax, eax
mov dword [esp + 0xb4], 7
mov dword [esp + 0xb0], edi
mov word [esp + 0xa0], ax
cmp dword [esp + 0xec], esi
jb 0x4013da
mov ecx, dword [esp + 0xd8]
push ecx
call ebx
add esp, 4
mov eax, dword [esp + 0x68]
cmp dword [esp + 0x7c], esi
jae 0x4013e8
lea eax, [esp + 0x68]
push eax
call dword [sym.imp.Common.dll_public:_static_bool___cdecl_CFileOperation::IsDirExist_wchar_t_const__]
add esp, 4
test al, al
jne 0x40141b
mov eax, dword [esp + 0x84]
cmp dword [esp + 0x98], esi
jae 0x40140d
lea eax, [esp + 0x84]
push eax
call dword [sym.imp.Common.dll_public:_static_bool___cdecl_CFileOperation::IsFileExist_wchar_t_const__]
add esp, 4
test al, al
je 0x40143a
call dword [sym.imp.King.dll_GetUIRes]
mov ecx, dword [esp + 0x68]
cmp dword [esp + 0x7c], esi
jae 0x40142f
lea ecx, [esp + 0x68]
mov edx, dword [eax]
push edi
push ecx
mov ecx, eax
mov eax, dword [edx + 0x18]
call eax
cmp dword [esp + 0x98], esi
jb 0x401450
mov ecx, dword [esp + 0x84]
push ecx
call ebx
add esp, 4
xor edx, edx
mov dword [esp + 0x98], 7
mov dword [esp + 0x94], edi
mov word [esp + 0x84], dx
cmp dword [esp + 0x7c], esi
jb 0x40147c
mov eax, dword [esp + 0x68]
push eax
call ebx
add esp, 4
mov edi, dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
xor ebx, ebx
cmp dword [esp + 0x60], esi
jb 0x401494
mov ecx, dword [esp + 0x4c]
push ecx
call edi
add esp, 4
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
cmp eax, 0xa
jl 0x4012e9
fldz
lea edx, [esp + 0x18]
push edx
fstp qword [esp + 0x24]
lea eax, [esp + 0x44]
push eax
mov edi, vtable.CMainModule.0
push 1
mov dword [esp + 0x4c], edi
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x24], ebx
mov byte [esp + 0x28], bl
mov dword [esp + 0x44], ebx
call dword [sym.imp.Farmwork.dll_public:_static_class_CModuleManager____cdecl_CSingleton_class_CModuleManager_::getSingleton_void_]
mov ecx, eax
call dword [sym.imp.Farmwork.dll_public:_int___thiscall_CModuleManager::AddStaticModule_enum_ModuleType__class_BaseModule___struct_AddModuleArgs__]
call dword [sym.imp.King.dll_GetUIEngine]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 4]
call eax
call dword [sym.imp.King.dll_GetUIEngine]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 8]
call eax
call dword [sym.imp.Farmwork.dll_public:_static_class_CConfig____cdecl_CSingleton_class_CConfig_::getSingleton_void_]
mov ecx, eax
call dword [sym.imp.Farmwork.dll_public:_void___thiscall_CConfig::SaveConfig_void_]
mov eax, dword [0x408694]
cmp eax, ebx
je 0x401525
mov ebx, eax
call fcn.00401590
xor ebx, ebx
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x28]
cmp eax, ebx
je 0x401542
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x40], edi
cmp dword [esp + 0xd0], esi
jb 0x40156c
mov edx, dword [esp + 0xbc]
push edx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov ecx, dword [esp + 0xf4]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.004041ba
mov esp, ebp
pop ebp
ret 0x10