Compare commits

...
Author SHA1 Message Date
aclist 1cc1ba2864 chore: bump version 2026-10-16 00:06:54 +09:00
aclist 8c4d0aecdc fix: parse alternate VS_FIXEDFILEINFO structure 2026-10-16 00:06:37 +09:00
aclist 616f18452a Merge pull request #489 from aclist/fix/badlands
Mirror to Codeberg / mirror-to-codeberg (push) Canceled after 0s
fix: badlands
2026-10-15 19:26:43 +09:00
2 changed files with 21 additions and 9 deletions

No files matched your search

+20 -8
View File
@@ -255,16 +255,28 @@ class PeFileError(Exception):
pass pass
def parse_version_number(data: BinaryIO) -> FileVersion: def parse_version_number(data: BinaryIO) -> FileVersion:
# https://learn.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo # https://learn.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo
minor = struct.unpack("<L", data.read(4))[0] >> 16 & 0xFFFF """
major = struct.unpack("<L", data.read(4))[0] >> 0 & 0xFFFF Note: structure differs from standard VS_FIXEDFILEINFO
build = struct.unpack("<L", data.read(4))[0] >> 0 & 0xFFFF Major: lower 16 bits of first DWORD
# NOTE: 0-pad revision number Minor: upper 16 bits of first DWORD
revision = str(struct.unpack("<L", data.read(4))[0] >> 16 & 0xFFFF) Build: lower 16 bits of third DWORD
offset = 3 - len(revision) Revision: upper 16 bits of second DWORD, zero-padded
padded = "0" * offset + revision Lower 16 bits of revision DWORD appear unused.
return FileVersion(major, minor, build, padded) """
major_minor = struct.unpack("<I", data.read(4))[0]
revision_pair = struct.unpack("<I", data.read(4))[0]
build_dword = struct.unpack("<I", data.read(4))[0]
major = major_minor & 0xFFFF
minor = (major_minor >> 16) & 0xFFFF
build = build_dword & 0xFFFF
revision = (revision_pair >> 16) & 0xFFFF
revision = f"{revision:03d}"
return FileVersion(major, minor, build, revision)
def seek_to_hex(address: str, data: BinaryIO) -> None: def seek_to_hex(address: str, data: BinaryIO) -> None:
+1 -1
View File
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
authors = [ authors = [
{name = "aclist"} {name = "aclist"}
] ]
version = "7.0.0b27" version = "7.0.0b28"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
license-files = ["LICENSE"] license-files = ["LICENSE"]
readme = "README.md" readme = "README.md"