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

Disassembly:
push ebp
lea ebp, [esp - 0x60]
sub esp, 0xd24
mov eax, dword [0x40c0b4]
xor eax, dword [ebp + 0x64]
push edi
mov dword [ebp + 0x5c], eax
mov eax, dword [ebp + 0x6c]
mov eax, dword [eax]
xor edi, edi
inc edi
cmp eax, 0x80000003
mov dword [ebp + 0x48], edi
je 0x407495
cmp eax, 0x80000004
je 0x407495
push ebx
push esi
push 0x40c124
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, 0x104
push ebx
lea eax, [ebp - 0x4b4]
push eax
push edi
call sub.msnmetal.dll_Ordinal_7
mov byte [ebp + 0x6f], al
push ebx
lea eax, [ebp - 0x128]
push eax
xor esi, esi
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x128]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
test eax, eax
jne 0x40705c
lea eax, [ebp - 0x128]
mov dword [ebp + 0x34], eax
lea eax, [ebp + 0x30]
push eax
push edi
push esi
push 2
mov dword [ebp + 0x30], edi
call fcn.004021c9
push eax
push 0x30357965
call fcn.00403fec
add esp, 0x10
push 0x407544
call fcn.004023ff
test eax, eax
jne 0x4070a9
push 0x40
lea eax, [ebp - 0x1a8]
push eax
push 0x6b
push esi
call fcn.00401ac7
push 0x200
lea eax, [ebp - 0xcc4]
push eax
push 0x72
push esi
call fcn.00401ac7
push esi
lea eax, [ebp - 0x1a8]
push eax
lea eax, [ebp - 0xcc4]
push eax
push esi
call fcn.0040800a
jmp 0x407471
xor eax, eax
lea edi, [ebp + 0x3c]
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 + 0x3c]
push eax
push 0xffffffffffffffff
mov dword [ebp + 0x3c], 0xc
mov dword [ebp + 0x44], 1
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, esi
mov dword [ebp + 0x4c], eax
je 0x407471
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 0x407468
push edx
xor eax, eax
push edx
mov ecx, 0x714
mov edi, esi
rep stosd dword es:[edi], eax
push edx
lea eax, [ebp + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
xor edi, edi
push edi
push edi
mov dword [ebp + 0x54], eax
push edi
lea eax, [ebp + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
push edi
mov dword [ebp + 0x58], eax
push edi
lea eax, [ebp + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
push edi
push 1
mov dword [ebp + 0x50], eax
lea eax, [esi + 0x24]
push 0x1f0fff
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
push dword [ebp + 0x7c]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x407437
cmp dword [ebp + 0x54], edi
je 0x407445
mov ecx, dword [ebp + 0x58]
cmp ecx, edi
je 0x407437
mov eax, dword [ebp + 0x50]
cmp eax, edi
je 0x407437
cmp dword [esi + 0x24], edi
je 0x407437
mov edx, dword [ebp + 0x74]
mov dword [esi + 0x20], eax
mov eax, dword [ebp + 0x68]
mov dword [esi + 0x10], eax
mov eax, dword [ebp + 0x70]
push 0x38
mov dword [esi + 0xc], eax
mov dword [esi + 4], edx
mov edx, dword [ebp + 0x78]
lea eax, [esi + 0x48]
push eax
mov dword [esi + 8], edx
mov edx, dword [ebp + 0x54]
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], 0x9448
call fcn.00401ac7
push ebx
lea eax, [esi + 0x8d8]
push eax
push 0x6d
push edi
call fcn.00401ac7
push 0x38
lea eax, [esi + 0xae0]
push eax
push 0x6e
push edi
call fcn.00401ac7
push ebx
lea eax, [esi + 0xb50]
push eax
push 0x6f
push edi
call fcn.00401ac7
push 0x38
lea eax, [esi + 0xd58]
push eax
push 0x70
push edi
call fcn.00401ac7
push 0x38
lea eax, [esi + 0xdc8]
push eax
push 0x71
push edi
call fcn.00401ac7
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpynA]
push ebx
lea eax, [ebp - 0x128]
push eax
lea eax, [ebp - 0x2ac]
push eax
call edi
push 0x4074ac
lea eax, [ebp - 0x2ac]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea eax, [ebp - 0x2ac]
push eax
push 0x409
push 0x40753c
push 0x407530
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
push 0xc8
mov dword [esi + 0x1144], eax
push 0x407518
lea eax, [esi + 0x1148]
push eax
call edi
push ebx
push 0x4074d0
lea eax, [esi + 0x1040]
push eax
call edi
push 0x406370
push 0x406354
push 0
call fcn.0040880b
mov edi, eax
test edi, edi
je 0x4072c1
push edi
push 0x4074c8
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 fcn.00402c2c
cmp byte [ebp + 0x6f], 0
je 0x4072ef
push 0x400
lea eax, [ebp - 0x4b4]
push eax
lea eax, [esi + 0x1418]
push eax
call dword [sym.imp.SHLWAPI.dll_StrCpyNW]
push ebx
lea eax, [ebp - 0x6bc]
push eax
call fcn.00406e5c
test eax, eax
je 0x407352
cmp byte [ebp + 0x6f], 0
mov ebx, dword [sym.imp.SHLWAPI.dll_StrCatBuffW]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
je 0x407331
lea eax, [esi + 0x1418]
push eax
call edi
mov ecx, 0x400
sub ecx, eax
push ecx
push 0x4074c4
lea eax, [esi + 0x1418]
push eax
call ebx
lea eax, [esi + 0x1418]
push eax
call edi
mov ecx, 0x400
sub ecx, eax
push ecx
lea eax, [ebp - 0x6bc]
push eax
lea eax, [esi + 0x1418]
push eax
call ebx
push 0x11
xor eax, eax
pop ecx
push dword [ebp + 0x4c]
lea edi, [ebp - 0x24]
rep stosd dword es:[edi], eax
lea edi, [ebp + 0x20]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x8c4]
push 0x4074b8
push eax
mov dword [ebp - 0x24], 0x44
call fcn.00406b88
add esp, 0xc
lea eax, [ebp + 0x20]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x128]
push eax
xor eax, eax
push eax
push 0x4000020
xor edi, edi
inc edi
push edi
push eax
push eax
lea ecx, [ebp - 0x8c4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x40742b
mov dword [ebp + 0x7c], edi
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, 0x4e20
push ebx
push dword [ebp + 0x54]
call edi
test eax, eax
jne 0x4073d8
push 1
push dword [ebp + 0x58]
call edi
test eax, eax
jne 0x40741a
and dword [ebp + 0x7c], eax
jmp 0x40741a
push ebx
push dword [ebp + 0x50]
call edi
cmp eax, 0x102
je 0x40742b
cmp eax, 0x80
je 0x407422
push 1
push dword [ebp + 0x54]
call edi
test eax, eax
je 0x407402
push dword [ebp + 0x58]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x40740d
push 1
push dword [ebp + 0x58]
call edi
test eax, eax
jne 0x407411
and dword [ebp + 0x7c], 0
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [ebp + 0x7c], 0
jne 0x4073be
jmp 0x40742b
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
cmp dword [esi + 0x2c], 0x10
jne 0x407435
and dword [ebp + 0x48], 0
xor edi, edi
cmp dword [ebp + 0x54], edi
je 0x407445
push dword [ebp + 0x54]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0x58], edi
je 0x407453
push dword [ebp + 0x58]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0x50], edi
je 0x407461
push dword [ebp + 0x50]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp + 0x4c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp + 0x6f], 0
pop esi
pop ebx
je 0x407485
lea eax, [ebp - 0x4b4]
push eax
call fcn.004041b8
push 0x40c124
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp + 0x48]
jmp 0x407497
xor eax, eax
mov ecx, dword [ebp + 0x5c]
xor ecx, dword [ebp + 0x64]
pop edi
call fcn.004012b8
add ebp, 0x60
leave
ret 0x18