diff options
author | Malfurious <m@lfurio.us> | 2020-12-21 00:57:45 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2020-12-21 00:57:45 -0500 |
commit | 75c74abf9249f6aee6dc22c4dbc345c4840181aa (patch) | |
tree | d85c28e6b1cc5335218571914ef5e1807cf58737 /genhex.cpp | |
parent | 0c452f6508a2e14b22aa3abc93497ee6078a49f8 (diff) | |
download | lib-des-gnux-75c74abf9249f6aee6dc22c4dbc345c4840181aa.tar.gz lib-des-gnux-75c74abf9249f6aee6dc22c4dbc345c4840181aa.zip |
Create tools directory
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'genhex.cpp')
-rw-r--r-- | genhex.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/genhex.cpp b/genhex.cpp deleted file mode 100644 index a37f91e..0000000 --- a/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; -} |