MCPcopy Create free account
hub / github.com/andrecrafts/hide-payload-in-images

github.com/andrecrafts/hide-payload-in-images @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
28 symbols 42 edges 7 files 11 documented · 39% updated 8mo ago★ 233

Browse by type

Functions 15 Types & classes 13
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Hiding Shellcode in Image Files with Python and C/C++

-> A project that demonstrates embedding shellcode payloads into image files (like PNGs) using Python and extracting them using C/C++. Payloads can be retrieved directly from the file on disk or from the image stored in a binary's resources section (.rsrc)

Note: This repository just reached 200 stars ⭐! 🎉 Thank you guys so much for your support!

🔍 Learn more about this in my blog post:

Code of this Project

❗ Updates ❗

  1. Stealthier Payload Extraction: Implemented manual PE header parsing to retrieve resources without WinAPI calls, avoiding detection vectors.
  2. PEB Reliability Fix: Replaced function hGetCurrentModuleHandle's unsafe backward header parsing with direct PEB access via __readgsqword/__readfsdword, resolving compiler-optimization crashes and supporting x86/x64. This new function has two alternatives, based on whether the project is a DLL or a EXE.
  3. PEB Structure Support: Added PEB_Structs.h for portable PEB/PE definitions, eliminating dependencies on Windows headers.

🎥 Video Demo

👉 Watch the full video demo here: - Updated to include payload-extractor-from-resource-via-peb.cpp demo.

Support & Contributions

Enjoying my content? Show your support by sharing or starring the repo!

You can also support me on buy me a ko-fi to fuel more awesome content:

Buy me a KO-FI

💬 Have feedback or ideas? I’d love to hear your thoughts or suggestions!

Looking for a Pentester? I’m open for contracts and full-time opportunities – feel free to DM me!

Credits

Made with 💙 by @andrecrafts

Core symbols most depended-on inside this repo

Shape

Function 15
Class 13

Languages

C++89%
Python11%

Modules by API surface

code/payload-extractor/payload-extractor-from-rsrc-via-peb/PEB_Structs.h13 symbols
code/payload-extractor/payload-extractor-from-rsrc-via-peb/payload-extractor-from-rsrc-via-peb.cpp5 symbols
code/payload-extractor/payload-extractor-from-file/payload-extractor-from-file.cpp4 symbols
code/payload-extractor/payload-extractor-from-rsrc/payload-extractor-from-rsrc.cpp3 symbols
code/payload-embedder.py3 symbols

For agents

$ claude mcp add hide-payload-in-images \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page