Function at 0x100041d0
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
cmp byte [0x10033b44], 0
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x10004263
call fcn.100022e0
mov dword [ebp - 8], eax
mov ecx, edx
sub eax, dword [0x10033dc0]
mov bl, 1
mov dword [ebp - 0xc], ecx
sbb ecx, dword [0x10033dc4]
cmp ecx, 1
jb 0x10004245
ja 0x10004217
cmp eax, 0x2a05f200
jbe 0x10004245
push 0x10033b48
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
test eax, eax
setne bl
test eax, eax
je 0x10004235
push eax
call edi
mov eax, dword [ebp - 8]
mov dword [0x10033dc0], eax
mov eax, dword [ebp - 0xc]
mov dword [0x10033dc4], eax
push 0
push dword [0x10033924]
call esi
test eax, eax
je 0x10004257
test bl, bl
jne 0x1000425c
call fcn.10004430
cmp byte [0x10033b44], 0
mov ebx, dword [ebp + 8]
jne 0x100042b9
push 0
push dword [0x10033920]
call esi
test eax, eax
jne 0x100042b9
push 0x10033b48
push eax
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
test eax, eax
setne cl
mov byte [ebp - 1], cl
test eax, eax
je 0x10004299
push eax
call edi
mov cl, byte [ebp - 1]
test cl, cl
je 0x100042b9
mov eax, dword [0x1003391c]
test eax, eax
je 0x100042ab
cmp eax, 0xffffffff
jne 0x100042b0
call fcn.100020b0
push ebx
call fcn.10004490
add esp, 4
cmp byte [0x10033b44], 0
je 0x1000441b
mov eax, dword [0x10033918]
mov esi, dword [eax + 0x38]
mov edi, dword [eax + 0x3c]
mov eax, esi
or eax, edi
je 0x10004341
call fcn.100022e0
mov ebx, dword [0x10033dbc]
mov ecx, eax
sub eax, dword [0x10033db8]
mov dword [ebp - 8], edx
sbb dword [ebp - 8], ebx
mov dword [ebp - 0xc], eax
cmp dword [ebp - 8], edi
jb 0x1000441b
ja 0x10004306
cmp eax, esi
jb 0x1000441b
mov eax, edi
mov ebx, esi
shld eax, ebx, 1
add ebx, ebx
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp + 8]
cmp dword [ebp - 8], eax
jb 0x10004325
ja 0x10004335
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x10]
ja 0x10004335
mov ecx, dword [0x10033db8]
mov edx, dword [0x10033dbc]
add ecx, esi
adc edx, edi
mov dword [0x10033db8], ecx
mov dword [0x10033dbc], edx
mov ecx, dword [0x10033da8]
mov esi, 3
lea eax, [ecx + 1]
cdq
idiv esi
mov esi, edx
cmp byte [esi + 0x10033da0], 0
je 0x10004396
mov byte [esi + 0x10033da0], 0
lea edx, [ebp - 0x18]
mov ecx, dword [esi*4 + 0x10033d94]
push 0x10
push 0
push edx
mov eax, dword [ecx]
push ecx
call dword [eax + 0x24]
test eax, eax
js 0x10004390
push dword [ebp - 0x14]
mov byte [esi + 0x10033da3], 1
push esi
call fcn.100023a0
add esp, 8
mov ecx, dword [0x10033da8]
mov eax, dword [0x10033dac]
cmp eax, 2
jge 0x100043b3
pop edi
mov dword [0x10033da8], esi
inc eax
pop esi
mov dword [0x10033dac], eax
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ecx*4 + 0x10033d94]
push ecx
call fcn.100023e0
add esp, 4
test al, al
je 0x100043e7
mov eax, dword [edi]
push edi
call dword [eax + 0x28]
mov eax, dword [0x10033da8]
mov byte [eax + 0x10033da3], 0
push dword [0x10033da8]
call fcn.10002430
add esp, 4
mov eax, dword [ebx]
push 0
push edi
push 0
push 0
push dword [ebp + 0xc]
push ebx
call dword [eax + 0x70]
test eax, eax
jns 0x10004409
push eax
push str.d3d8_shmem_capture:_CopyRects_failed
call fcn.10001fc0
add esp, 8
mov eax, dword [0x10033da8]
mov byte [eax + 0x10033da0], 1
mov dword [0x10033da8], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret