Skip to content

Instantly share code, notes, and snippets.

@ihaveamac
Created August 2, 2016 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihaveamac/f8ae182ba0786ddad39daf3cdb63c6ea to your computer and use it in GitHub Desktop.
Save ihaveamac/f8ae182ba0786ddad39daf3cdb63c6ea to your computer and use it in GitHub Desktop.
def getContentIndex(count):
# this is a disaster
# but this will just get longer and longer...
# i'll figure out a better way to do this later
content_index = 0
content_index_string = ""
content_index_offset = 0
for i in range(0, count):
if int(content_index) == 0xFF:
content_index = 0
content_index_string += "FF"
content_index_offset = 0
content_index += (0x80 / (2 << content_index_offset)) * 2
content_index_offset += 1
return content_index_string + format(int(content_index), 'X')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment