aboot-parser icon indicating copy to clipboard operation
aboot-parser copied to clipboard

This is for those who have Python updated from 3.10

Open Sota4Ever opened this issue 1 year ago • 1 comments

Sota4Ever avatar Apr 09 '24 00:04 Sota4Ever

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)

kirya-dev avatar Feb 21 '25 09:02 kirya-dev