添加bootram 密码计算脚本
This commit is contained in:
25
pass.py
Normal file
25
pass.py
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
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])
|
||||
|
Reference in New Issue
Block a user