zakipedio/gadgetsniper — explained in plain English
Analysis updated 2026-05-18
Scan a folder of Windows DLLs for call-stack spoofing gadgets used in red-team tooling.
Validate candidate gadgets with a real x64 disassembler to avoid false positives from byte matching.
Generate a text report of gadget locations across an entire System32 directory.
| zakipedio/gadgetsniper | bio-canse/fh6-miaomiao-tools | epotseluevskaya/regsecretscs | |
|---|---|---|---|
| Stars | 19 | 19 | 19 |
| Language | C# | C# | C# |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 3/5 | 4/5 |
| Audience | researcher | general | researcher |
Figures from each repo's GitHub metadata at analysis time.
Requires the .NET 8 SDK, runs only against Windows PE32+ DLLs.
GadgetSniper is a command line tool that scans 64-bit Windows DLL files to find a specific type of instruction pattern used in a technique called call-stack spoofing. That technique lets malicious or red-team software make its call stack look like it came from a trusted, signed program, and doing it convincingly requires finding tiny snippets of existing code, called gadgets, inside real system DLLs that can be reused for this purpose. Rather than searching for byte patterns directly, which can easily produce false matches because x64 instructions are variable length and can overlap in confusing ways, GadgetSniper uses a real instruction decoder called Iced to check every candidate. It only keeps a result if the bytes actually decode as a valid call instruction followed by a jump through one of the eight registers that survive across function calls, such as RBX or R14. This removes phantom matches that a simple byte search would report. The tool is written in C# and targets .NET 8. It scans every executable section of a DLL, not just the main code section, and can recurse through an entire folder of DLLs while skipping files it cannot access and avoiding symlink loops. Each file is scanned independently so one bad or corrupted DLL does not stop the whole run. Results are written to a text report that lists total counts by gadget type followed by details for each file and address where a gadget was found. To use it, someone installs the .NET 8 SDK, clones the repository, and runs a build or publish command to produce either a normal binary or a single self-contained executable that does not need the .NET runtime installed on the target machine. The tool is then run from the command line against a directory, with optional flags for recursive scanning and a custom output file path. The project credits an earlier tool called GadgetHunter as the inspiration for this approach.
A command line tool that scans 64-bit Windows DLLs to find call-stack spoofing gadgets using real instruction decoding instead of byte matching.
Mainly C#. The stack also includes C#, .NET 8, Iced.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
double-check against the repo, no cap.