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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x168
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
xor ebx, ebx
mov dword [ebp + 0x10], eax
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
push dword [ebp + 8]
mov esi, 0x41b678
mov dword [0x41b6e8], 0x418500
mov dword [0x41b754], esi
push 0x41b730
push esi
mov dword [0x41b678], 0x84
mov dword [0x41b6dc], 0x300
call fcn.00407b51
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push str.Uninited
mov ecx, 0x41b704
mov dword [0x41b6fc], eax
call fcn.00401523
mov edi, 0x41859c
mov dword [ebp - 8], ebx
push edi
mov dword [ebp - 4], 1
push dword [ebp + 0x10]
call fcn.00405b29
pop ecx
cmp eax, ebx
pop ecx
mov dword [ebp + 0x10], eax
je 0x4065ea
push str.UnregServer
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4065bc
push str.RegServer
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4065d0
push edi
push dword [ebp + 0x10]
jmp 0x406586
push ebx
push ebx
push 0x64
push esi
call fcn.004067e3
push ebx
push ebx
push esi
call fcn.00407e1e
jmp 0x4065e4
push ebx
push 1
push 0x64
push esi
call fcn.004067e3
push ebx
push 1
push esi
call fcn.00407ca5
mov dword [ebp - 8], eax
mov dword [ebp - 4], ebx
push str.Uninited
lea ecx, [ebp - 0xc]
call fcn.00402afc
push eax
mov ecx, 0x41b704
call fcn.004067b8
test eax, eax
jne 0x40660f
cmp dword [ebp - 4], ebx
mov byte [ebp + 0x13], 1
jne 0x406612
mov byte [ebp + 0x13], bl
mov ecx, dword [ebp - 0xc]
cmp ecx, ebx
je 0x40661e
call fcn.00401128
cmp byte [ebp + 0x13], bl
je 0x40667e
push 0x118
call fcn.0040c1cb
cmp eax, ebx
pop ecx
je 0x40663d
mov ecx, eax
call fcn.004088bd
mov edi, eax
jmp 0x40663f
xor edi, edi
cmp dword [edi + 0x110], ebx
jle 0x40666f
push ebx
mov ecx, edi
call fcn.004081bf
push eax
call fcn.0040c240
test eax, eax
pop ecx
jbe 0x40666f
push ebx
mov ecx, edi
call fcn.004081bf
push eax
mov ecx, 0x41b704
call fcn.00401523
jmp 0x406672
mov dword [ebp - 4], ebx
cmp edi, ebx
je 0x40667e
mov eax, dword [edi]
push 1
mov ecx, edi
call dword [eax]
mov al, byte [ebp + 0xb]
push ebx
lea ecx, [ebp - 0x1c]
mov byte [ebp - 0x1c], al
call fcn.00405013
mov edi, str.igfxhkmutext
push edi
call fcn.0040c240
pop ecx
push eax
push edi
lea ecx, [ebp - 0x1c]
call fcn.00405220
mov eax, dword [ebp - 0x18]
cmp eax, ebx
jne 0x4066af
mov eax, 0x41536c
push 0x104
push eax
lea eax, [ebp - 0x168]
push eax
call fcn.0040cb80
lea eax, [ebp - 0x168]
push eax
call fcn.0040a23f
mov edi, eax
push edi
call fcn.0040c240
add esp, 0x14
lea ecx, [ebp - 0x1c]
push eax
push edi
call fcn.00405220
mov eax, dword [ebp - 0x18]
cmp eax, ebx
jne 0x4066ee
mov eax, 0x41536c
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x406708
mov dword [ebp - 4], ebx
cmp dword [ebp - 4], ebx
je 0x40679e
push 1
push 4
push esi
call fcn.00407bd4
push 0x28
lea eax, [ebp - 0x44]
push ebx
push eax
call fcn.0040c1e0
mov eax, dword [ebp + 8]
add esp, 0xc
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x44]
mov edi, str.HkClass
push eax
mov dword [ebp - 0x40], 0x405c9c
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x30], ebx
call dword [sym.imp.USER32.dll_RegisterClassA]
push ebx
push dword [ebp + 8]
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push str.HkWndName
push edi
push ebx
call dword [sym.imp.USER32.dll_CreateWindowExA]
push ebx
push ebx
push 0x111
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
mov edi, dword [sym.imp.USER32.dll_GetMessageA]
push ebx
push ebx
lea eax, [ebp - 0x60]
push ebx
push eax
call edi
test eax, eax
je 0x406798
lea eax, [ebp - 0x60]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push ebx
push ebx
lea eax, [ebp - 0x60]
push ebx
push eax
jmp 0x40677f
push esi
call fcn.00407c69
call dword [sym.imp.ole32.dll_CoUninitialize]
push 1
lea ecx, [ebp - 0x1c]
call fcn.00405013
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret 0x10