File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
ltchiptool/soc/ambz2/util Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 29
29
30
30
FLASH_CALIBRATION = b"\x99 \x99 \x96 \x96 \x3F \xCC \x66 \xFC \xC0 \x33 \xCC \x03 \xE5 \xDC \x31 \x62 "
31
31
32
+ IMAGE_SIGNATURE_OFFSET = 0
32
33
IMAGE_PUBLIC_KEY_OFFSET = 32
33
34
34
35
Original file line number Diff line number Diff line change 1
1
# Copyright (c) Martin Prokopič 2024-12-02
2
2
3
- from .models .images import IMAGE_PUBLIC_KEY_OFFSET
3
+ from .models .images import IMAGE_PUBLIC_KEY_OFFSET , IMAGE_SIGNATURE_OFFSET
4
4
5
5
6
6
def patch_firmware_for_ota (data : bytes ) -> bytes :
7
7
copy = bytearray (data )
8
- copy [0 ] ^= 0xff # negate first signature byte
9
- copy [IMAGE_PUBLIC_KEY_OFFSET ] ^= 0xff # negate first pubkey byte
8
+ copy [IMAGE_SIGNATURE_OFFSET ] ^= 0xFF # negate first signature byte
9
+ copy [IMAGE_PUBLIC_KEY_OFFSET ] ^= 0xFF # negate first pubkey byte
10
10
return bytes (copy )
You can’t perform that action at this time.
0 commit comments