about summary refs log tree commit diff stats
path: root/example/jitter
diff options
context:
space:
mode:
authorFlorent Monjalet <florent.monjalet@gmail.com>2015-11-26 14:12:06 +0100
committerFlorent Monjalet <florent.monjalet@gmail.com>2016-01-18 14:02:31 +0100
commit5df71c349c4c8832a31586207b48cd1fc51da7b9 (patch)
tree126b95aee76a175057b052abfa6465b5cf5042c5 /example/jitter
parent81076e0cfbe80e1e9aa090dd509f272b1e3cdfd0 (diff)
downloadmiasm-5df71c349c4c8832a31586207b48cd1fc51da7b9.tar.gz
miasm-5df71c349c4c8832a31586207b48cd1fc51da7b9.zip
MemStruct example: fix memset usage
Diffstat (limited to 'example/jitter')
-rw-r--r--example/jitter/memstruct.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/example/jitter/memstruct.py b/example/jitter/memstruct.py
index 934c1c22..a79686a8 100644
--- a/example/jitter/memstruct.py
+++ b/example/jitter/memstruct.py
@@ -56,10 +56,6 @@ class LinkedList(MemStruct):
         ("size", Num("<I")),
     ]
 
-    def __init__(self, vm, *args, **kwargs):
-        super(LinkedList, self).__init__(vm, *args, **kwargs)
-        self.memset()
-
     def get_head(self):
         """Returns the head ListNode instance"""
         if self.head == 0:
@@ -156,6 +152,8 @@ vm = jitter.vm
 # Auto-allocated by my_heap. If you allocate memory at `addr`,
 # `link = LinkedList(vm, addr)` will use this allocation.
 link = LinkedList(vm)
+# Memset the struct (with '\x00' by default)
+link.memset()
 
 # Push three uninitialized structures
 link.push(DataArray(vm))