Function at 0x40d470
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x441300
mov eax, dword fs:[0]
push eax
sub esp, 0x7c
mov eax, dword [0x46706c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x88], ecx
mov ebx, dword [ebp + 8]
push str.GlobalHCDN_CLIENT_MUTEX
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov esi, eax
mov dword [ebp - 0x84], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, 0xb7
je 0x40d4d7
cmp eax, 5
jne 0x40d5d3
xor eax, eax
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], 0
mov word [ebp - 0x64], ax
cmp word [ebx], ax
jne 0x40d502
xor ecx, ecx
jmp 0x40d516
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40d507
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x64]
call fcn.00409420
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x64]
push 0xb
sub esp, 8
call fcn.0040e050
cmp eax, 0xffffffff
jne 0x40d55e
push str.GlobalHCDN_CLIENT_SHELL_START_EVENT
push 0
push 2
call dword [sym.imp.KERNEL32.dll_OpenEventA]
mov esi, eax
test esi, esi
je 0x40d558
push esi
call dword [sym.imp.KERNEL32.dll_SetEvent]
push esi
call edi
mov esi, dword [ebp - 0x84]
call fcn.0040dcf0
test al, al
jne 0x40d5a3
test esi, esi
je 0x40d56e
push esi
call edi
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x50]
cmp eax, 8
jb 0x40d58a
inc eax
lea ecx, [ebp - 0x64]
push eax
push dword [ebp - 0x64]
call fcn.00409ea0
xor eax, eax
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], 0
mov word [ebp - 0x64], ax
jmp 0x40d9f9
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x50]
cmp eax, 8
jb 0x40d5bf
inc eax
lea ecx, [ebp - 0x64]
push eax
push dword [ebp - 0x64]
call fcn.00409ea0
xor eax, eax
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], 0
mov word [ebp - 0x64], ax
xor eax, eax
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], 0
mov word [ebp - 0x64], ax
cmp word [ebx], ax
jne 0x40d5fe
xor ecx, ecx
jmp 0x40d612
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40d603
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x64]
call fcn.00409420
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x64]
push 0xb
sub esp, 8
call fcn.0040e050
push str.GlobalHCDN_CLIENT_SHELL_START_EVENT
push 0
cmp eax, 0xffffffff
je 0x40d679
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov edi, eax
test edi, edi
je 0x40d691
push 0x1d4c0
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x40d691
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x64]
call fcn.00407960
jmp 0x40d9f9
push 2
call dword [sym.imp.KERNEL32.dll_OpenEventA]
mov esi, eax
test esi, esi
je 0x40d691
push esi
call dword [sym.imp.KERNEL32.dll_SetEvent]
push esi
call edi
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x50]
cmp eax, 8
jb 0x40d6ad
inc eax
lea ecx, [ebp - 0x64]
push eax
push dword [ebp - 0x64]
call fcn.00409ea0
xor eax, eax
mov dword [ebp - 0x50], 7
mov dword [ebp - 0x54], 0
mov word [ebp - 0x64], ax
call fcn.0040fe80
mov ecx, dword [0x46aa50]
test ecx, ecx
je 0x40d6ee
mov eax, dword [ecx]
mov eax, dword [eax + 0x14]
call eax
test al, al
je 0x40d6ee
push ebx
push 0x455930
push str.ppskernel
call fcn.00410370
add esp, 0xc
push str.p2pnetwork.ini
push ecx
mov edx, str.show_windows
mov ecx, str.Debug
call fcn.004047e0
mov ecx, dword [0x46aa50]
neg eax
sbb eax, eax
neg eax
mov dword [0x46a574], eax
test ecx, ecx
je 0x40d73b
mov eax, dword [ecx]
mov eax, dword [eax + 0x14]
call eax
test al, al
je 0x40d73b
push dword [0x46a574]
push 0x455988
push str.ppskernel
call fcn.00410370
add esp, 0xc
mov edi, dword [ebp - 0x88]
mov esi, dword [sym.imp.USER32.dll_LoadStringW]
push 0x64
push 0x46a578
push 0x67
push edi
call esi
push 0x64
push 0x46a4a8
push 0x6d
push edi
call esi
push 0
call fcn.0042bc5d
push edx
push eax
lea eax, [ebp - 0x4c]
push str._lld
push eax
call fcn.0040e140
lea edx, [ebp - 0x4c]
add esp, 0x14
mov esi, edx
nop
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40d780
mov edi, 0x46a4a8
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40d795
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x88]
mov ecx, edi
call fcn.0040da20
push 0
push edi
push 0
push 0
push 0xb4
push 0xfa
push 0x1f4
push 0x3e8
push 0xcf0000
push 0x46a578
push 0x46a4a8
push 0
mov dword [0x46a4a4], edi
call dword [sym.imp.USER32.dll_CreateWindowExW]
mov esi, eax
mov dword [0x46a570], esi
test esi, esi
je 0x40d979
cmp dword [0x46a574], 0
je 0x40d81e
push dword [ebp + 0xc]
push esi
call dword [sym.imp.USER32.dll_ShowWindow]
push esi
call dword [sym.imp.USER32.dll_UpdateWindow]
push 0x6d
push edi
call dword [sym.imp.USER32.dll_LoadAcceleratorsW]
cmp word [ebx], 0
mov dword [ebp - 0x88], eax
jne 0x40d837
xor ecx, ecx
jmp 0x40d84f
mov ecx, ebx
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40d840
sub ecx, edx
sar ecx, 1
push ecx
push ebx
mov ecx, 0x46b0d0
call fcn.00409420
call fcn.0040b160
lea ecx, [eax + 0xe8]
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [sym.imp.USER32.dll_GetMessageW]
lea eax, [ebp - 0x80]
push 0
push 0
push 0
push eax
call esi
test eax, eax
je 0x40d8c3
mov edi, dword [sym.imp.USER32.dll_TranslateMessage]
mov ebx, dword [sym.imp.USER32.dll_DispatchMessageW]
nop dword [eax]
lea eax, [ebp - 0x80]
push eax
push dword [ebp - 0x88]
push dword [ebp - 0x80]
call dword [sym.imp.USER32.dll_TranslateAcceleratorW]
test eax, eax
jne 0x40d8b3
lea eax, [ebp - 0x80]
push eax
call edi
lea eax, [ebp - 0x80]
jmp 0x54fe00
adc al, 0
push 0
push 0
lea eax, [ebp - 0x80]
push eax
call esi
test eax, eax
jne 0x40d890
call fcn.0040b160
lea ecx, [eax + 0xe8]
mov eax, dword [ecx]
call dword [eax + 8]
mov ecx, dword [0x46aa50]
test ecx, ecx
je 0x40d900
mov eax, dword [ecx]
mov eax, dword [eax + 0x14]
call eax
test al, al
je 0x40d8fa
push str._PPSKERNEL
push str.ppskernel
call fcn.00410370
add esp, 8
mov ecx, dword [0x46aa50]
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x40d917
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x46aa50]
test ecx, ecx
je 0x40d971
mov eax, dword [ecx]
mov eax, dword [eax + 0x14]
call eax
test al, al
je 0x40d938
push str._PPSAP
push str.ppskernel
call fcn.00410370
add esp, 8
mov ecx, dword [0x46aa50]
test ecx, ecx
je 0x40d971
mov eax, dword [ecx]
mov eax, dword [eax + 8]
call eax
test al, al
je 0x40d971
mov ecx, dword [0x46aa5c]
mov dword [0x46aa50], 0
test ecx, ecx
je 0x40d971
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [0x46aa5c], 0
mov eax, dword [ebp - 0x78]
jmp 0x40d9fb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x46aa50]
mov esi, eax
test ecx, ecx
je 0x40d9af
mov edx, dword [ecx]
mov edx, dword [edx + 0x14]
call edx
test al, al
je 0x40d9a9
push esi
push str.PPSKERNEL
push str.ppskernel
call fcn.00410370
add esp, 0xc
mov ecx, dword [0x46aa50]
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x40d9c6
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x46aa50]
test ecx, ecx
je 0x40d9f9
mov eax, dword [ecx]
mov eax, dword [eax + 8]
call eax
test al, al
je 0x40d9f9
mov ecx, dword [0x46aa5c]
mov dword [0x46aa50], 0
test ecx, ecx
je 0x40d9f9
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [0x46aa5c], 0
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042318e
mov esp, ebp
pop ebp
ret