drop cmdline limits
This commit is contained in:
+1
-41
@@ -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})")
|
||||
|
||||
Reference in New Issue
Block a user