Skip to content

Commit

Permalink
cacheXXXX.bin header detection fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
yam-anssi committed Jul 1, 2016
1 parent 6393bc7 commit 99bc01c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ With the following arguments meaning:
```
## Changelog
```
01/07/2016 1.00a cacheXXXX.bin header detection fixed.
27/06/2016 1.00 Initial release.
```
5 changes: 3 additions & 2 deletions bmc-tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from struct import pack, unpack

class BMCContainer():
BIN_FILE_HEADER = "RDP8bmp\x00\x03\x00\x00\x00"
BIN_FILE_HEADER = "RDP8bmp\x00"
BIN_CONTAINER = ".BIN"
BMC_CONTAINER = ".BMC"
TILE_HEADER_SIZE = {BMC_CONTAINER: 0x14, BIN_CONTAINER: 0xC}
Expand Down Expand Up @@ -41,7 +41,8 @@ def b_import(self, fname):
self.fname = fname
self.btype = self.BMC_CONTAINER
if self.bdat[:len(self.BIN_FILE_HEADER)] == self.BIN_FILE_HEADER:
self.bdat = self.bdat[len(self.BIN_FILE_HEADER):]
self.b_log(sys.stdout, True, 2, "Subsequent header version: %d." % (unpack("<L", self.bdat[len(self.BIN_FILE_HEADER):len(self.BIN_FILE_HEADER)+4])[0]))
self.bdat = self.bdat[len(self.BIN_FILE_HEADER)+4:]
self.btype = self.BIN_CONTAINER
self.b_log(sys.stdout, True, 0, "Successfully loaded '%s' as a %s container." % (self.fname, self.btype))
return True
Expand Down

0 comments on commit 99bc01c

Please sign in to comment.