Extend event effects through add-building strip
This commit is contained in:
parent
4945430149
commit
b2da02befa
7 changed files with 3319 additions and 1161 deletions
|
|
@ -147,6 +147,10 @@ def classify(
|
|||
parameter_family = "company_governance_scalar"
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif 39 <= descriptor_id <= 54:
|
||||
parameter_family = "runtime_variable_scalar"
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif 59 <= descriptor_id <= 104:
|
||||
parameter_family = "world_scalar_override"
|
||||
runtime_key = normalize_world_scalar_key(label)
|
||||
|
|
@ -217,14 +221,10 @@ def classify(
|
|||
runtime_key = "world.all_electric_locos_available"
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif 503 <= descriptor_id <= 519:
|
||||
elif 503 <= descriptor_id <= 613:
|
||||
parameter_family = "world_building_spawn"
|
||||
label = f"Add Building Slot {descriptor_id - 502}"
|
||||
runtime_status = "shell_owned"
|
||||
elif signature_byte_0x63 == 0 and signature_byte_0x64 == 0x8F:
|
||||
parameter_family = "runtime_variable_scalar"
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif "Earthquake" in label or "Storm" in label:
|
||||
parameter_family = "world_disaster_scalar"
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from pathlib import Path
|
|||
|
||||
TABLE_BASE_VA = 0x00610398
|
||||
ROW_STRIDE = 0x6E
|
||||
ROW_COUNT = 520
|
||||
MAX_ROW_COUNT = 2048
|
||||
IMAGE_BASE = 0x00400000
|
||||
|
||||
|
||||
|
|
@ -27,17 +27,20 @@ def load_lng_labels(path: Path) -> dict[int, str]:
|
|||
def extract_rows(exe_bytes: bytes, labels: dict[int, str]) -> list[dict[str, object]]:
|
||||
table_offset = TABLE_BASE_VA - IMAGE_BASE
|
||||
rows: list[dict[str, object]] = []
|
||||
for row_index in range(ROW_COUNT):
|
||||
for row_index in range(MAX_ROW_COUNT):
|
||||
row = exe_bytes[
|
||||
table_offset + row_index * ROW_STRIDE : table_offset + (row_index + 1) * ROW_STRIDE
|
||||
]
|
||||
if len(row) < ROW_STRIDE:
|
||||
break
|
||||
descriptor_id = struct.unpack_from("<I", row, 0x04)[0]
|
||||
if descriptor_id != row_index:
|
||||
break
|
||||
label_id = struct.unpack_from("<H", row, 0x6A)[0]
|
||||
rows.append(
|
||||
{
|
||||
"row_index": row_index,
|
||||
"descriptor_id": struct.unpack_from("<I", row, 0x04)[0],
|
||||
"descriptor_id": descriptor_id,
|
||||
"selector_order": struct.unpack_from("<f", row, 0x00)[0],
|
||||
"target_mask_bits": row[0x65],
|
||||
"label_id": label_id,
|
||||
|
|
@ -62,12 +65,12 @@ def main() -> None:
|
|||
artifact = {
|
||||
"table_base_va": f"0x{TABLE_BASE_VA:08x}",
|
||||
"row_stride_hex": f"0x{ROW_STRIDE:02x}",
|
||||
"descriptor_count": ROW_COUNT,
|
||||
"binary_path_hint": str(args.exe),
|
||||
"language_path_hint": str(args.lng),
|
||||
"binary_sha256": hashlib.sha256(exe_bytes).hexdigest(),
|
||||
"descriptors": extract_rows(exe_bytes, labels),
|
||||
}
|
||||
artifact["descriptors"] = extract_rows(exe_bytes, labels)
|
||||
artifact["descriptor_count"] = len(artifact["descriptors"])
|
||||
args.out.write_text(json.dumps(artifact, indent=2) + "\n", encoding="utf-8")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue