diff --git a/qiling/os/memory.py b/qiling/os/memory.py index fe9470b01..46ccba63f 100644 --- a/qiling/os/memory.py +++ b/qiling/os/memory.py @@ -3,9 +3,8 @@ # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # -from ctypes import Union import os, re -from typing import Any, Callable, List, MutableSequence, Optional, Sequence, Tuple +from typing import Any, Callable, List, MutableSequence, Optional, Sequence, Tuple, Union from unicorn import UC_PROT_NONE, UC_PROT_READ, UC_PROT_WRITE, UC_PROT_EXEC, UC_PROT_ALL @@ -65,6 +64,7 @@ def __write_string(self, addr: int, s: str, encoding: str): self.write(addr, bytes(s, encoding) + b'\x00') def __getitem__(self, key: Union[slice, int]) -> bytearray: + print(key) if isinstance(key, slice): start = key.start stop = key.stop @@ -81,6 +81,8 @@ def __getitem__(self, key: Union[slice, int]) -> bytearray: raise KeyError("Wrong type of key") def __setitem__(self, key: Union[slice, int], value: Union[bytes, bytearray]): + print(key) + print(value) if isinstance(key, int): self.ql.mem.write(key, value) else: