Function at 0x40a140
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2be4
call fcn.004221d0
mov eax, dword [0x467080]
xor eax, esp
mov dword [esp + 0x2be0], eax
test byte [0x46a020], 1
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
jne 0x40a18b
or dword [0x46a020], 1
mov ecx, 0x46a028
call sym.Install_comm.exe_public:_void___thiscall_CNsApp::constructor_void_
push 0x4523b0
call fcn.00418f2c
add esp, 4
push 0x459888
push 0x46a23a
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
test byte [0x46a5c8], 1
jne 0x40a1c2
or dword [0x46a5c8], 1
mov ecx, 0x46a5cc
call sym.Install_comm.exe_public:_void___thiscall_CnsDump::constructor_void_
push 0x452400
call fcn.00418f2c
add esp, 4
push str.hf_install_dump
push 0x459888
mov ecx, 0x46a5cc
call sym.Install_comm.exe_public:_void___thiscall_CnsDump::Install_wchar_t_const___wchar_t_const__
xor eax, eax
push 0x208
push eax
lea ecx, [esp + 0x29e2]
push ecx
mov word [esp + 0x29e4], ax
call fcn.00419d00
add esp, 0xc
push 0x104
lea edx, [esp + 0x29dc]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x29d8]
push eax
call sym.Install_comm.exe_long_long___int64____cdecl_FileSize_wchar_t_const__
mov edi, edx
mov edx, dword [section..data]
mov esi, eax
mov eax, dword [edx + 0xc]
add esp, 4
mov ecx, section..data
call eax
push edi
add eax, 0x10
push esi
push str.ns_installer__I64d
lea edi, [esp + 0x20]
mov dword [esp + 0x20], eax
call fcn.00406080
mov edi, dword [esp + 0x20]
add esp, 0xc
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40a2ef
lea ecx, [esp + 0x1990]
push ecx
call fcn.004094d0
push 9
push 8
push 0xb4
push 0x140
push 3
push 0
push 0
mov edi, 0x4598e0
mov edx, 0x4598e8
lea eax, [esp + 0x19ac]
call fcn.00409e60
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [esp + 0x1990]
push edx
call fcn.00409660
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a2d6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x2bec]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.00418dfa
mov esp, ebp
pop ebp
ret 0x10
lea ecx, [esp + 0x10]
push ecx
mov ecx, ebx
call fcn.004058e0
mov eax, dword [esp + 0x10]
mov esi, dword [eax - 0xc]
test esi, esi
jns 0x40a310
push 0x80070057
call fcn.004064c0
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, esi
or edx, ecx
jge 0x40a330
mov eax, esi
lea ecx, [esp + 0x10]
call fcn.00405f60
mov eax, dword [esp + 0x10]
lea edx, [esi + 1]
push edx
push eax
call fcn.00419b02
mov eax, dword [esp + 0x18]
add esp, 8
cmp esi, dword [eax - 8]
jg 0x40a306
mov dword [eax - 0xc], esi
mov ecx, dword [esp + 0x10]
xor eax, eax
mov word [ecx + esi*2], ax
mov eax, dword [esp + 0x10]
cmp dword [eax - 0xc], 0
jl 0x40a3d1
push 0x459910
push eax
call fcn.00419858
add esp, 8
test eax, eax
je 0x40a3d1
sub eax, dword [esp + 0x10]
sar eax, 1
js 0x40a3d1
lea ecx, [esp + 0x1da0]
call sym.Install_comm.exe_public:_void___thiscall_CNsInstaller::constructor_void_
push ebx
lea ecx, [esp + 0x1da4]
call sym.Install_comm.exe_public:_void___thiscall_CNsInstaller::ParseParams_wchar_t_const__
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x1db0]
call sym.Install_comm.exe_public:_void___thiscall_CNsInstaller::StartInstall_wchar_t_const___struct_HWND_____int__struct_HWND____
lea ecx, [esp + 0x1da0]
call sym.Install_comm.exe_public:_void___thiscall_CNsInstaller::AutoRun_void_
push 0
push 0
lea ecx, [esp + 0x1da8]
call sym.Install_comm.exe_public:_void___thiscall_CNsInstaller::DoUpdate_bool__wchar_t_const__
lea ecx, [esp + 0x1da0]
call sym.Install_comm.exe_public:_void___thiscall_CNsInstaller::destructor_void_
jmp 0x40a474
lea esi, [esp + 0x18]
call fcn.004073b0
push 0
mov esi, 1
push esi
push 0
push 0xb4
push 0x1ae
push 0
push 0
xor eax, eax
lea ecx, [esp + 0x34]
call fcn.00406cb0
push 5
push esi
push esi
lea ecx, [esp + 0x24]
call fcn.00404d40
test byte [0x46a020], 1
jne 0x40a430
or dword [0x46a020], esi
mov ecx, 0x46a028
call sym.Install_comm.exe_public:_void___thiscall_CNsApp::constructor_void_
push 0x4523b0
call fcn.00418f2c
add esp, 4
test byte [0x46a020], 1
mov edx, dword [esp + 0x6c]
mov dword [0x46a02c], edx
jne 0x40a460
or dword [0x46a020], esi
mov ecx, 0x46a028
call sym.Install_comm.exe_public:_void___thiscall_CNsApp::constructor_void_
push 0x4523b0
call fcn.00418f2c
add esp, 4
mov ecx, 0x46a028
call sym.Install_comm.exe_public:_int___thiscall_CNsApp::MsgLoop_void_
lea eax, [esp + 0x18]
push eax
call fcn.00407650
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a494
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
jmp 0x40a2bd