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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd20
mov eax, dword [ebp + 0xc]
push edi
push 1
mov eax, dword [eax]
pop edi
cmp eax, 0x80000003
mov dword [ebp - 0x14], edi
je 0x405d3c
cmp eax, 0x80000004
je 0x405d3c
push ebx
push esi
push 0x40b120
call dword [sym.imp.KERNEL32.DLL_EnterCriticalSection]
mov ebx, 0x104
lea eax, [ebp - 0x510]
push ebx
push eax
push edi
call fcn.004092bb
mov byte [ebp + 0xf], al
lea eax, [ebp - 0x184]
push ebx
xor esi, esi
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
lea eax, [ebp - 0x184]
push eax
call dword [section..data]
test eax, eax
jne 0x405903
lea eax, [ebp - 0x184]
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x2c]
push eax
push edi
push 0x4000000
push 0x30357965
call fcn.00403379
add esp, 0x10
push 0x40462c
call fcn.00403c0f
test eax, eax
jne 0x405950
lea eax, [ebp - 0x204]
push 0x40
push eax
push 0x6b
push esi
call fcn.004019b5
lea eax, [ebp - 0xd20]
push 0x200
push eax
push 0x72
push esi
call fcn.004019b5
lea eax, [ebp - 0x204]
push esi
push eax
lea eax, [ebp - 0xd20]
push eax
push esi
call fcn.004069e8
jmp 0x405d18
xor eax, eax
lea edi, [ebp - 0x20]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push esi
push 0x1c50
stosd dword es:[edi], eax
push esi
lea eax, [ebp - 0x20]
push 4
push eax
push 0xffffffffffffffff
mov dword [ebp - 0x20], 0xc
mov dword [ebp - 0x18], 1
call dword [sym.imp.KERNEL32.DLL_CreateFileMappingA]
cmp eax, esi
mov dword [ebp - 0x10], eax
je 0x405d18
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 0x405d0f
mov ecx, 0x714
xor eax, eax
mov edi, esi
push edx
rep stosd dword es:[edi], eax
push edx
lea eax, [ebp - 0x20]
push edx
push eax
call dword [sym.imp.KERNEL32.DLL_CreateEventA]
xor edi, edi
mov dword [ebp - 8], eax
push edi
push edi
lea eax, [ebp - 0x20]
push edi
push eax
call dword [sym.imp.KERNEL32.DLL_CreateEventA]
mov dword [ebp - 4], eax
push edi
lea eax, [ebp - 0x20]
push edi
push eax
call dword [sym.imp.KERNEL32.DLL_CreateMutexA]
mov dword [ebp - 0xc], eax
push edi
lea eax, [esi + 0x24]
push 1
push 0x1f0fff
push eax
call dword [sym.imp.KERNEL32.DLL_GetCurrentProcess]
push eax
push dword [ebp + 0x1c]
call dword [sym.imp.KERNEL32.DLL_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.DLL_DuplicateHandle]
test eax, eax
je 0x405cde
cmp dword [ebp - 8], edi
je 0x405cec
mov ecx, dword [ebp - 4]
cmp ecx, edi
je 0x405cde
mov eax, dword [ebp - 0xc]
cmp eax, edi
je 0x405cde
cmp dword [esi + 0x24], edi
je 0x405cde
mov edx, dword [ebp + 0x14]
mov dword [esi + 0x20], eax
mov eax, dword [ebp + 8]
mov dword [esi + 4], edx
mov edx, dword [ebp + 0x18]
mov dword [esi + 0x10], eax
mov eax, dword [ebp + 0x10]
push 0x38
mov dword [esi + 0xc], eax
lea eax, [esi + 0x48]
mov dword [esi + 8], edx
mov edx, dword [ebp - 8]
push eax
push 0x6b
push edi
mov dword [esi + 0x1c], edx
mov dword [esi + 0x14], ecx
mov dword [esi], 0x1c50
mov dword [esi + 0x34], 2
mov dword [esi + 0x28], 0x1448
call fcn.004019b5
lea eax, [esi + 0x8d8]
push ebx
push eax
push 0x6d
push edi
call fcn.004019b5
lea eax, [esi + 0xae0]
push 0x38
push eax
push 0x6e
push edi
call fcn.004019b5
lea eax, [esi + 0xb50]
push ebx
push eax
push 0x6f
push edi
call fcn.004019b5
lea eax, [esi + 0xd58]
push 0x38
push eax
push 0x70
push edi
call fcn.004019b5
lea eax, [esi + 0xdc8]
push 0x38
push eax
push 0x71
push edi
call fcn.004019b5
mov edi, dword [sym.imp.KERNEL32.DLL_lstrcpynA]
lea eax, [ebp - 0x184]
push ebx
push eax
lea eax, [ebp - 0x308]
push eax
call edi
lea eax, [ebp - 0x308]
push 0x404598
push eax
call dword [0x40b018]
lea eax, [ebp - 0x308]
push eax
push 0x409
push 0x404624
push 0x404618
call dword [sym.imp.KERNEL32.DLL_GetPrivateProfileIntA]
mov dword [esi + 0x1144], eax
push 0xc8
lea eax, [esi + 0x1148]
push 0x404600
push eax
call edi
push ebx
lea eax, [esi + 0x1040]
push 0x4045b8
push eax
call edi
push 0x40456c
push 0x404550
push 0
call fcn.00407d5d
mov edi, eax
test edi, edi
je 0x405b68
push edi
push 0x4045b4
lea eax, [esi + 0xe38]
push ebx
push eax
call dword [0x40b01c]
add esp, 0x10
push edi
call dword [0x40b078]
lea eax, [esi + 0xb8]
push ebx
push eax
push 0
call fcn.004027a1
cmp byte [ebp + 0xf], 0
je 0x405b96
lea eax, [ebp - 0x510]
push 0x400
push eax
lea eax, [esi + 0x1418]
push eax
call dword [0x40b054]
lea eax, [ebp - 0x718]
push ebx
push eax
call fcn.00405fcc
test eax, eax
je 0x405bf9
cmp byte [ebp + 0xf], 0
mov ebx, dword [0x40b034]
mov edi, dword [sym.imp.KERNEL32.DLL_lstrlenW]
je 0x405bd8
lea eax, [esi + 0x1418]
push eax
call edi
mov ecx, 0x400
sub ecx, eax
lea eax, [esi + 0x1418]
push ecx
push 0x4045b0
push eax
call ebx
lea eax, [esi + 0x1418]
push eax
call edi
mov ecx, 0x400
sub ecx, eax
lea eax, [ebp - 0x718]
push ecx
push eax
lea eax, [esi + 0x1418]
push eax
call ebx
push 0x11
xor eax, eax
pop ecx
lea edi, [ebp - 0x80]
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x3c]
push dword [ebp - 0x10]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x920]
push 0x4045a4
push eax
mov dword [ebp - 0x80], 0x44
call fcn.00405d43
add esp, 0xc
lea eax, [ebp - 0x3c]
lea ecx, [ebp - 0x920]
push eax
lea eax, [ebp - 0x80]
push eax
lea eax, [ebp - 0x184]
push eax
xor eax, eax
push eax
push 0x4000020
push 1
pop edi
push edi
push eax
push eax
push ecx
push eax
call dword [sym.imp.KERNEL32.DLL_CreateProcessA]
test eax, eax
je 0x405cd2
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 0x405c7f
push 1
push dword [ebp - 4]
call edi
test eax, eax
jne 0x405cc1
and dword [ebp + 0x1c], eax
jmp 0x405cc1
push ebx
push dword [ebp - 0xc]
call edi
cmp eax, 0x102
je 0x405cd2
cmp eax, 0x80
je 0x405cc9
push 1
push dword [ebp - 8]
call edi
test eax, eax
je 0x405ca9
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_SetEvent]
jmp 0x405cb4
push 1
push dword [ebp - 4]
call edi
test eax, eax
jne 0x405cb8
and dword [ebp + 0x1c], 0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_ReleaseMutex]
cmp dword [ebp + 0x1c], 0
je 0x405cd2
jmp 0x405c65
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_ReleaseMutex]
cmp dword [esi + 0x2c], 0x10
jne 0x405cdc
and dword [ebp - 0x14], 0
xor edi, edi
cmp dword [ebp - 8], edi
je 0x405cec
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [ebp - 4], edi
je 0x405cfa
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [ebp - 0xc], edi
je 0x405d08
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.DLL_UnmapViewOfFile]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp byte [ebp + 0xf], 0
pop esi
pop ebx
je 0x405d2c
lea eax, [ebp - 0x510]
push eax
call fcn.0040376c
push 0x40b120
call dword [sym.imp.KERNEL32.DLL_LeaveCriticalSection]
mov eax, dword [ebp - 0x14]
jmp 0x405d3e
xor eax, eax
pop edi
leave
ret 0x18