GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cppcoffee/inl_hook: a linux kernel function inline hooking library

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
udis86
udis86
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
hello_core.c
hello_core.c
 
 
inl_hook.c
inl_hook.c
 
 
inl_hook.h
inl_hook.h
 
 
util.c
util.c
 
 
util.h
util.h
 
 

Repository files navigation

about inl_hook

inl_hook is a linux kernel function inline hooking library. it is very easy to use.

example

in the hello_core.c

static void (*tcp_set_state_fn)(struct sock *sk, int state);

static void my_tcp_set_state(struct sock *sk, int state);

static struct hook_ops hello_hooks[] = {
	DECLARE_HOOK(&tcp_set_state_fn, my_tcp_set_state),
};


static void
my_tcp_set_state(struct sock *sk, int state)
{
	// copy your origin code here, then write patch code.
	// You can refer to hello_core.c
}

// hooking
ret = inl_sethook_ops(hello_hooks, ARRAY_SIZE(hello_hooks));
if (ret < 0) {
	pr_err("inl_sethook_ops hello_hooks fail.\n");
	goto exit;
}

// unhook
inl_unhook_ops(hello_hooks, ARRAY_SIZE(hello_hooks));

thank

udis86: https://github.com/vmt/udis86

mhook: https://github.com/martona/mhook

About

a linux kernel function inline hooking library

Resources

Readme
Activity

Stars

30 stars

Watchers

2 watching

Forks

14 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.