Skip to content

Commit 4ee1195

Browse files
authored
Merge pull request #2 from MrMatch246/patch-1
Update harness.py to work with default permissions
2 parents c454cb9 + 3e39183 commit 4ee1195

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

harness/fuzzware_harness/harness.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ def configure_unicorn(args):
8282
if 'permissions' not in region:
8383
logger.warning(f"defaulting to RWX permissions for region {rname}")
8484
prot = 7 # UC_PROT_ALL
85-
if 'r' in region['permissions'].lower():
86-
prot |= 1
87-
if 'w' in region['permissions'].lower():
88-
prot |= 2
89-
if 'x' in region['permissions'].lower():
90-
prot |= 4
85+
else:
86+
if 'r' in region['permissions'].lower():
87+
prot |= 1
88+
if 'w' in region['permissions'].lower():
89+
prot |= 2
90+
if 'x' in region['permissions'].lower():
91+
prot |= 4
9192

9293
# Derive memory region size from backing file
9394
if 'size' not in region and 'file' in region:

0 commit comments

Comments
 (0)