I'm writing an addon for scapy, and encountered a problem. I had to slightly modify the original scapy code (every class is inheriting from object) The modified code can be found here: http://pastebin.com/pjcL1KJv
The code I wrote is the following:
class Foo():
array=[ BitField("foo",0x0,2),
BitField("foo1",0x0,2),
BitField("bar",0x0,2),
BitField("blub",None,2)
]
def returnArr(a):
for i in a.array:
print type(i.default)
if __name__ == "__main__":
a=Foo()
a.blub=0x23
returnArr(a)
The output:
< type 'int'>
< type 'int'>
< type 'int'>
< type 'NoneType'>
My question:
Is it possible to detect if the second paremeter of BitField("foo",0x0,2)
is 0x0
or something else? If it is possible, how would I do that? If not, why?