Function at 0x40e3c0
Capabilities:
Get keyboard layout
Log keystrokes via polling

Disassembly:
sub esp, 0x164
push ebx
push ebp
push esi
mov esi, dword [0x4bbc34]
push edi
mov byte [esp + 0x1c], 0
test esi, esi
je 0x40e4cc
lea ecx, [ecx]
cmp dword [esi], 1
jne 0x40e4c1
mov al, byte [esi + 0x3c]
test al, al
je 0x40e420
mov ecx, dword [esp + 0x178]
mov ecx, dword [ecx + 0x10]
lea edx, [ecx + 0x3c2c17]
dec al
cmp edx, 0x66
ja 0x40e410
mov edx, 0xffc3d44d
sub edx, ecx
jmp 0x40e415
mov edx, 0x65
movzx eax, al
cmp edx, eax
jle 0x40e4c1
cmp byte [esp + 0x184], 0
je 0x40e4b6
mov eax, dword [esi + 8]
test eax, eax
je 0x40e489
cmp dword [eax + 0x364], 0
je 0x40e489
mov ebp, dword [esp + 0x180]
mov bl, byte [esp + 0x17c]
movzx eax, bp
mov dl, byte [eax + esi + 0x150]
movzx edi, bl
mov cl, byte [edi + esi + 0x50]
or dl, cl
test dl, 0x20
jne 0x40e46f
cmp byte [esi + 0x42], 0
je 0x40e497
test cl, 0x40
jne 0x40e497
shl eax, 0x10
or eax, edi
push eax
mov eax, dword [0x4bb428]
push esi
push 0x41e
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x40e497
mov bl, byte [esp + 0x17c]
mov ebp, dword [esp + 0x180]
movzx ecx, bp
test byte [ecx + esi + 0x150], 0x80
jne 0x40e63b
movzx edx, bl
test byte [edx + esi + 0x50], 0x80
jne 0x40e65a
cmp byte [esi + 0x3f], 0
je 0x40e4c1
mov byte [esp + 0x1c], 1
mov esi, dword [esi + 4]
test esi, esi
jne 0x40e3e0
cmp byte [esp + 0x184], 0
jne 0x40e997
mov al, byte [0x4bb425]
mov byte [esp + 0x18], 1
test al, 0xcf
je 0x40e4fc
cmp byte [esp + 0x1c], 0
jne 0x40e4fc
test al, 0xc
je 0x40e4f7
test al, 3
jne 0x40e4fc
mov byte [esp + 0x18], 0
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebx, eax
xor esi, esi
mov dword [esp + 0x20], ebx
test ebx, ebx
je 0x40e541
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push ebx
call edi
lea edx, [esp + 0x40]
mov esi, eax
push edx
push esi
mov dword [esp + 0x48], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x40e541
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x40e541
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
mov dword [esp + 0x1c], ebp
cmp dword [0x4bcc64], ebx
je 0x40e585
push 0x1c
lea eax, [esp + 0x28]
push eax
push ebx
mov dword [0x4bcc64], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea ecx, [esp + 0x24]
push str.ApplicationFrameWindow
push ecx
call fcn.004926f1
add esp, 8
test eax, eax
sete byte [0x4bcc60]
mov bl, byte [0x4bcc58]
xor edx, edx
mov ecx, 0x40
mov esi, 0x4bb450
lea edi, [esp + 0x70]
mov byte [esp + 0x14], 0
mov word [esp + 0x15], dx
rep movsd dword es:[edi], dword [esi]
test bl, bl
je 0x40e673
cmp byte [0x4bcc60], dl
je 0x40e673
cmp byte [esp + 0x17c], 0xe7
je 0x40e673
mov al, byte [0x4bcc5e]
mov cl, byte [0x4bcc5f]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x70]
call fcn.0041a7f0
push ebp
mov ebp, dword [sym.imp.USER32.dll_ToAsciiEx]
push 0
lea edx, [esp + 0x1c]
push edx
mov eax, ecx
movzx ecx, word [0x4bcc5c]
push eax
movzx edx, bl
push ecx
push edx
call ebp
test eax, eax
jle 0x40e632
mov eax, dword [esp + 0x1c]
push eax
movzx eax, word [0x4bcc5c]
push 0
lea ecx, [esp + 0x1c]
push ecx
movzx ecx, byte [0x4bcc58]
lea edx, [esp + 0x7c]
push edx
push eax
push ecx
call ebp
mov byte [0x4bcc58], 0
jmp 0x40e679
movzx eax, bp
and byte [eax + esi + 0x150], 0x7f
lea eax, [eax + esi + 0x150]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
movzx ecx, bl
and byte [ecx + esi + 0x50], 0x7f
lea esi, [ecx + esi + 0x50]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
mov ebp, dword [sym.imp.USER32.dll_ToAsciiEx]
mov al, byte [0x4bb425]
lea ecx, [esp + 0x70]
call fcn.0041a7f0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40e69d
or byte [esp + 0x84], 1
jmp 0x40e6a5
and byte [esp + 0x84], 0xfe
mov bl, byte [esp + 0x17c]
cmp bl, 0xe7
jne 0x40e6dd
mov ebx, dword [esp + 0x178]
push 0
push 0
push 3
lea edx, [esp + 0x20]
push edx
push 1
lea eax, [ebx + 4]
push eax
push 0x400
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
jmp 0x40e765
cmp byte [esp + 0x18], 0
je 0x40e735
mov ecx, dword [esp + 0x1c]
xor edx, edx
cmp dword [0x4bb5c0], edx
push ecx
setne dl
lea eax, [esp + 0x18]
lea ecx, [esp + 0x74]
push edx
mov edx, dword [esp + 0x180]
push eax
mov eax, dword [edx + 4]
push ecx
movzx ecx, bl
push eax
push ecx
call ebp
test byte [0x4bb425], 3
mov edi, eax
jne 0x40e737
mov al, 0xd
mov cl, 0xa
cmp byte [esp + 0x14], al
jne 0x40e729
mov byte [esp + 0x14], cl
cmp byte [esp + 0x15], al
jne 0x40e737
mov byte [esp + 0x15], cl
jmp 0x40e737
xor edi, edi
cmp bl, 8
jne 0x40e75e
test edi, edi
je 0x40e75e
cmp byte [0x4bcc60], 0
mov ebx, dword [esp + 0x178]
je 0x40e75b
xor edi, edi
mov byte [0x4bcc58], 0
jmp 0x40e765
dec edi
jmp 0x40e765
mov ebx, dword [esp + 0x178]
mov esi, dword [esp + 0x180]
mov eax, dword [esp + 0x17c]
push edi
lea edx, [esp + 0x18]
push edx
push esi
push eax
push ebx
call fcn.0040ed80
add esp, 0x14
test al, al
je 0x40e64d
cmp byte [0x4bcc58], 0
je 0x40e79e
mov byte [esp + 0x18], 1
test edi, edi
jg 0x40e7a5
mov byte [esp + 0x18], 0
test edi, edi
jns 0x40e813
mov al, byte [0x4bb425]
mov cl, byte [esp + 0x17c]
test al, 0x30
setne dl
mov byte [0x4bcc58], cl
mov word [0x4bcc5c], si
mov byte [0x4bcc5e], dl
test al, 3
je 0x40e7da
mov byte [0x4bcc5f], 1
test al, 0xc
jne 0x40e7e1
mov byte [0x4bcc5f], 0
mov eax, dword [esp + 0x1c]
xor edx, edx
cmp dword [0x4bb5c0], edx
push eax
setne dl
lea eax, [esp + 0x18]
movzx ecx, cl
push edx
push eax
mov eax, dword [ebx + 4]
lea edx, [esp + 0x7c]
push edx
push eax
push ecx
call ebp
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
cmp dword [0x4bbca4], 0
je 0x40e8c1
cmp byte [esp + 0x188], 0
jne 0x40e8c1
mov cl, byte [esp + 0x17c]
cmp cl, 8
je 0x40e860
cmp cl, 0x20
jbe 0x40e87f
cmp cl, 0x28
ja 0x40e87f
cmp dword [0x4ba1d4], 0
je 0x40e87f
mov byte [0x4ba1d8], 0
mov dword [0x4ba1d4], 0
jmp 0x40e87f
cmp byte [0x4bb425], 0
jne 0x40e87f
mov eax, dword [0x4ba1d4]
test eax, eax
je 0x40e87f
dec eax
mov dword [0x4ba1d4], eax
mov byte [eax + 0x4ba1d8], 0
test edi, edi
jle 0x40e8c8
mov edx, dword [esp + 0x194]
mov eax, dword [esp + 0x190]
mov ecx, dword [esp + 0x18c]
push edx
push eax
mov eax, dword [esp + 0x28]
push ecx
push edi
push ebx
lea ecx, [esp + 0x28]
call fcn.0040e9b0
add esp, 0x14
test al, al
jne 0x40e8c1
mov byte [0x4bcc58], al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
mov cl, byte [esp + 0x17c]
cmp byte [esp + 0x18], 0
je 0x40e997
mov edx, dword [esp + 0x1c]
xor eax, eax
cmp dword [0x4bb5c0], eax
push edx
setne al
movzx esi, cl
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x74]
push eax
mov eax, dword [ebx + 4]
push ecx
push edx
push eax
push esi
call ebp
mov ebp, eax
test ebp, ebp
jns 0x40e924
mov ecx, dword [esp + 0x1c]
xor edx, edx
cmp dword [0x4bb5c0], edx
push ecx
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x74]
push edx
mov edx, dword [ebx + 4]
push eax
push ecx
push edx
push esi
call dword [sym.imp.USER32.dll_ToAsciiEx]
cmp ebp, edi
jne 0x40e932
mov al, byte [esp + 0x14]
cmp al, byte [esp + 0x18]
je 0x40e997
push pe_nt_image_headers32
lea ecx, [esp + 0x74]
push 0
push ecx
call fcn.0049bcd0
mov al, byte [0x4bcc5e]
mov dl, byte [0x4bcc5f]
add esp, 0xc
neg al
sbb al, al
and al, 0x20
neg dl
sbb dl, dl
and dl, 9
or al, dl
lea ecx, [esp + 0x70]
call fcn.0041a7f0
mov eax, dword [esp + 0x1c]
push eax
movzx eax, word [0x4bcc5c]
push 0
lea ecx, [esp + 0x24]
push ecx
movzx ecx, byte [0x4bcc58]
lea edx, [esp + 0x7c]
push edx
push eax
push ecx
call dword [sym.imp.USER32.dll_ToAsciiEx]
mov byte [0x4bcc58], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x164
ret