hook

IDirect3DDevice9::EndScene hook sometimes get NULL in the parameter IDirect3DDevice9

删除回忆录丶 提交于 2019-12-12 02:26:54
问题 I made a trampoline hook for the function IDirect3DDevice9::EndScene. The codecave I modified the start if the EndScene function to jump to is this: __declspec(naked) HRESULT EndScene_Hook(IDirect3DDevice9* device) { ScreenCapture::Capture(device); __asm { PUSH 0x14 MOV EAX, 0x718E6478 JMP address } } The problem is that sometimes device is NULL, why is that? if I add a small condition like this: if(device != NULL) ScreenCapture::Capture(device); Everything works as intended with no errors.

Global hook using WH_GETMESSAGE and WH_KEYBOARD

为君一笑 提交于 2019-12-12 01:58:52
问题 I try to make the global hook, in order to catch the number from keyboard, change it, and pass it. So for example: if I type "0" in google, the software will change it, and the "1" is inserted instead. In order to learn, how the hooks works, I used WH_KEYBOARD in order to get all keys inserted into my pc. And it worked. However, now I would like to change the key globally, and in order to do that I use WH_GETMESSAGE. And in this case, hook isn't applied globally, but locally instead(in test

Network hooks hanging the system

懵懂的女人 提交于 2019-12-12 01:45:15
问题 I was testing the network hook code given in https://en.wikipedia.org/wiki/Hooking . My kernel version is 3.11. #include <linux/module.h> #include <linux/kernel.h> #include <linux/skbuff.h> #include <net/ip.h> #include <linux/ip.h> #include <linux/tcp.h> #include <linux/in.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> /* Port we want to drop packets on */ static const uint16_t port = 25; /* This is the hook function itself */ static unsigned int hook_func(unsigned int

How to use Global Hook

江枫思渺然 提交于 2019-12-12 01:35:13
问题 I tried using global hook, and when I typed in using gma.System.Windows; it did not recognize gma? What do I need to do? 回答1: It looks like you may be using code from this CodeProject article. You need to reference the assembly / source code from that article. Also, you need to type Gma. rather than gma. -- C# is case sensitive. 回答2: If you want to stay inside the C# world, you are restricted to low-level hooks only. There is some code here and here. 来源: https://stackoverflow.com/questions

How to sync the stage(index) and working directory after git hook post-receive?

心已入冬 提交于 2019-12-12 01:28:37
问题 In my other question, Issue in automatic executing post-commit in git hook to sync local and remote directory, I could use git hook to invoke post-receive so that the working directory is the same as git bare repository. unset GIT_INDEX_FILE git --work-tree=/home/ubuntu/dumb --git-dir=/home/ubuntu/git/dumb.git checkout -f After the push the working directory is revised, but the index is not updated. For example, in my local machine, I add a line "???" in hello.txt. I added/commited/push the

Hooking __thiscall without using __fastcall

笑着哭i 提交于 2019-12-12 01:12:48
问题 Say you need to hook/detour a function that is the __thiscall type on x86 Windows and in order to do that, you need to pass a void* to the shim function. Yes this is technically "horrible abuse" of C++, but this is function hooking, not an exercise in coding a portable application. For example, say you need to hook a function such as this: void __thiscall SomeClass::MemberFunction(int b) { this->somevar = b; } Obviously it's well known that you can just create a __fastcall function that uses

Hook keyboard shortcuts from Windows lock screen

家住魔仙堡 提交于 2019-12-12 00:59:01
问题 I have an arduino in keyboard emulation mode that sends keyboard keystrokes to the computer it's connected to, the latter appending a log line in a local webpage upon receiving each keystroke. The log program is coded in C using Win32 API. Now, since it's supposed to function at work (the idea is to get a log file online of when pushbuttons on my desk have been activated), I will be locking my computer... How can I keep processing CTRL+ALT+key strokes from the windows lock screen? Thanks,

Call SetWindowsHookEx with method defined in header file

有些话、适合烂在心里 提交于 2019-12-11 22:57:05
问题 I am attempting to add a low level mouse hook to a class. I am able to do so by placing this function in my CPP file: LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) { //my hook code here return CallNextHookEx(0, nCode, wParam, lParam); } Then, I set up the hook in the class constructor like so: HHOOK mousehook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, NULL, 0); This works fine for intercepting mouse events, however since the callback function is not defined in my

Custom Field URL Option for Woocommerce Product Thumbnail

会有一股神秘感。 提交于 2019-12-11 21:24:37
问题 Currently I'm using the Woocommerce plugin for affiliate products. I would like to be able to click on the thumbnail on the main page and go directly to amazon, for example. Currently it's setup so that once clicked it goes to the product detail page on my site. From there you can get to the amazon page. However, fewer clicks the better. So I found the hook in the content-product.php page. What I did was wrap the whole thing in a URL and used a custom field to add in the URL. Doesn't work as

How to resolve conflict between hooks modifying the same jsp?

强颜欢笑 提交于 2019-12-11 20:13:34
问题 We have downloaded the Notifications portlet from liferay which modifies the JSP: html/portlet/dockbar/view_user_account.jspf And we are also modifying this particular jspf in our hook. Currently what we are doing is we are copying the code from notifications portlet in our custom hook and are deploying our custom hook at the end so that our changes are applied. Or else we would need to remove the JSP hook from notifications portlet by modifying the notification portlet's source. Are there