Skip to content

Commit

Permalink
Page mask can be simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
ValekoZ committed May 30, 2024
1 parent 36898ce commit e057b6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -10613,7 +10613,7 @@ def read_cstring(self,
# - 0x555555557000 -> 0x555555556fff -> 0x555555556000

new_end_addr = address + length - 1
page_mask = ((1 << gef.arch.ptrsize * 8) - 1) ^ (DEFAULT_PAGE_SIZE - 1)
page_mask = ~(DEFAULT_PAGE_SIZE - 1)

length = (new_end_addr & page_mask) - address

Expand Down

0 comments on commit e057b6d

Please sign in to comment.