diff options
| author | Pierre LALET <pierre.lalet@cea.fr> | 2015-06-28 18:13:58 +0200 |
|---|---|---|
| committer | Pierre LALET <pierre.lalet@cea.fr> | 2015-06-28 18:19:06 +0200 |
| commit | 5055ac3ae8c6c2a7a65d44d1a46ff964d63e8b41 (patch) | |
| tree | 0495661f91edce5d899d07053b152b73e92e1171 /miasm2/os_dep/common.py | |
| parent | 1bb328a8922f8b2220529f0a61c1f50f94bbc367 (diff) | |
| download | miasm-5055ac3ae8c6c2a7a65d44d1a46ff964d63e8b41.tar.gz miasm-5055ac3ae8c6c2a7a65d44d1a46ff964d63e8b41.zip | |
os_dep: PEP8 compliance
Diffstat (limited to 'miasm2/os_dep/common.py')
| -rw-r--r-- | miasm2/os_dep/common.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/miasm2/os_dep/common.py b/miasm2/os_dep/common.py index 9f0d2fa2..7f8caed1 100644 --- a/miasm2/os_dep/common.py +++ b/miasm2/os_dep/common.py @@ -9,7 +9,7 @@ def get_str_ansi(jitter, ad_str, max_char=None): l = 0 tmp = ad_str while ((max_char is None or l < max_char) and - jitter.vm.get_mem(tmp, 1) != "\x00"): + jitter.vm.get_mem(tmp, 1) != "\x00"): tmp += 1 l += 1 return jitter.vm.get_mem(ad_str, l) @@ -19,7 +19,7 @@ def get_str_unic(jitter, ad_str, max_char=None): l = 0 tmp = ad_str while ((max_char is None or l < max_char) and - jitter.vm.get_mem(tmp, 2) != "\x00\x00"): + jitter.vm.get_mem(tmp, 2) != "\x00\x00"): tmp += 2 l += 2 s = jitter.vm.get_mem(ad_str, l) @@ -36,13 +36,14 @@ def set_str_unic(s): # TODO: real unicode encoding return "\x00".join(list(s)) + '\x00' * 3 + class heap(object): "Light heap simulation" addr = 0x20000000 align = 0x1000 size = 32 - mask = (1<< size) - 1 + mask = (1 << size) - 1 def next_addr(self, size): """ @@ -54,7 +55,6 @@ class heap(object): self.addr &= self.mask ^ (self.align - 1) return ret - def alloc(self, jitter, size): """ @jitter: a jitter instance |