Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def deserialize_stream(self, stream):
ofs = self.getoffset()
try:
return super(infinite, self).deserialize_stream(stream)
except StopIteration:
pass
return self
if __name__ == '__main__':
import ptype,parray
string = 'A'*100
class qword(ptype.type): length = 8
class dword(ptype.type): length = 4
class word(ptype.type): length = 2
class byte(ptype.type): length = 1
import random
def function(self):
# if len(self.value) > 0:
# self[0].load()
# print self[0]
return random.sample([byte, word, dword, function2], 1)[0]
def function2(self):
return qword()
class myarray(parray.type):
length = 5
_object_ = dword
x = myarray()
del( self[-1] ) # XXX: hopefully this isn't partially initialzied...
return self
def deserialize_stream(self, stream):
ofs = self.getoffset()
try:
return super(infinite, self).deserialize_stream(stream)
except StopIteration:
pass
return self
if __name__ == '__main__':
import ptype,parray
string = 'A'*100
class qword(ptype.type): length = 8
class dword(ptype.type): length = 4
class word(ptype.type): length = 2
class byte(ptype.type): length = 1
import random
def function(self):
# if len(self.value) > 0:
# self[0].load()
# print self[0]
return random.sample([byte, word, dword, function2], 1)[0]
def function2(self):
return qword()
class myarray(parray.type):
length = 5
def deserialize_stream(self, stream):
ofs = self.getoffset()
try:
return super(infinite, self).deserialize_stream(stream)
except StopIteration:
pass
return self
if __name__ == '__main__':
import ptype,parray
string = 'A'*100
class qword(ptype.type): length = 8
class dword(ptype.type): length = 4
class word(ptype.type): length = 2
class byte(ptype.type): length = 1
import random
def function(self):
# if len(self.value) > 0:
# self[0].load()
# print self[0]
return random.sample([byte, word, dword, function2], 1)[0]
def function2(self):
return qword()
class myarray(parray.type):
length = 5
_object_ = dword
return self
def deserialize_stream(self, stream):
ofs = self.getoffset()
try:
return super(infinite, self).deserialize_stream(stream)
except StopIteration:
pass
return self
if __name__ == '__main__':
import ptype,parray
string = 'A'*100
class qword(ptype.type): length = 8
class dword(ptype.type): length = 4
class word(ptype.type): length = 2
class byte(ptype.type): length = 1
import random
def function(self):
# if len(self.value) > 0:
# self[0].load()
# print self[0]
return random.sample([byte, word, dword, function2], 1)[0]
def function2(self):
return qword()
class myarray(parray.type):
length = 5
_object_ = dword