Example #1
0
# 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)
Example #2
0
relData = []

for i in data:
        if len(i) == 58152:
                relData.append(i)

print len(relData)

relData = [dparse.txtToAsc(i) for i in relData]

xored = relData[0]

for i in range(1, len(relData)):
        xored = dmanip.xor(xored, relData[i])

dstats.extMagNum(dparse.intToHex(xored))

with open("../data/xorrunes.asc", 'w') as f:
        f.write(dparse.intToAsc(xored))

# Search for suffs and prefs
# count = 2
# prevPref = 0
# prevSuff = 0
# while(True):
#         prefs = [', '.join([str(j) for j in i[:count]])  for i in data]
#         suffs = [', '.join([str(j) for j in i[-count:]]) for i in data]
#         
#         curPref = len(dstats.getFreq(prefs))
#         curSuff = len(dstats.getFreq(suffs))
#