# bBin = dparse.txtToBin(bRaw) # bInt = dparse.binToInt(bBin) # # # d1 = [15, 7, 3] # # d2 = [2, 2, 2] # # print dparse.intToBin(d1) # # print dparse.intToBin(d2) # # print dparse.intToBin(dmanip.xor(d1, d2)) # # print hHex # print hInt # print "-----" # print bBin # print dmanip.flipOrder(bBin) # print dmanip.flipBits(bBin) # # # print hInt[0:dstats.searchForBytes(hInt, [73, 254]) gRaw = dparse.readFile("../../../../Downloads/hello.gif") gAsc = dparse.txtToAsc(gRaw) gInt = dparse.ascToInt(gAsc) gHex = dparse.intToHex(gInt) dstats.magNumSearch(gHex) print "---" oRaw = dparse.readFile("../data/onion2.hex") oHex = dparse.txtToHex(oRaw) dstats.extMagNum(gHex)
#!/usr/bin/python import dparse import dstats import dmanip print "starting" txt = "" with open("../data/twitter.hex", "r") as f: for line in f: if line[:3] == "Off": continue txt += line[9:] print "parsing" tInt = dparse.hexToInt(dparse.txtToHex(txt)) sInt = dparse.ascToInt(dparse.txtToAsc(dparse.readFile("761.MP3"))) dstats.magNumSearch(sInt) print len(tInt) print len(sInt) outFile = open("../pics/twitter.jpg", "w") outFile.write(dparse.intToAsc(dmanip.xor(tInt, sInt))) outFile.close()