Function at 0x40d4e1
Capabilities:
Check mutex on windows
Create process on windows
Read .ini file
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x480
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
cmp eax, 0x80000003
mov dword [ebp - 0x10], 1
je 0x40d8ae
cmp eax, 0x80000004
je 0x40d8ae
push ebx
push esi
push 0x418b6c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, 0x104
push ebx
lea eax, [ebp - 0x174]
push eax
xor esi, esi
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x40d89c
lea eax, [ebp - 0x174]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
test eax, eax
je 0x40d89c
push edi
xor eax, eax
lea edi, [ebp - 0x1c]
stosd dword es:[edi], eax
push esi
stosd dword es:[edi], eax
push 0x1c50
push esi
stosd dword es:[edi], eax
push 4
lea eax, [ebp - 0x1c]
push eax
push 0xffffffffffffffff
mov dword [ebp - 0x1c], 0xc
mov dword [ebp - 0x14], 1
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, esi
mov dword [ebp - 0xc], eax
je 0x40d89b
push esi
push esi
push esi
push 6
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
xor edx, edx
cmp esi, edx
je 0x40d892
push edx
xor eax, eax
push edx
mov ecx, 0x714
mov edi, esi
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push edx
lea eax, [ebp - 0x1c]
push eax
call edi
mov dword [ebp - 8], eax
xor eax, eax
push eax
push eax
push eax
lea eax, [ebp - 0x1c]
push eax
call edi
xor edi, edi
push edi
mov dword [ebp + 0xc], eax
push edi
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push 1
mov dword [ebp - 4], eax
lea eax, [esi + 0x24]
push 0x1f0fff
push eax
call edi
push eax
push dword [ebp + 0x1c]
call edi
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x40d85e
mov edx, dword [ebp - 8]
test edx, edx
je 0x40d86d
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x40d85e
mov eax, dword [ebp - 4]
test eax, eax
je 0x40d85e
cmp dword [esi + 0x24], 0
je 0x40d85e
mov edi, dword [ebp + 0x14]
mov dword [esi + 0x20], eax
mov eax, dword [ebp + 8]
mov dword [esi + 0x10], eax
mov eax, dword [ebp + 0x10]
push 0x38
mov dword [esi + 0xc], eax
lea eax, [esi + 0x48]
mov dword [esi + 4], edi
mov edi, dword [ebp + 0x18]
push eax
push 0x6b
mov dword [esi + 8], edi
mov edi, dword [sym.imp.USER32.dll_LoadStringW]
push 0
mov dword [esi + 0x1c], edx
mov dword [esi + 0x14], ecx
mov dword [esi], 0x1c50
mov dword [esi + 0x34], 2
mov dword [esi + 0x28], 0x9548
call edi
push ebx
lea eax, [esi + 0x8d8]
push eax
push 0x6d
push 0
call edi
push 0x38
lea eax, [esi + 0xae0]
push eax
push 0x6e
push 0
call edi
push ebx
lea eax, [esi + 0xb50]
push eax
push 0x6f
push 0
call edi
push 0x38
lea eax, [esi + 0xd58]
push eax
push 0x70
push 0
call edi
push 0x38
lea eax, [esi + 0xdc8]
push eax
push 0x71
push 0
call edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpynA]
push ebx
lea eax, [ebp - 0x174]
push eax
lea eax, [ebp - 0x278]
push eax
call edi
push 0x4017a0
lea eax, [ebp - 0x278]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea eax, [ebp - 0x278]
push eax
push 0x409
push 0x401874
push 0x401868
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
push 0xc8
mov dword [esi + 0x1144], eax
push 0x401840
lea eax, [esi + 0x1148]
push eax
call edi
push ebx
push 0x4017f8
lea eax, [esi + 0x1040]
push eax
call edi
push 0x401774
push 0x401758
push 0
call fcn.0041411b
mov edi, eax
test edi, edi
je 0x40d75d
push edi
push 0x4017f0
lea eax, [esi + 0xe38]
push ebx
push eax
call dword [sym.imp.SHLWAPI.dll_wnsprintfA]
add esp, 0x10
push edi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
push ebx
lea eax, [esi + 0xb8]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x40d85e
push 0x11
xor eax, eax
pop ecx
push dword [ebp - 0xc]
lea edi, [ebp - 0x70]
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x2c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x4017e4
stosd dword es:[edi], eax
lea eax, [ebp - 0x480]
push 0x208
push eax
mov dword [ebp - 0x70], 0x44
call dword [sym.imp.SHLWAPI.dll_wnsprintfA]
add esp, 0x10
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x174]
push eax
xor eax, eax
push eax
push 0x4000020
xor edi, edi
inc edi
push edi
push eax
push eax
lea ecx, [ebp - 0x480]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x40d854
mov dword [ebp + 0x1c], edi
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, 0x4e20
push ebx
push dword [ebp - 8]
call edi
test eax, eax
jne 0x40d801
push 1
push dword [ebp + 0xc]
call edi
test eax, eax
jne 0x40d843
and dword [ebp + 0x1c], eax
jmp 0x40d843
push ebx
push dword [ebp - 4]
call edi
cmp eax, 0x102
je 0x40d854
cmp eax, 0x80
je 0x40d84b
push 1
push dword [ebp - 8]
call edi
test eax, eax
je 0x40d82b
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x40d836
push 1
push dword [ebp + 0xc]
call edi
test eax, eax
jne 0x40d83a
and dword [ebp + 0x1c], 0
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [ebp + 0x1c], 0
jne 0x40d7e7
jmp 0x40d854
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [esi + 0x2c], 0x10
jne 0x40d85e
and dword [ebp - 0x10], 0
cmp dword [ebp - 8], 0
je 0x40d86d
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0xc], 0
je 0x40d87c
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], 0
je 0x40d88b
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
push 0x418b6c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x10]
pop esi
pop ebx
jmp 0x40d8b0
xor eax, eax
leave
ret 0x18