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 - adamhlt/Cave-Finder: Tool to find code cave in PE image (x86 / x64) - Find empty space to place code in PE files

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
Code Cave Miner
Code Cave Miner
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
Code Cave Miner.sln
Code Cave Miner.sln
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Cave Finder

Code cave finder in PE files (x86 / x64), retrieve empty space to place code

Language Platform Arch License: GPL v3


Cave Finder is a command line tool that searches for code caves in a PE file (EXE, DLL or driver). A code cave is a run of null bytes (0x0) inside a section, with enough space you can write a shellcode.

It reads the file without loading it, and every access is checked against the file size, so a malformed PE file produces an error message instead of a crash. The same code base handles x86 and x64 files.

DEMONSTRATION

Demo.mp4

Features

Scan

  • Every section of the PE file is scanned for caves of a minimum size
  • Works on x86 and x64 files

Report

  • Section where the cave resides and size of the cave
  • Start / End file offset of the cave
  • Start / End virtual address of the cave
  • Permissions on the cave (EXECUTE | READ | WRITE)

Usage

miner.exe <pe_file> <cave_size> [--pause]
  • <cave_size> is the minimum size of the caves to report, in bytes
  • --pause waits for a key press before exiting

Note Example: miner.exe miner.exe 16 scans the tool itself for caves of at least 16 bytes.

The program returns 0 on success and -1 if the arguments are invalid, or if the file cannot be read or is not a valid PE file.

Build

  1. Open Code Cave Miner.sln in Visual Studio (C++17).
  2. Build in Release (x86 or x64).
  • Output: every configuration is already set up, the executable is named miner.exe
  • Architecture: the x86 build can parse x86 and x64 PE files, and so can the x64 build
  • CMake: a CMakeLists.txt is provided for other IDEs, cmake -S . -B build then cmake --build build --config Release

License

This project is licensed under the GNU GPLv3.

About

Tool to find code cave in PE image (x86 / x64) - Find empty space to place code in PE files

Topics

codecavecpppewinapiwindowswindows-internals

Resources

Readme
License
Activity

Stars

81 stars

Watchers

2 watching

Forks

11 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402792 — 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.