• Stars
    star
    171
  • Rank 215,276 (Top 5 %)
  • Language
    C
  • License
    MIT License
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Single-header, minimalistic, cross-platform hook library written in pure C

logo

Single-header, minimalistic, cross-platform hook library written in pure C.

But... why?

While other well-written libraries that do exactly the same already exist, I wanted to have something simple that would not use an entire disassembler engine which can sometimes be painful to include in a project.

Pros of this library:

  • Written in pure C
  • No dependencies (no full disassembler engine)
  • Single header
  • Works in both kernelmode/usermode
  • Cross-platform (Windows/Linux/EFI)
  • Easily portable (3 functions to allocate/free/protect memory that are platform specific)

Cons of this library:

  • Breaks when a function starts with unsupported instructions (ex. AVX)

Showcase

linux wink winu efi

Usage

Include the header file in your project. Initialise hook structure by calling CreateHook. Perform the actual hook by calling EnableHook and optionally revert the hook with a call to DisableHook.

HookInformation info = CreateHook((void*)&FunctionToHook, (void*)&FunctionToCall);
int status = EnableHook(&info);
if (!status)
    return;

// Call the original function with info.Trampoline
FunctionToHook(10, 20);

DisableHook(&info)

License

This repository is licensed under MIT if not stated otherwise in subfolders.

More Repositories

1

VirusTotalUploader

C# Open-Source Winforms application for uploading files to VirusTotal
C#
1,013
star
2

mutante

Kernel-mode Windows HWID spoofer
C++
509
star
3

efi-memory

PoC EFI runtime driver for memory r/w & kdmapper fork
C++
418
star
4

rainbow

Hide SMBIOS/disk/NIC serials from EFI bootkit
C
249
star
5

negativespoofer

PoC HWID spoofer that runs in EFI
C++
244
star
6

RwxMeme

State of the art DLL injector that took 20 minutes to make
C++
175
star
7

nullmap

Using CVE-2023-21768 to manual map kernel mode driver
C
154
star
8

tpm-spoofer

Simple proof of concept kernel mode driver hooking tpm.sys dispatch to randomize any public key reads
C
132
star
9

meme-rw

Archive R/W into any protected process by changing the value of KTHREAD->PreviousMode
C++
130
star
10

SecureFakePkg

Simple EFI runtime driver that hooks GetVariable function and returns data expected by Windows to make it think that it's running with secure boot enabled (faking secure boot)
C
117
star
11

BetterTiming

PoC TSC offsetting in KVM
113
star
12

OverlayCord

Simple proof of concept showing how you can abuse Discord's in-game internal module to draw on top of the game (even if the game is in fullscreen) from an external application without modifying any Discord files or loading its modules.
C++
110
star
13

voidmap

Using CVE-2021-40449 to manual map kernel mode driver
C
96
star
14

CanetisRadar

Open-source application for detecting sound direction using 7.1 audio device in games
C#
92
star
15

windowhide

Hide external overlay by using SetWindowDisplayAffinity
C++
79
star
16

PatchBoot

Guide for patching AMI Aptio V UEFI firmware to circumvent Secure Boot checks
75
star
17

DirectPageManipulation

A basic demonstration of directly overwriting paging structures for physical memory r/w and interprocess memory copy
C++
55
star
18

eac_cr3_shuffle

C++
37
star
19

EfiDump

PoC EFI runtime driver for direct Windows interprocess memory copy
C
35
star
20

InjectMouseInputExample

C/C++ example of InjectMouseInput function
C++
30
star
21

human-mouse

Adopted SRL-6 mouse movement to C++
C++
26
star
22

memdrv

C++
26
star
23

be_shellcode_dump

December 2023 BattlEye shellcode dump
C
25
star
24

GetDeviceInterfacesMemoryLeak

Small memory leak PoC that is happening in IopGetDeviceInterfaces
C++
24
star
25

SaberHighlight

Beat Saber mod enabling NVIDIA Highlights functionality
C#
23
star
26

vmcheck

C
18
star
27

SoundReplacer

BSIPA mod for replacing hit sounds, menu music, click sounds and much more!
C#
18
star
28

ida-unity-pdb-downloader

Simple IDA Pro plugin to download Unity debug symbols from their symbol server
C++
17
star
29

OcuFix

Simple mod to automatically disable ASW and change services/runtime priority
C#
16
star
30

RecoilTime

A simple program made in C# for reducing recoil in games under Windows environment
C#
14
star
31

EasyUefi

Visual Studio template for GNU-EFI
C
13
star
32

DiscordLeech

Read Discord user info from process memory
C#
10
star
33

EvilKaspersky

C++
10
star
34

esea-control

Simple program to temporarly disable ESEA anti-cheat
C#
9
star
35

lrdp

8
star
36

EmuAuth

KeyAuth server emulator
C++
8
star
37

memhv

Minimalistic hypervisor with memory introspection capabilities
C++
7
star
38

ByeMouse

C#
5
star
39

EasyDump

C#
4
star
40

PowerControl

C#
4
star
41

eft-profile-api

Reversing the newly added EFT feature that allows you to view other players' stats
C#
4
star
42

obs-dda

C
3
star
43

virtmgr

C++
2
star
44

OneplusDebloat

Remove crappy useless apps in Oxygen OS (both 3rd party and Google)
Shell
2
star
45

SamuelTulach

1
star
46

NekoSwap

C++
1
star