hook

How to capture any key in X?

Hi, I am building an application for which I need to periodically get information about users keyboard. It is going to be user idle detection application. I have a fairly simple solution to periodically check if the mouse has been moved. But I can't figure any reasonable non root way to detect if the keyboard has been pressed. I was thi...

Keyboard hooking for Bengali Phonetic keyboard

As an academic project we are trying to make a software for Linux that will be used to write Bengali(Phonetic).To do this we need keyboard hooking in Linux. But i have found there's not so much resource available on keyboard hooking. Is there any API in Linux for hooking? Is there any good documentation for hooking in Linux? ...

A hooked DirectX 9 program crashes on window resize, texture related.

I'm using EasyHook and SlimDX to overlay some graphics using SlimDX's Sprite and Texture classes. When I resize windows some programs fine, but others will crash - Winamp's MilkDrop 2 gives me an ambiguous memory error for example. I expect this is due to the after market Texture I created. The question is what VTable function should I ...

Raising event on reading file?

I have external app reading files, I want to hook that to get event in my app. But I cannot find a sources hooking ReadFile (or something else that can help me achieve that). Any ideas how to do that? It must be done in User-Mode. I was thinking for something similar to Process Monitor. I wonder how it does it.. ...

Hook key & key combinations from keyboard with Qt 4.6

Let's say I have a window-less application which has only an icon on the Taskbar (Windows, Mac OS X & Linux). I want it to capture some key & key combinations, let's say Right Control + Right Shift. Upon keying in correct, combination, it will do something, say take screenshot. I can do window-less app, icon on the Taskbar and screen cap...

Drupal hook_user stop execution

Hello, I need to use Drupal 6's "hook_user" to update a 3rd party API whenever a user updates their profile. Therefore I use the 'update' operation. The problem I am facing is that I just cannot see how I can stop execution if the 3rd party API update fails. I.e. the user updates their username, but if the API fails, prevent Drupal ...

How do I patch a Windows API at runtime so that it to returns 0 in x64?

In x86, I get the function address using GetProcAddress() and write a simple XOR EAX,EAX; RET 4; in it. Simple and effective. How do I do the same in x64? bool DisableSetUnhandledExceptionFilter() { const BYTE PatchBytes[5] = { 0x33, 0xC0, 0xC2, 0x04, 0x00 }; // XOR EAX,EAX; RET 4; // Obtain the address of SetUnhandledExceptionFilt...

Python hooks navigation logger windows

Hi, I´m trying to do a path logger (Navigation logger) in Python, the thing that I need is that the program can get the paths that de user is accesing in real time, for example: C:\Documents and Settings\ C:\Documents and Settings\Administrator\ C:\Documents and Settings\Administrator\Desktop\ C:\Documents and Settings\Administrator\Des...

Process-wide hook using SetWindowsHookEx

I need to inject a dll into one or more external processes, from which I also want to intercept keybord events. That's why using SetWindowsHookEx with WH_KEYBOARD looks like an easy way to achieve both things in a single step. Now I really don't want to install a global hook when I'm only interested in a few selected processes, but Wind...

Keyboard hook return different symbols from card reader depends whther my app in focus or not

I code WinForm application (VS2008 .Net 2.0) where one of the input is magnetic stripe card reader (CR). I am using code George Mamaladze's article Processing Global Mouse and Keyboard Hooks in C# on codeproject.com to listen keyboard (USB card reader acts same way as keyboard) and I have weird situation. One card reader CR1 (Unitech MS...

Hook perm for more than one content type

Drupal 6.x I have this module that manages four different content types. For that matter, how do I define permission for each content within the same module? Is that even possible? I can't figure out how to define permission for each content type cuz hook_perm has to be named with module name and it doesn't have any argument(like hook_a...

How to correctly hook and return GetDlgItemTextA from C++ to C# to C++ from EasyHook

I'm using EasyHook, a C# library for injecting and detouring functions from unmanaged applications. I'm trying to hook onto GetDlgItemTextA, which takes the arguments: UINT WINAPI GetDlgItemText( __in HWND hDlg, __in int nIDDlgItem, __out LPTSTR lpString, __in int nMaxCount );` In my hook, I am casting it as: [DllImpo...

Problem with writing mobilesubstrate plugins for iOS

I am trying to hooking message sending for iOS 3.2, I implement my own hook on a working ExampleHook program I find on the web. But my hook apparently caused segmentation fault everytime it hooks and I don't know why. I want to hook to [NSURL initWithString:(NSString *)URLString relativeToURL:(NSURL *)baseURL; and here is my related...

Drupal hook_cron execution order

Does anyone know off hand what order Drupal executes it's _cron hooks? It is important for a certain custom module I am developing and can't seem to find any documentation on it on the web. Maybe I'm searching for the wrong thing! Any help? Jeff ...

How to hook a function for a particular shared ELF library?

LD_PRELOAD hooks some functions for the entire process, but I need to hook a particular function for only one dynamically linked library by its name. ...

Block committing changes to Microsoft Access database

Is there a way to write a hook that will run before changes are committed to an Access DB? I'm looking for a way to block changes if a specific process is currently querying the DB. ...

How can I intercept/rewrite Windows ODBC calls?

I'm looking to modify ODBC calls either directly before hitting the ODBC stack or between the ODBC stack and the dll driver for the connection I am using. For instance, if the application does a SELECT, I want to be able to modify it be SELECT_ALL How can I do that? ...

How to redirect registry access of a dll loaded by my program

I have got a dll that I load in my program which reads and writes its settings to the registry (hkcu). My program changes these settings prior to loading the dll so it uses the settings my program wants it to use which works fine. Unfortunately I need to run several instances of my program with different settings for the dll. Now the ap...

Emacs: Using and initializing CEDET

Hi, I'm using Emacs with CEDET and auto complete for code completion. Originally I set up CEDET so it loads at Emacs start up every time. However, this took quite a long time, so i thought it would be clever to load it just if needed, i.e. - in my case - when entering C++-Mode. So I moved the original function into a lambda that is ...

How to distinguish ordinary commit and merge in Subversion?

I'm working on SVN repository hooks. Here is the typical structure of repository: trunk/ branches/ branch1/ branch2/ In pre-commit hook I need to detect if merge (between branches, from branch to trunk or vice-versa) has been performed and check if user is authorized to perform merge. I discovered that merge changes 'svn:merg...