Skip to content

Instantly share code, notes, and snippets.

@Mr-Un1k0d3r
Created October 18, 2021 18:20
Show Gist options
  • Save Mr-Un1k0d3r/9b4e580dc46540b91eb2e247361f89b5 to your computer and use it in GitHub Desktop.
Save Mr-Un1k0d3r/9b4e580dc46540b91eb2e247361f89b5 to your computer and use it in GitHub Desktop.
Generate shellcode bash script
# Usage:
# ./generate.sh file.o
# \x0f\x01\x..
# ./generate.sh file.o ,0x
# ,0x0f,0x01,0x..
#!/bin/bash
DELIMITER=$2
if [ -z "$DELIMITER" ]
then
DELIMITER='\x'
fi
for i in $(objdump -d $1 -M intel |grep "^ " |cut -f2); do echo -n $DELIMITER$i; done;echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment