5 BASE_SB_PATH =
"file_sb"
11 while ((max_char
is None or l < max_char)
and
12 jitter.vm.get_mem(tmp, 1) !=
"\x00"):
15 return jitter.vm.get_mem(ad_str, l)
21 while ((max_char
is None or l < max_char)
and
22 jitter.vm.get_mem(tmp, 2) !=
"\x00\x00"):
25 s = jitter.vm.get_mem(ad_str, l)
37 return "\x00".join(list(s)) +
'\x00' * 3
41 "Light heap simulation"
46 mask = (1 << size) - 1
50 @size: the size to allocate
51 return the future checnk address
60 @jitter: a jitter instance
61 @size: the size to allocate
65 jitter.vm.add_memory_page(addr, PAGE_READ | PAGE_WRITE,
"\x00" * size)
70 """Convert a Windows path to a valid filename within the sandbox
74 path = [elt
for elt
in path.lower().replace(
'/',
'_').split(
'\\')
if elt]
75 return os.path.join(BASE_SB_PATH, *path)
79 """Convert a POSIX path to a valid filename within the sandbox
83 path = [elt
for elt
in path.split(
'/')
if elt]
84 return os.path.join(BASE_SB_PATH, *path)