Function at 0x40f34b
Capabilities:
Check if file exists
Check mutex and terminate process on windows
Check mutex on windows
Delete file
Query environment variable
Set current directory
Set environment variable
Terminate process

Disassembly:
push ebp
lea ebp, [esp - 0x20c54]
mov eax, 0x20c54
call fcn.004128e0
push 0xffffffffffffffff
push 0x41c69b
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x4313f4]
xor eax, ebp
mov dword [ebp + 0x20c50], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 0x20c64]
xor ebx, ebx
push ebx
push ebx
push 1
push ebx
mov eax, str.int___stdcall_wWinMain_struct_HINSTANCE____struct_HINSTANCE____wchar_t__int_
push eax
push 0x424300
push eax
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x18], edi
call fcn.00407ab1
mov dword [ebp - 4], ebx
mov esi, 0x4242ec
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40f3dd
push 1
push 0x4242dc
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040bcf5
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40f415
push 1
push edi
push str._commandline_:
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
push str.mutexXmpSetupProgress_01572D6A_8C9A_484b_8B31_F2890BF1FB21
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x14], eax
call edi
cmp eax, 0xb7
je 0x40f43c
call edi
cmp eax, 5
jne 0x40f4af
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40f46f
push 2
call edi
push eax
push str.XmpSetup_is_Running_in_Progress____EXIT____Win32_Error:
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a2f0
mov ecx, eax
call fcn.0040bcf5
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
mov esi, eax
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x6c]
call fcn.00407d23
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x20c50]
xor ecx, ebp
call fcn.0041276a
add ebp, 0x20c54
leave
ret 0x10
cmp dword [ebp - 0x14], ebx
je 0x40f4bd
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.ChangeWindowMessageFilter
push str.USER32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x40f4de
push 1
push 0x4a
call eax
lea eax, [ebp - 0xd]
push eax
push dword [ebp + 0x20c68]
mov byte [ebp - 0xd], bl
push dword [ebp - 0x18]
call fcn.0040b6ad
mov ecx, eax
call fcn.0040d13f
mov esi, eax
cmp byte [ebp - 0xd], bl
je 0x40f514
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x40f47c
xor eax, eax
mov edi, 0x206
push edi
mov word [ebp + 0x20430], ax
lea eax, [ebp + 0x20432]
push ebx
push eax
call sub.MSVCR90.dll_memset
push 0x4241e4
push str.XMPWinMain_D5F0F030_E8E0_4F8D_98D1_2381E3F773E6
push str.mutex_s__s
mov esi, 0x104
lea eax, [ebp + 0x20430]
push esi
push eax
call dword [sym.imp.MSVCR90.dll__snwprintf]
add esp, 0x20
lea eax, [ebp + 0x20430]
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x18], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x40f580
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x40f5bf
mov esi, 0x4242ec
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40f5ae
push 1
push str.other_xmp.exe_is_runing_in_winmain__so_exit_current_process
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040bcf5
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xd
pop esi
jmp 0x40f47c
xor eax, eax
push edi
mov word [ebp + 0x20a48], ax
lea eax, [ebp + 0x20a4a]
push ebx
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push esi
lea eax, [ebp + 0x20a48]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp + 0x20a48]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp + 0x20a48]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
xor eax, eax
push 0xfffe
mov word [ebp + 0x228], ax
lea eax, [ebp + 0x22a]
push ebx
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0x8000
lea eax, [ebp + 0x228]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp + 0x20a48]
push eax
lea eax, [ebp + 0x228]
push eax
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
jne 0x40f6fe
push 0xfffe
mov word [ebp + 0x10228], ax
lea eax, [ebp + 0x1022a]
push ebx
push eax
call sub.MSVCR90.dll_memset
lea eax, [ebp + 0x228]
push eax
lea eax, [ebp + 0x20a48]
push eax
push str._s__s
lea eax, [ebp + 0x10228]
push 0x8000
push eax
call dword [sym.imp.MSVCR90.dll__snwprintf]
push 0x4242ec
call fcn.00402c05
add esp, 0x24
test eax, eax
jne 0x40f6ec
push 1
lea eax, [ebp + 0x10228]
push eax
push str.___GetEnvironmentVariable_:
lea eax, [ebp + 0x20a48]
push eax
push str._AddEnvironmentVariable_:
push ebx
push 0x4242ec
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
lea eax, [ebp + 0x10228]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
xor eax, eax
push edi
mov word [ebp + 0x20228], ax
lea eax, [ebp + 0x2022a]
push ebx
push eax
call sub.MSVCR90.dll_memset
push 0x4241e4
push str.XMP_D5F0F030_E8E0_4F8D_98D1_2381E3F773E6
push str.mutex_s__s
lea eax, [ebp + 0x20228]
push esi
push eax
call dword [sym.imp.MSVCR90.dll__snwprintf]
add esp, 0x20
lea eax, [ebp + 0x20228]
push eax
push ebx
push 0x20000
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x40f75f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x40f75f
mov byte [ebp - 0xd], bl
jmp 0x40f771
mov byte [ebp - 0xd], 1
cmp dword [ebp - 0x14], ebx
je 0x40f771
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp + 0x20c]
push eax
call fcn.0040e9f2
pop ecx
mov byte [ebp - 4], 1
cmp byte [ebp - 0xd], bl
jne 0x40f951
lea eax, [ebp - 0x14]
push ebx
push eax
call fcn.0040c9ef
mov byte [ebp - 4], 2
xor eax, eax
push edi
mov word [ebp + 0x20638], ax
lea eax, [ebp + 0x2063a]
push ebx
push eax
call sub.MSVCR90.dll_memset
xor eax, eax
push edi
mov word [ebp + 0x20840], ax
lea eax, [ebp + 0x20842]
push ebx
push eax
call sub.MSVCR90.dll_memset
mov edi, dword [sym.imp.MSVCR90.dll_wcsncpy]
push esi
push dword [ebp - 0x14]
lea eax, [ebp + 0x20840]
push eax
call edi
push esi
push dword [ebp - 0x14]
lea eax, [ebp + 0x20638]
push eax
call edi
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0x38
push dword [ebp - 0x14]
call esi
mov edi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
test eax, eax
je 0x40f941
lea eax, [ebp + 0x20638]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp + 0x20638]
push eax
mov ecx, 0x432948
call fcn.0040a6b1
push str.Core.cab
lea eax, [ebp + 0x20840]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp + 0x20840]
push eax
call esi
test eax, eax
je 0x40f941
push str.XMPCoreE
lea ecx, [ebp - 0x1c]
call fcn.0040a683
mov byte [ebp - 4], 3
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push 0x423bc4
push dword [ebp - 0x1c]
call fcn.0040d941
mov esi, 0x4242ec
push esi
call fcn.00402c05
add esp, 0x10
test eax, eax
jne 0x40f8c6
push 1
push dword [0x432948]
lea eax, [ebp + 0x20840]
push str._ExtractDir_:
push eax
push str._Core.cab_:
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
push ebx
push 0x40d9c7
push ebx
lea eax, [ebp + 0x20840]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupIterateCabinetW]
test eax, eax
je 0x40f919
lea eax, [ebp + 0x20840]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push 0x423b9c
push dword [ebp - 0x1c]
call fcn.0040d941
add esp, 0xc
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
call fcn.0040e0cd
pop ecx
jmp 0x40f936
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push 0x42407c
push dword [ebp - 0x1c]
call fcn.0040d941
add esp, 0xc
mov byte [ebp - 4], 2
push dword [ebp - 0x1c]
call edi
jmp 0x40f946
mov esi, 0x4242ec
mov byte [ebp - 4], 1
push dword [ebp - 0x14]
call edi
jmp 0x40f956
mov esi, 0x4242ec
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40f97f
push 1
push str.DefWindowProc
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040bcf5
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.USER32.dll_DefWindowProcW]
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40f9b2
push 1
push str.AtlInitCommonControls
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040bcf5
push 4
call fcn.00409b09
push esi
call fcn.00402c05
pop ecx
pop ecx
test eax, eax
jne 0x40f9e3
push 1
push str._Module.Init
push ebx
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040bcf5
push ebx
push dword [ebp + 0x20c5c]
mov esi, 0x43290c
push ebx
mov ecx, esi
call fcn.0040a843
lea ecx, [ebp - 0x54]
call fcn.0040b005
mov byte [ebp - 4], 4
lea eax, [ebp - 0x54]
push eax
mov ecx, esi
call fcn.0040b37a
push str.XmpPlayer.dll
lea ecx, [ebp]
call fcn.0040eeaa
mov byte [ebp - 4], 5
mov eax, dword [ebp]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.HandleXmpSingleton
push eax
mov dword [ebp - 0x14], eax
call esi
cmp eax, ebx
jne 0x40fa90
push ebx
push 0x420310
push 0x423fd0
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xfffffffffffffff6
pop esi
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov byte [ebp - 4], 4
xor eax, eax
cmp ax, word [ebp + 4]
je 0x40fa70
lea eax, [ebp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x54]
call fcn.0040b0f6
mov byte [ebp - 4], bl
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
jmp 0x40f47c
call eax
mov edi, eax
cmp dword [ebp - 0x18], ebx
je 0x40faa2
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, ebx
jl 0x40fade
mov byte [ebp - 4], 4
xor eax, eax
cmp ax, word [ebp + 4]
je 0x40fabc
lea eax, [ebp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x54]
call fcn.0040b0f6
mov byte [ebp - 4], bl
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
push 2
jmp 0x40f5b9
push str.InitXLUE
push dword [ebp - 0x14]
call esi
mov edi, eax
cmp edi, ebx
jne 0x40fafe
push ebx
push 0x420310
push 0x423f90
jmp 0x40fa42
push 0x64
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call fcn.0040dfcb
pop ecx
pop ecx
push ebx
call edi
lea ecx, [ebp - 0x54]
call fcn.0040a7ab
push ebx
lea ecx, [ebp + 0x20c]
mov edi, eax
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call fcn.0040dfcb
pop ecx
pop ecx
push str.UnInitXLUE
push dword [ebp - 0x14]
call esi
cmp eax, ebx
je 0x40fb46
call eax
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov byte [ebp - 4], 4
xor eax, eax
cmp ax, word [ebp + 4]
je 0x40fb6b
lea eax, [ebp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x54]
call fcn.0040b0f6
mov byte [ebp - 4], bl
lea ecx, [ebp + 0x20c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov esi, edi
jmp 0x40f47c