![]() |
miasm
Reverse engineering framework
|


Public Member Functions | |
| def | set (self, vm, addr, val) |
| def | get (self, vm, addr) |
| def | lval (self) |
| def | size (self) |
| def | __len__ (self) |
| def | __neq__ (self, other) |
| def | __eq__ (self, other) |
| def | __ne__ (self, other) |
Base class to provide methods to describe a type, as well as how to set and get fields from virtual mem. Each Type subclass is linked to a MemType subclass (e.g. Struct to MemStruct, Ptr to MemPtr, etc.). When nothing is specified, MemValue is used to access the type in memory. MemValue instances have one `.val` field, setting and getting it call the set and get of the Type. Subclasses can either override _pack and _unpack, or get and set if data serialization requires more work (see Struct implementation for an example). TODO: move any trace of vm and addr out of these classes?
| def miasm.core.types.Type.__eq__ | ( | self, | |
| other | |||
| ) |
Reimplemented in miasm.core.types.Void, miasm.core.types.Str, miasm.core.types.BitField, miasm.core.types.Bits, miasm.core.types.Array, miasm.core.types.Struct, miasm.core.types.Ptr, and miasm.core.types.RawStruct.

| def miasm.core.types.Type.__len__ | ( | self | ) |

| def miasm.core.types.Type.__ne__ | ( | self, | |
| other | |||
| ) |
| def miasm.core.types.Type.__neq__ | ( | self, | |
| other | |||
| ) |
| def miasm.core.types.Type.get | ( | self, | |
| vm, | |||
| addr | |||
| ) |
Get the python value of a field from a VmMngr memory at @addr.
Reimplemented in miasm.core.types.Str, miasm.core.types.Bits, miasm.core.types.Array, miasm.core.types.Struct, and miasm.core.types.Ptr.


| def miasm.core.types.Type.lval | ( | self | ) |
Returns a class with a (vm, addr) constructor that allows to interact with this type in memory. In compilation terms, it returns a class allowing to instantiate an lvalue of this type. @return: a MemType subclass.


| def miasm.core.types.Type.set | ( | self, | |
| vm, | |||
| addr, | |||
| val | |||
| ) |
Set a VmMngr memory from a value. @vm: VmMngr instance @addr: the start address in memory to set @val: the python value to serialize in @vm at @addr
Reimplemented in miasm.core.types.BitField, miasm.core.types.Bits, miasm.core.types.Array, miasm.core.types.Struct, miasm.core.types.Ptr, and miasm.core.types.Str.


| def miasm.core.types.Type.size | ( | self | ) |
Return the size in bytes of the serialized version of this field
Reimplemented in miasm.core.types.Str, miasm.core.types.Bits, miasm.core.types.Array, miasm.core.types.Union, miasm.core.types.Struct, and miasm.core.types.RawStruct.
