From 51077c2fe8c160743a67303fb516126bb98afff7 Mon Sep 17 00:00:00 2001 From: Owl Date: Fri, 22 Aug 2025 00:15:50 -0400 Subject: changes until now - test --- smg_common.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'smg_common.py') diff --git a/smg_common.py b/smg_common.py index c278382..3c7bb0f 100644 --- a/smg_common.py +++ b/smg_common.py @@ -1,6 +1,30 @@ -# paddng string -padding = +# padding stuff +# padding string +class padding(): + + # the fill string + def __init__(self): + self.string = "This is padding data to alignme" + + # return the padding string to align data at a + # given start_index with a specific byte_alignment + def string_fill(self, byte_alignment, start_index): + # check the variables first + if ((type(start_index) != int) + or (type(byte_alignment) != int) + or (start_index < 0) + or (byte_alignment != 4 and byte_alignment != 32): + return None + # return the fill string + i = 0 + rtn = "" + while (start_index % byte_alignment != 0): + rtn += self.padding[i] + i += 1 + start_index += 1 + return rtn + # name tables # read name tables found in SMG binary files -- cgit v1.2.3-70-g09d2