aboot-parser
aboot-parser copied to clipboard
This is for those who have Python updated from 3.10
This fix works with Python 3.9
import io
def frombits(bits) -> io.BytesIO:
chars = bytearray()
for b in range(len(bits) // 8):
byte = bits[b * 8:(b + 1) * 8]
chars.append(int(''.join([str(bit) for bit in byte]), 2))
return io.BytesIO(chars)