Function at 0x40d1cb
Capabilities:
Accept command line arguments
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x74
mov eax, dword [0x4213f0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x2c], edi
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
xor esi, esi
push esi
mov dword [ebp - 0x24], eax
call dword [sym.imp.ole32.dll_CoInitialize]
push esi
push edi
mov edi, 0x4227a4
push 0x422780
mov ecx, edi
call fcn.00407b79
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x4227d4], eax
mov dword [ebp - 0x30], esi
mov ebx, 0x41d060
jmp 0x40d242
push str.UnregServer
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40d256
push str.RegServer
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40d26b
push ebx
push dword [ebp - 0x24]
call fcn.004073a6
pop ecx
mov dword [ebp - 0x24], eax
pop ecx
cmp eax, esi
jne 0x40d21e
jmp 0x40d283
push esi
push esi
push 0x64
push edi
call fcn.0040ae3a
push esi
push esi
mov ecx, edi
call fcn.0040a5a4
jmp 0x40d280
push esi
push 1
push 0x64
push edi
call fcn.0040ae3a
push esi
push 1
mov ecx, edi
call fcn.0040a535
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x28]
push eax
push 0x41c9bc
push 0x15
push esi
push 0x41ca1c
mov dword [ebp - 0x28], esi
xor ebx, ebx
call dword [sym.imp.ole32.dll_CoCreateInstance]
test eax, eax
jl 0x40d429
cmp dword [ebp - 0x28], esi
je 0x40d429
mov dword [ebp - 0x24], esi
call fcn.0040839d
test eax, eax
jne 0x40d2de
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax]
lea edx, [ebp - 0x1c]
push edx
push 0x18
push eax
call dword [ecx + 0x10]
test eax, eax
jl 0x40d2e1
cmp dword [ebp - 0xc], esi
jle 0x40d2da
cmp dword [ebp - 0xc], 0x11
jle 0x40d2fc
xor ebx, ebx
jmp 0x40d2e1
xor ebx, ebx
inc ebx
cmp ebx, 1
je 0x40d2ff
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
inc dword [ebp - 0x24]
cmp dword [ebp - 0x24], 0x14
jbe 0x40d2b3
jmp 0x40d2ff
xor ebx, ebx
inc ebx
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov dword [ebp - 0x28], esi
cmp ebx, esi
je 0x40d429
push str.IGFXPERSISTMUTEXT
lea ecx, [ebp - 0x20]
call fcn.00402ce2
cmp dword [ebp - 8], 0x10
mov eax, dword [ebp - 0x1c]
jae 0x40d32c
lea eax, [ebp - 0x1c]
push eax
push 1
push esi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40d348
xor ebx, ebx
push esi
push 1
lea ecx, [ebp - 0x20]
call fcn.004026b0
cmp ebx, esi
je 0x40d429
push 1
push 4
mov ecx, edi
call fcn.004087ba
push 0x28
lea eax, [ebp - 0x58]
push esi
push eax
call fcn.0040f480
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x48], eax
add esp, 0xc
lea eax, [ebp - 0x58]
mov ebx, str.PersistClass
push eax
mov dword [ebp - 0x54], 0x40cd14
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x44], esi
call dword [sym.imp.USER32.dll_RegisterClassA]
push esi
push dword [ebp - 0x2c]
push esi
push esi
push esi
push esi
push esi
push esi
push esi
push str.PersistWndName
push ebx
push esi
call dword [sym.imp.USER32.dll_CreateWindowExA]
mov dword [ebp - 0x2c], eax
cmp eax, esi
je 0x40d422
push str.wtsapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x42271c], eax
cmp eax, esi
je 0x40d403
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WTSRegisterSessionNotification
push eax
call ebx
push str.WTSUnRegisterSessionNotification
push dword [0x42271c]
mov dword [0x422720], eax
call ebx
mov dword [0x422724], eax
mov eax, dword [0x422720]
cmp eax, esi
je 0x40d403
push esi
push dword [ebp - 0x2c]
call eax
mov dword [0x422728], eax
mov ebx, dword [sym.imp.USER32.dll_GetMessageA]
jmp 0x40d415
lea eax, [ebp - 0x74]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push esi
push esi
push esi
lea eax, [ebp - 0x74]
push eax
call ebx
test eax, eax
jne 0x40d40b
mov ecx, edi
call fcn.004087fc
cmp dword [ebp - 0x24], esi
pop edi
pop esi
pop ebx
je 0x40d43a
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.ole32.dll_CoUninitialize]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x30]
xor ecx, ebp
call fcn.0040f4fa
leave
ret 0x10