def hook_write(addr: int, size: int, data: bytes) -> Optional[bytes]
def hook_read(addr: int, size: int, data: bytes) -> Optional[bytes]
Returning None would abort the read/write with an exception, otherwise you can return data or a modified buffer to read/write.
Returning
Nonewould abort the read/write with an exception, otherwise you can returndataor a modified buffer to read/write.