Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startAt = all_bytes[sector_size + 4 + offset * sector_size:]
- startCluster = (rootUpper + 1)
- if((myRange - 1) % 2 != 0):
- endCluster = upper
- else:
- endCluster = myRange-1
- count = 0
- start = rootUpper + 3
- prevClusterValue = 0
- # print(startAt[500:560])
- while count < endCluster:
- cluster = startAt[count : count + 2]
- clusterValue = struct.unpack("<H", cluster)[0]
- if(cluster != b'\x00\x00'):
- if(cluster == b'\xff\xff'):
- end = count + startCluster + 1
- result.append(str(start) + "-" + str(end) + " (" + str(end-start+1) + ") -> EOF")
- else:
- if(clusterValue - prevClusterValue > 1):
- # start = count + startCluster
- fragment = clusterValue * 2 + (rootUpper + 1) - 4
- start = count + startCluster
- # result.append(str(start) + "-" + str(count + clusterValue) + " (" + str(count + clusterValue-start+1) + ") -> " + str(fragment))
- prevClusterValue = clusterValue
- count = count + 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement