hook

Git commit hook - How to use the commit-msg hook to check for string in message?

瘦欲@ 提交于 2019-12-06 09:12:33
问题 I need to make a commit-msg hook to check if the commit message contains "app.asana" in any part of this. I searched some references and documentation and I know I need to use the commit-msg for this. I have to make this using Perl or Bash. Does anybody has a clue about this or somewhere I can look more examples to learn how to do it?? Thank you. 回答1: I found an answer to my question. In case it may help somebody... I just created a commit-msg file in .git/hooks containing #!/bin/sh test -n "

Is there a Subversion Checkout Hook or something similar?

柔情痞子 提交于 2019-12-06 08:58:14
I'm using a subversion repository and I want to know whenever somebody asks my repository for a checkout; like a 'svn co' or an 'svn up'. Is there a hook or some other method that I can use so that a script is run, or email sent, whenever somebody requests information from my svn server? How can I achieve this without relying on apache logs? BTW it is a pretty simple repository just meant for Educational purposes. (If you need more information then just ask. Thanks in advance.) The following are all the supported hooks in Subversion 1.5, from the Version Control with Subversion book: start

Git post-receive user input

主宰稳场 提交于 2019-12-06 08:45:08
问题 This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . I am trying to implement a database import after a git push origin master , but the problem is I cannot prompt the user for input from post-receive hook in Git. I need to ask the user about the import, if it should happen and for the name of the database export file. I couldn't find any useful information in Google. 回答1: The hook itself can only return stdout/stderr

PInvoke errors calling external SetWindowsHookEx and GetModuleHandle

ぃ、小莉子 提交于 2019-12-06 07:43:44
I am trying to set windows hooks in my program to an external EXE. This will be used to monitor resizing/minimizing of the window, so I can resize my program similarly, docking to the window. How do I get around error codes 1428 and 126 below? When calling SetWindowsHookEx with a null hMod, I was getting this error 1428 . I get the same error if passing the current module (instead of IntPtr.Zero), which it seems to get correctly, as so: IntPtr module = PInvoke.GetModuleHandle(null); [...] SetWindowsHookEx(...,...,module,...); int error = PInvoke.GetLastError(); 1428 = Cannot set nonlocal hook

Hooking Win32 windows creation/resize/querying sizes

允我心安 提交于 2019-12-06 07:32:18
问题 I'm trying to "stretch" an existing application. The goal is to make an existing application become larger without changing the code of that application. A cosntraint is that the stretched application will not "notice" it, so if the application query a created window size it'll see the original size and not the resized size. I managed to resize the windows using SetWindowsHookEx : HHOOK hMessHook = SetWindowsHookEx(WH_CBT,CBTProc, hInst, 0); And: LRESULT CALLBACK CBTProc( __in int nCode, __in

How to make a Hook and Trampoline function in one for WinAPI hooking

只愿长相守 提交于 2019-12-06 07:26:59
So I have been learning about the concept of hooking and using trampolines in order to bypass/execute data in a WinAPI hook function (In a different executable file, using DLL injection). So far I know how to make it (the trampoline and hook) using a mixture of assembly and C, but I can't seem to do it with just using C, as I seem to be missing something. I'd appreciate if someone could tell me what I'm doing wrong and how to fix it up. Right now my code: #include <Windows.h> unsigned char* address = 0; __declspec(naked) int __stdcall MessageBoxAHookTrampoline(HWND Window, char* Message, char*

Sandboxing a program using WinAPI hooks

非 Y 不嫁゛ 提交于 2019-12-06 06:02:36
I'd like to sandbox a native code and use hooking of WinAPI and system functions to block or allow this program to perform some operations like reading/writing files, modify Windows registry, using an Internet connection. Is it a good and secure way to do so? How difficult would it be for that program to bypass such a security layer? +1 to Hans, however if you are really into it then I can recommend Easyhook . I have personally used it successfully in Win XP, Vista and 7. I don't know how bypassable it is but other alternatives do exist - madSHI hooks, and, if you want to go the official way,

How do i send keys using a global keyboard hook?

喜欢而已 提交于 2019-12-06 05:28:54
问题 I'm trying to send keys to an application which does not respond to any of the API's that I have so far used (SendInput(), PostMessage(), SendMessage() and others). However, i tested Windows' On-Screen Keyboard Utility and pressed the keys i needed and the application received these keys easily. If i understand correctly the keyboard utility uses global keyboard hooks to send the keys, so I'm interested i how i could do so as well. I have tried finding examples of how this can be done on

Linux module to hook process functions

北城以北 提交于 2019-12-06 05:20:57
I have a problem, maybe you have some information about this. I want to hook socket receive function (recv) in running process and modify incoming data. How i know, i can do this using kernel module, but i cant find information about how to do such hook. I tried to go another ways like Netfilter, iptables, but these ways to slow. Be aware that there are several different syscalls which could be used - not just recv(). Assuming the application in question does its kernel interaction via the C library (instead of crafting syscalls by hand), and that you can restart it to set up the test, a