-class ctf:
-
- #enum equivalent, accessible constants
- #These are taken directly from ctf/events.h
- #All changes to enums must also be made here
- class type_id:
- UNKNOWN = 0
- INTEGER = 1
- FLOAT = 2
- ENUM = 3
- STRING = 4
- STRUCT = 5
- UNTAGGED_VARIANT = 6
- VARIANT = 7
- ARRAY = 8
- SEQUENCE = 9
- NR_CTF_TYPES = 10
-
- def get_type_id_name(id):
- name = "UNKNOWN"
- constants = [attr for attr in dir(ctf.type_id) if not callable(getattr(ctf.type_id, attr)) and not attr.startswith("__")]
- for attr in constants:
- if getattr(ctf.type_id, attr) == id:
- name = attr
- break
- return name
-
+class CTFStringEncoding:
+ NONE = 0
+ UTF8 = 1
+ ASCII = 2
+ UNKNOWN = 3
+
+#enum equivalent, accessible constants
+#These are taken directly from ctf/events.h
+#All changes to enums must also be made here
+class CTFTypeId:
+ UNKNOWN = 0
+ INTEGER = 1
+ FLOAT = 2
+ ENUM = 3
+ STRING = 4
+ STRUCT = 5
+ UNTAGGED_VARIANT = 6
+ VARIANT = 7
+ ARRAY = 8
+ SEQUENCE = 9
+ NR_CTF_TYPES = 10
+
+ def get_type_name(id):
+ name = "UNKNOWN"
+ constants = [attr for attr in dir(CTFTypeId) if not callable(getattr(CTFTypeId, attr)) and not attr.startswith("__")]
+ for attr in constants:
+ if getattr(CTFTypeId, attr) == id:
+ name = attr
+ break
+ return name
+
+class CTFReader: