hook

drupal--hook_menu

痞子三分冷 提交于 2019-12-08 14:26:19
问题 the info file is right,the following is my module file code. when i access the http://localhost/drupal/mymenu why it can't work. <?php function mymenu(){ $item = array(); $item['mymenu'] = array( 'description'=>'test1', 'page callback'=>'mymenu_test', 'access arguments' => array('access mymenu'), 'type'=>MENU_CALLBACK, ); return $item; } function mymenu_perm(){ return array('access mymenu'); } function mymenu_test() { $output = 'hello world'; return $output; } i have gave the 'access mymenu'

ClearCase.ClearTool returns No view context available error

牧云@^-^@ 提交于 2019-12-08 13:50:37
I am trying to run the following code, but the got #error 1 at startview command, and #error 2 in desc command. use Win32::OLE; $ct = Win32::OLE->new('ClearCase.ClearTool') or die "Could not create ClearTool object\n"; $view = "ccadm01_UARK_DEV"; $output = $ct->CmdExec("pwv") or die("Cleartool returned error: ", Win32::OLE->LastError(), "\n"); print ("pwv \$output = $output\n"); # error 1 : cleartool return error 0 $output = $ct->CmdExec("startview ccadm01_UARK_DEV") or die("Cleartool returned error: ", Win32::OLE->LastError(), "\n"); $CWD = $view_dir; print( "Current directory: $CWD\n"); #

Hook flash application

白昼怎懂夜的黑 提交于 2019-12-08 13:16:59
问题 if I load in my C# application a flash application A that opens a socket with a server B, is it possible to setup a local hook so that i can read the packets exchanged between A and the server B? I may obtain the flash application sources if needed, but I'm not the one who wrote them I'm new to C# ( to be honest, I'm still wondering what's the best language to write this kind of application for windows ) and to hooking, so any example would be really appreciated :) I'm working client side 回答1

MS Detours Express 3.0 is not hooking CreateFile win32 API function properly

懵懂的女人 提交于 2019-12-08 12:37:11
问题 I am trying to hook win32 API function "CreateFile" using MS Detours, but when I test it by opening a *.doc file using MS Word, The CreateFile call for DLLs and font files and directories loaded by MS Word are redirected to my detoured function but not for that *.doc file, but when I open a *.txt file using notepad the CreateFile call for that *.txt file comes to my detoured function. I am using following code for hooking CreateFile: static HANDLE (WINAPI *Real_CreateFile)(LPCWSTR lpFileName,

Detours Hook memcpy Not Working

假如想象 提交于 2019-12-08 12:13:18
问题 I have programmed hook for memcpy but it only calls on the end of the program. Not each time, when was function called. Also the adresses are different. This is the hook: #include <windows.h> #include<iostream> #include "detours\detours.h" #pragma comment( lib, "msvcrt.lib" ) #pragma comment( lib, "detours.lib" ) //#pragma comment( lib, "detoured.lib" ) //int (WINAPI *Real_Send)(SOCKET s, const char *buf, int len, int flags) = send; //int WINAPI Mine_Send(SOCKET s, const char* buf, int len,

Keyboard hooks without using a DLL?

痞子三分冷 提交于 2019-12-08 12:11:40
问题 I'm trying to create a program with some key bindings (F1-F12) which will pick up the key presses while out of focus (specifically, while a game is running). Is there anyway to detect these key presses without using a global hook? The language I am programming in (real studio) doesn't have a means of creating a DLL (required for a global hooks), plus, I'm hoping of having it cross platform with mac (which is what realstudio does). 回答1: While as klartex says, a low-level keyboard/mouse hook

sequelize capitalize name before saving in database - instance hook

柔情痞子 提交于 2019-12-08 12:02:52
问题 I am new to sequelize and I am trying to capitalize the first letter of the name every time I create a new "Rider" so it looks capitalized on my table. I haven't been able to do it: this is my model: const db = require("./db"); const Sequelize = require("sequelize"); //(w / WSL ranking, Last tournament won, Country, favorite wave, current board). const Rider = db.define("rider", { name: { type: Sequelize.STRING, allowNull: false }, country: Sequelize.STRING, wsa: { type: Sequelize.INTEGER,

Checking if an API is monitored (hooked?)

删除回忆录丶 提交于 2019-12-08 10:02:28
问题 My application uses some APIs like GetProcAddress and CreateProcess that cause sometimes antiviruses to flag it as malicious even though it is not. What I am trying to do is check whether a specific API is being monitored or hooked and if it is then I won't call that part of the code. How do I check whether a certain API is hooked? This is a Windows application written in C. Thanks. 回答1: On win32 there are no offical methods to detect and/or place hooks (besides the SetWindowsHookEx() (http:/

Java/SWT: How to receive mouse events from an embedded window

社会主义新天地 提交于 2019-12-08 08:52:28
问题 I am embedding a windows application into my SWT application using 'reparenting'. That part works ok. I would now like to hook my SWT app into the message queue for the embedded app to receive mouse move events. I see that the OS class in SWT has a number of interesting methods for adding hooks but I have not been able to figure out how to use them. Can anyone help? Thanks 回答1: This should work, but it relies on using reflection to call non-API, so use it at your own risk. Use reflection to

Hooking WinAPI functions called from DLL

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 07:52:59
问题 I have a DLL file library.dll which contains a function foo . The function foo calls a WinAPI function goo . I wrote an application that calls foo from library.dll . The problem is that I want to override the call to goo function by my own function hoo I declared in the application (not in the DLL). How can I hook the call to goo function? I'm not looking for a global hook, I just want to override calls made by application I wrote. 回答1: There is library called Detours provided by Microsoft