- Working towards text attack output.
This commit is contained in:
parent
1ecc43e9d6
commit
412c75cc51
@ -214,7 +214,7 @@ class Run(object):
|
|||||||
self.eventList = []
|
self.eventList = []
|
||||||
self.intruder = False
|
self.intruder = False
|
||||||
self.attack = None
|
self.attack = None
|
||||||
self.variables = []
|
self.variables = []
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return iter(self.eventList)
|
return iter(self.eventList)
|
||||||
@ -230,6 +230,13 @@ class Run(object):
|
|||||||
def getLastAction(self):
|
def getLastAction(self):
|
||||||
return self.eventList[-1]
|
return self.eventList[-1]
|
||||||
|
|
||||||
|
def collapseIntruder(self):
|
||||||
|
""" TODO still working on this. """
|
||||||
|
if self.intruder:
|
||||||
|
shouldcollapse = False
|
||||||
|
for ev in self:
|
||||||
|
return
|
||||||
|
|
||||||
class Event(object):
|
class Event(object):
|
||||||
def __init__(self,index,label,follows):
|
def __init__(self,index,label,follows):
|
||||||
self.index = index
|
self.index = index
|
||||||
@ -308,3 +315,25 @@ class EventClaim(Event):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "CLAIM_%s(%s, %s)" % (self.shortLabel(),self.type,self.argstr())
|
return "CLAIM_%s(%s, %s)" % (self.shortLabel(),self.type,self.argstr())
|
||||||
|
|
||||||
|
class EventIntruder(Event):
|
||||||
|
"""
|
||||||
|
Intruder event extensions (allows for collapsing attacks later)
|
||||||
|
"""
|
||||||
|
def __init__(self,follows,message,key,result):
|
||||||
|
Event.__init__(self,0,None,follows)
|
||||||
|
self.follows = follows
|
||||||
|
self.message = message
|
||||||
|
self.key = key
|
||||||
|
self.result = result
|
||||||
|
self.intruder = True
|
||||||
|
|
||||||
|
class EventDecr(EventIntruder):
|
||||||
|
def __str__(self):
|
||||||
|
return "DECR(%s, %s, %s)" % (self.message, self.key, self.result)
|
||||||
|
|
||||||
|
class EventEncr(EventIntruder):
|
||||||
|
def __str__(self):
|
||||||
|
return "ENCR(%s, %s, %s)" % (self.message, self.key, self.result)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user