26 lines
440 B
Python
26 lines
440 B
Python
|
|
import sys
|
|
from bin.crc import CRC32
|
|
|
|
|
|
|
|
|
|
def bootram_pssword(chip_id:str):
|
|
data=bytearray(b'Aerospace C.Power')
|
|
data+=bytearray(chip_id.encode('utf-8'))
|
|
off=64-len(data)
|
|
if(off>0):
|
|
data+=bytearray(b'\x5A'*off)
|
|
pss=CRC32(data)
|
|
# print(f"data={data} len={len(data)}")
|
|
print(f"bootram_pssword:{pss:08x}")
|
|
return pss
|
|
print(f"chip_id err.")
|
|
return 0
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
bootram_pssword(sys.argv[1])
|
|
|