Function at 0x40aad0
Capabilities:
Check mutex on windows

Disassembly:
push 0xffffffffffffffff
push 0x599348
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push edi
mov eax, dword [0x5fd890]
xor eax, esp
push eax
lea eax, [esp + 0x1c]
mov dword fs:[0], eax
call fcn.00470afc
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40ab10
push 0x80004005
call fcn.004020b0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebp, [eax + 0x10]
mov dword [esp + 0x10], ebp
mov dword [esp + 0x24], 0
call fcn.00470afc
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40ab42
push 0x80004005
call fcn.004020b0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
mov bl, 1
mov byte [esp + 0x24], bl
mov ecx, dword [esi + 0x440]
mov eax, dword [ecx - 0xc]
test eax, eax
jne 0x40abff
lea edi, [esi + 0x44c]
push edi
lea edx, [esp + 0x1c]
push str.3DS_Soft_Tool_Install_RunOnce_
push edx
call fcn.0040c560
add esp, 0xc
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x28], 2
call fcn.004044b0
mov byte [esp + 0x24], bl
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40abb5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push edi
lea ecx, [esp + 0x1c]
push str.3DS_Soft_Tool_Start_Flag_
push ecx
call fcn.0040c560
add esp, 0xc
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x28], 3
call fcn.004044b0
mov byte [esp + 0x24], bl
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40abfb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebp, dword [esp + 0x10]
push ebp
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40acd9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.ck_WL
lea ecx, [esi + 0x44c]
push ecx
lea edx, [esp + 0x20]
push edx
call fcn.00404340
push esi
push eax
push 0
mov byte [esp + 0x3c], 4
call fcn.00404b20
mov byte [esp + 0x3c], bl
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
add esp, 0x18
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ac6f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x15c]
mov ecx, esi
call eax
mov byte [esp + 0x24], 0
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 0x40aca0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov dword [esp + 0x24], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40acc4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x18
ret
mov byte [esp + 0x24], 0
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 0x40acfe
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov dword [esp + 0x24], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ad22
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, bl
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x18
ret