A method and system for detecting a keylogger on a computer is described.
One illustrative embodiment creates, in a memory of the computer, a
hidden window; generates a unique, unpredictable data pattern; inputs, to
the hidden window, the unique, unpredictable data pattern in a manner
that mimics keyboard input from a user; scans running processes in the
memory other than a keylogger detection process for the unique,
unpredictable data pattern; and performs a secondary scan of a suspect
process, the suspect process having an associated buffer that contains
the unique, unpredictable data pattern.