mirror of
https://github.com/NinjaCheetah/libWiiPy.git
synced 2025-04-27 22:01:01 -04:00
Finally fix content region size in WAD headers
This commit is contained in:
parent
45638769a9
commit
c5abf16f67
@ -7,7 +7,7 @@ import io
|
|||||||
import hashlib
|
import hashlib
|
||||||
from typing import List
|
from typing import List
|
||||||
from ..types import _ContentRecord
|
from ..types import _ContentRecord
|
||||||
from ..shared import _pad_bytes
|
from ..shared import _pad_bytes, _align_value
|
||||||
from .crypto import decrypt_content, encrypt_content
|
from .crypto import decrypt_content, encrypt_content
|
||||||
|
|
||||||
|
|
||||||
@ -97,7 +97,10 @@ class ContentRegion:
|
|||||||
# Calculate the size of the whole content region.
|
# Calculate the size of the whole content region.
|
||||||
content_region_size = 0
|
content_region_size = 0
|
||||||
for record in range(len(self.content_records)):
|
for record in range(len(self.content_records)):
|
||||||
content_region_size += self.content_records[record].content_size
|
if record is len(self.content_records) - 1:
|
||||||
|
content_region_size += self.content_records[record].content_size
|
||||||
|
else:
|
||||||
|
content_region_size += _align_value(self.content_records[record].content_size, 64)
|
||||||
return content_region_data, content_region_size
|
return content_region_data, content_region_size
|
||||||
|
|
||||||
def get_enc_content_by_index(self, index: int) -> bytes:
|
def get_enc_content_by_index(self, index: int) -> bytes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user