Function at 0x403f40
Capabilities:
Check mutex and terminate process on windows
Check mutex on windows
Delete file
Print debug messages
Resolve function by parsing pe exports
Set file attributes
Terminate process

Disassembly:
sub esp, 0x16c
push ebx
push ebp
push esi
push edi
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
push 0
call dword [sym.imp.MSVCRT.dll_time]
push eax
call dword [sym.imp.MSVCRT.dll_srand]
mov esi, dword [sym.imp.MSVCRT.dll_rand]
add esp, 8
call esi
cdq
mov ecx, 5
mov edi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
idiv ecx
inc edx
lea eax, [edx + edx*2]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 6
push edx
push 0
call edi
mov dword [esp + 0x30], eax
call esi
cdq
mov ecx, 5
idiv ecx
inc edx
lea eax, [edx + edx*2]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 6
push edx
push 0
call edi
mov dword [esp + 0x28], eax
call esi
cdq
mov ecx, 5
idiv ecx
inc edx
lea eax, [edx + edx*2]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 6
push edx
push 0
call edi
mov dword [esp + 0x2c], eax
call esi
mov esi, eax
and esi, 0x80000003
jns 0x403ffc
dec esi
or esi, 0xfffffffc
inc esi
add esi, 4
lea eax, [esi*8 + 4]
push eax
call sub.MFC42.DLL_operatornew
add esp, 4
test eax, eax
je 0x404031
push fcn.00404490
push 0x404480
lea edi, [eax + 4]
push esi
push 8
push edi
mov dword [eax], esi
call fcn.00404934
mov dword [esp + 0x20], edi
jmp 0x404039
mov dword [esp + 0x20], 0
test esi, esi
jle 0x404059
mov edi, dword [esp + 0x20]
mov ebp, dword [sym.imp.USER32.dll_CreateMenu]
mov ebx, esi
call ebp
push eax
mov ecx, edi
call sub.MFC42.DLL_CMenu::Attach
add edi, 8
dec ebx
jne 0x404049
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
call ebx
mov ecx, dword [esp + 0x188]
push ecx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString_2
mov edx, dword [esp + 0x18]
mov eax, dword [edx - 8]
test eax, eax
jle 0x404169
push 0x22
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Remove
lea eax, [esp + 0x18]
push eax
call fcn.004034a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4040b4
push 0
push edi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x18]
push 0x80
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ebp, 0x1e
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0x32
mov edi, eax
call ebx
dec ebp
test edi, edi
jne 0x4040e3
test ebp, ebp
jg 0x4040c9
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString_3
push 0x5c
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::ReverseFind
inc eax
lea ecx, [esp + 0x18]
push eax
lea eax, [esp + 0x14]
push eax
call sub.MFC42.DLL_CString::Mid
push eax
lea ecx, [esp + 0x20]
call fcn.004046fa
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
push 0x2e
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CString::ReverseFind
lea ecx, [esp + 0x10]
push eax
push ecx
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::Left
push eax
lea ecx, [esp + 0x20]
call fcn.004046fa
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
push ecx
lea edx, [esp + 0x20]
mov ecx, esp
mov dword [esp + 0x14], esp
push edx
call sub.MFC42.DLL_CString::CString_1
call fcn.00402b70
add esp, 4
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString
mov ebp, dword [sym.imp.KERNEL32.dll_CreateEventA]
push 0
push 0
push 0
push 0
call ebp
mov dword [0x4835b4], eax
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x79]
mov byte [esp + 0x78], 0
push 0x104
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x7c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString_3
lea ecx, [esp + 0x78]
push ecx
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString_2
push 0x5c
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::ReverseFind
inc eax
lea edx, [esp + 0x10]
push eax
push edx
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Mid
push eax
lea ecx, [esp + 0x18]
call fcn.004046fa
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
push 0x2e
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::ReverseFind
push eax
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::Left
push eax
lea ecx, [esp + 0x18]
call fcn.004046fa
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::MakeLower
lea ecx, [esp + 0x14]
push str.D1BAC1AB_9220_435f_89FF_E8314F87437B
lea edx, [esp + 0x14]
push ecx
push edx
call sub.MFC42.DLL_operator_3
push eax
lea ecx, [esp + 0x28]
call fcn.004046fa
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, dword [esp + 0x24]
push ecx
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call edi
cmp eax, 0xb7
jne 0x4042bd
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
mov ebx, dword [esp + 0x20]
jle 0x404290
mov edi, ebx
mov ecx, edi
call sub.MFC42.DLL_CMenu::DestroyMenu
add edi, 8
dec esi
jne 0x404283
test ebx, ebx
je 0x40429d
mov edx, dword [ebx]
push 3
mov ecx, ebx
call dword [edx + 4]
mov eax, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push eax
call esi
mov ecx, dword [esp + 0x28]
push ecx
call esi
mov edx, dword [esp + 0x2c]
push edx
call esi
jmp 0x4043e9
lea ecx, [esp + 0x40]
call fcn.004012e0
lea ecx, [esp + 0x40]
call fcn.004013e0
push sub.MFC42.DLL_CString::CString
push sub.MFC42.DLL_CString::CString_3
push 3
lea eax, [esp + 0x40]
push 4
push eax
call fcn.00404934
lea ecx, [esp + 0x68]
call fcn.00402370
push 0x5c
lea ecx, [esp + 0x48]
call sub.MFC42.DLL_CString::ReverseFind
inc eax
lea ecx, [esp + 0x10]
push eax
push ecx
lea ecx, [esp + 0x4c]
call sub.MFC42.DLL_CString::Mid
push str.EVT_FD0A4F40_0340_40ab
push 0
push 1
push 0
call ebp
call edi
cmp eax, 0xb7
jne 0x404333
push str.EVT_FD0A4F40_0340_40ab
push 0
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventA]
mov ebx, dword [esp + 0x4c]
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [0x4835b4]
push 0xbb8
push edx
call edi
test eax, eax
je 0x40435b
push 0xbb8
push ebx
call edi
test eax, eax
jne 0x40433d
mov eax, dword [0x4835b4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call edi
push ebx
mov dword [0x4835b4], 0
call edi
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x68]
call fcn.004024f0
push sub.MFC42.DLL_CString::CString
push 3
lea ecx, [esp + 0x3c]
push 4
push ecx
call fcn.00404840
test esi, esi
mov ebx, dword [esp + 0x20]
jle 0x4043b2
mov edi, ebx
mov ecx, edi
call sub.MFC42.DLL_CMenu::DestroyMenu
add edi, 8
dec esi
jne 0x4043a5
test ebx, ebx
je 0x4043bf
mov edx, dword [ebx]
push 3
mov ecx, ebx
call dword [edx + 4]
mov eax, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push eax
call esi
mov ecx, dword [esp + 0x28]
push ecx
call esi
mov edx, dword [esp + 0x2c]
push edx
call esi
call dword [sym.imp.ole32.dll_CoUninitialize]
lea ecx, [esp + 0x40]
call fcn.00401360
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x16c
ret 0x10