import math import os import struct import sys import tkinter as tk import types import setup_tool_dynamic_core as _dynamic_core # Keep the feature-branch implementation intact and layer only the executable # normalization policy here. This makes the B-total policy easy to audit and # keeps every unrelated remote/fallback behavior byte-for-byte unchanged. from setup_tool_dynamic_core import * # noqa: F401,F403 from setup_tool_dynamic_core import ModernWowSetupTool as _ModernWowSetupToolCore _CAMERA_REGIONS = ( ( 0x02CCD0, bytes.fromhex( "55 8b ec 83 ec 10 8d 45 f0 50 33 c9 e8 4f 8f 00 " "00 50 ff 15 64 f6 7f 00 8b 45 f8 99 2b c2 8b c8 " "8b 45 fc 99 2b c2 d1 f8 d1 f9 50 51 89 0d 38 4e " "88 00 a3 3c 4e 88 00 ff 15 5c f6 7f 00 8b e5 5d " "c3 90 90" ), bytes.fromhex( "55 8b 05 48 4e 88 00 8b 0d 44 4e 88 00 e9 33 90 " "32 00 83 c0 32 83 c1 32 3b 0d a8 eb c4 00 7e 03 " "83 e9 01 3b 05 ac eb c4 00 7e 03 83 e8 01 83 e9 " "32 83 e8 32 89 05 48 4e 88 00 89 0d 44 4e 88 00 " "5d eb 0d" ), ), ( 0x02D326, bytes.fromhex("8b 45 f0 8b 15"), bytes.fromhex("e9 b1 8a 32 00"), ), ( 0x02D334, bytes.fromhex("8b 35 3c 4e 88 00"), bytes.fromhex("8b 35 48 4e 88 00"), ), ( 0x355D15, bytes.fromhex( "cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc " "cc cc cc cc cc" ), bytes.fromhex( "83 f8 32 7d 03 83 c0 01 83 f9 32 7d 03 83 c1 01 " "e9 b8 6f cd ff" ), ), ( 0x355DDC, bytes.fromhex( "cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc " "cc cc cc cc cc cc cc cc cc cc cc cc cc cc" ), bytes.fromhex( "8d 4d f0 51 ff 35 00 4e 88 00 ff 15 50 f6 7f 00 " "8b 45 f0 8b 15 44 4e 88 00 e9 35 75 cd ff" ), ), ) _CUSTOM_GLUES_SITES = ( (0x2F113A, 0x5F, 0xEB), (0x2F113B, 0x5E, 0x19), (0x2F1158, 0x01, 0x03), (0x2F11A7, 0x01, 0x03), (0x2F11F0, 0x5F, 0xEB), (0x2F11F1, 0x5E, 0xB2), ) class ModernWowSetupTool(_ModernWowSetupToolCore): """Remote-fallback tool with authoritative, fail-safe Vanilla Tweaks output.""" def _vanilla_tweaks_signature(self): signature = super()._vanilla_tweaks_signature() # v2 expands normalization from the original selected subset to every # executable tweak exposed by the Tool except the two intentionally # legacy upstream-only patches (Blue Moon and Cross-faction Res). signature["selected_patch_normalization"] = 2 return signature @staticmethod def _validate_float_field(data, offset, label, minimum, maximum): current = struct.unpack_from(" 4: raise RuntimeError("Sound Channels value is outside the supported WoW 1.12.1 range.") # All validation passed. Apply the exact Tool selections in memory. desired_quickloot_opcode = 0x75 if self.vt_quickloot.get() else 0x74 for offset, displacement in quickloot_sites: data[offset:offset + 2] = bytes( (desired_quickloot_opcode, displacement) ) data[0x3A4869] = 0x27 if self.vt_bg_sound.get() else 0x14 data[0x126:0x128] = b"\x2F\x01" if self.vt_laa.get() else b"\x0F\x01" desired_camera_patched = bool(self.vt_cam_fix.get()) for offset, original, patched in _CAMERA_REGIONS: desired = patched if desired_camera_patched else original data[offset:offset + len(desired)] = desired desired_custom_patched = bool(self.vt_custom_glues.get()) for offset, original, patched in _CUSTOM_GLUES_SITES: data[offset] = patched if desired_custom_patched else original struct.pack_into("