Пример #1
0
#!/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()
Пример #2
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)
Пример #3
0
import os  
import dparse
import dstats
import dmanip

# Load all files
data = []

for fn in os.listdir('../outguesses/runebook'):
        print fn
        f = open("../outguesses/runebook/" + fn, 'r')
        cur = ""
        for line in f:
                cur += line
        
        data.append(dparse.ascToInt(dparse.txtToAsc(cur)))

print len(data)

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]