mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-05-03 07:04:54 -04:00
Added partition hash gen tool
This commit is contained in:
parent
a686fd5577
commit
01ef8ca51b
1 changed files with 19 additions and 0 deletions
19
partition_hashes
Executable file
19
partition_hashes
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/python
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import RNS
|
||||||
|
import json
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
major_version = None
|
||||||
|
minor_version = None
|
||||||
|
target_version = None
|
||||||
|
|
||||||
|
target_file = os.path.join(sys.argv[1])
|
||||||
|
|
||||||
|
firmware_data = open(target_file, "rb").read()
|
||||||
|
calc_hash = hashlib.sha256(firmware_data[0:-32]).digest()
|
||||||
|
part_hash = firmware_data[-32:]
|
||||||
|
|
||||||
|
if calc_hash == part_hash:
|
||||||
|
print(RNS.hexrep(part_hash, delimit=False))
|
Loading…
Add table
Add a link
Reference in a new issue