Function at 0x41c860
Capabilities:
Check for foreground window switch
Log keystrokes
Log keystrokes via polling

Disassembly:
sub esp, 0x38
push ebx
push ebp
push esi
mov esi, dword [sym.imp.USER32.dll_GetForegroundWindow]
push edi
call esi
mov edi, eax
mov dword [esp + 0x34], edi
call dword [sym.imp.ComFnUtl.dll_ComFnUtl_GetFocusHandle]
xor ebp, ebp
mov ebx, eax
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x10], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x30], ebp
cmp edi, ebp
je case.default.0x41cae4
cmp ebx, ebp
je case.default.0x41cae4
call esi
cmp eax, ebp
je 0x41c92c
push ebp
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov esi, eax
cmp esi, ebp
je 0x41c92c
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
cmp edi, ebp
je 0x41c92c
mov ebx, dword [sym.imp.USER32.dll_AttachThreadInput]
push 1
push edi
push esi
call ebx
test eax, eax
je 0x41c928
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x11
call dword [sym.imp.USER32.dll_GetKeyState]
push ebp
movzx eax, ax
push edi
push esi
mov dword [esp + 0x2c], eax
call ebx
test eax, eax
je 0x41c928
mov cx, word [esp + 0x20]
mov eax, 0xf
lea esp, [esp]
sar cx, 1
sub eax, 1
jne 0x41c910
mov word [esp + 0x20], cx
mov eax, dword [esp + 0x20]
and eax, 1
mov dword [esp + 0x1c], eax
mov ebx, dword [esp + 0x2c]
lea ecx, [esp + 0x30]
push ecx
push 0x10
call fcn.0041c7a0
mov edi, dword [esp + 0x38]
add esp, 8
cmp dword [0x4a449c], ebp
jne 0x41cad2
cmp dword [esp + 0x1c], ebp
jne 0x41cad2
cmp edi, ebp
jne 0x41cad2
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x20]
push eax
push ebx
call fcn.0041c450
add esp, 0x18
test eax, eax
mov eax, dword [esp + 0x4c]
je 0x41ca66
add eax, 0xffff8000
cmp eax, 3
ja case.default.0x41cae4
jmp dword [eax*4 + 0x41cb98]
cmp dword [esp + 0x24], ebp
je 0x41cb7f
mov ecx, dword [esp + 0x10]
mov edi, dword [esp + 0x18]
push 0x115
push ecx
xor ebx, ebx
call fcn.0041c740
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
add esp, 8
push ecx
push 8
push 0x115
push edx
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
cmp dword [esp + 0x24], ebp
je 0x41cb7f
mov edx, dword [esp + 0x10]
mov edi, dword [esp + 0x18]
push 0x115
push edx
mov ebx, 1
jmp 0x41c9ba
cmp dword [esp + 0x28], ebp
je 0x41cb7f
mov eax, dword [esp + 0x10]
push 0x114
push eax
xor ebx, ebx
jmp 0x41ca36
cmp dword [esp + 0x28], ebp
je 0x41cb7f
mov ecx, dword [esp + 0x10]
push 0x114
push ecx
mov ebx, 1
mov edi, dword [esp + 0x1c]
call fcn.0041c740
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
add esp, 8
push edx
push 8
push 0x114
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
add eax, 0xffff8000
cmp eax, 3
ja case.default.0x41cae4
jmp dword [eax*4 + 0x41cba8]
mov byte [esp + 0x20], 0x26
mov byte [esp + 0x1c], 0x48
jmp 0x41caa9
mov byte [esp + 0x20], 0x28
mov byte [esp + 0x1c], 0x50
jmp 0x41caa9
mov byte [esp + 0x20], 0x25
mov byte [esp + 0x1c], 0x4b
jmp 0x41caa9
mov byte [esp + 0x20], 0x27
mov byte [esp + 0x1c], 0x4d
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
mov ebx, dword [sym.imp.USER32.dll_keybd_event]
push ebp
push 1
push esi
push edi
call ebx
push ebp
push 3
push esi
push edi
call ebx
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
mov eax, dword [esp + 0x4c]
add eax, 0xffff8000
cmp eax, 3
ja case.default.0x41cae4
jmp dword [eax*4 + 0x41cbb8]
mov esi, 0x78
jmp 0x41caf7
mov esi, 0xffffff88
lea eax, [esp + 0x38]
push eax
push ebx
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x44]
sub eax, dword [esp + 0x3c]
cdq
sub eax, edx
sar eax, 1
movzx ecx, ax
mov eax, dword [esp + 0x40]
sub eax, dword [esp + 0x38]
shl ecx, 0x10
cdq
sub eax, edx
sar eax, 1
movzx edx, ax
or ecx, edx
cmp dword [0x49fa94], ebp
jne 0x41cb50
mov eax, dword [0x4a4498]
push ecx
mov ecx, dword [esp + 0x38]
push esi
push eax
push ecx
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
xor eax, eax
cmp dword [esp + 0x1c], ebp
je 0x41cb5d
mov eax, 8
cmp edi, ebp
je 0x41cb64
or eax, 4
movzx edx, si
movzx eax, ax
push ecx
mov ecx, dword [0x4a4498]
shl edx, 0x10
or edx, eax
push edx
push ecx
push ebx
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x38
ret