public Header LockScript(uint scrId)
{
if (_scriptList[scrId / ObjectMan.ITM_PER_SEC] == 0)
throw new InvalidOperationException($"Script id {scrId} not found");
scrId = _scriptList[scrId / ObjectMan.ITM_PER_SEC];
# if SCUMM_BIG_ENDIAN
OpenScriptResourceBigEndian(scrId);
#else
OpenScriptResourceLittleEndian(scrId);
#endif
MemHandle handle = ResHandle(scrId);
if (handle == null)
throw new InvalidOperationException($"Script resource handle {scrId} not found");
return new Header(handle.data);
}