diff options
| author | Florent Monjalet <florent.monjalet@gmail.com> | 2015-11-24 19:16:03 +0100 |
|---|---|---|
| committer | Florent Monjalet <florent.monjalet@gmail.com> | 2016-01-18 14:02:31 +0100 |
| commit | 8bd16bab859480582f89962c878e867d6c8ab985 (patch) | |
| tree | 7a38321933b34a489702153548a849bd3a6a4533 /example/jitter | |
| parent | 82fa0e423f7f3f0d33c7ca9b32029d0022c31dec (diff) | |
| download | miasm-8bd16bab859480582f89962c878e867d6c8ab985.tar.gz miasm-8bd16bab859480582f89962c878e867d6c8ab985.zip | |
MemStruct: fix example to use Ptr to MemSizedArray rather that Array
Diffstat (limited to 'example/jitter')
| -rw-r--r-- | example/jitter/memstruct.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/example/jitter/memstruct.py b/example/jitter/memstruct.py index 775b3643..934c1c22 100644 --- a/example/jitter/memstruct.py +++ b/example/jitter/memstruct.py @@ -7,7 +7,7 @@ as well. from miasm2.analysis.machine import Machine from miasm2.analysis.mem import MemStruct, MemSelf, MemVoid, MemStr,\ - Ptr, Num, Array, set_allocator + MemSizedArray, Ptr, Num, Array, set_allocator from miasm2.os_dep.common import heap # Instanciate a heap @@ -130,7 +130,7 @@ class DataArray(MemStruct): # MemStruct containing only one field named "value" will be created, so # that Ptr can point to a MemStruct instance. Here, # data_array.deref_array.value will allow to access an Array - ("arrayptr", Ptr("<I", Array(Num("B"), 16))), + ("arrayptr", Ptr("<I", MemSizedArray, Num("B"), 16)), # Array of 10 uint8 ("array", Array(Num("B"), 16)), ] @@ -184,7 +184,7 @@ assert link.size == 2 # Make the Array Ptr point to the data's array field data.arrayptr = data.get_addr("array") # Now the pointer dereference is equal to the array field's value -assert data.deref_arrayptr.value == data.array +assert data.deref_arrayptr == data.array # Let's say that it is a DataStr: datastr = data.cast(DataStr) |