Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def compare_indexes( a, b ):
- l_a, l_b = len(a), len(b)
- if l_a > l_b:
- print( 'a is ' + str( l_a - l_b ) + 'bytes longer than b.' )
- return
- elif l_a < l_b:
- print( 'a is ' + str( l_b - l_a ) + 'bytes shorter than b.' )
- return
- else:
- boundaries = deque( [ 0, # Start of format version
- 4, # after format version
- 24, # 20 bytes of unknown is over
- 36, # after bytes for 5char name, diff, hair and hair dye
- 44, # 8 bytes of unknown is over
- 65, # after whether demon heart has been used
- 69, # 4 bytes of unknown is over
- 180, # after last social accessory
- 190, # 10 bytes of unknown is over
- 235, # after last dye
- 240, # 5 bytes of unknown is over
- 1779, # after display_moon
- 1780 # 1 unknown byte is over
- ] )
- skip = False
- for i in range( l_a ):
- if len(boundaries) > 0 and i == boundaries[0]: # Toggle skipping if at next boundary
- skip = not skip
- boundaries.popleft()
- #print( ('Not s' if not skip else 'S') + 'kipping from index: ' + str(i) )
- if not skip: # Compare at index if not skipping
- a_i, b_i = a[i], b[i]
- if a_i != b_i:
- print( 'Difference index: ' + str(i) + ': ' + str(a_i) + ': ' + str(b_i) )
- if skip and len(boundaries) == 0: # If set to skip and never going to change that, exit loop
- print( 'Ending comparison early after index: ' + str(i) )
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement