hook

Hooking CreateFile in notepad.exe does not catch API calls

流过昼夜 提交于 2019-12-03 21:17:30
My ultimate goal is to track file operations done by explorer.exe via hooking file api in kernel32.dll, however I have yet to get that working (either explorer.exe is not calling the APIs, or something is wrong on my end). In order to figure out what is going on, I've set a goal to track whenever notepad.exe creates a file, however this has failed for some reason as well! I have 3 Visual Studio 2012 C++ projects: my DLL, a DLL injector that will force any executable to load my dll (although it may fail if Unicode/Multibyte and 32/64bit settings don't match up), and a test program that calls

Detect / Hook Window Move/Drag of other external processes

假装没事ソ 提交于 2019-12-03 20:21:46
问题 What is the best way to Detect Window Move/Drag of other Processes? In Windows7 64-bit I'm currently investigating Global Hooks from a DLL using C++ & C#. It's a pain as it doesn't want to work properly. I've gotten some success with keyboard and mouse hooks. but for window messages I've just got no idea whats wrong. this is the code in my .dll file #include <windows.h> #include <iostream> #include <stdio.h> HINSTANCE hinst; #pragma data_seg(".shared") HHOOK hhk; WNDPROC realProc; #pragma

Wordpress Add new User hooks

走远了吗. 提交于 2019-12-03 17:31:16
问题 I want to add some custom fields to add new user in Wordpress . I am using the following hooks: show_user_profile edit_user_profile these hooks displaying new custom field on edit profile page, but i want the new custom field to be shown in Add New User page. and also i want to insert values in wp_usermeta table, for this i am using following hooks: personal_options_update edit_user_profile_update these hooks are also working fine on edit or update profile, but i need the insertion of record

'Safe' DLL Injection

杀马特。学长 韩版系。学妹 提交于 2019-12-03 17:13:32
Not a terribly good question, sorry. I have a program that needs to be alerted when a file is opened from explorer (i.e. ShellExecute(A/W) is called). Unfortunately, Microsoft removed the COM interface (IShellExecuteHook) that allows you to hook these events in Vista and up, supposedly because older code could cause a crash due to changes. There was a work-around to re-enable this feature, but it no longer works. I've done some research and it looks like the only way to catch calls to ShellExecute is to re-route the call to shell32.dll. At the moment, I'm looking at injecting my own DLL into

How to add MS outlook reminders event handlers with VBA

时光怂恿深爱的人放手 提交于 2019-12-03 17:00:50
I want to extend MS Outlook so that when a calendar reminder pops up, I can run a VBA hook that can run an external program (like a batch script). In my case, I want to "forward" the reminder to a Linux desktop since I work in both environments and I don't always have the Windows desktop visible. I see an example at http://office.microsoft.com/en-us/outlook-help/HV080803406.aspx and have opened VBA Developer view in MS outlook 2010 and inserted a class module and added that VBA code, but I do not see how to activate this code - when a reminder pops up, this code is not activated. Update Here

Hook into Wordpress image upload

情到浓时终转凉″ 提交于 2019-12-03 16:44:38
For my Wordpress website I want to generate programmatically and automatically an extra photo size while a user uploads a picture . I want this photo also to appear in the media library. I wrote a little side plugin which I activate to hook into the upload action. My question is, which wp upload action I should hook into to generate this extra size of the uploaded image. Example of getting the current upload and write the extra image entry are welcome. Thanks! You can try wp_handle_upload_prefilter: add_filter('wp_handle_upload_prefilter', 'custom_upload_filter' ); function custom_upload

Port Win32 DLL hook to Linux

不羁岁月 提交于 2019-12-03 16:27:02
I have a program (NWShader) which hooks into a second program's OpenGL calls (NWN) to do post-processing effects and whatnot. NWShader was originally built for Windows, generally modern versions (win32), and uses both DLL exports (to get Windows to load it and grab some OpenGL functions) and Detours (to hook into other functions). I'm using the trick where Win will look in the current directory for any DLLs before checking the sysdir, so it loads mine. I have on DLL that redirects with this method: #pragma comment(linker, "/export:oldFunc=nwshader.newFunc) To send them to a different named

Is there a way to listen to an event in the phantom context from page context?

…衆ロ難τιáo~ 提交于 2019-12-03 14:37:18
问题 For example: I open a page with PhantomJS, evaluate an asynchronous script (e.g. ajax). When it succeeds, I want to let the phantom context (outside of page.evaluate() ) know that the asynchronous process is finished. I don't want to use setTimeout and setInteval to wait and check continously in the phantom context that the process is finished. 回答1: That is exactly what the onCallback and window.callPhantom() pair is for. So, if you have an asynchronous call in the page context like an AJAX

.NET events - blocking subscribers from subscribing on an event

浪子不回头ぞ 提交于 2019-12-03 13:44:53
Let's say I have a "Processor" interface exposing an event - OnProcess. Usually the implementors do the processing. Thus I can safely subscribe on this event and be sure it will be fired. But one processor doesn't do processing - thus I want to prevent subscribers to subscibe on it. Can I do that? In other words in the code below I want the last line to throw an exception: var emptyProcessor = new EmptyProcessor(); emptyProcessor.OnProcess += event_handler; // This line should throw an exception. class EmptyProcessor : IProcessor { [Obsolete("EmptyProcessor.OnProcess should not be directly

Smartgit: Auto insert commit message

妖精的绣舞 提交于 2019-12-03 13:16:23
Is there a way to auto insert the commit message in Smartgit with a hook script? (Bash). If a user commit's his change, I want to preload the commit message field. VonC I don't see any SmartGit configuration for this feature. I would rather rely on a prepare-commit-msg hook as described in " How do I add project-specific information to the Git commit comment? ", based on a commit.template Git configuration . See also " Including the current branch name in the commit template " for another example. There are 2 hooks which may be of interest to you: prepare-commit-msg and commit-msg prepare