The recovered system: fire channels = LBE4ControlsManager buttonGroups (0x40/0x45/0x46/0x47); default groups = the per-mech type-6 controls-map resource in BTL4.RES, installed by the T0 CreateStreamedMappings the port already called -- it needed only the TriggerState attribute (id 0x13 PINNED to the binary value; fireImpulse@0x31C is the binary's TriggerState) and an input feed. Keyboard/harness now push press/release edges into the button groups; the gBT*Trigger bypasses, per-type keyboard split and 1,0 pulse hack are retired -- weapons sharing a button fire TOGETHER (madcat Trigger = 4 weapons). Myomers @4b9550/@4b95b8 misattribution corrected (they are MechWeapon ConfigureMappables/ChooseButton). Verified 2-node: kill through the authentic chain (12 hits vs ~36 pre-groups). Config-mode session (regrouping UI) = the remaining stage, KB-scoped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
804 B
Python
23 lines
804 B
Python
import struct, sys
|
|
f = open(r'C:/git/bt411/content/BTL4OPT.EXE', 'rb').read()
|
|
pe = struct.unpack_from('<I', f, 0x3c)[0]
|
|
nsec = struct.unpack_from('<H', f, pe + 6)[0]
|
|
optsz = struct.unpack_from('<H', f, pe + 20)[0]
|
|
base = struct.unpack_from('<I', f, pe + 24 + 28)[0]
|
|
secs = []
|
|
for i in range(nsec):
|
|
s = pe + 24 + optsz + i * 40
|
|
vsz, va, rsz, ro = struct.unpack_from('<IIII', f, s + 8)
|
|
secs.append((base + va, rsz, ro))
|
|
|
|
def fo(va):
|
|
for sva, rsz, ro in secs:
|
|
if sva <= va < sva + rsz:
|
|
return ro + (va - sva)
|
|
raise ValueError(hex(va))
|
|
|
|
for va_s, n in [(a, int(b)) for a, b in (x.split(':') for x in sys.argv[1:])]:
|
|
va = int(va_s, 16)
|
|
vals = [struct.unpack_from('<I', f, fo(va) + i * 4)[0] for i in range(n)]
|
|
print(hex(va), ' '.join(hex(v) for v in vals))
|