diff --git a/gef.py b/gef.py index d05f918ef..a744a9881 100644 --- a/gef.py +++ b/gef.py @@ -10705,7 +10705,7 @@ def parse_gdb_info_proc_maps(cls) -> Generator[Section, None, None]: break parts = [x.strip() for x in line.split()] - addr_start, addr_end, offset = [int(x, 16) for x in parts[0:3]] + addr_start, addr_end, _, offset = [int(x, 16) for x in parts[0:4]] if mock_permission: perm = Permission(7) path = " ".join(parts[4:]) if len(parts) >= 4 else "" diff --git a/tests/api/gef_memory.py b/tests/api/gef_memory.py index d771b1038..19d2d350b 100644 --- a/tests/api/gef_memory.py +++ b/tests/api/gef_memory.py @@ -75,8 +75,11 @@ def test_api_gef_memory_parse_info_proc_maps(self): next(root.eval("gef.memory.parse_gdb_info_proc_maps()") ) else: - for section in root.eval("gef.memory.parse_gdb_info_proc_maps()"): - assert isinstance(section, Section) + sections = list(root.eval("gef.memory.parse_gdb_info_proc_maps()")) + with open(f"/proc/{gef.session.pid}/maps") as f: + for section, line in zip(sections, f.read().splitlines()): + assert isinstance(section, Section) + assert section.offset == int(line.split()[2], 16) def test_func_parse_permissions(self): root = self._conn.root