From aea57a2099fac2f06bc1733db42af637b4ef0722 Mon Sep 17 00:00:00 2001 From: toneillcodes <148013535+toneillcodes@users.noreply.github.com> Date: Mon, 1 Sep 2025 21:04:24 -0400 Subject: [PATCH] Port bintoc from ruby to python --- snippets/bintoc.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 snippets/bintoc.py diff --git a/snippets/bintoc.py b/snippets/bintoc.py new file mode 100644 index 0000000..3fbbd33 --- /dev/null +++ b/snippets/bintoc.py @@ -0,0 +1,15 @@ +#!/usr/bin/python +# Originally Cod3d By 0xNinjaCyclone, file output added by @toneillcodes +# https://github.com/0xNinjaCyclone/EarlyCascade/blob/main/bintoc.rb +with open("demon.x64.bin", "rb") as input_file: + with open("shellcode.txt", "w") as output_file: + output_file.write("BYTE x64_stub[] = ") + while True: + buffer = input_file.read(16) + if not buffer: + break + output_file.write(f"\n{' ' * 20}\"") + for byte in buffer: + output_file.write(f"\\x{byte:02x}") + output_file.write('"') + output_file.write(';')