This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import idaapi | |
import idc | |
import inspect | |
def selection_is_valid(selection, ea): | |
"""If the cursor is not at the beginning or the end of our selection, assume that | |
something bad has gone wrong and bail out instead of turning a lot of important | |
things into dwords. | |
""" | |
if not (ea == selection[1] or ea == selection[2]-1): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import binascii | |
import sys | |
def convert_hex(input_file, output_file): | |
""" input: list containing raw lines of hex | |
output: continuous binary data | |
""" | |
last_addr = None | |
for line in input_file: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hexdump(src, length=16, sep='.'): | |
"""Modified from: https://gist.github.com/7h3rAm/5603718 | |
""" | |
FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or sep for x in range(256)]) | |
lines = [] | |
for c in xrange(0, len(src), length): | |
chars = src[c:c+length] | |
hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
if len(hex) > 24: | |
hex = "%s %s" % (hex[:24], hex[24:]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hotkey_utils.py - bNull | |
# | |
# Some useful shortcuts for binding to hotkeys. Current output/hotkeys: | |
# | |
# [+] Bound make_dwords to Ctrl-Alt-D | |
# [+] Bound make_cstrings to Ctrl-Alt-A | |
# [+] Bound make_offset to Ctrl-Alt-O | |
import idaapi | |
import idc |