From 0ec610ab9c97dd3301957256f8c61014f1c7b8f4 Mon Sep 17 00:00:00 2001 From: chrishoder Date: Sun, 17 Feb 2013 23:12:41 +0000 Subject: [PATCH 1/1] debugged some additions to the generation fuzzer git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1502 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/experiments.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/experiments.py b/client/experiments.py index 76aa37a..12ccfd9 100644 --- a/client/experiments.py +++ b/client/experiments.py @@ -179,11 +179,11 @@ class experiments(GoodFETMCPCANCommunication): # where low is the low end of values for the fuzz, high is the high end value # period is the time between sending packets in milliseconds, writesPerFuzz is the times the # same fuzzed packet will be injecetez. Fuzzes is the number of different packets to be injected - def generationFuzzer(self,freq, standardIds, dbLimits, period, writesPerFuzz, Fuzzes): - print "Fuzzing on standard ID: %d" %standardId + def generationFuzzer(self,freq, standardIDs, dbLimits, period, writesPerFuzz, Fuzzes): + #print "Fuzzing on standard ID: %d" %standardId self.client.serInit() self.spitSetup(freq) - packet = [0,0,0,0,0,0,0,0,0,0,0,0] #empty template + packet = [0,0,0x00,0x00,0x08,0,0,0,0,0,0,0,0] #empty template #form a basic packet # #### split SID into different regs @@ -209,7 +209,7 @@ class experiments(GoodFETMCPCANCommunication): numIds = len(standardIDs) fuzzNumber = 0; while( fuzzNumber < Fuzzes): - id_new = standsardIDs[random.randint(0,numIds-1)] + id_new = standardIDs[random.randint(0,numIds-1)] #### split SID into different regs SIDlow = (id_new & 0x07) << 5; # get SID bits 2:0, rotate them to bits 7:5 SIDhigh = (id_new >> 3) & 0xFF; # get SID bits 10:3, rotate them to bits 7:0 @@ -224,7 +224,7 @@ class experiments(GoodFETMCPCANCommunication): packet[i+5] = value #put a rough time stamp on the data and get all the data bytes - row = [time.time(), standardId,8] + row = [time.time(), id_new,8] msg = "Injecting: " for i in range(5,13): row.append(packet[i]) @@ -300,4 +300,4 @@ class experiments(GoodFETMCPCANCommunication): time.sleep(period/1000) fuzzNumber += 1 print "Fuzzing Complete" - outfile.close() \ No newline at end of file + outfile.close() -- 2.20.1