Joh*_*mBF 2 python wildcard syntax-error
显然,通配符%x不被识别为字节十六进制值,因此我得到错误"ValueError:invalid\x escape".
怎么避免这个?我不熟悉python.
for i in xrange(0,length):
if i % 2 == 0:
tempArray.append(unpack("B",payload_raw[x])[0]^key)
x += 1
else:
randomByte = random.randint(65,90)
tempArray.append(randomByte)
for i in range(0,len(tempArray)):
tempArray[i]="\x%x"%tempArray[i]
for i in range(0,len(tempArray),15):
outArray.append("\n'"+"".join(tempArray[i:i+15])+"'")
outArray = "".join(outArray)
devide = "i % 2;"
open_structure = open(structure).read()
code = open_structure % (junkA,outArray,junkB,key,length,devide)
b.write(code)
b.flush()
Run Code Online (Sandbox Code Playgroud)