This repository contains a Python script to extract files embedded in Go binaries using the embed package.
You can use the extract_embed.py script to extract embedded files from a Go binary.
- Python 3
pyelftoolslibrary
You can install the required library using pip:
pip install pyelftoolsRun the script by providing the path to the Go binary as an argument:
python3 extract_embed.py <binary_path> [optional_hex_addr]<binary_path>: Path to the compiled Go binary.[optional_hex_addr]: (Optional) The virtual address of theembed.FSvariable. If not provided, the script attempts to auto-detect it.
python3 extract_embed.py ./my_go_appThe extracted files will be saved in the extracted_embed directory.