drop cmdline limits

This commit is contained in:
2026-10-06 00:13:14 +02:00
parent fd8f59649e
commit 57b1d338ac
2 changed files with 3 additions and 64 deletions
+1 -41
View File
@@ -65,44 +65,4 @@ if __name__ == "__main__":
case 3:
kind_str = "unsigned integer"
# Skip function pointer
# Allowed values
limit = ""
limit_ptr = int.from_bytes(option[32:][:SIZEOF_PTR], byteorder=ENDIAN)
if limit_ptr != 0:
elffile.seek(next(file.address_offsets(start=limit_ptr)))
match kind:
case 0:
limit = []
i = 0
while True:
ptr = next(file.address_offsets(start=limit_ptr + i * SIZEOF_PTR))
elffile.seek(ptr)
str_ptr = int.from_bytes(elffile.read(SIZEOF_PTR), byteorder=ENDIAN)
if str_ptr == 0:
break
strstr_off = next(file.address_offsets(start=str_ptr))
val = ""
elffile.seek(strstr_off)
while True:
b = int.from_bytes(elffile.read(1))
if b == 0:
break
val += chr(b)
i += 1
limit.append(val)
case 2:
min = int.from_bytes(elffile.read(SIZEOF_PTR), byteorder=ENDIAN, signed=True)
max = int.from_bytes(elffile.read(SIZEOF_PTR), byteorder=ENDIAN)
limit = f"[{min}, {max}]"
case 3:
min = int.from_bytes(elffile.read(SIZEOF_PTR), byteorder=ENDIAN)
max = int.from_bytes(elffile.read(SIZEOF_PTR), byteorder=ENDIAN)
limit = f"[{min}, {max}]"
print(f"- {name}:\t{desc} ({kind_str}) {limit if len(limit) != 0 else ""}")
print(f"- {name}:\t{desc} ({kind_str})")