Eliminar CopyPaste.py

This commit is contained in:
Miguel 2024-04-22 04:28:02 -03:00
parent a4bc042b2c
commit 615bfbf5bd
1 changed files with 0 additions and 19 deletions

View File

@ -1,19 +0,0 @@
def calculate_offsets(db_struct, current_offset=0, parent=None):
"""
Recursively calculate byte offsets for each field in the DB structure considering special types.
"""
last_key_was_bool = False
last_bit_offset = 0 # To track bit offsets within a byte
if isinstance(db_struct, dict):
for key, value in list(db_struct.items()):
if isinstance(value, dict):
if "type" in value and not "offset" in value:
current_offset = calculate_offsets(
value, current_offset, value
) # Recurse into nested structs
elif isinstance(db_struct, list):
for item in db_struct:
current_offset = calculate_offsets(item, current_offset, parent)
return current_offset