summaryrefslogtreecommitdiff
path: root/smg_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'smg_common.py')
-rw-r--r--smg_common.py28
1 files changed, 26 insertions, 2 deletions
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