diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-09-01 02:04:34 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-09-01 02:05:18 -0500 |
commit | a5b718db57a361cf3c196d73cbc5b3e21d3ddf6e (patch) | |
tree | 312937bcf9bced31a13e854e25b1ffb92f5cf48b /redtools/pretty_text.py | |
parent | fc6785b87b7ddd27437ac2ac15bcc0870cc0fe90 (diff) |
dump in pokered/extras/ python stuff from b185b245
Diffstat (limited to 'redtools/pretty_text.py')
-rw-r--r-- | redtools/pretty_text.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/redtools/pretty_text.py b/redtools/pretty_text.py new file mode 100644 index 0000000..4933dca --- /dev/null +++ b/redtools/pretty_text.py @@ -0,0 +1,21 @@ +#author: Bryan Bishop <kanzure@gmail.com> +#date: 2012-01-16 +from optparse import OptionParser +from analyze_texts import text_pretty_printer_at + +def main(): + usage = "usage: %prog address label" + parser = OptionParser(usage) + (options, args) = parser.parse_args() + if len(args) == 1: + print "usage: python pretty_text.py address label" + args.append("UnnamedText_" + (args[0].replace("0x", ""))) + elif len(args) != 2: + parser.error("we need both an address and a label") + address = int(args[0], 16) + label = args[1] + + text_pretty_printer_at(address, label) + +if __name__ == "__main__": + main() |