'XXX' : [ None, ['array', 4, ['Flags', dict(target = 'unsigned long', bitmap = { 'A': 0, 'B': 1, 'C': 2 })]]],
In that case, Struct.XXX[0] should be the first element in the array which is a Flags type. However, I ran into similar errors as you did, and I'm not entirely sure my approach would produce the structure you need even if it did work. This shows the error that I see:
>>> flags = obj.Object("Array", targetType = "Flags", offset = address, vm = addrspace, count = 2)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/mike/Desktop/volatility/volatility/obj.py", line 173, in Object
result = vm.profile.types[theType](offset = offset, vm = vm, name = name, **kwargs)
File "/Users/mike/Desktop/volatility/volatility/obj.py", line 582, in __init__
if self.current.size() == 0:
File "/Users/mike/Desktop/volatility/volatility/obj.py", line 435, in size
return struct.calcsize(self.format_string)
TypeError: Struct() argument 1 must be string, not Array
So just posting this here for documentation. Any other devs know why this doesn't work or how to get around it?
MHL