import os import struct import tempfile import unittest from unittest import mock import setup_tool_dynamic from setup_tool import WowSetupTool from setup_tool_dynamic import ModernWowSetupTool class FakeVar: def __init__(self, value): self.value = value def get(self): return self.value def set(self, value): self.value = value class VanillaTweaksNormalizationTests(unittest.TestCase): def _tool( self, *, fov, sound, quickloot, background, farclip=777, frill=300, nameplate=41, maxcam=100, laa=True, camera=True, custom_glues=True, crossfaction=False, bluemoon=False, ): tool = ModernWowSetupTool.__new__(ModernWowSetupTool) tool.vt_fov = FakeVar(fov) tool.vt_soundchan = FakeVar(sound) tool.vt_quickloot = FakeVar(quickloot) tool.vt_bg_sound = FakeVar(background) tool.vt_farclip = FakeVar(farclip) tool.vt_frill = FakeVar(frill) tool.vt_nameplate = FakeVar(nameplate) tool.vt_maxcam = FakeVar(maxcam) tool.vt_laa = FakeVar(laa) tool.vt_cam_fix = FakeVar(camera) tool.vt_crossfaction_res = FakeVar(crossfaction) tool.vt_custom_glues = FakeVar(custom_glues) tool.vt_bluemoon = FakeVar(bluemoon) tool.core_plugins = {"SuperWoWhook.dll": FakeVar(True)} return tool def _write_exe( self, root, quick1, quick2, background, fov, sound, *, farclip=777.0, frill=70.0, nameplate=20.0, maxcam=50.0, laa_patched=False, camera_patched=False, custom_patched=False, crossfaction_byte=0x01, bluemoon_bytes=None, filename="WoW_Modernized.exe", ): data = bytearray(0x46795C + 16) # Use a minimal but structurally valid PE32 header. The selected PE # offset deliberately places COFF Characteristics at 0x126, matching # the real client's Large Address Aware patch location. pe_offset = 0x110 data[:2] = b"MZ" struct.pack_into("