Wednesday, May 2, 2012

Hex Generator

Finding bad character when developing an exploit is important to make the exploit works properly as we want. In my post about searching bad character I used a perl script to generate a series of hex character start from 00 to FF. Here's other script used to generate it. I found the script at this site. It is written in python language.

Download here.

Script:
#HEX Generator
#http://www.digital-echidna.org
#0x04112011

def gene():
        c=0
        x=0
        hslgen='"'
        while x <= 255:
          hslhex=hex(x)
          if c == 16:
            hslgen=hslgen+'"\n"'
            c=0
          if x <= 16:
            hslgen=hslgen.replace('0x','\\x0')
          hslgen=hslgen+hslhex
          x+=1
          c+=1

        print "\n#Generated with dE HEX Generator"
        print "#http://www.digital-echidna.org\n"
        print hslgen.replace('0x','\\x')+'"\n'

if __name__ == "__main__":
        gene()
"the quieter you become, the more you are able to hear.."

0 comments:

Post a Comment