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

Disassembly:
sub esp, 0x330
mov eax, dword [0x42d040]
xor eax, esp
mov dword [esp + 0x32c], eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_AllocConsole]
test eax, eax
je 0x404952
push 1
call fcn.004081c1
push eax
push 0x428f44
push str.CONOUT_
call fcn.00407f08
push 2
call fcn.004081c1
push eax
push 0x428f44
push str.CONOUT_
call fcn.00407f08
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.00404370
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 0x4049c2
push str.keyboard_remapper.exe_is_already_running__n
call fcn.00401050
add esp, 4
push str._nPress_any_key_to_exit..._n
call fcn.00401050
add esp, 4
call fcn.00410a30
pop edi
mov eax, 1
pop esi
mov ecx, dword [esp + 0x32c]
xor ecx, esp
call fcn.00404f79
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 0x4049f0
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 0x404a13
mov eax, dword [str.config.txt]
mov dword [ecx], eax
mov eax, dword [0x428fc8]
mov dword [ecx + 4], eax
mov eax, dword [0x428fcc]
mov dword [ecx + 8], eax
mov eax, dword [0x428fd0]
mov dword [ecx + 0xc], eax
mov eax, dword [0x428fd4]
mov dword [ecx + 0x10], eax
mov ax, word [0x428fd8]
mov word [ecx + 0x14], ax
lea eax, [esp + 0x12c]
push 0x428f50
push eax
lea eax, [esp + 0x10]
push eax
call fcn.0040809b
add esp, 0xc
test eax, eax
jle 0x404a88
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.00401050
add esp, 8
jmp 0x404994
push dword [esp + 8]
lea eax, [esp + 0x30]
mov esi, 1
push 0xff
push eax
call fcn.0040a294
add esp, 0xc
test eax, eax
je 0x404ada
nop word [eax + eax]
mov edx, esi
lea ecx, [esp + 0x2c]
call fcn.00402bd0
push dword [esp + 8]
inc esi
test eax, eax
jne 0x404b2a
lea eax, [esp + 0x30]
push 0xff
push eax
call fcn.0040a294
add esp, 0xc
test eax, eax
jne 0x404ab0
push dword [esp + 8]
call fcn.00408481
add esp, 4
mov edx, esi
xor ecx, ecx
call fcn.00402bd0
test eax, eax
jne 0x404994
cmp dword [0x42db68], eax
je 0x404b5c
push 0x80
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
test eax, eax
jne 0x404b34
call edi
push eax
push str.Error_setting_process_priority:__d_n
call fcn.00401050
add esp, 8
jmp 0x404994
call fcn.00408481
jmp 0x404991
push 2
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
test eax, eax
jne 0x404b5c
call edi
push eax
push str.Error_setting_thread_priority:__d_n
call fcn.00401050
add esp, 8
jmp 0x404994
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [0x42f2bc], eax
test eax, eax
jne 0x404b88
call edi
push eax
push str.CreateEvent_error:__d_n
call fcn.00401050
add esp, 8
jmp 0x404994
lea eax, [esp + 0xc]
xorps xmm0, xmm0
push eax
push 0
push 0x42e730
push 0x404780
push 0
movlpd qword [0x42ea78], xmm0
push 0
movlpd qword [0x42ea80], xmm0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x404bcf
call edi
push eax
push str.Error_creating_the_thread:__d_n
call fcn.00401050
add esp, 8
jmp 0x404994
call dword [sym.imp.KERNEL32.dll_CreateTimerQueue]
cmp dword [0x42e71c], 0
mov dword [0x42e724], eax
jne 0x404bf4
push str.DEBUG
call fcn.0040f2d2
add esp, 4
test eax, eax
je 0x404bf9
mov eax, 1
mov esi, dword [sym.imp.USER32.dll_SetWindowsHookExA]
push 0
push 0
push 0x4044d0
push 0xe
mov dword [0x42e71c], eax
call esi
push 0
push 0
push 0x4046e0
push 0xd
mov dword [0x42f2b8], eax
call esi
cmp dword [0x42e71c], 0
mov dword [0x42f2c0], eax
je 0x404c40
push str.___DEBUG_MODE____n
call fcn.00401050
add esp, 4
jmp 0x404c63
push 1
call fcn.004081c1
push eax
call fcn.00408481
push 2
call fcn.004081c1
push eax
call fcn.00408481
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 0x404ca7
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 0x404c87
pop ebx
push dword [0x42f2c0]
mov esi, dword [sym.imp.USER32.dll_UnhookWindowsHookEx]
call esi
push dword [0x42f2b8]
call esi
cmp dword [0x42e6f8], 0
je 0x404cd0
mov dword [0x42e6f8], 0
mov eax, dword [0x42e718]
test eax, eax
je 0x404ce8
push 0
push eax
push dword [0x42e724]
call dword [sym.imp.KERNEL32.dll_DeleteTimerQueueTimer]
push dword [0x42f2bc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [0x42e724]
call dword [sym.imp.KERNEL32.dll_DeleteTimerQueue]
mov ecx, 0x42e730
call fcn.00402010
call fcn.00401a60
mov ecx, dword [esp + 0x334]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.00404f79
add esp, 0x330
ret