diff options
author | Malfurious <m@lfurio.us> | 2021-08-22 10:24:45 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2021-08-22 10:24:45 -0400 |
commit | ad0ff4ede0e35d7c70fa0469f94f526196fa8ad4 (patch) | |
tree | 64258b519fa6ea1a36cdf50a7f7bf20567098d13 /tools/genhex.cpp | |
parent | 442640f100727a081cf26460992465386fe3a633 (diff) | |
parent | 083f76002476dd722a2989cf2c33d0e616e3fd84 (diff) | |
download | lib-des-gnux-ad0ff4ede0e35d7c70fa0469f94f526196fa8ad4.tar.gz lib-des-gnux-ad0ff4ede0e35d7c70fa0469f94f526196fa8ad4.zip |
Merge branch 'shellcode-templates'
This is content from an old repo of mine. I think it makes much more
sense to merge it into lib-des-gnux.
templates/shellcode/ will track any useful shellcode recipes and
contains utilities for building them into ready-to-use payloads.
* shellcode-templates:
Globally ignore all build artifacts
Add Makefile for shellcode templates
Refactor genhex into shelltool
Add sys_exit shellcode templates
Add generic /bin/sh shellcode templates
Diffstat (limited to '')
-rw-r--r-- | tools/genhex.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/tools/genhex.cpp b/tools/genhex.cpp deleted file mode 100644 index a37f91e..0000000 --- a/tools/genhex.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include <iostream> -#include <string> - -/* - * Read in all of stdin (should be piped from objdump), look for bytecode hex, - * and print this code, escaped in a C-string literal, to stdout. - * - * EG output: "\x01\x02\x03\x04" - */ - -int main() -{ - std::string tmp; - unsigned int hex; - - std::cout << "\""; - - while (true) - { - std::cin >> tmp; - - if (std::cin.eof()) - break; - - if (tmp.size() == 2 && - tmp.find(":") == std::string::npos && - sscanf(tmp.c_str(), "%x", &hex) > 0) - std::cout << "\\x" << tmp; - } - - std::cout << "\"\n"; - return 0; -} |