私はこのライブラリを使用しようとしています: http://pastebin.com/xgPXpGtw (使用例: http://pastebin.com/fNFAW3Fh ) すべてのバイトを配列に分割したくないので、いくつかの問題があります彼がするように。
私のテストスクリプトは次のようになります。
import random
from random import *
def onerand(packet):
pack = packet[:]
byte = str(chr(choice(range(256))))
pack[choice(range(len(packet)))]= byte
print "fuzzing rand byte:%s\n" % (byte.encode("hex"))
return pack
test = "\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63"
while True:
print onerand(test)
そして実際に戻ります:
Traceback (most recent call last):
File "test.py", line 14, in <module>
print onerand(test)
File "test.py", line 7, in onerand
pack[choice(range(len(packet)))]= byte
TypeError: 'str' object does not support item assignment
では、テストパラメータでその関数を使用できるようにするにはどうすればよいですか?
ありがとう !