How to hook into application and process startup in windows?

You didn’t mention your prefered programming language, so I’ll use C# for example snippets. You can start a process and capture/write into its standard IO streams. The following snippet, opens a process and captures its StdOut stream: using (var process = Process.Start(new ProcessStartInfo(FileName = @”yourExecutablePath”, UseShellExecute = false, RedirectStandardOutput = true))) using (var stdout = … Read more

Hook/Overlay a DirectX game?

You can try my example on hooking the Direct3D 9 API using C#. This utilizes EasyHook an open source .NET assembly that allows you to install hooks from managed code into unmanaged functions. SlimDX is also used – this is an open source managed wrapper around the Direct3D libraries. The tricky part of the hooking … Read more

Get commit message in Git hook

In the pre-commit hook, the commit message usually hasn’t been created yet 1. You probably want to use one of the prepare-commit-msg or commit-msg hooks instead. There’s a nice section in Pro Git on the order in which these hooks are run, and what you typically might do with them. 1. The exception is that … Read more

IOS Jailbreak How do intercept SMS / Text Messages

This code snippet should intercept SMS messages- You can extend it for other kinds of notifications. Will work on iOS 5.0.1 as well. Does not work with iMessages though. Link with CoreTelephony framework (there are bunch of private headers there which you’d can class-dump) #include <dlfcn.h> #define CORETELPATH “/System/Library/PrivateFrameworks/CoreTelephony.framework/CoreTelephony” id(*CTTelephonyCenterGetDefault)(); void (*CTTelephonyCenterAddObserver) (id,id,CFNotificationCallback,NSString*,void*,int); static void … Read more

reset hard on git push

The issue is a difference in how Git commands behave in the environment created for hook scripts versus your normal environment. First, hook scripts run with their current working directory set to the Git directory itself (i.e. the .git/ directory of a non-bare repository). Second, hook scripts run with the GIT_DIR environment variable set and … Read more

Print TCP Packet Data

How to print data from TCP packets Below is an example which does exactly what you need: hook received TCP packets and print their payloads. If you want to print some other information from received packet (like binary data), you just need to modify a bit the section under this comment: /* —– Print all … Read more