diff options
author | Benjamin Dobell <benjamin.dobell+git@glassechidna.com.au> | 2013-03-07 14:00:52 +0100 |
---|---|---|
committer | Benjamin Dobell <benjamin.dobell+git@glassechidna.com.au> | 2013-03-07 14:12:27 +0100 |
commit | ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768 (patch) | |
tree | 2267ec17efe5435887cb68169a56418acf7a9f05 /libpit/Source | |
parent | Previous libusbx fix was a red herring of sorts. Inadvertedly it did fix the (diff) | |
download | Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.tar Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.tar.gz Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.tar.bz2 Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.tar.lz Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.tar.xz Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.tar.zst Heimdall-ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768.zip |
Diffstat (limited to 'libpit/Source')
-rw-r--r-- | libpit/Source/libpit.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libpit/Source/libpit.h b/libpit/Source/libpit.h index 9e6c452..eb37647 100644 --- a/libpit/Source/libpit.h +++ b/libpit/Source/libpit.h @@ -250,7 +250,8 @@ namespace libpit enum { kFileIdentifier = 0x12349876, - kHeaderDataSize = 28 + kHeaderDataSize = 28, + kPaddedSizeMultiplicand = 4096 }; private: @@ -349,6 +350,22 @@ namespace libpit return entryCount; } + unsigned int GetDataSize(void) const + { + return PitData::kHeaderDataSize + entryCount * PitEntry::kDataSize; + } + + unsigned int GetPaddedSize(void) const + { + unsigned int dataSize = GetDataSize(); + unsigned int paddedSize = (dataSize / kPaddedSizeMultiplicand) * kPaddedSizeMultiplicand; + + if (dataSize % kPaddedSizeMultiplicand != 0) + paddedSize += kPaddedSizeMultiplicand; + + return paddedSize; + } + unsigned int GetUnknown1(void) const { return unknown1; |