Skip to content

Commit

Permalink
Merge pull request #901 from sbechet/main
Browse files Browse the repository at this point in the history
small update
  • Loading branch information
bkerler authored Jan 24, 2024
2 parents 29341e5 + 03d63da commit 18947b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ python mtk da peek [addr in hex] [length in hex] [optional: -filename filename.b

Poke memory
```
python mtk da peek [addr in hex] [data as hexstring or -filename for reading from file]
python mtk da poke [addr in hex] [data as hexstring or -filename for reading from file]
```

Read rpmb (Only xflash for now)
Expand Down
6 changes: 3 additions & 3 deletions mtkclient/Library/Hardware/seccfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, hwc, mtk, loglevel=logging.INFO):
self.org_data = None
self.hwc = hwc
self.mtk = mtk
self.info = b"AND_SECCFG_v\x00\x00\x00\x00"
self.info_header = b"AND_SECCFG_v\x00\x00\x00\x00"
self.magic = 0x4D4D4D4D
self.seccfg_ver = 3
self.seccfg_size = 0x1860
Expand Down Expand Up @@ -189,7 +189,7 @@ def parse(self, data):
if data[:0x10] != b"AND_SECCFG_v\x00\x00\x00\x00":
return False
rf = structhelper_io(BytesIO(bytearray(data)))
self.info = rf.bytes(0x10)
self.info_header = rf.bytes(0x10)
self.magic = rf.dword()
self.seccfg_ver = rf.dword()
self.seccfg_size = rf.dword()
Expand Down Expand Up @@ -252,7 +252,7 @@ def create(self, lockflag: str = "unlock"):

data = bytearray()
wf = BytesIO(data)
wf.write(self.info)
wf.write(self.info_header)
wf.write(int.to_bytes(self.magic, 4, 'little'))
wf.write(int.to_bytes(self.seccfg_ver, 4, 'little'))
wf.write(int.to_bytes(self.seccfg_size, 4, 'little'))
Expand Down

0 comments on commit 18947b7

Please sign in to comment.