Function at 0x10069cb0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100b1bbf
mov eax, dword fs:[0]
push eax
sub esp, 0x16c
push ebx
push esi
push edi
mov eax, dword [0x100dbc1c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x28], ecx
xor eax, eax
mov dword [ebp - 0x18], eax
mov edx, dword [ecx + 4]
mov dword [ebp - 0x14], eax
test edx, edx
je 0x10069e48
mov eax, dword [ebp + 8]
add eax, 0x10
mov dword [ebp - 0x24], eax
mov eax, dword [eax]
test eax, eax
je 0x10069e48
cmp eax, 0xa00000
ja 0x10069e48
push 0
push 0
push 0
push 0xf001f
push edx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x3c], eax
test eax, eax
jne 0x10069e5e
lea eax, [ebp - 0x40]
push eax
call fcn.1003b6a0
add esp, 4
cmp dword [eax], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 1
je 0x10069d76
lea eax, [ebp - 0x2c]
push eax
call fcn.1003b6a0
add esp, 4
mov ecx, dword [eax]
mov dword [ebp - 4], 1
mov dword [ebp - 0x18], 3
mov eax, dword [ecx]
mov eax, dword [eax + 4]
call eax
mov byte [ebp + 0xb], 1
test al, al
jne 0x10069d7a
mov byte [ebp + 0xb], 0
mov esi, dword [ebp - 0x28]
or ebx, 0xffffffff
test esi, esi
je 0x10069da9
test byte [ebp - 0x18], 2
je 0x10069da9
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x10069da9
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x10069da9
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov esi, dword [ebp - 0x3c]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x10069dd6
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x10069dd6
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x10069dd6
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp byte [ebp + 0xb], 0
je 0x10069e48
lea eax, [ebp - 0x2c]
push eax
call fcn.1003b6a0
add esp, 4
mov edi, dword [eax]
lea ecx, [ebp - 0xe0]
mov dword [ebp - 4], 2
call fcn.10015e70
mov esi, eax
push str.mapviewoffile_fail.
push esi
mov byte [ebp - 4], 3
call fcn.10012080
mov edx, dword [edi]
add esp, 8
mov ecx, edi
push esi
call dword [edx + 0x14]
lea ecx, [ebp - 0xe0]
call fcn.10012280
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x10069e48
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x10069e48
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], ebx
dec ebx
jne 0x10069e48
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
xor eax, eax
or ebx, 0xffffffff
mov dword [ebp - 0x20], eax
cmp dword [ebp + 0xc], eax
je 0x10069fdf
push str.coupon_sm_mutex
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x34]
push eax
call fcn.1003b6a0
add esp, 4
cmp dword [eax], 0
mov ecx, 4
mov dword [ebp - 4], 4
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
je 0x10069eda
lea eax, [ebp - 0x48]
push eax
call fcn.1003b6a0
add esp, 4
mov ecx, 0xc
mov dword [ebp - 4], 5
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
mov ecx, dword [eax]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
call eax
mov byte [ebp - 0xd], 1
test al, al
jne 0x10069ede
mov byte [ebp - 0xd], 0
mov ecx, dword [ebp - 0x14]
test cl, 8
je 0x10069f15
mov esi, dword [ebp - 0x44]
and ecx, 0xfffffff7
mov dword [ebp - 0x14], ecx
test esi, esi
je 0x10069f15
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x10069f15
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x10069f12
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov ecx, dword [ebp - 0x14]
mov esi, dword [ebp - 0x30]
and ecx, 0xfffffffb
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x14], ecx
test esi, esi
je 0x10069f48
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x10069f48
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x10069f48
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp byte [ebp - 0xd], 0
je 0x10069fcc
lea eax, [ebp - 0x34]
push eax
call fcn.1003b6a0
add esp, 4
mov edi, dword [eax]
lea ecx, [ebp - 0xe0]
mov dword [ebp - 4], 6
call fcn.10015e70
mov esi, eax
push str.w_createmutex_errcode:
push esi
mov byte [ebp - 4], 7
call fcn.10012080
add esp, 8
mov ecx, esi
push dword [ebp - 0x38]
call fcn.10011d70
mov eax, dword [edi]
mov ecx, edi
push esi
call dword [eax + 0x14]
lea ecx, [ebp - 0xe0]
call fcn.10012280
mov esi, dword [ebp - 0x30]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x10069fcc
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x10069fcc
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x10069fcc
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x10069fdf
push 0x2710
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp - 0x48]
push eax
call fcn.1003b6a0
add esp, 4
mov ecx, dword [ebp - 0x14]
or ecx, 0x10
mov dword [ebp - 4], 8
cmp dword [eax], 0
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
je 0x1006a033
lea eax, [ebp - 0x34]
push eax
call fcn.1003b6a0
add esp, 4
mov ecx, dword [ebp - 0x14]
or ecx, 0x20
mov dword [ebp - 4], 9
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
mov ecx, dword [eax]
mov eax, dword [ecx]
mov eax, dword [eax + 4]
call eax
mov byte [ebp - 0xd], 1
test al, al
jne 0x1006a037
mov byte [ebp - 0xd], 0
mov esi, dword [ebp - 0x30]
test esi, esi
je 0x1006a065
mov ecx, dword [ebp - 0x14]
test cl, 0x20
je 0x1006a065
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1006a065
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x1006a065
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov esi, dword [ebp - 0x44]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x1006a092
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1006a092
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x1006a092
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp byte [ebp - 0xd], 0
je 0x1006a10b
lea eax, [ebp - 0x1c]
push eax
call fcn.1003b6a0
add esp, 4
mov edi, dword [eax]
lea ecx, [ebp - 0x178]
mov dword [ebp - 4], 0xa
call fcn.10015e70
mov esi, eax
push str.start_write_sm
push esi
mov byte [ebp - 4], 0xb
call fcn.10012080
mov edx, dword [edi]
add esp, 8
mov ecx, edi
push esi
call dword [edx + 0x14]
lea ecx, [ebp - 0x178]
call fcn.10012280
mov esi, dword [ebp - 0x18]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x1006a10b
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1006a10b
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], ebx
dec ebx
jne 0x1006a10b
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov edi, dword [ebp - 0x3c]
push 0xa00000
push 0
push edi
call fcn.100837f0
mov ebx, dword [ebp + 8]
add esp, 0xc
mov eax, ebx
cmp dword [ebx + 0x14], 0x10
jb 0x1006a12b
mov eax, dword [ebx]
mov esi, dword [ebp - 0x24]
push dword [esi]
push eax
push edi
call fcn.10082cf0
add esp, 0xc
cmp dword [ebp + 0xc], 0
je 0x1006a158
mov esi, dword [ebp - 0x20]
test esi, esi
je 0x1006a155
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x24]
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x28]
add ecx, 8
cmp ecx, ebx
je 0x1006a179
cmp dword [ebx + 0x14], 0x10
jb 0x1006a171
mov ebx, dword [ebx]
push dword [esi]
push ebx
call fcn.1001dd80
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8