Function at 0x5164c0
Capabilities:
Check mutex on windows
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xac
mov eax, dword [0x5c04b4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, ecx
mov esi, 4
lea eax, [edi + 0x10]
push eax
mov dword [ebp - 0xa0], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [edi + 8], 0
jne 0x5167e8
mov eax, dword [ebp + 0x14]
and eax, 1
mov dword [ebp - 0x8c], eax
je 0x51653d
cmp ebx, 0x100000
jbe 0x51653d
mov esi, 0xa
mov ecx, edi
call fcn.00516460
push dword [ebp - 0xa0]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00553510
mov esp, ebp
pop ebp
ret 0x10
mov dword [ebp - 0x9c], 0xc
mov dword [ebp - 0x94], 0
call fcn.0051e410
test eax, eax
mov eax, 0x593718
jne 0x516564
mov eax, 0x574c4c
push dword [ebp + 0xc]
push dword [ebp + 8]
push eax
push str._sNODCOMM_08XTo_08XBroadcastMutex
push 0xffffffffffffffff
lea eax, [ebp - 0x84]
push 0x40
push eax
call dword [sym.imp.MSVCR120.dll__snwprintf_s]
add esp, 0x18
mov edx, 0x120001
xor cl, cl
push 0
call fcn.00519090
add esp, 8
mov dword [ebp - 0x98], eax
lea eax, [ebp - 0x84]
push eax
push 0
lea eax, [ebp - 0x9c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [edi], eax
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0x90], 0
test eax, eax
je 0x516611
lea ecx, [ebp - 0xac]
push ecx
lea ecx, [ebp - 0x90]
push ecx
lea ecx, [ebp - 0xa8]
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
mov edx, dword [ebp - 0x90]
mov ecx, eax
xor eax, eax
test edx, edx
setne al
test ecx, eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
je 0x516609
push edx
call eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 0xa4]
call eax
cmp dword [edi], 0
je 0x516515
call fcn.0051e410
test eax, eax
mov eax, 0x593718
jne 0x51662d
mov eax, 0x574c4c
push dword [ebp + 0xc]
push dword [ebp + 8]
push eax
push str._sNODCOMM_08XTo_08XBroadcast
push 0xffffffffffffffff
lea eax, [ebp - 0x84]
push 0x40
push eax
call dword [sym.imp.MSVCR120.dll__snwprintf_s]
add esp, 0x18
mov edx, 0x20004
xor cl, cl
push 0
call fcn.00519090
add esp, 8
mov dword [ebp - 0x98], eax
cmp dword [ebp - 0x8c], 0
lea eax, [ebp - 0x84]
push eax
je 0x516682
push 0x100020
push 0
push 0x4000004
jmp 0x51668a
lea eax, [ebx + 0x20]
push eax
push 0
push 4
lea eax, [ebp - 0x9c]
push eax
push 0xffffffffffffffff
call dword [0x5c0278]
mov dword [edi + 4], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x98]
cmp eax, 0xb7
sete byte [ebp - 0x85]
call fcn.005193d0
mov eax, dword [edi + 4]
test eax, eax
je 0x516515
cmp dword [ebp - 0x8c], 0
je 0x516704
push 0x100000
push 0
push 0
push 6
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ecx, eax
mov dword [edi + 8], ecx
test ecx, ecx
je 0x516716
push 4
push 0x1000
lea eax, [ebx + 0x20]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x516515
jmp 0x516716
push 0
push 0
push 0
push 6
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [edi + 8], eax
mov eax, dword [edi + 8]
test eax, eax
je 0x516515
cmp byte [ebp - 0x85], 0
jne 0x51678a
lea esi, [ebx + 0x20]
push esi
push 0
push eax
call sub.MSVCR120.dll_memset
mov eax, dword [edi + 8]
add esp, 0xc
mov ecx, dword [ebp + 0x14]
mov dword [eax], 0x20
mov eax, dword [edi + 8]
mov dword [eax + 4], esi
xor esi, esi
mov eax, dword [edi + 8]
mov dword [eax + 8], 0x43646f4e
mov eax, dword [edi + 8]
mov dword [eax + 0xc], 0x206d6d6f
mov eax, dword [edi + 8]
mov dword [eax + 0x10], 2
mov eax, dword [edi + 8]
mov dword [eax + 0x14], ecx
mov eax, dword [edi + 8]
mov dword [eax + 0x18], 0x20
mov eax, dword [edi + 8]
mov dword [eax + 0x1c], ebx
mov byte [edi + 0xc], 1
jmp 0x51651c
cmp dword [eax], 0x20
jne 0x516515
cmp dword [eax + 8], 0x43646f4e
jne 0x516515
cmp dword [eax + 0xc], 0x206d6d6f
jne 0x516515
cmp dword [eax + 0x10], 2
jne 0x516515
cmp dword [ebp - 0x8c], 0
je 0x5167db
push ebx
mov ecx, edi
call fcn.005167f0
test eax, eax
jne 0x516515
mov byte [edi + 0xc], 1
xor esi, esi
jmp 0x51651c
cmp dword [eax + 0x1c], ebx
jb 0x516515
mov byte [edi + 0xc], 1
xor esi, esi
jmp 0x51651c