Function at 0x40b930
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x86c
push ebx
mov ebx, dword [ebp + 8]
xor eax, eax
push esi
push edi
mov byte [esp + 0x20], 0
mov ecx, 0x8f
lea edi, [esp + 0x21]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov ecx, 0x80
lea edi, [esp + 0x261]
mov byte [esp + 0x260], 0
rep stosd dword es:[edi], eax
mov eax, dword [ebx]
dec eax
cmp eax, 0x68
mov esi, 1
ja case.0x40b983.5
movzx eax, byte [eax + 0x40bf68]
jmp dword [eax*4 + 0x40bf50]
lea ecx, [esp + 0x468]
push ecx
push 0xf
call fcn.0040f6b0
add esp, 8
jmp 0x40ba05
lea edx, [esp + 0x468]
push edx
push 0xd
call fcn.0040f6b0
add esp, 8
jmp 0x40ba05
lea eax, [esp + 0x468]
push eax
push 0xe
call fcn.0040f6b0
add esp, 8
jmp 0x40ba05
mov dword [esp + 0x46c], esi
mov dword [esp + 0x468], esi
jmp 0x40ba21
lea ecx, [esp + 0x468]
push ecx
push 0x10
call fcn.0040f6b0
add esp, 8
jmp 0x40ba05
push 0x200
lea edx, [esp + 0x24]
push str.Unknown_Event_Code
push edx
call fcn.00416090
mov eax, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
jne 0x40ba21
cmp dword [esp + 0x468], esi
jne 0x40ba21
mov eax, dword [esp + 0x46c]
test eax, eax
je 0x40bf46
mov eax, dword [ebx]
dec eax
cmp eax, 0x68
ja case.0x40ba34.5
movzx eax, byte [eax + 0x40bfec]
jmp dword [eax*4 + 0x40bfd4]
push str.KaseyaConfigLogSema
push 0
lea ecx, [esp + 0x1c]
push ecx
mov dword [esp + 0x20], 0xc
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ebx, eax
test ebx, ebx
jne 0x40baa6
lea edx, [esp + 0x674]
push str.ERROR:_Failed_to_create_mutex_in_logEvent___for_the_config_log.
push edx
call fcn.004142bd
lea eax, [esp + 0x18]
push eax
mov dword [esp + 0x67c], esi
call fcn.00414284
mov ecx, dword [esp + 0x1c]
push ecx
lea edx, [esp + 0x680]
push edx
call fcn.0040b930
add esp, 0x14
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0xffffffffffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40baf9
lea eax, [esp + 0x674]
push str.ERROR:_Failed_to_obtain_mutex_in_logEvent___for_the_config_log._n
push eax
call fcn.004142bd
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0x67c], esi
call fcn.00414284
mov edx, dword [esp + 0x1c]
push edx
lea eax, [esp + 0x680]
push eax
call fcn.0040b930
add esp, 0x14
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov ecx, 0x90
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
lea ecx, [ebp + 0xc]
push ecx
call fcn.00415edf
push eax
push str._H:_M:_S__b__d__Y__
lea edx, [esp + 0x2c]
push 0x240
push edx
call fcn.00415ec4
mov eax, dword [ebp + 8]
push 0x200
add eax, 4
push eax
lea ecx, [esp + 0x27c]
push ecx
call fcn.00414960
lea edx, [esp + 0x280]
push 0x27
push edx
call fcn.00414460
add esp, 0x28
test eax, eax
je 0x40bb65
push 0x27
push eax
mov byte [eax], 0x60
call fcn.00414460
add esp, 8
test eax, eax
jne 0x40bb53
push 0x200
lea eax, [esp + 0x264]
push eax
lea ecx, [esp + 0x28]
push ecx
call fcn.00416090
lea eax, [esp + 0x2c]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40bb86
sub eax, edx
mov cl, byte [esp + eax + 0x1f]
cmp cl, 0xa
lea eax, [esp + eax + 0x1f]
jne 0x40bb9f
mov byte [eax], 0
lea edi, [esp + 0x20]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40bba4
mov dx, word [0x422870]
mov al, byte [0x422872]
mov word [edi], dx
mov byte [edi + 2], al
lea esi, [esp + 0x20]
mov eax, 0x427af8
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40bbeb
test cl, cl
je 0x40bbe7
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40bbeb
add eax, 2
add esi, 2
test cl, cl
jne 0x40bbc7
xor eax, eax
jmp 0x40bbf0
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40bc32
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
call fcn.0040b290
mov esi, eax
add esp, 4
test esi, esi
je 0x40bc21
lea edx, [esp + 0x20]
push edx
push 0x422b2c
push esi
call fcn.004155e8
push esi
call fcn.0041414f
add esp, 0x10
xor eax, eax
mov cl, byte [esp + eax + 0x20]
mov byte [eax + 0x427af8], cl
inc eax
test cl, cl
jne 0x40bc23
push ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.KaseyaErrorLogSema
push 0
lea eax, [esp + 0x1c]
push eax
mov dword [esp + 0x20], 0xc
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov esi, eax
test esi, esi
mov dword [esp + 0x10], esi
je 0x40bf46
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x40be8a
mov ecx, 0x90
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
lea ecx, [ebp + 0xc]
push ecx
call fcn.00415edf
mov edx, dword [ebp + 0xc]
mov esi, eax
mov eax, dword [0x427f78]
add esp, 4
cmp edx, eax
jne 0x40bd43
mov eax, dword [0x427f7c]
inc eax
cmp eax, 0x8e
mov dword [0x427f7c], eax
jle 0x40bcd1
mov dword [0x427f7c], 0x8e
push esi
push str._H:_M:_S
lea eax, [esp + 0x28]
push 0x240
push eax
call fcn.00415ec4
lea eax, [esp + 0x30]
add esp, 0x10
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40bcf0
mov ecx, dword [0x427f7c]
imul ecx, ecx, 7
push ecx
sub eax, edx
lea edx, [esp + eax + 0x24]
push str.._03d
push edx
call fcn.004142bd
lea eax, [esp + 0x2c]
add esp, 0xc
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40bd20
sub eax, edx
push esi
mov ecx, 0x23f
push str.__b__d__Y__
sub ecx, eax
push ecx
lea edx, [esp + eax + 0x2c]
push edx
call fcn.00415ec4
jmp 0x40bd6b
push esi
push str._H:_M:_S__b__d__Y__
lea eax, [esp + 0x28]
push 0x240
push eax
call fcn.00415ec4
mov ecx, dword [ebp + 0xc]
mov dword [0x427f78], ecx
mov dword [0x427f7c], 0
add esp, 0x10
push 0x200
lea edx, [ebx + 4]
push edx
lea eax, [esp + 0x268]
push eax
call fcn.00414960
lea ecx, [esp + 0x26c]
push 0x27
push ecx
call fcn.00414460
add esp, 0x14
test eax, eax
je 0x40bdb2
lea ebx, [ebx]
push 0x27
push eax
mov byte [eax], 0x60
call fcn.00414460
add esp, 8
test eax, eax
jne 0x40bda0
push 0x200
lea edx, [esp + 0x264]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.00416090
lea eax, [esp + 0x2c]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40bdd3
sub eax, edx
mov cl, byte [esp + eax + 0x1f]
cmp cl, 0xa
lea eax, [esp + eax + 0x1f]
jne 0x40bdec
mov byte [eax], 0
lea edi, [esp + 0x20]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40bdf1
mov cx, word [0x422870]
mov dl, byte [0x422872]
mov word [edi], cx
mov byte [edi + 2], dl
lea esi, [esp + 0x20]
mov eax, 0x427d38
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40be39
test cl, cl
je 0x40be35
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40be39
add eax, 2
add esi, 2
test cl, cl
jne 0x40be15
xor eax, eax
jmp 0x40be3e
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40be7f
mov eax, dword [ebx]
push eax
call fcn.0040b290
mov esi, eax
add esp, 4
test esi, esi
je 0x40be6c
lea ecx, [esp + 0x20]
push ecx
push 0x422b2c
push esi
call fcn.004155e8
push esi
call fcn.0041414f
add esp, 0x10
xor eax, eax
mov edi, edi
mov cl, byte [esp + eax + 0x20]
mov byte [eax + 0x427d38], cl
inc eax
test cl, cl
jne 0x40be70
mov esi, dword [esp + 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0040b040
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0040adb0
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.KaseyaErrorLogSema
push 0
lea edx, [esp + 0x1c]
push edx
mov dword [esp + 0x20], 0xc
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], esi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edi, eax
test edi, edi
je 0x40bf46
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x40bf21
mov eax, dword [ebx]
push eax
call fcn.0040b290
mov esi, eax
add esp, 4
test esi, esi
je 0x40bf1a
add ebx, 4
push ebx
push 0x422b2c
push esi
call fcn.004155e8
push esi
call fcn.0041414f
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x200
lea ecx, [esp + 0x24]
push str.Unknown_Event_Code
push ecx
call fcn.00416090
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret