Function at 0x404810
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 0x404892
push 1
call fcn.00407f36
push eax
push 0x426e48
push str.CONOUT_
call fcn.00407e48
push 2
call fcn.00407f36
push eax
push 0x426e48
push str.CONOUT_
call fcn.00407e48
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.1.1.1
push str._keyboard_remapper__s__n_n
push str.e_32m
call fcn.004042d0
add esp, 0xc
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 0x404902
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.004103df
pop edi
mov eax, 1
pop esi
mov ecx, dword [esp + 0x32c]
xor ecx, esp
call fcn.00404eb9
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 + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x404930
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 0x404953
mov eax, dword [str.config.txt]
mov dword [ecx], eax
mov eax, dword [0x426ec8]
mov dword [ecx + 4], eax
mov eax, dword [0x426ecc]
mov dword [ecx + 8], eax
mov eax, dword [0x426ed0]
mov dword [ecx + 0xc], eax
mov eax, dword [0x426ed4]
mov dword [ecx + 0x10], eax
mov ax, word [0x426ed8]
mov word [ecx + 0x14], ax
lea eax, [esp + 0x12c]
push 0x426e54
push eax
lea eax, [esp + 0x10]
push eax
call fcn.00408070
add esp, 0xc
test eax, eax
jle 0x4049c8
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 0x4048d4
push dword [esp + 8]
lea eax, [esp + 0x30]
mov esi, 1
push 0xff
push eax
call fcn.0040a0d4
add esp, 0xc
test eax, eax
je 0x404a1a
nop word [eax + eax]
mov edx, esi
lea ecx, [esp + 0x2c]
call fcn.00402ba0
push dword [esp + 8]
inc esi
test eax, eax
jne 0x404a6a
lea eax, [esp + 0x30]
push 0xff
push eax
call fcn.0040a0d4
add esp, 0xc
test eax, eax
jne 0x4049f0
push dword [esp + 8]
call fcn.004082f3
add esp, 4
mov edx, esi
xor ecx, ecx
call fcn.00402ba0
test eax, eax
jne 0x4048d4
cmp dword [0x42b9c8], eax
je 0x404a9c
push 0x80
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
test eax, eax
jne 0x404a74
call edi
push eax
push str.Error_setting_process_priority:__d_n
call fcn.00401020
add esp, 8
jmp 0x4048d4
call fcn.004082f3
jmp 0x4048d1
push 2
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
test eax, eax
jne 0x404a9c
call edi
push eax
push str.Error_setting_thread_priority:__d_n
call fcn.00401020
add esp, 8
jmp 0x4048d4
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [0x42d03c], eax
test eax, eax
jne 0x404ac8
call edi
push eax
push str.CreateEvent_error:__d_n
call fcn.00401020
add esp, 8
jmp 0x4048d4
lea eax, [esp + 0xc]
xorps xmm0, xmm0
push eax
push 0
push 0x42c4b0
push 0x4046c0
push 0
movlpd qword [0x42c7f8], xmm0
push 0
movlpd qword [0x42c800], xmm0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x404b0f
call edi
push eax
push str.Error_creating_the_thread:__d_n
call fcn.00401020
add esp, 8
jmp 0x4048d4
call dword [sym.imp.KERNEL32.dll_CreateTimerQueue]
cmp dword [0x42c494], 0
mov dword [0x42c49c], eax
jne 0x404b34
push str.DEBUG
call fcn.0040eea6
add esp, 4
test eax, eax
je 0x404b39
mov eax, 1
mov esi, dword [sym.imp.USER32.dll_SetWindowsHookExA]
push 0
push 0
push 0x404420
push 0xe
mov dword [0x42c494], eax
call esi
push 0
push 0
push 0x404620
push 0xd
mov dword [0x42d038], eax
call esi
cmp dword [0x42c494], 0
mov dword [0x42d040], eax
je 0x404b80
push str.___DEBUG_MODE____n
call fcn.00401020
add esp, 4
jmp 0x404ba3
push 1
call fcn.00407f36
push eax
call fcn.004082f3
push 2
call fcn.00407f36
push eax
call fcn.004082f3
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 0x404be7
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 0x404bc7
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 0x404c10
mov dword [0x42c470], 0
mov eax, dword [0x42c490]
test eax, eax
je 0x404c28
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.00404eb9
add esp, 0x330
ret