Function at 0x404750
Capabilities:
Check mutex on windows
Create thread
Log keystrokes via application hook

Disassembly:
sub esp, 0x330
mov eax, dword [0x42b040]
xor eax, esp
mov dword [esp + 0x32c], eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_AllocConsole]
test eax, eax
je 0x4047d2
push 1
call fcn.00407e76
push eax
push 0x426e1c
push str.CONOUT_
call fcn.00407d88
push 2
call fcn.00407e76
push eax
push 0x426e1c
push str.CONOUT_
call fcn.00407d88
add esp, 0x20
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov dword [esp + 8], 0
lea eax, [esp + 8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov ecx, dword [esp + 8]
or ecx, 4
push ecx
push esi
mov dword [esp + 0x10], ecx
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push str.e_0m
push str.1.1.1
push str.e_32m
push str._s_keyboard_remapper__s__s_n_n
call fcn.00401020
add esp, 0x10
push str.keyboard_remapper.single_instance
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0xb7
jne 0x404847
push str.keyboard_remapper.exe_is_already_running__n
call fcn.00401020
add esp, 4
push str._nPress_any_key_to_exit..._n
call fcn.00401020
add esp, 4
call fcn.0041031f
pop edi
mov eax, 1
pop esi
mov ecx, dword [esp + 0x32c]
xor ecx, esp
call fcn.00404df9
add esp, 0x330
ret
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x104
lea ecx, [esp + 0x130]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x12c]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x404870
sub ecx, edx
xor eax, eax
sar ecx, 1
mov word [esp + ecx*2 + 0x102], ax
lea ecx, [esp + 0x12c]
add ecx, 0xfffffffe
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x404893
mov eax, dword [str.config.txt]
mov dword [ecx], eax
mov eax, dword [0x426ea0]
mov dword [ecx + 4], eax
mov eax, dword [0x426ea4]
mov dword [ecx + 8], eax
mov eax, dword [0x426ea8]
mov dword [ecx + 0xc], eax
mov eax, dword [0x426eac]
mov dword [ecx + 0x10], eax
mov ax, word [0x426eb0]
mov word [ecx + 0x14], ax
lea eax, [esp + 0x12c]
push 0x426e28
push eax
lea eax, [esp + 0x10]
push eax
call fcn.00407fb0
add esp, 0xc
test eax, eax
jle 0x404908
lea eax, [esp + 0x12c]
push eax
push str.Cannot_open_configuration_file__ws._Make_sure_it_is_in_the_same_directory_as_keyboard_remapper.exe._n
call fcn.00401020
add esp, 8
jmp 0x404819
push dword [esp + 8]
lea eax, [esp + 0x30]
mov esi, 1
push 0xff
push eax
call fcn.0040a014
add esp, 0xc
test eax, eax
je 0x40495a
nop word [eax + eax]
mov edx, esi
lea ecx, [esp + 0x2c]
call fcn.00402ba0
push dword [esp + 8]
inc esi
test eax, eax
jne 0x4049aa
lea eax, [esp + 0x30]
push 0xff
push eax
call fcn.0040a014
add esp, 0xc
test eax, eax
jne 0x404930
push dword [esp + 8]
call fcn.00408233
add esp, 4
mov edx, esi
xor ecx, ecx
call fcn.00402ba0
test eax, eax
jne 0x404819
cmp dword [0x42b9c8], eax
je 0x4049dc
push 0x80
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
test eax, eax
jne 0x4049b4
call edi
push eax
push str.Error_setting_process_priority:__d_n
call fcn.00401020
add esp, 8
jmp 0x404819
call fcn.00408233
jmp 0x404816
push 2
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
test eax, eax
jne 0x4049dc
call edi
push eax
push str.Error_setting_thread_priority:__d_n
call fcn.00401020
add esp, 8
jmp 0x404819
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [0x42d03c], eax
test eax, eax
jne 0x404a08
call edi
push eax
push str.CreateEvent_error:__d_n
call fcn.00401020
add esp, 8
jmp 0x404819
lea eax, [esp + 0xc]
xorps xmm0, xmm0
push eax
push 0
push 0x42c4b0
push 0x404600
push 0
movlpd qword [0x42c7f8], xmm0
push 0
movlpd qword [0x42c800], xmm0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x404a4f
call edi
push eax
push str.Error_creating_the_thread:__d_n
call fcn.00401020
add esp, 8
jmp 0x404819
call dword [sym.imp.KERNEL32.dll_CreateTimerQueue]
cmp dword [0x42c494], 0
mov dword [0x42c49c], eax
jne 0x404a74
push str.DEBUG
call fcn.0040ede6
add esp, 4
test eax, eax
je 0x404a79
mov eax, 1
mov esi, dword [sym.imp.USER32.dll_SetWindowsHookExA]
push 0
push 0
push 0x404370
push 0xe
mov dword [0x42c494], eax
call esi
push 0
push 0
push 0x404560
push 0xd
mov dword [0x42d038], eax
call esi
cmp dword [0x42c494], 0
mov dword [0x42d040], eax
je 0x404ac0
push str.___DEBUG_MODE____n
call fcn.00401020
add esp, 4
jmp 0x404ae3
push 1
call fcn.00407e76
push eax
call fcn.00408233
push 2
call fcn.00407e76
push eax
call fcn.00408233
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_FreeConsole]
mov esi, dword [sym.imp.USER32.dll_GetMessageA]
lea eax, [esp + 0x10]
push 0
push 0
push 0
push eax
call esi
test eax, eax
jle 0x404b27
mov edi, dword [sym.imp.USER32.dll_TranslateMessage]
push ebx
mov ebx, dword [sym.imp.USER32.dll_DispatchMessageA]
lea eax, [esp + 0x14]
push eax
call edi
lea eax, [esp + 0x14]
push eax
call ebx
push 0
push 0
push 0
lea eax, [esp + 0x20]
push eax
call esi
test eax, eax
jg 0x404b07
pop ebx
push dword [0x42d040]
mov esi, dword [sym.imp.USER32.dll_UnhookWindowsHookEx]
call esi
push dword [0x42d038]
call esi
cmp dword [0x42c470], 0
je 0x404b50
mov dword [0x42c470], 0
mov eax, dword [0x42c490]
test eax, eax
je 0x404b68
push 0
push eax
push dword [0x42c49c]
call dword [sym.imp.KERNEL32.dll_DeleteTimerQueueTimer]
push dword [0x42d03c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [0x42c49c]
call dword [sym.imp.KERNEL32.dll_DeleteTimerQueue]
mov ecx, 0x42c4b0
call fcn.00401fe0
call fcn.00401a20
mov ecx, dword [esp + 0x334]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.00404df9
add esp, 0x330
ret