hook

Exceuting a simple assembly code in C++ without it being in a function

馋奶兔 提交于 2019-12-13 21:01:17
问题 I'm trying to write a trampoline hook to some win32 api function, when I write the JMP instruction to the start of the original function I want it to jump to a codecave instead of calling a function. The original function start looks like this in OllyDBG: PUSH 14 MOV EAX, 12345678 ... And I patch it to: JMP 87654321 NOP NOP The address of the following function: int HookFunc(int param) { DoStuff(param); return ExecuteOriginal(param); } ExceuteOriginal looks like this: unsigned long address =

How to know selected file in C#

孤街浪徒 提交于 2019-12-13 18:07:47
问题 I want to build a software. This software will just get the path of currently selected file. Suppose I click a file on my desktop. Now I want to get the path of this file. So whenever a new selection is made just get the path of newly selected file. Any ideas? 回答1: The windows Desktop window is a ListView Control like in the end (at least it was in Windows XP...) so if you need to know selected item of a ListView you basically need to get the handle of the desktop and check what has been

how are system calls in android OS executed and is it possible to monitor them?

拥有回忆 提交于 2019-12-13 17:25:17
问题 I'm having some trouble understanding how system calls come into play in android app execution. From my understanding of android app execution, .class file is translated into dalvik bytecode (DEX) which is combined together to form ODEX. ODEX is then compiled with JIT compiler directly into machine code for execution. In this case, how does system call on android's linux kernel comes into play? In addition, is there any possible way to monitor these system calls? 回答1: System calls are the

Dynamically discounting Woocommerce Products [duplicate]

吃可爱长大的小学妹 提交于 2019-12-13 07:54:38
问题 This question already has answers here : Set cart item product generated sale price only for specific products in Woocommerce (1 answer) Set only specific products sale price programmatically in WooCommerce 3 (1 answer) Set product sale price programmatically in WooCommerce 3 (2 answers) Closed last year . What I would like to do is take the regular price for each of my Woocommerce products and dynamically create a sale price based on several conditions. This would include the following: 1)

How to hook system calls of my android app

╄→尐↘猪︶ㄣ 提交于 2019-12-13 06:52:06
问题 I want to intercept the connect() system call and use my own custom implementation. The custom implementation will do some action like printing a log for simplicity and then call the system implementation further. I looked at Audrey's blog where the approach is to patch the PLT. But unfortunately this code is crashing when trying to change the address in the relocation table. After goggling a while i came across This already answered question. But the approach described here gives me the

Win32. Hook. Intercept WM_MOUSEWHEEL by child windows

↘锁芯ラ 提交于 2019-12-13 05:24:02
问题 I am trying to intercept mouse wheel by child windows under cursor. But something is wrong. It seems like message sends many times. What did I do wrong? LRESULT CALLBACK MouseProc(__in int nCode, __in WPARAM wParam, __in LPARAM lParam) { LRESULT ret = 0; static BOOL b = TRUE; if (wParam == WM_MOUSEWHEEL) { if (b) { MOUSEHOOKSTRUCTEX *pMhs = (MOUSEHOOKSTRUCTEX *)lParam; short zDelta = HIWORD(pMhs->mouseData); POINT pt; GetCursorPos(&pt); LPARAM lParam = MAKELPARAM(pt.x, pt.y); HWND hWnd =

Does Karma have an initialization hook?

冷暖自知 提交于 2019-12-13 05:09:11
问题 Does Karma (0.12) have a hook which I can use to perform some initialization before running tests? 回答1: With karma 0.10 I've done the following: created an helper.js file which has been added to the JS list in the karma configuration module.exports = function(config) { config.set({ ... files: [ // Helping Libraries 'vendor/jquery.js', 'helpers/helper.js', ... ], ... the content of the helper is: window.__karma__.loaded = function() {}; $(function () { // do my stuff in here // at the end of

WooCommerce: change form labels on registration page

牧云@^-^@ 提交于 2019-12-13 04:54:51
问题 I'm trying to find the Hook to edit the form label on woocommarce restration page (/my-account/) without luck. I want to add to functions.php what to change username label to. Username to: Username more text I do not want to edit template files. Any ide what to do? 回答1: Unfortunately the login form labels aren't filterable. You will need to override the my-account/form-login.php template in your theme and make your edits there. 回答2: You will need to look and find out is the hook for your

How can I sort woocommerce grouped products by post date instead of menu order?

六月ゝ 毕业季﹏ 提交于 2019-12-13 04:51:13
问题 What code/filter can I add to my wordpress functions.php file to modify the order of grouped products by post date instead of menu_order? class-wc-product-grouped.php $args = apply_filters( 'woocommerce_grouped_children_args', array( 'post_parent' => $this->id, 'post_type' => 'product', 'orderby' => 'menu_order', 'order' => 'ASC', 'fields' => 'ids', 'post_status' => 'publish', 'numberposts' => -1, ) ); I'm pretty sure you can hook into it but just not sure how to configure the following

Cannot get my post-commit script to run (git)

こ雲淡風輕ζ 提交于 2019-12-13 04:33:10
问题 I want my remote git-repo to create a zip file from one folder in the master branch every time someone pushes. I renamed the post-commit.sample file and added the following: #!/bin/bash echo "creating zip" /usr/local/bin/git archive --format=zip --output=~/the-folder.zip master:the-folder echo "creating zip done" When I commit from my client I don't see the echoes and I don't get any zip-file. The post-commit file has execution privileges. What am I missing? 回答1: For the remote repository you