Function at 0x40a893
Capabilities:
Check if file exists
Check mutex and terminate process on windows
Check mutex on windows
Create process on windows
Get common file path
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x838
push ebx
push esi
push edi
xor edi, edi
push dword [0x41a160]
push 1
push edi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
lea eax, [ebp - 0x838]
push 0x104
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, 0x41ac98
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::size_void_const]
push eax
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
lea eax, [ebp - 0x220]
push 0x208
mov ebx, 0x41aa30
push eax
push str.exepath
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
mov esi, 0x80000001
push eax
push esi
call fcn.0040b50b
add esp, 0x1c
test al, al
jne 0x40a912
push edi
call dword [sym.imp.MSVCRT.dll_exit]
lea eax, [ebp - 1]
lea ecx, [ebp - 0x18]
push eax
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_class_std::allocator_char__const__]
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x220]
push eax
call fcn.004127dd
pop ecx
test al, al
pop ecx
jne 0x40a93c
push edi
call dword [sym.imp.MSVCRT.dll_exit]
push dword [ebp + 8]
push edi
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenProcess]
push 0xffffffffffffffff
push eax
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0x415900
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
push esi
call fcn.0040b6a2
add esp, 0x10
test al, al
je 0x40aab5
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40a9bf
lea eax, [ebp - 0x220]
push edi
push eax
lea ecx, [ebp - 0x18]
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::size_void_const]
push eax
lea ecx, [ebp - 0x18]
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
call fcn.00412754
add esp, 0x10
test al, al
je 0x40a9d5
push 1
push edi
lea eax, [ebp - 0x220]
push edi
push eax
push str.open
push edi
jmp 0x40aa5f
mov ecx, 0x82
xor eax, eax
lea edi, [ebp - 0x630]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x630]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x428]
push eax
push 0
lea eax, [ebp - 0x630]
push str.temp_
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp - 0x428]
push str..exe
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp - 0x428]
push 0
push eax
lea ecx, [ebp - 0x18]
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::size_void_const]
push eax
lea ecx, [ebp - 0x18]
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
call fcn.00412754
add esp, 0x10
test al, al
je 0x40aa65
xor eax, eax
push 1
push eax
lea ecx, [ebp - 0x428]
push eax
push ecx
push str.open
push eax
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
lea eax, [ebp + 8]
mov edi, 0x415608
push eax
push edi
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
push esi
call fcn.0040b341
add esp, 0x10
mov byte [ebp - 1], al
test al, al
je 0x40aa9d
push edi
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
push esi
call fcn.0040b7d4
add esp, 0xc
jmp 0x40aaa8
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [ebp - 1], 0
je 0x40aa65
xor edi, edi
jmp 0x40a93c
push 1
call dword [sym.imp.MSVCRT.dll_exit]
push ebp
mov ebp, esp
sub esp, 0x208
push ebx
mov ebx, dword [sym.imp.MSVCP60.dll_bool___cdecl_std::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const___unsigned_short_int_const__]
push esi
push edi
push 0x4147f4
push 0x41aa18
call ebx
pop ecx
mov esi, 0x41ac98
test al, al
pop ecx
je 0x40ab6f
and word [ebp - 0x208], 0
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x206]
rep stosd dword es:[edi], eax
mov ecx, esi
stosw word es:[edi], ax
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::size_void_const]
push eax
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
lea eax, [ebp - 0x208]
push 0x410
push eax
push str.exepath
mov ecx, 0x41aa30
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
push 0x80000001
call fcn.0040b50b
add esp, 0x1c
test al, al
je 0x40ab55
lea eax, [ebp - 0x208]
mov ecx, 0x41aa18
push eax
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_unsigned_short_int_const__]
push 0x4147f4
push 0x41aa18
call ebx
pop ecx
test al, al
pop ecx
je 0x40ab6f
push 1
pop eax
jmp 0x40ac1e
cmp byte [0x41ad40], 0
je 0x40ac1c
mov edi, 0x41aa18
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [0x41aa11], 0
je 0x40abc7
mov ecx, 0x41aa40
call dword [sym.imp.MSVCP60.dll_public:_unsigned_short_int_const____thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::c_str_void_const]
push eax
mov al, byte [0x41aa10]
push eax
mov al, byte [0x41aa28]
push eax
mov al, byte [0x41ac5c]
push eax
mov al, byte [0x41ac5d]
push eax
mov al, byte [0x41aa50]
push eax
call fcn.00407c44
add esp, 0x18
push 3
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::size_void_const]
push eax
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
mov ecx, edi
call dword [sym.imp.MSVCP60.dll_public:_unsigned_int___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::size_void_const]
lea eax, [eax + eax + 2]
mov ecx, edi
push eax
call dword [sym.imp.MSVCP60.dll_public:_unsigned_short_int_const____thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::c_str_void_const]
push eax
push str.exepath
mov ecx, 0x41aa30
call dword [sym.imp.MSVCP60.dll_public:_char_const____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::c_str_void_const]
push eax
push 0x80000001
call fcn.0040b771
add esp, 0x20
cmp byte [0x41ad40], 0
jne 0x40ab81
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 4