Function at 0x406166
Capabilities:
Check mutex on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
xor eax, eax
mov edi, ecx
push 0x4022f8
push 1
push eax
mov esi, eax
mov byte [ebp - 1], al
mov byte [ebp - 2], al
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [0x412860], eax
test eax, eax
je 0x4061b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4061b2
push 0x2710
push dword [0x412860]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0x4022b0
call dword [sym.imp.USER32.dll_RegisterWindowMessageW]
push 4
push dword [0x412030]
lea ecx, [ebp - 0x18]
mov dword [0x412868], eax
mov dword [ebp - 0x18], 0x67727473
mov dword [ebp - 0x14], 0x4128c8
call fcn.0040fe77
push dword [ebp - 0x14]
push 0x40232c
call dword [sym.imp.USER32.dll_FindWindowW]
mov ebx, eax
test ebx, ebx
je 0x40623d
and dword [ebp - 8], esi
lea eax, [ebp - 8]
push eax
push ebx
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push dword [ebp - 8]
call dword [sym.imp.USER32.dll_AllowSetForegroundWindow]
lea eax, [ebp - 0xc]
push eax
push 0x2710
push 2
push 0
push 0
push dword [0x412868]
push ebx
call dword [sym.imp.USER32.dll_SendMessageTimeoutW]
test eax, eax
je 0x40623d
cmp dword [ebp - 0xc], 0x77636364
jne 0x40623d
mov esi, 0x800700b7
mov byte [ebp - 2], 1
or dword [edi + 0x28], 0x14000004
mov dword [edi + 0x34], 0x64
test esi, esi
js 0x40686d
push 0xa8
call fcn.004102fe
mov esi, eax
lea ebx, [edi + 0x64]
pop ecx
test esi, esi
je 0x406286
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 5
push 0x64
mov ecx, esi
call fcn.0040a74b
mov dword [esi], 0x4018f4
jmp 0x406288
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xa8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x4062ca
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0xf
push 0x69
mov ecx, esi
call fcn.0040a74b
mov dword [esi], 0x4018c0
jmp 0x4062cc
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xcc
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406326
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x226
push 0x221
push 0x21c
push 0x64
push 0x5f
push 0x5a
push 0x55
push 0x9b
mov ecx, esi
call fcn.0040bbd9
mov dword [esi], 0x4015b8
jmp 0x406328
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xec
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406379
push 0
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x228
push 0x22b
push 0x6e
push 0xa0
mov ecx, esi
call fcn.0040c11c
mov dword [esi], 0x40156c
jmp 0x40637b
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xa8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x4063bd
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x14
push 0x6e
mov ecx, esi
call fcn.0040a74b
mov dword [esi], 0x4012c8
jmp 0x4063bf
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xcc
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406419
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x1fe
push 0x1f9
push 0x1f4
push 0x28
push 0x23
push 0x1e
push 0x19
push 0x87
mov ecx, esi
call fcn.0040bbd9
mov dword [esi], 0x401784
jmp 0x40641b
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xc8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406467
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x226
push 0x203
push 0x32
push 0x78
mov ecx, esi
call fcn.00407276
mov dword [esi], fcn.004071e0
jmp 0x406469
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xcc
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x4064c3
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x212
push 0x20d
push 0x208
push 0x46
push 0x41
push 0x3c
push 0x37
push 0x91
mov ecx, esi
call fcn.0040bbd9
mov dword [esi], 0x401800
jmp 0x4064c5
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xc8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406514
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x227
push 0x217
push 0x50
push 0x82
mov ecx, esi
call fcn.00407276
mov dword [esi], fcn.004071e0
jmp 0x406516
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push pe_nt_image_headers32
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406567
push 1
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x226
push 0x203
push 0x32
push 0x8c
mov ecx, esi
call fcn.0040c11c
mov dword [esi], fcn.0040b130
jmp 0x406569
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push pe_nt_image_headers32
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x4065ba
push 1
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x227
push 0x217
push 0x50
push 0x96
mov ecx, esi
call fcn.0040c11c
mov dword [esi], fcn.0040b130
jmp 0x4065bc
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xa8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406601
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x73
push 0xa5
mov ecx, esi
call fcn.0040a74b
mov dword [esi], 0x401614
jmp 0x406603
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xcc
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x40665c
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x229
push 0x24e
push 0x82
push 0xaf
mov ecx, esi
call fcn.00407276
and dword [esi + 0xc8], 0
mov dword [esi], 0x4016ac
jmp 0x40665e
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xa8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x4066a3
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0x78
push 0xb4
mov ecx, esi
call fcn.0040a74b
mov dword [esi], 0x401894
jmp 0x4066a5
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0x108
call fcn.004102fe
pop ecx
test eax, eax
je 0x4066db
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
mov ecx, eax
call fcn.0040d35d
jmp 0x4066dd
xor eax, eax
push eax
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xac
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406720
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0xd7
mov ecx, esi
call fcn.0040ae9f
mov dword [esi], 0x401540
jmp 0x406722
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xac
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x406765
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0xdc
mov ecx, esi
call fcn.0040ae9f
mov dword [esi], 0x401830
jmp 0x406767
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
push 0xa8
call fcn.004102fe
mov esi, eax
pop ecx
test esi, esi
je 0x4067af
push dword [edi + 0x6c]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, ebx
push ecx
push 0xd2
push 0xe1
mov ecx, esi
call fcn.0040a74b
mov dword [esi], 0x401920
jmp 0x4067b1
xor esi, esi
push esi
mov ecx, edi
call fcn.00406bd5
mov esi, eax
test esi, esi
js 0x40686d
xor esi, esi
push dword [esi + 0x401a10]
call dword [sym.imp.USER32.dll_RegisterWindowMessageW]
mov dword [esi + 0x41286c], eax
mov ebx, 0x80070000
test eax, eax
je 0x4067ec
add esi, 4
cmp esi, 4
jl 0x4067c5
xor esi, esi
jmp 0x406801
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x4067ff
movzx esi, si
or esi, ebx
test esi, esi
js 0x40686d
lea eax, [edi + 0xe0]
push eax
call dword [sym.imp.mscms.dll_WcsGetCalibrationManagementState]
test eax, eax
jne 0x40683b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x406823
movzx esi, si
or esi, ebx
push esi
mov edx, 0x13a
xor ecx, ecx
call fcn.0040e9dc
mov bl, 1
test esi, esi
js 0x406870
mov ebx, 0x80070000
push 0
call dword [sym.imp.mscms.dll_WcsSetCalibrationManagementState]
test eax, eax
jne 0x4068a9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x406858
movzx esi, si
or esi, ebx
push esi
mov edx, 0x13c
xor ecx, ecx
call fcn.0040e9dc
mov bl, 1
test esi, esi
jns 0x4068a9
jmp 0x406870
mov bl, byte [ebp - 1]
mov eax, dword [0x412860]
test eax, eax
je 0x406893
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x412860]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [0x412860], 0
test bl, bl
jne 0x4068a9
cmp byte [ebp - 2], bl
jne 0x4068a9
push esi
mov edx, 0x13e
xor ecx, ecx
call fcn.0040e9dc
push dword [ebp - 0x14]
call fcn.0040ff06
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret