hook

Read from STDIN on a Git pre-commit Hook (with PHP)

对着背影说爱祢 提交于 2019-12-10 14:39:28
问题 I'm looking for a way to have git-commit wait for standard input. I'm coding this in PHP , as my bash skills are non-existant, so I thougth doing a regular <?php $input = trim(fgets(STDIN)); fscanf(STDIN, "%d\n", $line); ?> would do the trick, and wait until I write stuff in to continue, but it just goes ahead and continues executing my PHP script anyways. The idea behind this is that after I tag a release, git will push HEAD to the testing webserver, send a couple of tweets, and let me write

SVN post-update hook

扶醉桌前 提交于 2019-12-10 13:27:20
问题 I searched on the web for info about how to implement a post-update hook in my local machine but i didnt found anything! In particular I would like to fire that hook after I update my svn copy from PHPStorm 3.0. I wrote a phing build.xml that will handle a task that i want to be performed after the svn update automatically. Any Idea ? Ty in advance! P.S: our local machines runs Win7. 回答1: As @Rup has mentioned, you'll need a client that supports client-side hooks (such as Tortoise SVN).

Prevent repainting of window in C++

故事扮演 提交于 2019-12-10 12:57:54
问题 I am writing a global hook DLL that needs to do some drawing using GDI+ on a window in response to an event. My problem is that the window that is being drawn keeps repainting itself, so what I draw gets erased before I want it to. Is there any way I can prevent the window from painting anything for as long as I need to? My hook currently is a WH_CALLWNDPROC hook. The drawing is done using GDI+ in response to the message WM_SIZING . I drawing using GDI+ onto the window's DC (i.e. GetWindowDC

How can i protect against this bypass?

让人想犯罪 __ 提交于 2019-12-10 12:28:29
问题 I have it to protect against bots called by mouse. (if click is by a human or not). I have it to protect: http://pastebin.com/SfebsEPj But some peoples did a bypass: http://pastebin.com/HK9CekzZ Anyone have an idea? Code: HHOOK MouseHook; LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode == HC_ACTION) { if(wParam == WM_RBUTTONDOWN || wParam == WM_LBUTTONDOWN) { MSLLHOOKSTRUCT *info=(MSLLHOOKSTRUCT*)lParam; if((info->flags & LLMHF_INJECTED) == LLMHF_INJECTED)

hooking explorer drag drop fails

依然范特西╮ 提交于 2019-12-10 12:17:13
问题 The big picuture: I am trying to inject my own own wrapper around explorer's drag n drop. My code is injected into explorer, and I try to replace the drop target with my own. In order to do this I am doing: Find all explorer windows (using EnumWindows and checking process association for each window). For each window I am running the following (do nothing) code: IDropTarget* lpDT = (IDropTarget *)GetProp(hwnds[i], L"OleDropTargetInterface"); //get existing drop target HRESULT res1 = :

Why I can't use sessions in a CodeIgniter hook

怎甘沉沦 提交于 2019-12-10 12:05:59
问题 I have this code here: hooks/account.php: class Account { public function checkIfLogged() { if(!$this->session->userdata('logged') ){ $this->load->view('error/not_found'); exit; } } } and I get this error: Undefined property: Account::$session I can confirm that my hook is a post_controller_constructor. Can somebody tell me where I am going wrong? Thanks. 回答1: you should use: $this->CI = & get_instance(); if(!$this->CI->session->userdata('logged') ){ $this->CI->load->view('error/not_found');

Adding custom jQuery validation in SugarCRM editview

元气小坏坏 提交于 2019-12-10 12:04:04
问题 I am trying to add custom jQuery script in either header or footer of Accounts edit view, searched everywhere in Google but can't find an hook that prints scripts in header or footer. My goal is to add custom validation for my custom fields, but as soon as I add jQuery code the page gets halted. I am inserting following code in custom/modules/Accounts/metadata/editviewdefs.php $viewdefs ['Accounts'] = array( 'EditView' => array( 'templateMeta' => array( 'javascript' => '<script type="text

Problems on injecting into printf using LD_PRELOAD method

廉价感情. 提交于 2019-12-10 11:31:08
问题 I was hacking printf() of glibc in one of my project and encountered some problem. Could you please give some clues? And one of my concern is why the same solution for malloc/free works perfect! As attached, “PrintfHank.c” contains my own solution of printf() which will be preloaded before standard library; and “main.c” just outputs a sentence using printf(). After editing two files, I issued following commands: compile main.c gcc –Wall –o main main.c create my own library gcc –Wall –fPIC

git push remote: warning: hooks.mailinglist has multiple values

一个人想着一个人 提交于 2019-12-10 11:27:20
问题 I have just upgraded from using gitosis to gitolite. Email notifications are working for all repos but for the gitolite-admin repo I get this waring when I push (the push is good): $ git push remote: warning: hooks.announcelist has multiple values remote: error: cannot overwrite multiple values with a single value remote: Use a regexp, --add or --set-all to change hooks.announcelist. remote: warning: hooks.mailinglist has multiple values remote: error: cannot overwrite multiple values with a

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

有些话、适合烂在心里 提交于 2019-12-10 10:49:00
问题 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*