MCPcopy Create free account
hub / github.com/qilingframework/qiling / string

Method string

qiling/os/memory.py:108–122  ·  view source on GitHub ↗

Read or write string to memory. Args: addr: source / destination address value: string to write, or None if reading one from memory encoding: string encoding Returns: null-terminated string read from memory, or None if wrote one

(self, addr: int, value=None, encoding='utf-8')

Source from the content-addressed store, hash-verified

106 # TODO: this is an obsolete utility method that should not be used anymore
107 # and here for backward compatibility. use QlOsUtils.read_cstring instead
108 def string(self, addr: int, value=None, encoding='utf-8') -> Optional[str]:
109 """Read or write string to memory.
110
111 Args:
112 addr: source / destination address
113 value: string to write, or None if reading one from memory
114 encoding: string encoding
115
116 Returns: null-terminated string read from memory, or None if wrote one
117 """
118
119 if value is None:
120 return self.__read_string(addr)
121
122 self.__write_string(addr, value, encoding)
123
124 def add_mapinfo(self, mem_s: int, mem_e: int, mem_p: int, mem_info: str, mmio_ctx: Optional[QlMmioHandler] = None):
125 """Add a new memory range to map.

Callers 15

read_stringMethod · 0.80
ql_syscall_open_nocancelFunction · 0.80
hook__vn_getpathFunction · 0.80
hook__ctl_registerFunction · 0.80
hook__ctl_deregisterFunction · 0.80
hook__sflt_registerFunction · 0.80
hook__kauth_listen_scopeFunction · 0.80
hook__ipf_addv4Function · 0.80

Calls 2

__read_stringMethod · 0.95
__write_stringMethod · 0.95

Tested by 1

check_printMethod · 0.64