Function at 0x4044c0
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 0x404542
push 1
call fcn.00407be6
push eax
push 0x426e78
push str.CONOUT_
call fcn.00407af8
push 2
call fcn.00407be6
push eax
push 0x426e78
push str.CONOUT_
call fcn.00407af8
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 0x426f0c
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 0x4045b7
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.0041008f
pop edi
mov eax, 1
pop esi
mov ecx, dword [esp + 0x32c]
xor ecx, esp
call fcn.00404b69
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 0x4045e0
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 0x404603
mov eax, dword [str.config.txt]
mov dword [ecx], eax
mov eax, dword [0x426ef8]
mov dword [ecx + 4], eax
mov eax, dword [0x426efc]
mov dword [ecx + 8], eax
mov eax, dword [0x426f00]
mov dword [ecx + 0xc], eax
mov eax, dword [0x426f04]
mov dword [ecx + 0x10], eax
mov ax, word [0x426f08]
mov word [ecx + 0x14], ax
lea eax, [esp + 0x12c]
push 0x426e84
push eax
lea eax, [esp + 0x10]
push eax
call fcn.00407d20
add esp, 0xc
test eax, eax
jle 0x404678
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 0x404589
push dword [esp + 8]
lea eax, [esp + 0x30]
mov esi, 1
push 0xff
push eax
call fcn.00409d84
add esp, 0xc
test eax, eax
je 0x4046ca
nop word [eax + eax]
mov edx, esi
lea ecx, [esp + 0x2c]
call fcn.004029d0
push dword [esp + 8]
inc esi
test eax, eax
jne 0x40471a
lea eax, [esp + 0x30]
push 0xff
push eax
call fcn.00409d84
add esp, 0xc
test eax, eax
jne 0x4046a0
push dword [esp + 8]
call fcn.00407fa3
add esp, 4
mov edx, esi
xor ecx, ecx
call fcn.004029d0
test eax, eax
jne 0x404589
cmp dword [0x42b9c8], eax
je 0x40474c
push 0x80
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
test eax, eax
jne 0x404724
call edi
push eax
push str.Error_setting_process_priority:__d_n
call fcn.00401020
add esp, 8
jmp 0x404589
call fcn.00407fa3
jmp 0x404586
push 2
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
test eax, eax
jne 0x40474c
call edi
push eax
push str.Error_setting_thread_priority:__d_n
call fcn.00401020
add esp, 8
jmp 0x404589
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [0x42d03c], eax
test eax, eax
jne 0x404778
call edi
push eax
push str.CreateEvent_error:__d_n
call fcn.00401020
add esp, 8
jmp 0x404589
lea eax, [esp + 0xc]
xorps xmm0, xmm0
push eax
push 0
push 0x42c4b0
push 0x404370
push 0
movlpd qword [0x42c7f8], xmm0
push 0
movlpd qword [0x42c800], xmm0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x4047bf
call edi
push eax
push str.Error_creating_the_thread:__d_n
call fcn.00401020
add esp, 8
jmp 0x404589
call dword [sym.imp.KERNEL32.dll_CreateTimerQueue]
cmp dword [0x42c494], 0
mov dword [0x42c49c], eax
jne 0x4047e4
push str.DEBUG
call fcn.0040eb56
add esp, 4
test eax, eax
je 0x4047e9
mov eax, 1
mov esi, dword [sym.imp.USER32.dll_SetWindowsHookExA]
push 0
push 0
push 0x4040e0
push 0xe
mov dword [0x42c494], eax
call esi
push 0
push 0
push 0x4042d0
push 0xd
mov dword [0x42d038], eax
call esi
cmp dword [0x42c494], 0
mov dword [0x42d040], eax
je 0x404830
push str.___DEBUG_MODE____n
call fcn.00401020
add esp, 4
jmp 0x404853
push 1
call fcn.00407be6
push eax
call fcn.00407fa3
push 2
call fcn.00407be6
push eax
call fcn.00407fa3
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 0x404897
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 0x404877
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 0x4048c0
mov dword [0x42c470], 0
mov eax, dword [0x42c490]
test eax, eax
je 0x4048d8
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.00401e20
call fcn.004018a0
mov ecx, dword [esp + 0x334]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.00404b69
add esp, 0x330
ret