<?xml version='1.0' encoding='utf-8'?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>1</ID>
      <Description>"[ATTACH / ALL OFF] The Last Caretaker"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>

{ Game    : The Last Caretaker
  Process : VoyageSteam-Win64-Shipping.exe
  Author  : Black_wolf
  CheatVer: 0.10.0-001-003

  Memo    : ゲームバージョン Ver. 0.10.0.653173
            ゲームエンジン Unreal Engine 5.8.2
            Steam BuildID 25982825, PE TimeDateStamp 2250921485

	なかなかに手こずった。
	最初はスペース長押しのホバー機能や船ワープ機能つけたかったんだが、
	結局いろいろやってしまった。
}

[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.disableAll(memrec) end)
{$asm}
[DISABLE]
</AssemblerScript>
      <Color>00A5FF</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>2</ID>
      <Description>"0. Settings &amp; README"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>3</ID>
          <Description>"Language / 言語設定"</Description>
          <Options moManualExpandCollapse="1" />
          <GroupHeader>1</GroupHeader>
          <CheatEntries>
            <CheatEntry>
              <ID>4</ID>
              <Description>"English (default)"</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.setLang('en') end)
{$asm}
[DISABLE]
</AssemblerScript>
              <Color>00A5FF</Color>
            </CheatEntry>
            <CheatEntry>
              <ID>5</ID>
              <Description>"日本語 / Japanese"</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.setLang('ja') end)
{$asm}
[DISABLE]
</AssemblerScript>
              <Color>00A5FF</Color>
            </CheatEntry>
          </CheatEntries>
          <Color>FFFF00</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>6</ID>
          <Description>"README"</Description>
          <Options moManualExpandCollapse="1" />
          <GroupHeader>1</GroupHeader>
          <CheatEntries>
            <CheatEntry>
              <ID>7</ID>
              <Description>"V01 / Ver. 0.10.0.653173 / Unreal Engine 5.8.2 / Steam build 25982825 / CheatVer: 0.10.0-001-003"</Description>
              <Options moManualExpandCollapse="1" />
              <GroupHeader>1</GroupHeader>
            </CheatEntry>
            <CheatEntry>
              <ID>8</ID>
              <Description>"Attach after loading a save. Player and inventories are resolved automatically."</Description>
              <Options moManualExpandCollapse="1" />
              <GroupHeader>1</GroupHeader>
            </CheatEntry>
          </CheatEntries>
          <Color>FFFF00</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>20</ID>
          <Description>"Environment / connection information"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.envReport() end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>21</ID>
          <Description>"Signature validation"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.scanSelfTest() end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>22</ID>
          <Description>"State"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.statusReport() end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        </CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>100</ID>
      <Description>"01. Gameplay"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>101</ID>
          <Description>"Invincible (block incoming attacks)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'invincible',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'invincible',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>102</ID>
          <Description>"Infinite health"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'health',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'health',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>103</ID>
          <Description>"Infinite battery"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'battery',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'battery',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>104</ID>
          <Description>"Hold Space to ascend"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'float',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'float',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry><ID>118</ID><Description>"Wall pass / free movement (Space up, Ctrl down)"</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'noclip040',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'noclip040',false)
{$asm}
</AssemblerScript><Color>00A5FF</Color><CheatEntries><CheatEntry><ID>119</ID><Description>"Movement speed (cm/s)"</Description><VariableType>Float</VariableType><Address>tlcVars+C8</Address></CheatEntry></CheatEntries></CheatEntry><CheatEntry>
          <ID>105</ID>
          <Description>"One-hit kill (NPC only)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'oneshot',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'oneshot',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>106</ID>
          <Description>"No ammo / grenade decrease"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'ammo',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'ammo',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>107</ID>
          <Description>"Zero carried weight"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'weight',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'weight',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>108</ID>
          <Description>"Experience gain multiplier"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'exp',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'exp',false) end
{$asm}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>109</ID>
              <Description>"Multiplier"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+34</Address>
            </CheatEntry>
          </CheatEntries>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>115</ID>
          <Description>"Freeze human seed survival countdown"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'seedCountdown',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'seedCountdown',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>112</ID>
          <Description>"Cold immunity"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'cold',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'cold',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>113</ID>
          <Description>"No electricity / fuel / water / gas consumption (global)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'noresources',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'noresources',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>117</ID>
          <Description>"Bind map to the M key"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.bindMapKey026)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
      </CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>200</ID>
      <Description>"02. Player / Boats"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>202</ID>
          <Description>"Movement speed multiplier"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'speed',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'speed',false) end
{$asm}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>203</ID>
              <Description>"Multiplier"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+20</Address>
            </CheatEntry>
          </CheatEntries>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>209</ID>
          <Description>"Boat speed multiplier"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'boatSpeed',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'boatSpeed',false) end
{$asm}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>210</ID>
              <Description>"Multiplier"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+A0</Address>
            </CheatEntry>
          </CheatEntries>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>110</ID>
          <Description>"No fuel consumption for boats / vehicles"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'fuel',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'fuel',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>111</ID>
          <Description>"Boat durability protection"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'boat',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'boat',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry><ID>215</ID><Description>"Warp boat (choose destination)..."</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.openBoatWarp155)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry>
          <ID>211</ID>
          <Description>"Warp to boat"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.warpTo028(2) end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
          <CheatEntries>
            <CheatEntry>
              <ID>213</ID>
              <Description>"Height offset (cm)"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+C0</Address>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>212</ID>
          <Description>"Warp to waypoint"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.warpTo028(3) end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
          <CheatEntries>
            <CheatEntry>
              <ID>214</ID>
              <Description>"Height offset (cm)"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+C4</Address>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>201</ID>
          <Description>"Player editor / refresh"</Description>
          <Options moManualExpandCollapse="1" />
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.userRun(function() TLC.playerEditor(memrec) end)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.clearChildren(memrec) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
          <CheatEntries>
            <CheatEntry>
              <ID>207</ID>
              <Description>"Skill points (session edit)"</Description>
              <VariableType>4 Bytes</VariableType>
              <Address>tlcPointSkillPending</Address>
            </CheatEntry>
            <CheatEntry>
              <ID>208</ID>
              <Description>"Enhancement points (session edit)"</Description>
              <VariableType>4 Bytes</VariableType>
              <Address>tlcPointEnhancerPending</Address>
            </CheatEntry>
            <CheatEntry>
              <ID>206</ID>
              <Description>"Ascent velocity (cm/s)"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+28</Address>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
      </CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>300</ID>
      <Description>"03. Items"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>301</ID>
          <Description>"Edit item quantities / refresh"</Description>
          <Options moManualExpandCollapse="1" />
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.userRun(function() TLC.refreshItems(memrec) end)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.clearChildren(memrec) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>302</ID>
          <Description>"Add item (category / quantity)..."</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.addItemPick() end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
      </CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>400</ID>
      <Description>"04. Build"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>401</ID>
          <Description>"No materials needed for crafting / repairs"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'materials',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'materials',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>402</ID>
          <Description>"Instant crafting / building / dismantling / repairs"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'instant',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'instant',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry><ID>409</ID><Description>"Instant recycler / Recovery Grinder"</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'recyclerInstant155',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'recyclerInstant155',false) end
{$asm}
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry>
          <ID>404</ID>
          <Description>"No building power / tank consumption"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'powerTank',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'powerTank',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>403</ID>
          <Description>"No fabrication electricity cost"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'noCraftPower',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'noCraftPower',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>406</ID>
          <Description>"Fill loaded building tanks / batteries"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'fullTank',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'fullTank',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>407</ID>
          <Description>"Fill aimed tank / battery"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.fillAimedTank088() end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry><ID>410</ID><Description>"Empty aimed tank / battery"</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.emptyAimedStorage156)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry>
          <ID>408</ID>
          <Description>"Instant plant growth (trees / saplings / seeds)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'plantGrowth129',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'plantGrowth129',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
          
        </CheatEntry>
      </CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>500</ID>
      <Description>"05. World"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>501</ID>
          <Description>"Always daytime (12:00)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'noon',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'noon',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>513</ID>
          <Description>"Clear sea visibility (disable fog)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'clearWater',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'clearWater',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>503</ID>
          <Description>"Freeze weather (current / selected)"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'weather',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'weather',false) end
{$asm}
</AssemblerScript>
          <Color>00A5FF</Color>
          <CheatEntries>
            <CheatEntry>
              <ID>502</ID>
              <Description>"Choose and lock weather..."</Description>
              <VariableType>Auto Assembler Script</VariableType>
              <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.weatherPick() end)
{$asm}
[DISABLE]
</AssemblerScript>
              <Color>00A5FF</Color>
            </CheatEntry>
          </CheatEntries>
        </CheatEntry>
        <CheatEntry>
          <ID>510</ID>
          <Description>"Wind control / lock"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'wind',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'wind',false) end
{$asm}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>511</ID>
              <Description>"Wind speed (km/h, 0-300)"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+A8</Address>
            </CheatEntry>
            <CheatEntry>
              <ID>512</ID>
              <Description>"Wind direction (degrees, 0-360)"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+AC</Address>
            </CheatEntry>
          </CheatEntries>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>514</ID>
          <Description>"Wave control"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'waves051',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'waves051',false) end
{$asm}
</AssemblerScript>
          <CheatEntries><CheatEntry><ID>515</ID><Description>"Wave height multiplier (0 = calm, 0-5)"</Description><VariableType>Float</VariableType><Address>tlcVars+D0</Address></CheatEntry><CheatEntry><ID>516</ID><Description>"Wavelength multiplier (0.1-5)"</Description><VariableType>Float</VariableType><Address>tlcVars+D4</Address></CheatEntry><CheatEntry><ID>517</ID><Description>"Wave steepness multiplier (0-5)"</Description><VariableType>Float</VariableType><Address>tlcVars+D8</Address></CheatEntry></CheatEntries><Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>504</ID>
          <Description>"Set / freeze time"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'time',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'time',false) end
{$asm}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>505</ID>
              <Description>"Time of day (hours)"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+2C</Address>
            </CheatEntry>
          </CheatEntries>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry>
          <ID>506</ID>
          <Description>"Game time multiplier"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'gametime',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'gametime',false) end
{$asm}
</AssemblerScript>
          <CheatEntries>
            <CheatEntry>
              <ID>507</ID>
              <Description>"Multiplier"</Description>
              <VariableType>Float</VariableType>
              <Address>tlcVars+30</Address>
            </CheatEntry>
          </CheatEntries>
          <Color>00A5FF</Color>
        </CheatEntry>
      </CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
    <CheatEntry>
      <ID>700</ID>
      <Description>"06. Human editor"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <Color>FFFF00</Color>
      <CheatEntries>
        <CheatEntry>
          <ID>701</ID>
          <Description>"Edit launched humans / add humans..."</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.humanEditor033)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
      <CheatEntry><ID>702</ID><Description>"Instant human creation (growth pod)"</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.toggleRecord(memrec,'humanInstant068',true)
{$asm}
[DISABLE]
{$lua}
if syntaxcheck then return end
if TLC then TLC.toggleRecord(memrec,'humanInstant068',false) end
{$asm}
</AssemblerScript><Color>00A5FF</Color></CheatEntry></CheatEntries>
    </CheatEntry>
    <CheatEntry>
      <ID>600</ID>
      <Description>"07. Other"</Description>
      <Options moManualExpandCollapse="1" />
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>601</ID>
          <Description>"Unlock all Steam achievements..."</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,function() TLC.unlockAchievements() end)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry><ID>605</ID><Description>"Advance a selected quest by one objective..."</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.openQuestAdvance136)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry><ID>607</ID><Description>"Add a selected quest..."</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.openQuestAdd141)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry><ID>606</ID><Description>"Spawn enemies..."</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.openEnemySpawn139)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry>
          <ID>602</ID>
          <Description>"First Roots: recover existing Eden Frame completion"</Description>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.recoverFirstRoots031)
{$asm}
[DISABLE]
</AssemblerScript>
          <Color>00A5FF</Color>
        </CheatEntry>
        <CheatEntry><ID>603</ID><Description>"Restore nearby rocket nose cone"</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.restoreRocketTop036)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry>
        <CheatEntry><ID>604</ID><Description>"Repair stalled area loading (unresolved attachments)"</Description><VariableType>Auto Assembler Script</VariableType><AssemblerScript>[ENABLE]
{$lua}
if syntaxcheck then return end
TLC.oneShot(memrec,TLC.repairStalledArea037)
{$asm}
[DISABLE]
</AssemblerScript><Color>00A5FF</Color></CheatEntry></CheatEntries>
      <Color>FFFF00</Color>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols />
  <LuaScript>-- Restore and verify owned entry bytes before releasing ownership metadata.
local function makeVerifiedHookOff065(t)
 return function(name)
  local st=t.hookState[name];if not st then return end
  assert(t.pid==getOpenedProcessID(),'Hook restoration incomplete: target process changed; ownership record retained')
  assert(type(st.addr)=='number'and type(st.orig)=='table'and #st.orig&gt;0,'Hook restoration incomplete: missing original bytes; record retained')
  local function equal(expected)
   local actual=readBytes(st.addr,#expected,true);if not actual then return false end
   for k,v in ipairs(expected)do if actual[k]~=v then return false end end
   return true
  end
  if not equal(st.orig)then
   assert(st.patch and #st.patch==#st.orig and equal(st.patch),'Hook restoration incomplete: code ownership conflict; record retained: '..name)
   assert(writeBytes(st.addr,st.orig),'Hook restoration write failed; record retained: '..name)
  end
  assert(equal(st.orig),'Hook restoration readback failed; record retained: '..name)
  -- Old native calls may still be inside this allocation. Never free their code here.
  local disable=st.script and st.script:match('%[DISABLE%](.*)')or''
  for symbol in disable:gmatch('unregistersymbol%(([%w_]+)%)')do pcall(unregisterSymbol,symbol)end
  t.retiredCode065=t.retiredCode065 or{};t.retiredCode065[#t.retiredCode065+1]=st
  t.hookState[name]=nil
 end
end

local previous=rawget(_G,'TLC')
if previous and previous.hookState then previous.hookOff=makeVerifiedHookOff065(previous)end
local legacyFogPID039=previous and previous.legacyFogPID039
if previous and not previous.safeFog039 and previous.pid==getOpenedProcessID()and getProcessIDFromProcessName(previous.EXE)==previous.pid then
 for address,edit in pairs(previous.edits or {})do
  if edit.key=='clearWater'then previous.edits[address]=nil;legacyFogPID039=previous.pid end
 end
 if legacyFogPID039 then previous.featOn.clearWater=nil end
end
local language=previous and previous.lang or 'en'
if previous then
 if previous.mapHotkey then previous.mapHotkey.destroy();previous.mapHotkey=nil end
 if previous.pointTimer then previous.pointTimer.destroy();previous.pointTimer=nil end
 if previous.pendingJob and previous.base() and readInteger(previous.base()+0x500)==2 then error('A native action is executing. Reload after it finishes. / ゲーム処理の完了後に再読込してください。') end
 if previous.pid and getOpenedProcessID()==previous.pid and getProcessIDFromProcessName(previous.EXE)==previous.pid then
  if previous.stopBoatPropulsion then previous.stopBoatPropulsion()end
  previous.disableAll(nil)
  pcall(unregisterSymbol,'tlcFlags') -- Keep old storage valid for already executing native calls.
 else if previous.forgetProcess then previous.forgetProcess() end end
 if previous.timer then previous.timer.destroy();previous.timer=nil end
 for _,id in ipairs({201,301})do local mr=getAddressList().getMemoryRecordByID(id);if mr then for index=mr.Count-1,0,-1 do local child=mr.Child[index];if child.ID~=206 and child.ID~=207 and child.ID~=208 then child.destroy()end end end end
 for _,symbol in ipairs({'tlcFlags','tlcVars','tlcPtrs','tlcObjects','tlcObjectCount072','tlcEngine','tlcNpcClassSlot','tlcGameThreadId'})do pcall(unregisterSymbol,symbol)end
 for n in pairs(previous.SIGS or {})do pcall(unregisterSymbol,'tlcA_'..n)end
end
local TLC={lang=language,legacyFogPID039=legacyFogPID039,classes038={}}
TLC.TAG='TLC';TLC.TITLE='The Last Caretaker';TLC.EXE='VoyageSteam-Win64-Shipping.exe';TLC.MODULE=TLC.EXE
TLC.GAMEVER='0.10.0.653173';TLC.TICK_MS=100;TLC.lang=TLC.lang or 'en'
TLC.C_GROUP=0xFFFF00;TLC.C_SCRIPT=0x00A5FF;TLC.ID_ATTACH=1;TLC.ID_TOP0=2;TLC.OFF_VARS=0x100;TLC.OFF_PTRS=0x200
TLC.HOOKS={};TLC.SIGS={};TLC.PTRS={};TLC.F={};TLC.CV={}
TLC.VARDEF={[0x20]={'float',1},[0x24]={'float',1},[0x28]={'float',600},[0x2c]={'float',12},[0x30]={'float',1},[0x34]={'float',2},[0x3c]={'float',-1000000000},[0x48]={'float',0.001}}
TLC.BUILD={ts=2250921485,size=205975552}
TLC.SIGS.Weight={p='48 89 5C 24 10 48 89 74 24 18 48 89 7C 24 20 55 48 8B EC 48 81 EC 80 00 00 00 48 8D B1 90 09 00 00 0F 29 74 24 70 8B 5E',len=5,bytes={72,137,92,36,16,72,137,116,36,24,72,137,124,36,32,85,72,139,236,72,129,236,128,0,0,0,72,141,177,144,9,0,0,15,41,116,36,112,139,94}}
TLC.SIGS.AttributeChange={p='40 57 48 83 EC 20 8B 81 48 02 00 00 48 8B F9 44 0F B6 CA 3B 81 74 02 00 00 74 52 4C 8B 81 80 02 00 00 48 8D 81 78 02 00',len=6,bytes={64,87,72,131,236,32,139,129,72,2,0,0,72,139,249,68,15,182,202,59,129,116,2,0,0,116,82,76,139,129,128,2,0,0,72,141,129,120,2,0}}
TLC.SIGS.AttributeSet={p='F3 0F 10 41 0C F3 0F 5D C1 F3 0F 5F 41 08 F3 0F 11 01 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 08 57 48 83',len=5,bytes={243,15,16,65,12,243,15,93,193,243,15,95,65,8,243,15,17,1,195,204,204,204,204,204,204,204,204,204,204,204,204,204,72,137,92,36,8,87,72,131}}
TLC.SIGS.Exp={p='40 53 57 48 83 EC 38 83 7A 04 00 48 8B FA 48 8B D9 7F 09 32 C0 48 83 C4 38 5F 5B C3 48 89 6C 24 50 8B A9 9C 10 00 00 48',len=7,bytes={64,83,87,72,131,236,56,131,122,4,0,72,139,250,72,139,217,127,9,50,192,72,131,196,56,95,91,195,72,137,108,36,80,139,169,156,16,0,0,72}}
TLC.SIGS.AmmoGet={p='8B 81 A8 0B 00 00 C3 CC CC CC CC CC CC CC CC CC 40 57 48 83 EC 20 48 8D 79 50 48 8B CF E8 BE 8F 28 FC 84 C0 74 41 48 8B',len=6,bytes={139,129,168,11,0,0,195,204,204,204,204,204,204,204,204,204,64,87,72,131,236,32,72,141,121,80,72,139,207,232,190,143,40,252,132,192,116,65,72,139}}
TLC.SIGS.CraftTime={p='48 85 D2 74 2F 8B 82 20 02 00 00 3B 82 4C 02 00 00 74 21 0F B6 82 E8 01 00 00 48 D1 E8 83 E0 04 48 0D E0 03 00 00 F3 0F',len=5,bytes={72,133,210,116,47,139,130,32,2,0,0,59,130,76,2,0,0,116,33,15,182,130,232,1,0,0,72,209,232,131,224,4,72,13,224,3,0,0,243,15}}
TLC.SIGS.CraftElectricity={p='48 85 D2 74 2F 8B 82 20 02 00 00 3B 82 4C 02 00 00 74 21 0F B6 82 E8 01 00 00 48 D1 E8 83 E0 04 48 0D E8 03 00 00 F3 0F',len=5,bytes={72,133,210,116,47,139,130,32,2,0,0,59,130,76,2,0,0,116,33,15,182,130,232,1,0,0,72,209,232,131,224,4,72,13,232,3,0,0,243,15}}
TLC.SIGS.Fabricate={p='48 89 5C 24 20 55 56 57 48 81 EC A0 00 00 00 48 8B 05 BA 85 FD 05 48 33 C4 48 89 84 24 90 00 00 00 48 8B F2 41 8B D9 48',len=5,bytes={72,137,92,36,32,85,86,87,72,129,236,160,0,0,0,72,139,5,186,133,253,5,72,51,196,72,137,132,36,144,0,0,0,72,139,242,65,139,217,72}}
TLC.SIGS.WorldStateSet={p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 30 F3 0F 11 91 68 04 00 00 48 8B F9 48 81 C1 90 03 00 00 48 8B F2 E8 57 C2 FD',len=5,bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,48,243,15,17,145,104,4,0,0,72,139,249,72,129,193,144,3,0,0,72,139,242,232,87,194,253}}
TLC.SIGS.WeatherGet={p='48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 55 41 54 41 55 41 56 41 57 48 8D 6C 24 C9 48 81 EC 90 00 00 00 33 FF 4C 8B',len=5,bytes={72,137,92,36,8,72,137,116,36,16,72,137,124,36,24,85,65,84,65,85,65,86,65,87,72,141,108,36,201,72,129,236,144,0,0,0,51,255,76,139}}
TLC.SIGS.WorldTimeSet={p='48 85 C9 74 0F 0F 57 C0 F3 0F 5A C1 F2 0F 11 81 58 08 00 00 C3 CC CC CC CC CC CC CC CC CC CC CC 40 55 53 57 41 54 41 55',len=0,bytes={72,133,201,116,15,15,87,192,243,15,90,193,242,15,17,129,88,8,0,0,195,204,204,204,204,204,204,204,204,204,204,204,64,85,83,87,65,84,65,85}}
TLC.SIGS.WorldSettingsGet={p='48 8B 81 B8 02 00 00 C3 CC CC CC CC CC CC CC CC 40 53 48 83 EC 20 48 8B D9 48 8B 89 C8 00 00 00 48 85 C9 74 27 48 8B D3',len=0,bytes={72,139,129,184,2,0,0,195,204,204,204,204,204,204,204,204,64,83,72,131,236,32,72,139,217,72,139,137,200,0,0,0,72,133,201,116,39,72,139,211}}
TLC.SIGS.Objects={p='48 8D 0D B5 D6 5A 0A E8 00 8C 5B 00 48 8D 0D 89 7F 98 07 48 83 C4 28 E9 B8 1C 91 07 48 8D 0D 79',len=0,bytes={72,141,13,181,214,90,10,232,0,140,91,0,72,141,13,137,127,152,7,72,131,196,40,233,184,28,145,7,72,141,13,121}}
TLC.SIGS.Names={p='4C 8D 3D 32 70 0F 0A EB 16 48 8D 0D 29 70 0F 0A E8 A4 37 00 00 4C 8B F8 C6 05 F2 6D 0F 0A 01 8B',len=0,bytes={76,141,61,50,112,15,10,235,22,72,141,13,41,112,15,10,232,164,55,0,0,76,139,248,198,5,242,109,15,10,1,139}}
TLC.SIGS.SoftPathSet={p='40 55 53 57 41 54 41 56 41 57 48 8B EC 48 83 EC 58 48 63 42 08 4C 8B E2 4C 8B F9 85 C0 0F 84 6F 03 00 00 49 8B 0C 24 48',len=0,bytes={64,85,83,87,65,84,65,86,65,87,72,139,236,72,131,236,88,72,99,66,8,76,139,226,76,139,249,133,192,15,132,111,3,0,0,73,139,12,36,72}}
TLC.SIGS.SoftPathLoad={p='40 55 53 56 57 41 55 48 8D 6C 24 C9 48 81 EC C0 00 00 00 45 33 ED 41 8B F0 48 8B DA 48 8B F9 4C 89 6D 67 4C 39 29 0F 84',len=0,bytes={64,85,83,86,87,65,85,72,141,108,36,201,72,129,236,192,0,0,0,69,51,237,65,139,240,72,139,218,72,139,249,76,137,109,103,76,57,41,15,132}}
TLC.SIGS.GameThread={p='89 05 44 68 E7 06 E8 47 D5 BB FC E8 B2 54 D3 FC 48 8B C8 E8 EA 01 C1 FC 48 8D 4D 6F E8 71 AC D3 FC 48 8D 55 C7 48 8B C8',len=0,bytes={137,5,68,104,231,6,232,71,213,187,252,232,178,84,211,252,72,139,200,232,234,1,193,252,72,141,77,111,232,113,172,211,252,72,141,85,199,72,139,200}}
TLC.SIGS.ItemDataCtor={p='33 C0 C7 01 01 00 00 00 48 89 41 08 48 89 41 10 48 89 41 28 48 89 41 30 48 89 41 50 48 89 41 60 48 89 41 18 48 89 41 20',len=0,bytes={51,192,199,1,1,0,0,0,72,137,65,8,72,137,65,16,72,137,65,40,72,137,65,48,72,137,65,80,72,137,65,96,72,137,65,24,72,137,65,32}}
TLC.SIGS.Engine={p='48 8B 0D A7 F7 BC 08 E8 A2 73 7C 00 48 85 C0 74 15 48 8B 80 28 02 00 00 48 89 07 48 8B 5C 24 30 48 83 C4 20 5F C3 48 8B',len=0,bytes={72,139,13,167,247,188,8,232,162,115,124,0,72,133,192,116,21,72,139,128,40,2,0,0,72,137,7,72,139,92,36,48,72,131,196,32,95,195,72,139}}
TLC.SIGS.GameTick={p='4D 89 6B 20 4D 89 73 E0 4D 89 7B D8 48 89 4C 24 50 E8 49 47 D2 FC E8 64 EC C3 FC 48 8B C8 E8 2C 47 C4 FC E8 07 EB C3 FC',len=8,bytes={77,137,107,32,77,137,115,224,77,137,123,216,72,137,76,36,80,232,73,71,210,252,232,100,236,195,252,72,139,200,232,44,71,196,252,232,7,235,195,252}}
TLC.SIGS.InventoryAddItem={p='40 55 53 57 41 54 41 55 48 8D AC 24 D0 FE FF FF 48 81 EC 30 02 00 00 48 8B 05 C2 15 FA 05 48 33 C4 48 89 85 10 01 00 00',len=0,bytes={64,85,83,87,65,84,65,85,72,141,172,36,208,254,255,255,72,129,236,48,2,0,0,72,139,5,194,21,250,5,72,51,196,72,137,133,16,1,0,0}}
TLC.SIGS.InventoryForCharacter={p='48 89 5C 24 10 57 48 83 EC 20 48 8B 01 0F B6 FA 48 8B D9 FF 90 10 08 00 00 84 C0 74 54 48 8B 9B D8 02 00 00 48 85 DB 74',len=0,bytes={72,137,92,36,16,87,72,131,236,32,72,139,1,15,182,250,72,139,217,255,144,16,8,0,0,132,192,116,84,72,139,155,216,2,0,0,72,133,219,116}}
TLC.SIGS.NPCClass={p='48 8B 05 82 D3 4E 06 48 85 C0 0F 85 BD 00 00 00 48 8D 05 CA 1D 2F FD 49 89 43 10 4C 8D 0D 7F 87 01 00 48 8D 05 18 BF 1D',len=0,bytes={72,139,5,130,211,78,6,72,133,192,15,133,189,0,0,0,72,141,5,202,29,47,253,73,137,67,16,76,141,13,127,135,1,0,72,141,5,24,191,29}}
TLC.SIGS.InventoryWeight={p='48 8B C4 48 89 58 10 48 89 70 18 4C 89 60 20 55 41 56 41 57 48 8D 68 A1 48 81 EC 90 00 00 00 0F 29 70 D8 4C 8B E1 0F 29',len=7,bytes={72,139,196,72,137,88,16,72,137,112,24,76,137,96,32,85,65,86,65,87,72,141,104,161,72,129,236,144,0,0,0,15,41,112,216,76,139,225,15,41}}
TLC.SIGS.ConsumptionMultiplier={p='48 89 5C 24 08 57 48 83 EC 30 80 B9 54 01 00 00 00 48 8B D9 0F B6 FA 74 13 F3 0F 10 05 DF 09 6C 03 48 8B 5C 24 40 48 83',len=5,bytes={72,137,92,36,8,87,72,131,236,48,128,185,84,1,0,0,0,72,139,217,15,182,250,116,19,243,15,16,5,223,9,108,3,72,139,92,36,64,72,131}}
TLC.SIGS.InventoryRemove={p='40 55 53 56 57 41 56 48 8B EC 48 83 EC 60 41 8B D9 45 8B F0 48 8B F2 48 8B F9 48 85 D2 0F 84 7B 04 00 00 45 85 C0 0F 8E',len=5,bytes={64,85,83,86,87,65,86,72,139,236,72,131,236,96,65,139,217,69,139,240,72,139,242,72,139,249,72,133,210,15,132,123,4,0,0,69,133,192,15,142}}
TLC.SIGS.AmmoStore={p='89 9E A8 0B 00 00 E8 5C 2C FB FF 48 8B 5C 24 30 B0 01 48 8B 6C 24 38 48 8B 74 24 40 48 83 C4 20 5F C3 CC CC CC CC CC 48',len=6,bytes={137,158,168,11,0,0,232,92,44,251,255,72,139,92,36,48,176,1,72,139,108,36,56,72,139,116,36,64,72,131,196,32,95,195,204,204,204,204,204,72}}
TLC.SIGS.MaterialsResult={p='B0 01 48 8B BC 24 90 03 00 00 EB 02 32 C0 48 8B 8D 70 02 00 00 48 33 CC E8 A4 BE 4A 03 48 81 C4 98 03 00 00 41 5F 41 5E',len=10,bytes={176,1,72,139,188,36,144,3,0,0,235,2,50,192,72,139,141,112,2,0,0,72,51,204,232,164,190,74,3,72,129,196,152,3,0,0,65,95,65,94}}
TLC.SIGS.WeatherClass={p='48 8B 05 72 58 48 06 48 85 C0 0F 85 BD 00 00 00 48 8D 05 3A EB EF FB 49 89 43 10 4C 8D 0D FF 28 02 00 48 8D 05 08 E8 16',len=0,bytes={72,139,5,114,88,72,6,72,133,192,15,133,189,0,0,0,72,141,5,58,235,239,251,73,137,67,16,76,141,13,255,40,2,0,72,141,5,8,232,22}}
TLC.SIGS.WorldSubsystemGet={p='48 89 5C 24 08 57 48 83 EC 20 48 8B DA 48 8B F9 48 85 D2 0F 84 8C 00 00 00 80 3D 69 69 4C 08 00 48 89 54 24 38 74 08 48',len=0,bytes={72,137,92,36,8,87,72,131,236,32,72,139,218,72,139,249,72,133,210,15,132,140,0,0,0,128,61,105,105,76,8,0,72,137,84,36,56,116,8,72}}
TLC.SIGS.WorldStateCopyEnd={p='48 8B 5C 24 70 48 8B C7 48 83 C4 60 5F C3 CC CC CC CC 48 83 EC 28 0F B6 01 4C 8B C1 3A 02 75 19 8B C8 83 E9 04 74 2F 83',len=5,bytes={72,139,92,36,112,72,139,199,72,131,196,96,95,195,204,204,204,204,72,131,236,40,15,182,1,76,139,193,58,2,117,25,139,200,131,233,4,116,47,131}}
TLC.SIGS.InventoryAddSlot={p='40 55 53 56 57 41 54 41 56 41 57 48 8D AC 24 70 FF FF FF 48 81 EC 90 01 00 00 48 8B 05 5F FD F9 05 48 33 C4 48 89 45 70',len=0,bytes={64,85,83,86,87,65,84,65,86,65,87,72,141,172,36,112,255,255,255,72,129,236,144,1,0,0,72,139,5,95,253,249,5,72,51,196,72,137,69,112}}
TLC.SIGS.CV_damage={p='4C 8D 05 AF 00 BC 08 33 D2 48 8D 0D D6 65 63 0A E8 F1 6E 0F 00 48 8D 05 92 C9 22 09 48 8D 0D E3',len=0,bytes={76,141,5,175,0,188,8,51,210,72,141,13,214,101,99,10,232,241,110,15,0,72,141,5,146,201,34,9,72,141,13,227}}
TLC.CV.damage={sig='CV_damage',rip=9,typ='byte'}
TLC.SIGS.CV_cold={p='4C 8D 05 54 12 BC 08 33 D2 48 8D 0D 13 59 63 0A E8 3E 59 0F 00 48 8D 05 AF 9A 98 07 48 8D 0D 80',len=0,bytes={76,141,5,84,18,188,8,51,210,72,141,13,19,89,99,10,232,62,89,15,0,72,141,5,175,154,152,7,72,141,13,128}}
TLC.CV.cold={sig='CV_cold',rip=9,typ='int'}
TLC.SIGS.CV_consume={p='4C 8D 05 A4 0B BD 08 33 D2 48 8D 0D 0B 15 63 0A E8 0E F5 0E 00 48 8D 05 7F 36 98 07 48 8D 0D 80',len=0,bytes={76,141,5,164,11,189,8,51,210,72,141,13,11,21,99,10,232,14,245,14,0,72,141,5,127,54,152,7,72,141,13,128}}
TLC.CV.consume={sig='CV_consume',rip=9,typ='int'}
TLC.SIGS.CV_moduleSpeed={p='4C 8D 05 5C 0A BD 08 33 D2 48 8D 0D 33 13 63 0A E8 0E F4 0E 00 48 8D 05 8F 34 98 07 48 8D 0D D0',len=0,bytes={76,141,5,92,10,189,8,51,210,72,141,13,51,19,99,10,232,14,244,14,0,72,141,5,143,52,152,7,72,141,13,208}}
TLC.CV.moduleSpeed={sig='CV_moduleSpeed',rip=9,typ='float'}
TLC.SIGS.CV_impact={p='4C 8D 05 1C F1 BC 08 33 D2 48 8D 0D 33 1E 63 0A E8 6E 06 0F 00 48 8D 05 EF 46 98 07 48 8D 0D E0',len=0,bytes={76,141,5,28,241,188,8,51,210,72,141,13,51,30,99,10,232,110,6,15,0,72,141,5,239,70,152,7,72,141,13,224}}
TLC.CV.impact={sig='CV_impact',rip=9,typ='float'}
TLC.CATALOG={}
TLC.WEATHER={{label="DA_WeatherPreset_Calm",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Calm.DA_WeatherPreset_Calm"},{label="DA_WeatherPreset_Cheat_Default",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Cheat_Default.DA_WeatherPreset_Cheat_Default"},{label="DA_WeatherPreset_cloudy",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_cloudy.DA_WeatherPreset_cloudy"},{label="DA_WeatherPreset_Cloudy_Rain",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Cloudy_Rain.DA_WeatherPreset_Cloudy_Rain"},{label="DA_WeatherPreset_Default",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Default.DA_WeatherPreset_Default"},{label="DA_WeatherPreset_Fog",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Fog.DA_WeatherPreset_Fog"},{label="DA_WeatherPreset_HeavySnow",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_HeavySnow.DA_WeatherPreset_HeavySnow"},{label="DA_WeatherPreset_High_Waves",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_High_Waves.DA_WeatherPreset_High_Waves"},{label="DA_WeatherPreset_LightSnow",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_LightSnow.DA_WeatherPreset_LightSnow"},{label="DA_WeatherPreset_LightSnow_LowTemp",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_LightSnow_LowTemp.DA_WeatherPreset_LightSnow_LowTemp"},{label="DA_WeatherPreset_LightSnow_Test",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_LightSnow_Test.DA_WeatherPreset_LightSnow_Test"},{label="DA_WeatherPreset_MediumSnow",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_MediumSnow.DA_WeatherPreset_MediumSnow"},{label="DA_WeatherPreset_Mid_Waves",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Mid_Waves.DA_WeatherPreset_Mid_Waves"},{label="DA_WeatherPreset_Mid_Waves_cloudy",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Mid_Waves_cloudy.DA_WeatherPreset_Mid_Waves_cloudy"},{label="DA_WeatherPreset_Rain",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Rain.DA_WeatherPreset_Rain"},{label="DA_WeatherPreset_Snow_Biome_Default",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Snow_Biome_Default.DA_WeatherPreset_Snow_Biome_Default"},{label="DA_WeatherPreset_Storm",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Storm.DA_WeatherPreset_Storm"},{label="DA_WeatherPreset_Storm_NoLightning",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Storm_NoLightning.DA_WeatherPreset_Storm_NoLightning"},{label="DA_WeatherPreset_Strong_Storm",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Strong_Storm.DA_WeatherPreset_Strong_Storm"},{label="DA_WeatherPreset_Sunny",path="/Game/Data/Weather/WeatherPresets/DA_WeatherPreset_Sunny.DA_WeatherPreset_Sunny"}}
TLC.ACHIEVEMENTS={"ACH_APPRENTICE_CARETAKER","ACH_BASKETBALL_5_HOOPS","ACH_DELIVER_MONEY_STACKS","ACH_DELIVER_TEDDY","ACH_ENHANCE","ACH_FIRST_ARTIFACT","ACH_FIXABLE","ACH_GROUNDHOG","ACH_HUMANS_FIRST_BORN","ACH_HUMANS_FIRST_DELIVERY","ACH_MEMORY_40","ACH_MOTHER_UNDER_THE_SEA","ACH_ROBOT_BUILDER","ACH_SECRET_OF_THE_MAZE","ACH_TEN_MEMORIES"}
TLC.CLASS_SLOTS={} -- Classes are resolved from current UObject metadata.
TLC.REF_HINTS={["WorldSettingsGet"]={{owner="World",slot=191666376,fn="K2_GetWorldSettings",delta=39},{owner="World",slot=191666376,fn="HandleTimelineScrubbed",delta=71},{owner="World",slot=191666376,fn="GetDataLayerManager",delta=39}},["Weight"]={{owner="VoyageCharacter",slot=193111352,fn="GetTotalCarriedWeight",delta=30}},["InventoryForCharacter"]={{owner="VoyageBaseCharacter",slot=193113488,fn="GetInventoryComponent",delta=115}},["CraftTime"]={{owner="VoyageFabricatorComponent",slot=193123256,fn="CalculateItemProcessTime",delta=120}},["CraftElectricity"]={{owner="VoyageFabricatorComponent",slot=193123256,fn="CalculateItemProcessElecticityCost",delta=120}},["Fabricate"]={{owner="VoyageFabricatorComponent",slot=193123256,fn="CalculateFabricationRequirements",delta=289}},["InventoryWeight"]={{owner="VoyageInventoryWeightLimitedComponent",slot=193138808,fn="GetTotalWeight",delta=30}},["SoftPathLoad"]={{owner="VoyageModuleComponent",slot=193148208,fn="GetSignalObject",delta=271}},["WorldStateSet"]={{owner="VoyageLevelScriptActor",slot=193150728,fn="SetWorldState",delta=222}},["WorldTimeSet"]={{owner="VoyageMiscBlueprintFunctionLibrary",slot=193152216,fn="SetWorldTimeSeconds",delta=169}},["ConsumptionMultiplier"]={{owner="VoyageMiscBlueprintFunctionLibrary",slot=193152216,fn="GetConsumptionMultiplierByResource",delta=217}},["Exp"]={{owner="VoyagePlayerState",slot=193161016,fn="GainExp",delta=188}},["AttributeChange"]={{owner="VoyageSurvivalComponent",slot=193172472,fn="ChangeAttributeValue",delta=188}},["AmmoGet"]={{owner="VoyageWeaponBallistic",slot=193182016,fn="GetCurrentAmmoAmount",delta=30}}}
TLC.A      = TLC.A or {}      -- resolved signature addresses
TLC.pend   = TLC.pend or {}   -- unresolved signatures
TLC.hookState = TLC.hookState or {}
TLC.featOn = TLC.featOn or {}
TLC.dyn    = TLC.dyn or {}    -- dynamic records {mr,en,ja}
TLC.suffix = TLC.suffix or {} -- record ID -&gt; text appended to its name

----------------------------------------------------------------- helpers
local function rq(a) if not a or a==0 then return nil end local v=readQword(a) if not v or v==0 then return nil end return v end
local function ri(a) if not a or a==0 then return nil end local v=readInteger(a) if v and v&gt;=0x80000000 then v=v-0x100000000 end return v end
local function rf(a) if not a or a==0 then return nil end return readFloat(a) end
TLC.rq, TLC.ri, TLC.rf = rq, ri, rf
function TLC.T(en,ja) if TLC.lang=='ja' then return ja or en end return en end
function TLC.msg(en,ja) print('['..TLC.TAG..'] '..TLC.T(en,ja)) end
function TLC.err(en,ja) error(TLC.T(en,ja),0) end
local function hex(n) return string.format('%X',n) end

function TLC.mod(name) return getAddressSafe(name or TLC.MODULE) end
function TLC.modSize(name) local ok,s=pcall(getModuleSize,name or TLC.MODULE) return ok and s or nil end
function TLC.base() return getAddressSafe('tlcFlags') end
function TLC.flag(i) return TLC.base()+i end
function TLC.var(o) return TLC.base()+TLC.OFF_VARS+o end

----------------------------------------------------------------- one-shot / user action
-- run fn, show errors, then uncheck the record (action rows)
function TLC.userRun(fn)
  local ok,e=pcall(fn)
  if not ok then local m=tostring(e) print('['..TLC.TAG..'] '..m)  end
  return ok
end
function TLC.oneShot(mr, fn)
  TLC.userRun(fn)
  local t=createTimer(nil,false) t.Interval=150
  t.OnTimer=function(tt) tt.destroy() pcall(function() mr.Active=false end) end
  t.Enabled=true
end

----------------------------------------------------------------- attach / init
function TLC.attached() return TLC.pid~=nil and TLC.pid==getOpenedProcessID() and TLC.base()~=nil end
function TLC.require()
  if not TLC.attached() then
    TLC.err('Not attached to '..TLC.EXE..'. Run [ATTACH / ALL OFF] at the top of the table first.',
           TLC.EXE..'にアタッチされていません。先にテーブル先頭の【アタッチ／一括解除】を実行してください。')
  end
end
-- attach CE to the game; returns true when the opened process changed
function TLC.attachGame()
  local pid=getProcessIDFromProcessName(TLC.EXE)
  if not pid or pid==0 then TLC.err('The game is not running: '..TLC.EXE,'ゲームが起動していません: '..TLC.EXE) end
  local changed=false
  if getOpenedProcessID()~=pid then
    openProcess(pid) changed=true
    TLC.msg(('Attached to %s (PID %d).'):format(TLC.EXE,pid),('%s（PID %d）にアタッチしました。'):format(TLC.EXE,pid))
  end
  if not TLC.mod() then pcall(reinitializeSymbolhandler,true) end
  if not TLC.mod() then TLC.err(TLC.MODULE..' is not loaded yet. Wait until the title screen and try again.',
                              TLC.MODULE..' がまだ読み込まれていません。タイトル画面まで待ってから再実行してください。') end
  return changed
end
-- state of an old process: drop it without touching the new one
function TLC.forgetProcess()
  TLC.hookState={} TLC.featOn={} TLC.A={} TLC.pend={}
  TLC.pid=nil
end
function TLC.checkBuild()
  if not TLC.BUILD then return true end
  local m=TLC.mod(); local lf=ri(m+0x3C); local ts=lf and readInteger(m+lf+8)
  local sz=TLC.modSize()
  if ts~=TLC.BUILD.ts or (TLC.BUILD.size and sz~=TLC.BUILD.size) then
    TLC.msg(('WARNING: different game build (timestamp %s, size %s). Made for v%s. Features whose code is not found are disabled.'):format(hex(ts or 0),hex(sz or 0),TLC.GAMEVER),
           ('警告: 対応ビルドと異なります（タイムスタンプ %s、サイズ %s）。対応バージョンは v%s です。コードが見つからない機能は無効になります。'):format(hex(ts or 0),hex(sz or 0),TLC.GAMEVER))
    return false
  end
  return true
end
function TLC.init()
  local pid=getOpenedProcessID()
  if TLC.pid==pid and TLC.base() then return true end
  TLC.forgetProcess()
  for _,s in ipairs({'tlcFlags','tlcVars','tlcPtrs'}) do pcall(unregisterSymbol,s) end
  -- near the module (within 2GB) so hook code can reach [tlcFlags+n] RIP-relative.
  -- AA alloc searches free blocks near the address and retries; Lua allocateMemory(size,base) retries only once.
  local mem
  if autoAssemble(('alloc(tlcFlags,$2000,%X)\nregistersymbol(tlcFlags)\n'):format(TLC.mod())) then mem=getAddressSafe('tlcFlags') end
  if not mem or mem==0 then
    pcall(unregisterSymbol,'tlcFlags')
    mem=allocateMemory(0x2000)
    if not mem or mem==0 then TLC.err('Memory allocation failed.','メモリ確保に失敗しました。') end
    registerSymbol('tlcFlags', mem, true)
    TLC.msg('WARNING: shared memory is not near '..TLC.MODULE..'. Hook features may fail to assemble.',
           '警告: 共有メモリを '..TLC.MODULE..' の近くに確保できませんでした。フックを使う機能は組み立てに失敗する場合があります。')
  end
  registerSymbol('tlcVars',  mem+TLC.OFF_VARS, true)
  registerSymbol('tlcPtrs',  mem+TLC.OFF_PTRS, true)
  for o,d in pairs(TLC.VARDEF) do
    if d[1]=='float' then writeFloat(TLC.var(o),d[2]) elseif d[1]=='qword' then writeQword(TLC.var(o),d[2]) else writeInteger(TLC.var(o),d[2]) end
  end
  TLC.pid=pid
  TLC.checkBuild()
  TLC.resolveAll()
  TLC.onAttach()
  TLC.startTimer()
  return true
end

----------------------------------------------------------------- AOB resolver (synchronous aobscanregion)
local function aaFind(pat, s, e)
  pcall(unregisterSymbol,'tlc_tmp')
  local ok=autoAssemble(('aobscanregion(tlc_tmp,%s,%s,%s)\nregistersymbol(tlc_tmp)\n'):format(hex(s),hex(e),pat))
  if not ok then return nil end
  local a=getAddressSafe('tlc_tmp') pcall(unregisterSymbol,'tlc_tmp')
  return a
end
local function aobAll(pat, s, e, maxn)
  local r={} local from=s
  while from&lt;e and #r&lt;maxn do local a=aaFind(pat,from,e) if not a then break end r[#r+1]=a from=a+1 end
  return r
end
TLC.aobAll=aobAll
function TLC.resolveSig(name)
  if TLC.A[name] then return TLC.A[name] end
  local sg=TLC.SIGS[name]; if not sg then TLC.err('Unknown signature: '..name,'未定義のシグネチャ: '..name) end
  local m=TLC.mod(sg.mod); local sz=TLC.modSize(sg.mod)
  local a=m and sz and aaFind(sg.p, m, m+sz)
  if not a then TLC.pend[name]=true return nil end
  a=a+(sg.off or 0)
  TLC.A[name]=a; TLC.pend[name]=nil
  pcall(unregisterSymbol,'tlcA_'..name) registerSymbol('tlcA_'..name, a, true)
  return a
end
function TLC.resolveAll()
  local ok,ng=0,0
  for n in pairs(TLC.SIGS) do if TLC.resolveSig(n) then ok=ok+1 else ng=ng+1 end end
  TLC.msg(('Signatures: %d found, %d not found.'):format(ok,ng),('シグネチャ: %d件検出、%d件未検出。'):format(ok,ng))
end
function TLC.pendingNames() local r={} for n in pairs(TLC.pend) do r[#r+1]=n end table.sort(r) return r end

----------------------------------------------------------------- hook manager
function TLC.hookOn(name)
  if TLC.hookState[name] then return end
  local h=TLC.HOOKS[name] or TLC.err('Unknown hook: '..name,'未定義のフック: '..name)
  local a=TLC.resolveSig(h.sig)
  if not a then TLC.err('Game code for this feature was not found: '..h.sig..'\n(it may not be loaded yet, or the game was updated)',
                       'この機能に必要なゲームコードが見つかりません: '..h.sig..'\n（未読み込み、またはゲーム更新で変更された可能性があります）') end
  local len=TLC.SIGS[h.sig].len or 5
  local orig=readBytes(a,len,true) or TLC.err('Cannot read hook site.','フック位置を読み取れません。')
  local db={} for i,b in ipairs(orig) do db[i]=string.format('%02X',b) end
  local s=h.aa:gsub('%$SITE','tlcA_'..h.sig):gsub('%$ORIG','db '..table.concat(db,' '))
  s=s:gsub('%$NOP', len&gt;5 and ('nop '..(len-5)) or '')
  local ok,info=autoAssemble(s)
  if not ok then TLC.err('Hook assembly failed: '..name..'\n'..tostring(info),'フックの組み立てに失敗: '..name..'\n'..tostring(info)) end
  TLC.hookState[name]={script=s, info=info, addr=a, orig=orig}
end
TLC.hookOff=makeVerifiedHookOff065(TLC)

----------------------------------------------------------------- features
function TLC.feature(key, on)
  local f=TLC.F[key] or TLC.err('Unknown feature: '..key,'未定義の機能: '..key)
  if on then
    TLC.require()
    for _,h in ipairs(f.hooks or {}) do TLC.hookOn(h) end
    if f.flag then writeBytes(TLC.flag(f.flag),1) end
    if f.on then f.on() end
    TLC.featOn[key]=true
  else
    TLC.featOn[key]=nil
    if not TLC.attached() then return end
    if f.flag then writeBytes(TLC.flag(f.flag),0) end
    if f.off then pcall(f.off) end
    for _,h in ipairs(f.hooks or {}) do
      local used=false
      for k in pairs(TLC.featOn) do for _,x in ipairs(TLC.F[k].hooks or {}) do if x==h then used=true end end end
      if not used then TLC.hookOff(h) end
    end
  end
end

----------------------------------------------------------------- timer (pointer slots, tasks, process watch)
function TLC.tick()
  if not TLC.pid then return end
  if getOpenedProcessID()~=TLC.pid or getProcessIDFromProcessName(TLC.EXE)~=TLC.pid then
    TLC.msg('Game process changed or exited. Run [ATTACH / ALL OFF] again.','ゲームプロセスが変わったか終了しました。【アタッチ／一括解除】を再実行してください。')
    TLC.forgetProcess() return
  end
  local b=TLC.base(); if not b then return end
  for slot,fn in pairs(TLC.PTRS) do local ok,a=pcall(fn) writeQword(b+TLC.OFF_PTRS+slot*8, (ok and a) or 0) end
  for k in pairs(TLC.featOn) do local f=TLC.F[k] if f.task then pcall(f.task) end end
  for n in pairs(TLC.pend) do TLC.resolveSig(n) end
end
function TLC.startTimer()
  if TLC.timer then return end
  TLC.timer=createTimer(nil,false) TLC.timer.Interval=TLC.TICK_MS
  TLC.timer.OnTimer=function() pcall(TLC.tick) end
  TLC.timer.Enabled=true
end

----------------------------------------------------------------- ATTACH / ALL OFF
function TLC.disableAll(self)
  local ok,changed=pcall(TLC.attachGame)
  if not ok then print('['..TLC.TAG..'] '..tostring(changed))  return end
  if changed or (TLC.pid and TLC.pid~=getOpenedProcessID()) then TLC.forgetProcess() end
  local okI,e=pcall(TLC.init) if not okI then print('['..TLC.TAG..'] '..tostring(e))  return end
  local al=getAddressList(); local n=0
  for i=al.Count-1,0,-1 do
    local m=al.getMemoryRecord(i)
    if m.Active and not (self and m.ID==self.ID) then pcall(function() m.Active=false end) n=n+1 end
  end
  local r=0 for name in pairs(TLC.hookState) do TLC.hookOff(name) r=r+1 end
  for i=0,0xFF do writeBytes(TLC.flag(i),0) end
  TLC.featOn={}
  TLC.msg(('Attach / All OFF: %d records deactivated, %d hooks restored.'):format(n,r),
         ('アタッチ／一括解除: %d件を無効化、%d件のフックを元に戻しました。'):format(n,r))
end

----------------------------------------------------------------- UI helpers
function TLC.pick(title, names)   -- returns 1-based index or nil
  local sl=createStringList() for _,s in ipairs(names) do sl.add(s) end
  local i=showSelectionList(title, '', sl, true) sl.destroy()
  if i and i&gt;=0 then return i+1 end
end
function TLC.askInt(title, prompt, def, lo, hi)
  local s=inputQuery(title, prompt, tostring(def or 0)); if not s then return nil end
  local v=tonumber(s)
  if not v or v%1~=0 or (lo and v&lt;lo) or (hi and v&gt;hi) then TLC.err('Invalid number: '..s,'不正な数値です: '..s) end
  return v
end
-- dynamic records (lists built at run time)
function TLC.clearChildren(mr) for index=mr.Count-1,0,-1 do local child=mr.Child[index];if child.ID~=206 and child.ID~=207 and child.ID~=208 then child.destroy()end end end
function TLC.addHdr(parent, en, ja)
  local m=getAddressList().createMemoryRecord()
  m.IsGroupHeader=true m.Description=TLC.T(en,ja) m.Color=TLC.C_GROUP m.appendToEntry(parent) m.DontSave=true
  TLC.dyn[#TLC.dyn+1]={mr=m,en=en,ja=ja} return m
end
function TLC.addRec(parent, en, ja, addr, vt)
  local m=getAddressList().createMemoryRecord()
  m.Description=TLC.T(en,ja) m.Type=vt or vtDword m.Address=addr m.appendToEntry(parent) m.DontSave=true
  TLC.dyn[#TLC.dyn+1]={mr=m,en=en,ja=ja} return m
end

----------------------------------------------------------------- language
function TLC.applyLang()
  local al=getAddressList()
  for i=0,al.Count-1 do
    local m=al.getMemoryRecord(i); local n=TLC.NAMES[m.ID]
    if n then local d=(TLC.lang=='ja') and n[2] or n[1]
      if TLC.suffix[m.ID] then d=d..' : '..TLC.suffix[m.ID] end
      m.Description=d end
  end
  local keep={}
  for _,e in ipairs(TLC.dyn) do if pcall(function() e.mr.Description=TLC.T(e.en,e.ja) end) then keep[#keep+1]=e end end
  TLC.dyn=keep
end
function TLC.setLang(l) TLC.lang=l TLC.applyLang() end

----------------------------------------------------------------- diagnostics
-- Lua Engine window: record ID 13 is a toggle (check = open / uncheck = close)
function TLC.luaEngine() local ok,f=pcall(getLuaEngine) if ok then return f end end
function TLC.openLuaEngine(quiet)
  local f=TLC.luaEngine()
  if f then pcall(function() f.show() end) pcall(function() f.bringToFront() end) end
  if not quiet then TLC.msg('Lua Engine opened. Messages of this table are printed here.','Lua Engineを開きました。このテーブルのメッセージはここに表示されます。') end
end
function TLC.envReport()
  TLC.openLuaEngine(true)
  local pid=getOpenedProcessID()
  print(('[%s] CE version      : %s'):format(TLC.TAG, tostring(getCEVersion and getCEVersion())))
  print(('[%s] target process  : %s (running PID %s / opened PID %s / table PID %s)'):format(TLC.TAG, TLC.EXE,
        tostring(getProcessIDFromProcessName(TLC.EXE)), tostring(pid), tostring(TLC.pid)))
  local okx,x64=pcall(targetIs64Bit) print(('[%s] target 64-bit   : %s'):format(TLC.TAG, tostring(okx and x64)))
  local m=TLC.mod()
  if m then
    local lf=ri(m+0x3C); local ts=lf and readInteger(m+lf+8)
    print(('[%s] module          : %s base=%X size=%X PE-timestamp=%X'):format(TLC.TAG, TLC.MODULE, m, TLC.modSize() or 0, ts or 0))
    if TLC.BUILD then print(('[%s] expected build  : timestamp=%X size=%X (v%s)'):format(TLC.TAG, TLC.BUILD.ts, TLC.BUILD.size or 0, TLC.GAMEVER)) end
  else print(('[%s] module          : %s NOT FOUND'):format(TLC.TAG, TLC.MODULE)) end
  print(('[%s] shared memory   : tlcFlags=%s'):format(TLC.TAG, TLC.base() and hex(TLC.base()) or 'not allocated'))
  print(('[%s] attached        : %s'):format(TLC.TAG, tostring(TLC.attached())))
end
function TLC.scanSelfTest()
  TLC.openLuaEngine(true) TLC.require()
  local okn,bad=0,0
  local names={} for n in pairs(TLC.SIGS) do names[#names+1]=n end table.sort(names)
  for _,name in ipairs(names) do
    local sg=TLC.SIGS[name]; local m=TLC.mod(sg.mod); local sz=TLC.modSize(sg.mod)
    local r=aobAll(sg.p, m, m+sz, 3)
    local got={} for i,a in ipairs(r) do got[i]=string.format('%s+%X',sg.mod or TLC.MODULE,a-m) end
    local st=(#r==1) and 'OK' or ((#r==0) and 'NOT FOUND' or 'NOT UNIQUE')
    if #r==1 then okn=okn+1 else bad=bad+1 end
    print(('[%s]   %-16s %-10s %s'):format(TLC.TAG, name, st, table.concat(got,', ')))
  end
  TLC.msg(('AOB self-test done: %d OK, %d NG.'):format(okn,bad),('AOBスキャンテスト完了: 正常 %d件、異常 %d件。'):format(okn,bad))
end
function TLC.statusReport()
  TLC.openLuaEngine(true)
  local l=TLC.pendingNames()
  print(('[%s] unresolved signatures: %s'):format(TLC.TAG, #l&gt;0 and table.concat(l,', ') or '-'))
  local h={} for n,st in pairs(TLC.hookState) do h[#h+1]=('%s@%X'):format(n,st.addr) end table.sort(h)
  print(('[%s] active hooks        : %s'):format(TLC.TAG, #h&gt;0 and table.concat(h,', ') or '-'))
  local f={} for k in pairs(TLC.featOn) do f[#f+1]=k end table.sort(f)
  print(('[%s] features on         : %s'):format(TLC.TAG, #f&gt;0 and table.concat(f,', ') or '-'))
  local al=getAddressList(); local a={}
  for i=0,al.Count-1 do local m=al.getMemoryRecord(i) if m.Active then a[#a+1]=('[%d] %s'):format(m.ID,m.Description) end end
  print(('[%s] active records      : %s'):format(TLC.TAG, #a&gt;0 and table.concat(a,' / ') or '-'))
end


-- [GAME] Local EXE-derived resolver and feature backend for Steam build 25982825.
-- The common framework is overridden for transactional writes, process loss cleanup,
-- targeted pointer capture, and stale-object rejection before game-thread dispatch.
local U={names={}}; TLC.U=U
local function q(a) if a and a&gt;0 then local v=readQword(a);if v and v&gt;0 then return v end end end
local function i(a) return a and readInteger(a) end
local function f(a) return a and readFloat(a) end
local function hx(a) return string.format('%X',a) end
local function eq(a,t) local b=readBytes(a,#t,true);if not b then return false end;for n=1,#t do if b[n]~=t[n] then return false end end;return true end
local function rip(a) local d=i(a+3);if not d then return end;if d&gt;=0x80000000 then d=d-0x100000000 end;return a+7+d end
-- Resolve and retain a verified module base independently of CE symbol loading.
function TLC.mod(name)
 local wanted=(name or TLC.MODULE):lower();local pid=getOpenedProcessID()
 if TLC.moduleCache and TLC.moduleCache.pid==pid and TLC.moduleCache.name==wanted then
  local b=TLC.moduleCache.base;if readSmallInteger(b)==0x5a4d then return b end
 end
 local ok,modules=pcall(enumModules)
 if ok and modules then for _,m in ipairs(modules)do
  local n=(m.Name or m.name or ''):lower();local b=m.Address or m.address
  if n==wanted and type(b)=='number' and readSmallInteger(b)==0x5a4d then TLC.moduleCache={pid=pid,name=wanted,base=b};return b end
 end end
 local b=getAddressSafe(name or TLC.MODULE)
 if type(b)=='number' and b&gt;0 and readSmallInteger(b)==0x5a4d then TLC.moduleCache={pid=pid,name=wanted,base=b};return b end
end
function TLC.moduleRequired()
 local b=TLC.mod();if not b then TLC.err('Game module unavailable. Wait for the game to finish loading, then run ATTACH again.','ゲーム本体のモジュールを取得できません。読込完了後、アタッチを再実行してください。') end;return b
end
function TLC.checkBuild()
 local b=TLC.moduleRequired();local pe=i(b+0x3c)
 if not pe or i(b+pe+8)~=TLC.BUILD.ts or i(b+pe+0x50)~=TLC.BUILD.size then TLC.err('Unsupported executable build; no writes made.','未対応の実行ファイルです。書き込みを中止しました。') end
 return true
end
function TLC.resolveSig(n)
 if TLC.A[n] then return TLC.A[n] end
 local s=assert(TLC.SIGS[n]);local b=TLC.moduleRequired()
 -- Revalidate cached instructions. The current resolver discovers targets
 -- through executable-file signatures or named metadata.
 local a=rawget(TLC.A,n)
 if not a or not eq(a,s.bytes) then TLC.pend[n]=true;return end
 TLC.A[n]=a;TLC.pend[n]=nil;registerSymbol('tlcA_'..n,a,true);return a
end
function TLC.valid(o)
 if not o or o&lt;0x10000 or not U.go then return false end
 local idx=i(o+0xc);local count=TLC.objectCount072();if not idx or not count or idx&gt;=count then return false end
 local chunks=q(U.go);if not chunks then return false end;local ch=q(chunks+(idx//65536)*8);if not ch then return false end
 local item=ch+(idx%65536)*24
 return q(item+8)==o and ((i(o+8) or 0)&amp;0x18010)==0,item
end
function U.name(id)
 if not id or not U.gn or (id&gt;&gt;16)&gt;8191 then return '?' end
 if U.names[id] then return U.names[id] end
 local block=q(U.gn+0x10+(id&gt;&gt;16)*8);if not block then return '?' end
 local a=block+(id&amp;65535)*2;local h=readSmallInteger(a);if not h then return '?' end
 local n=h&gt;&gt;6;if n&gt;1023 then return '?' end
 local bt=readBytes(a+2,n*((h&amp;1)==1 and 2 or 1),true);if not bt then return '?' end;local s;if (h&amp;1)==0 then s=string.char(table.unpack(bt)) else local z={} for k=1,#bt,2 do z[#z+1]=utf8.char(bt[k]+bt[k+1]*256) end;s=table.concat(z) end;U.names[id]=s;return s
end
function U.n(o) local n=U.name(i(o+0x18));local num=i(o+0x1c) or 0;return n..(num&gt;0 and '_'..(num-1) or '') end
function U.c(o) local c=q(o+0x10);return c and U.n(c) or '?' end
function U.isA(o,n)
 if not TLC.valid(o) then return false end
 local c=q(o+0x10);for k=1,64 do if not c then return false end;if U.n(c)==n then return true end;c=q(c+0x40) end;return false
end
function TLC.world()
 local e=U.ge and q(U.ge);local vp=e and q(e+0xd78);local w=vp and q(vp+0x78);if TLC.valid(w) and U.c(w)=='World' then return w end
end
function TLC.player(required)
 local w=TLC.world();local gi=w and q(w+0x228);local list=gi and q(gi+0x38);local lp=list and q(list);local pc=lp and q(lp+0x30);local p=pc and q(pc+0x350)
 if TLC.valid(p) and U.isA(p,'VoyageCharacter') then return p end
 if required then TLC.err('Player character unavailable. Exit the boat or other controlled vehicle, then retry.','プレイヤーキャラクターを取得できません。船などの操縦を解除して再実行してください。') end
end
function TLC.inventory() local p=TLC.player(true);local inv=q(p+0x6b8);if TLC.valid(inv) and U.isA(inv,'VoyageBaseInventoryComponent') then return inv end;TLC.err('Player inventory unavailable.','プレイヤーインベントリを取得できません。') end
function TLC.survival() local p=TLC.player();local s=p and q(p+0x698);if TLC.valid(s) then return s end end
function TLC.map(a,stride)
 local rows={};local d=q(a);local n=i(a+8);if not d or not n or n&gt;20000 then return rows end
 local bit=q(a+0x20) or (a+0x10)
 for k=0,n-1 do local b=i(bit+(k//32)*4);if b and (b&amp;(1&lt;&lt;(k%32)))~=0 then rows[#rows+1]=d+k*stride end end
 return rows
end
function TLC.stats()
 local s=TLC.survival();local r={};if s then for _,a in ipairs(TLC.map(s+0x240,0x98)) do local k=readBytes(a,1);r[k]=a+8 end end;return r
end
function TLC.changed(a,typ,value,owner,key)
 if owner and not TLC.valid(owner) then return end
 TLC.edits=TLC.edits or {};local x=TLC.edits[a];local serial;if owner then local ok,entry=TLC.valid(owner);if not ok then return end;serial=i(entry+16);if x and x.serial~=serial then x=nil end end
 local read=typ=='float' and readFloat or typ=='double' and readDouble or typ=='byte' and function(p)return readBytes(p,1)end or readInteger
 local write=typ=='float' and writeFloat or typ=='double' and writeDouble or typ=='byte' and writeBytes or writeInteger
 if not x then local old=read(a);if old==nil then error('Unreadable value') end;x={old=old,owner=owner,serial=serial,key=key,write=write};TLC.edits[a]=x end
 assert(write(a,value),'Write failed')
end
function TLC.restore(key)
 for a,x in pairs(TLC.edits or {}) do if not key or x.key==key then
  local ownerOkay=not x.owner;if x.owner then local good,entry=TLC.valid(x.owner);ownerOkay=good and i(entry+16)==x.serial end;if ownerOkay and TLC.attached() then assert(x.write(a,x.old),'Restore failed') end;TLC.edits[a]=nil
 end end
end
function TLC.cvar(n)
 local d=TLC.CV[n];assert(d,'Unknown cvar');local site=assert(TLC.resolveSig(d.sig),'Cvar signature missing');local obj=rip(site+d.rip);local data=obj and q(obj+0x10)
 if not data or not readBytes(data,d.typ=='byte' and 2 or 8,true) then TLC.err('Cvar storage unavailable: '..n,'設定の保存先を取得できません: '..n) end
 return data,d.typ
end
function TLC.setCvar(n,v,key)
 local a,t=TLC.cvar(n);TLC.changed(a,t,v,nil,key);TLC.changed(a+(t=='byte' and 1 or 4),t,v,nil,key)
end
function TLC.job(fn,args,guard,done)
 TLC.require();local p=TLC.controlledPawn(true);local jb=TLC.base()+0x500;local guard2;if type(guard)=='table' then guard2=guard[2];guard=guard[1] end
 if (i(jb) or 0)~=0 or TLC.pendingJob then TLC.err('Another game-thread action is pending.','別のゲーム処理を実行中です。') end
 assert(fn and (TLC.executable038(fn) or (TLC.nativeCallAllowlist141 and TLC.nativeCallAllowlist141[fn])),'Invalid native function')
 for o=0,0xef do writeBytes(jb+o,0) end
 writeQword(jb+8,p);local ok,it=TLC.valid(p);assert(ok);writeInteger(jb+0x10,i(p+0xc));writeInteger(jb+0x14,i(it+0x10))
 if guard then local ok,slot=TLC.valid(guard);assert(ok);writeQword(jb+0x18,guard);writeInteger(jb+0x20,i(guard+0xc));writeInteger(jb+0x24,i(slot+0x10)) end
 if guard2 then local ok,slot=TLC.valid(guard2);assert(ok);writeQword(jb+0x90,guard2);writeInteger(jb+0x98,i(guard2+0xc));writeInteger(jb+0x9c,i(slot+0x10)) end
 writeQword(jb+0x28,fn)
 for k=1,6 do writeQword(jb+0x28+k*8,args[k] or 0) end
 for k=1,3 do local v=args['xmm'..k];if v then local a=jb+0x60+k*8;if type(v)=='table' and v.float then writeFloat(a,v.float) else writeDouble(a,type(v)=='table' and v.double or v) end end end
 TLC.publishJobWorld029(jb);TLC.pendingJob={done=done,start=getTickCount(),pawn=p,fn=fn};writeInteger(jb,1)
end
function TLC.nativeSlot(o,off)
 assert(TLC.valid(o),'Invalid object');local vt=q(o);local fn=vt and q(vt+off)
 assert(fn and TLC.executable038(fn),'Invalid native vtable target');return fn
end
function TLC.addItemPath(path,amount,done)
 TLC.require();local inv=TLC.inventory();local p=TLC.player(true);local payload=TLC.base()+0x800
 local buf=payload+0x100;assert(#path&lt;400);writeString(buf,path,true);writeSmallInteger(buf+#path*2,0)
 for o=0,0xff do writeBytes(payload+o,0) end
 writeQword(payload+0x20,buf);writeInteger(payload+0x28,#path)
 TLC.job(TLC.A.SoftPathSet,{payload,payload+0x20},inv,function()
  TLC.job(TLC.A.SoftPathLoad,{payload,0,0},inv,function(item)
   if not TLC.valid(item) or not U.isA(item,'VoyageItem') then TLC.err('Selected asset is not an inventory item.','選択したデータは所持品アイテムではありません。') end
   if TLC.player()~=p then return end
   local desired=readBytes(item+0x80,1);assert(type(desired)=='number','Item inventory preference unreadable');if desired==0 then desired=1 end
   TLC.job(TLC.A.InventoryForCharacter,{p,desired},p,function(destination)
   if not TLC.valid(destination) or not U.isA(destination,'VoyageBaseInventoryComponent') then TLC.err('Destination inventory is unavailable.','追加先のインベントリを取得できません。') end
   local offset=desired==1 and 0x6b8 or desired==2 and 0x7d0
   assert(not offset or destination==readQword(p+offset),'Resolved inventory does not belong to the current player')
   local location=desired==1 and TLC.T('Backpack','通常の所持品')or desired==2 and TLC.T('Vault','保管庫')or TLC.T('Game-selected inventory','ゲーム指定の所持品')
   inv=destination
   TLC.job(TLC.A.ItemDataCtor,{payload+0x40},inv,function()
    writeInteger(payload+0x40,amount)
    TLC.job(TLC.A.InventoryAddItem,{inv,item,payload+0x40,1,1},{inv,item},function(added)
     added=added&amp;0xffffffff;TLC.lastAdded={item=item,inventory=inv,amount=added,location=location};TLC.msg('Added: '..tostring(added)..' / '..amount..' ('..location..')','追加数: '..tostring(added)..' / '..amount..'（'..location..'）');if done then done(added)end
    end)
   end)
   end)
  end)
 end)
end
function TLC.addItemPick()
 TLC.require();local cats={};for _,x in ipairs(TLC.CATALOG) do cats[x.cat]=true end
 local cs={};for c in pairs(cats) do cs[#cs+1]=c end;table.sort(cs)
 local c=TLC.pick(TLC.T('Category','カテゴリ'),cs);if not c then return end
 local rows,names={},{};for _,x in ipairs(TLC.CATALOG) do if x.cat==cs[c] then rows[#rows+1]=x;names[#names+1]=x.label end end
 local n=TLC.pick(TLC.T('Item (search)','アイテム（検索可）'),names);if not n then return end
 local amt=TLC.askInt(TLC.T('Quantity','個数'),TLC.T('Quantity to add','追加する個数'),1,1,99999);if amt then TLC.addItemPath(rows[n].path,amt) end
end
function TLC.refreshItems(mr)
 TLC.require();TLC.clearChildren(mr);local p=TLC.player(true);local mirror=assert(allocateMemory(0x1000));TLC.mirrorPages=TLC.mirrorPages or {};TLC.mirrorPages[#TLC.mirrorPages+1]=mirror;local mirrorOffset=0
 for _,cfg in ipairs({{0x6b8,'Weight-limited inventory','重量制限インベントリ'},{0x7d0,'Vault inventory','保管庫インベントリ'},{0x6c0,'Output inventory','出力インベントリ'},{0x6a0,'Holstered weapons / throwables','装備中の武器・投擲物'},{0x6a8,'Equipment inventory','装備品インベントリ'}}) do
  local inv=q(p+cfg[1]);if TLC.valid(inv) then
   local group=TLC.addHdr(mr,cfg[2],cfg[3])
   for _,a in ipairs(TLC.map(inv+0x420,0xa0)) do
    local slot=i(a);local n=U.name(i(a+0x10));local num=i(a+0x14) or 0;if num&gt;0 then n=n..'_'..(num-1) end
    local en,ja=TLC.itemLabels(n);local g=TLC.addHdr(group,en..' [slot '..slot..']',ja..'［スロット '..slot..'］');assert(mirrorOffset&lt;0xffc,'Inventory editor buffer full');local valueAddress=mirror+mirrorOffset;mirrorOffset=mirrorOffset+4;writeInteger(valueAddress,i(a+0x20));local rec=TLC.addRec(g,'Quantity (native edit)','個数（ゲーム処理で変更）',hx(valueAddress),vtDword);rec.OnActivate=function(_,before)if before then return false end end;local parent=mr;local pawn=p;rec.OnValueChangedByUser=function(_,old,new)
     if TLC.player()~=pawn or not TLC.valid(inv) then return end
     local oldn,newn=tonumber(old),tonumber(new);if not oldn or not newn then return end
     local current;for _,row in ipairs(TLC.map(inv+0x420,0xa0))do local rowName=U.name(i(row+0x10));local number=i(row+0x14) or 0;if number&gt;0 then rowName=rowName..'_'..(number-1) end;if i(row)==slot and rowName==n then current=i(row+0x20);break end end;if not current then TLC.msg('Refresh the inventory editor.','一覧を再取得してください。');return end;writeInteger(valueAddress,current);TLC.setQuantity(inv,slot,n,current,newn,function()TLC.refreshItems(parent)end)
    end
   end
  end
 end
end
function TLC.playerEditor(mr)
 TLC.require();TLC.clearChildren(mr);local p=TLC.player(true);local st=TLC.stats()
 for k,n in pairs({[1]={'Temperature','温度'},[8]={'Health','体力'},[9]={'Stamina','スタミナ'},[10]={'Battery','バッテリー'},[13]={'Level attribute','レベル属性'}}) do
  if st[k] then TLC.addRec(mr,n[1],n[2],hx(st[k]),vtSingle);TLC.addRec(mr,n[1]..' maximum',n[2]..'上限',hx(st[k]+0xc),vtSingle) end
 end
 local m=q(p+0x330)
 if TLC.valid(m) then for _,v in ipairs(TLC.MOVEMENT_FIELDS) do TLC.addRec(mr,v[1],v[2],hx(m+v[3]),vtSingle) end end
end
function TLC.need() TLC.require();return TLC.player(true) end
local oldForget=TLC.forgetProcess
function TLC.forgetProcess()
 if TLC.timer then TLC.timer.Enabled=false end
 local al=getAddressList();for j=al.Count-1,0,-1 do local m=al.getMemoryRecord(j);if m.Active then pcall(function()m.disableWithoutExecute()end) end end
 oldForget();TLC.pendingJob=nil;TLC.edits={};TLC.mirrorPages={};U.go=nil;U.gn=nil;U.names={}
end
function TLC.onAttach()
 U.go=rip(TLC.A.Objects);U.gn=rip(TLC.A.Names);U.ge=rip(TLC.A.Engine);assert(U.go and U.gn);registerSymbol('tlcObjects',U.go,true);local a=TLC.A.GameThread;local disp=readInteger(a+2);if disp&gt;=0x80000000 then disp=disp-0x100000000 end;registerSymbol('tlcGameThreadId',a+6+disp,true)
 registerSymbol('tlcEngine',U.ge,true);registerSymbol('tlcNpcClassSlot',rip(TLC.A.NPCClass),true);TLC.edits={};TLC.hookOn('gameTick')
 TLC.msg('Ready. Current player is resolved through the EXE-derived engine chain.','準備完了。EXEから特定したエンジン経路で現在のプレイヤーを解決します。')
end
function TLC.tick()
 if not TLC.pid then return end
 if getOpenedProcessID()~=TLC.pid or getProcessIDFromProcessName(TLC.EXE)~=TLC.pid then TLC.forgetProcess();return end
 if TLC.pendingJob then
  local jb=TLC.base()+0x500;local state=i(jb);local j=TLC.pendingJob
  if state==3 or state==4 then
   TLC.pendingJob=nil;local result=q(jb+0x80) or 0;writeInteger(jb,0)
   if state==4 then if j.cancelled074 then pcall(j.cancelled074,'target/world identity changed')end;TLC.msg('Stale game-thread action cancelled.','対象が無効になったため処理を中止しました。') elseif j.done then local ok,e=pcall(j.done,result);if not ok then TLC.msg(tostring(e),tostring(e)) end end
  elseif state==1 and getTickCount()-j.start&gt;15000 then writeInteger(jb,0);TLC.pendingJob=nil;TLC.msg('Action timed out. Open the inventory and try again.','処理が時間切れです。インベントリを開いて再実行してください。') end
 end
 if TLC.drainActions025 then TLC.drainActions025()end
 local p=TLC.player();local inv=p and q(p+0x6b8);local vault=p and q(p+0x7d0);local marker=tostring(p)..'/'..tostring(inv and q(inv+0x420))..'/'..tostring(vault and q(vault+0x420));if TLC.editorMarker and TLC.editorMarker~=marker then for _,id in ipairs({201,301})do local mr=getAddressList().getMemoryRecordByID(id);if mr then TLC.clearChildren(mr) end end end;TLC.editorMarker=marker;writeQword(TLC.base()+0x200,p or 0);writeQword(TLC.base()+0x220,p and q(p+0x6b8) or 0);writeQword(TLC.base()+0x228,p and q(p+0x7d0) or 0);local st=p and TLC.stats() or {}
 local b=TLC.base()
 for k,o in pairs({[8]=0x10,[10]=0x18}) do writeQword(b+0x200+o,st[k] or 0) end
 if p then local s=TLC.survival();writeQword(b+0x208,s or 0) end
 for key in pairs(TLC.featOn) do local feat=TLC.F[key];if feat and feat.task then local ok,e=pcall(feat.task);if not ok then TLC.msg('Feature stopped: '..key..' '..tostring(e),'機能停止: '..key..' '..tostring(e));TLC.feature(key,false) end end end
end
function TLC.startTimer()
 if not TLC.timer then TLC.timer=createTimer(nil,false);TLC.timer.Interval=TLC.TICK_MS;TLC.timer.OnTimer=function()local ok,e=pcall(TLC.tick);if not ok then print('[TLC] '..tostring(e)) end end end;TLC.timer.Enabled=true
end
local commonFeature=TLC.feature
function TLC.feature(key,on)
 local feat=assert(TLC.F[key],'Unknown feature')
 if on then
  TLC.require();local ok,e=pcall(function()if feat.on then feat.on() end;for _,h in ipairs(feat.hooks or {}) do TLC.hookOn(h) end;if feat.flag then writeBytes(TLC.flag(feat.flag),1) end end)
  if not ok then TLC.restore(key);error(e,0) end;TLC.featOn[key]=true
 else
  if feat.flag and TLC.attached() then writeBytes(TLC.flag(feat.flag),0) end
  TLC.featOn[key]=nil;if feat.off then feat.off() end;TLC.restore(key)
  for _,h in ipairs(feat.hooks or {}) do local used=false;for k in pairs(TLC.featOn) do for _,other in ipairs(TLC.F[k].hooks or {}) do if other==h then used=true end end end;if not used and h~='gameTick' then TLC.hookOff(h) end end
 end
end
function TLC.disableAll(self)
 if TLC.pendingJob and i(TLC.base()+0x500)==2 then TLC.err('A native action is running; wait until it finishes.','ゲーム処理を実行中です。完了までお待ちください。') end
 TLC.attachGame();if TLC.pid and TLC.pid~=getOpenedProcessID() then TLC.forgetProcess() end
 if not TLC.image038 then TLC.checkBuild()end
 local legacyRestored065=TLC.restoreLegacyOwnedHooks065 and TLC.restoreLegacyOwnedHooks065()or 0
 if next(TLC.hookState)and not TLC.attached()then error('All-off incomplete: connection unavailable; hook records retained',0)end
 TLC.init()
 local restoreSites065={};for name,st in pairs(TLC.hookState)do restoreSites065[#restoreSites065+1]={name=name,addr=st.addr,orig=st.orig}end
 if TLC.pendingJob then writeInteger(TLC.base()+0x500,0);TLC.pendingJob=nil end
 local keys={};for k in pairs(TLC.featOn) do keys[#keys+1]=k end;for _,k in ipairs(keys) do TLC.feature(k,false) end
 TLC.restore();local al=getAddressList();for j=al.Count-1,0,-1 do local m=al.getMemoryRecord(j);if m.Active and (not self or m.ID~=self.ID) then m.Active=false end end
 local hooks={};for h in pairs(TLC.hookState) do hooks[#hooks+1]=h end;for _,h in ipairs(hooks) do TLC.hookOff(h) end
 for o=0,0xff do writeBytes(TLC.flag(o),0) end
 for _,id in ipairs({201,301})do local mr=getAddressList().getMemoryRecordByID(id);if mr then TLC.clearChildren(mr) end end
 for _,a in ipairs(TLC.mirrorPages or {})do pcall(deAlloc,a,0x1000)end;TLC.mirrorPages={};if TLC.timer then TLC.timer.Enabled=false end
 for _,st in ipairs(restoreSites065)do
  local actual=readBytes(st.addr,#st.orig,true);assert(actual,'All-off incomplete: restore site unreadable: '..st.name)
  for k,v in ipairs(st.orig)do assert(actual[k]==v,'All-off incomplete: original instructions not restored: '..st.name)end
 end
 assert(next(TLC.hookState)==nil,'All-off incomplete: active hooks remain')
 TLC.msg('All features disabled; patches and tracked edits restored.','全機能を解除し、パッチと追跡対象の変更を復元しました。')
end
TLC.F={
 invincible={},
 cold={on=function()TLC.setCvar('cold',1,'cold')end},
 health={flag=1,hooks={'attributes','attributeSet'},on=function()TLC.need()end,task=function()local s=TLC.stats()[8];if s then writeFloat(s,f(s+0xc)) end end},
 battery={flag=2,hooks={'attributes','attributeSet'},on=function()TLC.need()end,task=function()local s=TLC.stats()[10];if s then writeFloat(s,f(s+0xc)) end end},
 weight={flag=3,hooks={'capture','weightInventory'},on=function()TLC.need()end},
 exp={hooks={'exp'},flag=4,on=function()TLC.need()end},
 noresources={on=function()TLC.setCvar('consume',0,'noresources')end},
 instant={hooks={'craftTime'},flag=5},
 noCraftPower={hooks={'craftPower'},flag=6},
 speed={on=function()TLC.need()end,task=function()local p=TLC.player();local m=p and q(p+0x330);if TLC.valid(m) then local mul=f(TLC.var(0x20));for _,o in ipairs({0x288,0x28c,0x290,0x294,0x100c}) do local a=m+o;local x=TLC.edits and TLC.edits[a];local original=x and x.old or f(a);TLC.changed(a,'float',original*mul,m,'speed') end end end},
}

TLC.F.float={on=function()TLC.need()end,task=function()local p=TLC.player();local m=p and q(p+0x330);if TLC.valid(m) and isKeyPressed(VK_SPACE) then writeDouble(m+0xd8+16,f(TLC.var(0x28))) end end}
TLC.F.noon={on=function()TLC.need()end,task=function()local ls=TLC.levelScript();if ls then if TLC.valid(ls) then TLC.changed(ls+0x2c0,'float',12,ls,'noon');TLC.changed(ls+0x398,'float',12,ls,'noon') end end end}
TLC.F.gametime={on=function()TLC.need()end,task=function()local w=TLC.world();local l=w and q(w+0x30);local ws=l and q(l+0x2b8);if TLC.valid(ws) then TLC.changed(ws+0x3e0,'float',f(TLC.var(0x30)),ws,'gametime') end end}
TLC.F.time={on=function()TLC.need()end,task=function()local ls=TLC.levelScript();if TLC.valid(ls) then TLC.changed(ls+0x2c0,'float',f(TLC.var(0x2c)),ls,'time');TLC.changed(ls+0x398,'float',f(TLC.var(0x2c)),ls,'time') end end}
TLC.F.oneshot={flag=7,hooks={'attributes'},on=function()TLC.need()end}
TLC.MOVEMENT_FIELDS={{'Walk speed','歩行速度',0x288},{'Crouch speed','しゃがみ速度',0x28c},{'Swim speed','水泳速度',0x290},{'Fly speed','飛行速度',0x294},{'Jump velocity','ジャンプ初速',0x1b0},{'Gravity scale','重力倍率',0x1a8},{'Sprint multiplier','走行倍率',0x101c}}

function TLC.moduleMax(m,typ)
 local total=(readBytes(m+0x110,1)==typ) and (readDouble(m+0x148) or 0) or 0
 for _,a in ipairs(TLC.map(m+0x9a8,32)) do if readBytes(a+8,1)==typ then total=total+(readDouble(a+16) or 0) end end
 return total
end
function TLC.batteryAddress()
 local p=TLC.player();local m=p and q(p+0x6c8)
 if TLC.valid(m) then for _,a in ipairs(TLC.map(m+0x920,24)) do if readBytes(a,1)==0 then return a+8,m end end end
end
TLC.F.battery={on=function()TLC.need()end,task=function()local a,m=TLC.batteryAddress();if a then writeDouble(a,TLC.moduleMax(m,0)) end end}
local oldPlayerEditor=TLC.playerEditor
function TLC.playerEditor(mr)
 oldPlayerEditor(mr);local a,m=TLC.batteryAddress();if a then TLC.addRec(mr,'Battery charge (game units)','バッテリー残量（ゲーム内部単位）',hx(a),vtDouble);TLC.addRec(mr,'Battery base capacity','バッテリー基本容量',hx(m+0x148),vtDouble) end
end

TLC.F.fuel={flag=8,hooks={'consumption'}}
TLC.F.power={flag=9,hooks={'consumption'}}
TLC.F.tank={flag=10,hooks={'consumption'}}
TLC.F.ammo={flag=11,hooks={'ammoStore','ammoInventory'},on=function()TLC.need()end}
TLC.F.materials={flag=12,hooks={'materials'}}
function TLC.weak(a)
 local idx=i(a);if not idx or idx&gt;= (TLC.objectCount072() or 0) then return end
 local chunks=q(U.go);if not chunks then return false end;local ch=q(chunks+(idx//65536)*8);if not ch then return end
 local entry=ch+(idx%65536)*24
 if i(entry+16)==i(a+4) then local o=q(entry+8);if TLC.valid(o) then return o end end
end
function TLC.modules()
 local p=TLC.player();local m=p and q(p+0x6c8);local sys=m and q(m+0x620);local out={}
 if TLC.valid(sys) then for _,a in ipairs(TLC.map(sys+0x240,24)) do local component=TLC.weak(a+8);if component then out[#out+1]=component end end end
 return out
end
local tankTypes={[1]=true,[2]=true,[3]=true,[4]=true,[10]=true,[11]=true,[12]=true,[16]=true,[17]=true}
TLC.F.fullTank={on=function()TLC.need()end,task=function()
 if TLC.lastTankTick and getTickCount()-TLC.lastTankTick&lt;1000 then return end;TLC.lastTankTick=getTickCount()
 for _,m in ipairs(TLC.modules()) do
  if TLC.valid(m) then for _,a in ipairs(TLC.map(m+0x920,24)) do local typ=readBytes(a,1);if tankTypes[typ] then local maximum=TLC.moduleMax(m,typ);if maximum&gt;0 then writeDouble(a+8,maximum) end end end end
 end
end}
TLC.F.boat={on=function()TLC.need()end,task=function()
 if TLC.lastBoatTick and getTickCount()-TLC.lastBoatTick&lt;1000 then return end;TLC.lastBoatTick=getTickCount()
 for _,m in ipairs(TLC.modules()) do local owner=q(m+0x20)
  if owner and U.isA(owner,'VoyageBoatPawn') then local destruction=q(m+0xd68);if destruction and U.isA(destruction,'VoyageDestructibleObjectComponent') then TLC.changed(destruction+0xd0,'byte',0,destruction,'boat') end end
 end
end}

function TLC.levelScript()
 local w=TLC.world();if not w then return end;local levels=q(w+0x1c8);local n=i(w+0x1d0)
 if not levels or not n or n&gt;10000 then return end
 for k=0,n-1 do local level=q(levels+k*8);local script=level and q(level+0xf8);if script and U.isA(script,'VoyageLevelScriptActor') then return script end end
end

function TLC.weatherSystem(done)
 local w=TLC.world();if not w then TLC.need() end
 if TLC.weatherObject and TLC.weatherWorld==w and TLC.valid(TLC.weatherObject) then done(TLC.weatherObject);return end
 local cls=q(rip(TLC.A.WeatherClass));assert(cls,'Weather class unavailable')
 TLC.job(TLC.A.WorldSubsystemGet,{w+0x9e8,cls},w,function(o)
  if not TLC.valid(o) or not U.isA(o,'VoyageWeatherSubsystem') then TLC.err('Weather subsystem unavailable.','天候サブシステムを取得できません。') end
  TLC.weatherObject=o;TLC.weatherWorld=w;writeQword(TLC.base()+0x230,o+0x218);done(o)
 end)
end
function TLC.applyWorldFreeze(o)
 if not TLC.valid(o) then return end
 if TLC.featOn.noon then writeFloat(o+0x220,12) elseif TLC.featOn.time then writeFloat(o+0x220,f(TLC.var(0x2c))) end
 if TLC.featOn.weather and TLC.selectedWeather then for off=0,52,4 do writeInteger(o+0x238+off,i(TLC.base()+0xb00+off)) end end
end
TLC.F.noon={flag=17,hooks={'worldFreeze'},on=function()TLC.weatherSystem(function(o)TLC.applyWorldFreeze(o)end)end,task=function()local o=TLC.weatherObject;if o then TLC.applyWorldFreeze(o) end end}
TLC.F.time={flag=16,hooks={'worldFreeze'},on=function()TLC.weatherSystem(function(o)TLC.applyWorldFreeze(o)end)end,task=function()local o=TLC.weatherObject;if o then TLC.applyWorldFreeze(o) end end}
TLC.F.weather={flag=18,hooks={'worldFreeze'},on=function()if not TLC.selectedWeather then TLC.err('Select a weather preset first.','先に天候プリセットを指定してください。') end;TLC.weatherSystem(function(o)TLC.applyWorldFreeze(o)end)end,task=function()local o=TLC.weatherObject;if o then TLC.applyWorldFreeze(o) end end}
function TLC.loadAsset(path,done)
 TLC.need();local payload=TLC.base()+0x800;local buf=payload+0x100;assert(#path&lt;400)
 for off=0,0x3f do writeBytes(payload+off,0) end
 writeString(buf,path,true);writeSmallInteger(buf+#path*2,0);writeQword(payload+0x20,buf);writeInteger(payload+0x28,#path)
 TLC.job(TLC.A.SoftPathSet,{payload,payload+0x20},nil,function()
  TLC.job(TLC.A.SoftPathLoad,{payload,0,0},nil,function(o)if not TLC.valid(o) then TLC.err('Asset loading failed.','データの読み込みに失敗しました。') end;done(o)end)
 end)
end
function TLC.weatherPick()
 TLC.require();local names={};for _,x in ipairs(TLC.WEATHER)do names[#names+1]=x.label end
 local n=TLC.pick(TLC.T('Weather preset','天候プリセット'),names);if not n then return end
 TLC.loadAsset(TLC.WEATHER[n].path,function(asset)
  TLC.weatherSystem(function(o)
   local base=TLC.base()+0xb00;local mask=readBytes(asset+0x90,1)
   for off=0,52,4 do writeInteger(base+off,i(o+0x238+off)) end
   for _,x in ipairs({{1,{8,12,16}},{2,{20}},{128,{24}},{4,{28}},{8,{32}},{16,{48,52}}})do
    if (mask&amp;x[1])~=0 then for _,off in ipairs(x[2])do writeInteger(base+off,i(asset+0x98+off)) end end
   end
   TLC.selectedWeather=TLC.WEATHER[n].label
   for off=0,52,4 do writeInteger(o+0x238+off,i(base+off)) end
   TLC.msg('Weather preset applied: '..TLC.selectedWeather,'天候プリセットを適用: '..TLC.selectedWeather)
  end)
 end)
end

function TLC.steamAchievementExports(module)
  local base,size=TLC.mod(module),TLC.modSize(module)
  if not base or not size or size&lt;=0 then TLC.err('Steam API is not loaded. Start the game through Steam.','Steam APIが読み込まれていません。Steamからゲームを起動してください。') end
  local function at(rva,n)
    assert(type(rva)=='number' and rva&gt;=0 and rva+(n or 4)&lt;=size,'Invalid Steam API export layout')
    return base+rva
  end
  local function uint(rva)
    local n=readInteger(at(rva,4));assert(n,'Unreadable Steam API export layout');return n&amp;0xFFFFFFFF
  end
  local nt=uint(0x3C)
  assert(readSmallInteger(base)==0x5A4D and uint(nt)==0x4550 and readSmallInteger(at(nt+0x18,2))==0x20B,'Invalid Steam API PE header')
  local dir,dirSize=uint(nt+0x88),uint(nt+0x8C)
  at(dir,40);assert(dir&gt;0 and dirSize&gt;0,'Missing Steam API export directory')
  local functions,names=uint(dir+0x14),uint(dir+0x18)
  assert(functions&gt;0 and functions&lt;=65536 and names&gt;0 and names&lt;=65536,'Invalid Steam API export count')
  local ft,ntable,ord=uint(dir+0x1C),uint(dir+0x20),uint(dir+0x24)
  at(ft,functions*4);at(ntable,names*4);at(ord,names*2)
  local exports={}
  for i=0,names-1 do
    local nameRva=uint(ntable+i*4)
    local name=readString(at(nameRva,1),math.min(256,size-nameRva),false)
    if name and name:find('SteamAPI_',1,true)==1 then
      local index=readSmallInteger(at(ord+i*2,2))
      assert(index and (index&amp;0xFFFF)&lt;functions,'Invalid Steam API export ordinal')
      local rva=uint(ft+(index&amp;0xFFFF)*4)
      if rva&gt;0 and not (rva&gt;=dir and rva&lt;dir+dirSize) then exports[name]=at(rva,1) end
    end
  end
  return exports,base,size
end


function TLC.steamInfo(done)
 TLC.require();local ex=TLC.steamAchievementExports('steam_api64.dll')
 local ns={stats='SteamAPI_SteamUserStats_v013',utils='SteamAPI_SteamUtils_v010',app='SteamAPI_ISteamUtils_GetAppID',count='SteamAPI_ISteamUserStats_GetNumAchievements',name='SteamAPI_ISteamUserStats_GetAchievementName',get='SteamAPI_ISteamUserStats_GetAchievement',set='SteamAPI_ISteamUserStats_SetAchievement',store='SteamAPI_ISteamUserStats_StoreStats'}
 local api={};TLC.nativeCallAllowlist141={};for key,n in pairs(ns)do api[key]=assert(ex[n],'Steam API export missing: '..n);TLC.nativeCallAllowlist141[api[key]]=true end
 TLC.job(api.utils,{},nil,function(utils)
  assert(utils~=0,'Steam utils are not ready')
  TLC.job(api.app,{utils},nil,function(appid)
   if appid~=1783560 then TLC.err('Steam AppID does not match The Last Caretaker.','Steam AppIDがThe Last Caretakerと一致しません。') end
   TLC.job(api.stats,{},nil,function(stats)
    assert(stats~=0,'Steam user stats are not ready');api.instance=stats
    TLC.job(api.count,{stats},nil,function(count)assert(count&gt;0 and count&lt;=1000,'Invalid achievement count');api.countValue=count;done(api)end)
   end)
  end)
 end)
end
function TLC.unlockAchievements()
 TLC.require()
 TLC.steamInfo(function(api)
  local index=0;local count=api.countValue;local succeeded=0
  local function step()
   if index&gt;=count then TLC.job(api.store,{api.instance},nil,function(ok)
    TLC.msg('SetAchievement accepted: '..succeeded..' / '..count..'; StoreStats accepted: '..tostring((ok&amp;255)~=0)..'. Server confirmation is not verified.','実績設定の受付: '..succeeded..' / '..count..'／Steam保存の受付: '..tostring((ok&amp;255)~=0)..'。サーバー反映は未確認です。')
   end);return end
   TLC.job(api.name,{api.instance,index},nil,function(nameptr)
    assert(nameptr~=0,'Achievement name is missing');local name=readString(nameptr,256,false);assert(name and #name&gt;0 and #name&lt;200,'Invalid achievement name')
    local buf=TLC.base()+0xe00;writeString(buf,name);writeBytes(buf+#name,0)
    TLC.job(api.set,{api.instance,buf},nil,function(ok)if (ok&amp;255)~=0 then succeeded=succeeded+1 end;index=index+1;step()end)
   end)
  end
  step()
 end)
end

local requireCommon=TLC.require
function TLC.require()
 if not TLC.pid or getProcessIDFromProcessName(TLC.EXE)~=TLC.pid or getOpenedProcessID()~=TLC.pid then TLC.err('Run ATTACH / ALL OFF first.','先にアタッチ／一括解除を実行してください。') end
 requireCommon();if not TLC.hookState.gameTick then TLC.hookOn('gameTick') end;TLC.startTimer()
end
TLC.F.float.task=function()
 local p=TLC.player();local m=p and q(p+0x330)
 if TLC.valid(m) and isKeyPressed(VK_SPACE) then
  writeDouble(m+0x5f0,readDouble(m+0xd8));writeDouble(m+0x5f8,readDouble(m+0xe0));writeDouble(m+0x600,f(TLC.var(0x28)))
 end
end

function TLC.setQuantity(inv,slot,name,old,new,done)
 TLC.require();assert(new&gt;=0 and new&lt;=999999 and new%1==0,'Quantity must be an integer from 0 to 999999')
 if old==new then return end
 local found;for _,x in ipairs(TLC.CATALOG)do if x.label==name then if found and found.path~=x.path then TLC.err('Ambiguous item asset.','アイテム定義が一意に決まりません。') end;found=x end end
 if not found then TLC.err('This item is not in the verified catalog.','このアイテムは照合済みの一覧にありません。') end
 TLC.loadAsset(found.path,function(item)
  if new&lt;old then
   writeBytes(TLC.flag(0x15),1)
   TLC.job(TLC.A.InventoryRemove,{inv,item,old-new,slot,1},{inv,item},function(changed)
    writeBytes(TLC.flag(0x15),0);TLC.msg('Quantity decrease accepted: '..changed,'個数減少の受付: '..changed);if done then done() end
   end)
  else
   local data=TLC.base()+0x840
   TLC.job(TLC.A.ItemDataCtor,{data},inv,function()
    writeInteger(data,new-old);TLC.job(TLC.A.InventoryAddSlot,{inv,item,slot,data,1},{inv,item},function(changed)
     TLC.msg('Quantity increase accepted: '..changed,'個数増加の受付: '..changed);if done then done() end
    end)
   end)
  end
 end)
end

local commonHookOn=TLC.hookOn
function TLC.hookOn(name)
 if not TLC.hookState[name] then
  local h=assert(TLC.HOOKS[name]);local a=assert(TLC.resolveSig(h.sig),'Signature unavailable: '..h.sig)
  local sig=TLC.SIGS[h.sig];local length=sig.len or 5
  -- An owned patch may intersect the verification window, but two separate
  -- hooks must never overwrite the same machine instructions.
  for other,state in pairs(TLC.hookState)do
   if state.addr and state.orig and a&lt;state.addr+#state.orig and state.addr&lt;a+length then
    error('Hook instruction range conflicts with active feature: '..name..' / '..other,0)
   end
  end
  assert(TLC.originalView043(a,sig.bytes),'Hook site was modified by an unowned patch: '..name)
 end
 commonHookOn(name);local st=TLC.hookState[name];st.patch=readBytes(st.addr,#st.orig,true)
end
local commonHookOff=TLC.hookOff
function TLC.hookOff(name)
 local st=TLC.hookState[name]
 if st and TLC.attached() and st.patch and not eq(st.addr,st.patch) and not eq(st.addr,st.orig) then TLC.err('Patch ownership conflict: '..name,'他の変更と競合しているため復元を中止: '..name) end
 commonHookOff(name)
end
function TLC.scanSelfTest()
 TLC.require();local passed,failed=0,0
 for n,s in pairs(TLC.SIGS)do
  local a=TLC.resolveSig(n);local good=a and eq(a,s.bytes)
  if not good then for _,st in pairs(TLC.hookState)do if st.addr==a and st.patch and eq(a,st.patch) then good=true end end end
  if good then passed=passed+1 else failed=failed+1;TLC.msg('Signature failed: '..n,'シグネチャ検証失敗: '..n) end
 end
 TLC.msg('Signatures verified: '..passed..'; failed: '..failed,'シグネチャ検証: 成功 '..passed..'／失敗 '..failed)
 return passed,failed
end


TLC.HOOKS.capture={sig='Weight',aa=[==[
[ENABLE]
alloc(tlc_capture,$2000,$SITE)
label(tlc_capture_ret)
label(tlc_capture_normal)
tlc_capture:
pushfq
cmp byte ptr [tlcFlags+3],0
je tlc_capture_normal
popfq
xorps xmm0,xmm0
ret
tlc_capture_normal:
popfq
$ORIG
jmp tlc_capture_ret

$SITE:
jmp tlc_capture
$NOP
tlc_capture_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_capture)
]==]}

TLC.HOOKS.gameTick={sig='GameTick',aa=[==[
[ENABLE]
alloc(tlc_gameTick,$2000,$SITE)
label(tlc_gameTick_ret)
tlc_gameTick:
call tlc_dispatch
$ORIG
jmp tlc_gameTick_ret

label(tlc_dispatch)
label(tlc_job_end)
label(tlc_job_fail)

label(tlc_do_job)
label(tlc_job_guard2)
tlc_dispatch:
pushfq
push rax
push rcx
push rdx
push r8
push r9
push r10
push r11
sub rsp,A8
movdqu [rsp+40],xmm0
movdqu [rsp+50],xmm1
movdqu [rsp+60],xmm2
movdqu [rsp+70],xmm3
movdqu [rsp+80],xmm4
movdqu [rsp+90],xmm5
cmp dword ptr [tlcFlags+500],1
jne tlc_job_end
call GetCurrentThreadId
cmp eax,[tlcGameThreadId]
jne tlc_job_end
mov rax,[tlcEngine]
test rax,rax
je tlc_job_fail
mov rax,[rax+D78]
test rax,rax
je tlc_job_fail
mov rax,[rax+78]
test rax,rax
je tlc_job_fail
mov rax,[rax+228]
test rax,rax
je tlc_job_fail
mov rax,[rax+38]
test rax,rax
je tlc_job_fail
mov rax,[rax]
test rax,rax
je tlc_job_fail
mov rax,[rax+30]
test rax,rax
je tlc_job_fail
mov rax,[rax+350]
cmp rax,[tlcFlags+508]
jne tlc_job_fail
mov ecx,[tlcFlags+510]
cmp ecx,[tlcObjectCount072]
jae tlc_job_fail
mov r8,[tlcObjects]
mov edx,ecx
shr ecx,10
and edx,FFFF
mov r8,[r8+rcx*8]
imul rdx,rdx,18
cmp [r8+rdx+08],rax
jne tlc_job_fail
mov ecx,[tlcFlags+514]
cmp [r8+rdx+10],ecx
jne tlc_job_fail
mov rax,[tlcFlags+518]
test rax,rax
je tlc_job_guard2
mov ecx,[tlcFlags+520]
cmp ecx,[tlcObjectCount072]
jae tlc_job_fail
mov r8,[tlcObjects]
mov edx,ecx
shr ecx,10
and edx,FFFF
mov r8,[r8+rcx*8]
imul rdx,rdx,18
cmp [r8+rdx+08],rax
jne tlc_job_fail
mov ecx,[tlcFlags+524]
cmp [r8+rdx+10],ecx
jne tlc_job_fail
tlc_job_guard2:
mov rax,[tlcFlags+590]
test rax,rax
je tlc_do_job
mov ecx,[tlcFlags+598]
cmp ecx,[tlcObjectCount072]
jae tlc_job_fail
mov r8,[tlcObjects]
mov edx,ecx
shr ecx,10
and edx,FFFF
mov r8,[r8+rcx*8]
imul rdx,rdx,18
cmp [r8+rdx+08],rax
jne tlc_job_fail
mov ecx,[tlcFlags+59C]
cmp [r8+rdx+10],ecx
jne tlc_job_fail
test dword ptr [rax+08],18000
jne tlc_job_fail
tlc_do_job:
mov dword ptr [tlcFlags+500],2
mov rcx,[tlcFlags+530]
mov rdx,[tlcFlags+538]
mov r8,[tlcFlags+540]
mov r9,[tlcFlags+548]
mov rax,[tlcFlags+550]
mov [rsp+20],rax
mov rax,[tlcFlags+558]
mov [rsp+28],rax
movq xmm1,[tlcFlags+568]
movq xmm2,[tlcFlags+570]
movq xmm3,[tlcFlags+578]
call qword ptr [tlcFlags+528]
mov [tlcFlags+580],rax
movq [tlcFlags+588],xmm0
mov dword ptr [tlcFlags+500],3
jmp tlc_job_end
tlc_job_fail:
mov dword ptr [tlcFlags+500],4
tlc_job_end:
movdqu xmm0,[rsp+40]
movdqu xmm1,[rsp+50]
movdqu xmm2,[rsp+60]
movdqu xmm3,[rsp+70]
movdqu xmm4,[rsp+80]
movdqu xmm5,[rsp+90]
add rsp,A8
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
popfq
ret

$SITE:
jmp tlc_gameTick
$NOP
tlc_gameTick_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_gameTick)
]==]}

TLC.HOOKS.attributes={sig='AttributeChange',aa=[==[
[ENABLE]
alloc(tlc_attributes,$2000,$SITE)
label(tlc_attributes_ret)
label(tlc_attributes_done)
label(tlc_attributes_battery)
label(tlc_attributes_player)
label(tlc_attributes_classloop)
label(tlc_attributes_hit)
label(tlc_attributes_npc_end)
tlc_attributes:
pushfq
cmp rcx,[tlcPtrs+08]
je tlc_attributes_player
cmp byte ptr [tlcFlags+07],0
je tlc_attributes_done
cmp dl,08
jne tlc_attributes_done
push rax
push r10
push r11
movd r10d,xmm2
test r10d,80000000
je tlc_attributes_npc_end
mov rax,[rcx+20]
test rax,rax
je tlc_attributes_npc_end
mov rax,[rax+10]
mov r10,[tlcNpcClassSlot]
mov r11d,40
tlc_attributes_classloop:
test rax,rax
je tlc_attributes_npc_end
cmp rax,r10
je tlc_attributes_hit
mov rax,[rax+40]
dec r11d
jne tlc_attributes_classloop
jmp tlc_attributes_npc_end
tlc_attributes_hit:
movss xmm2,[tlcVars+3C]
tlc_attributes_npc_end:
pop r11
pop r10
pop rax
jmp tlc_attributes_done
tlc_attributes_player: 
cmp dl,08
jne tlc_attributes_battery
cmp byte ptr [tlcFlags+1],0
je tlc_attributes_done
xorps xmm2,xmm2
jmp tlc_attributes_done
tlc_attributes_battery:
cmp dl,0A
jne tlc_attributes_done
cmp byte ptr [tlcFlags+2],0
je tlc_attributes_done
xorps xmm2,xmm2
tlc_attributes_done:
popfq
$ORIG
jmp tlc_attributes_ret
$SITE:
jmp tlc_attributes
$NOP
tlc_attributes_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_attributes)
]==]}

TLC.HOOKS.attributeSet={sig='AttributeSet',aa=[==[
[ENABLE]
alloc(tlc_attributeSet,$2000,$SITE)
label(tlc_attributeSet_ret)
label(tlc_attributeSet_bat)
label(tlc_attributeSet_done)
tlc_attributeSet:
pushfq
cmp rcx,[tlcPtrs+10]
jne tlc_attributeSet_bat
cmp byte ptr [tlcFlags+1],0
je tlc_attributeSet_done
movss xmm1,[rcx+0C]
jmp tlc_attributeSet_done
tlc_attributeSet_bat:
cmp rcx,[tlcPtrs+18]
jne tlc_attributeSet_done
cmp byte ptr [tlcFlags+2],0
je tlc_attributeSet_done
movss xmm1,[rcx+0C]
tlc_attributeSet_done:
popfq
$ORIG
jmp tlc_attributeSet_ret
$SITE:
jmp tlc_attributeSet
$NOP
tlc_attributeSet_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_attributeSet)
]==]}

TLC.HOOKS.exp={sig='Exp',aa=[==[
[ENABLE]
alloc(tlc_exp,$2000,$SITE)
label(tlc_exp_ret)
tlc_exp:
pushfq
cmp byte ptr [tlcFlags+4],0
je tlc_exp_orig
push rax
sub rsp,10
movdqu [rsp],xmm0
cvtsi2ss xmm0,[rdx+04]
mulss xmm0,[tlcVars+34]
cvttss2si eax,xmm0
mov [rdx+04],eax
movdqu xmm0,[rsp]
add rsp,10
pop rax
tlc_exp_orig:
popfq
$ORIG
jmp tlc_exp_ret
$SITE:
jmp tlc_exp
$NOP
tlc_exp_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_exp)
]==]}

TLC.HOOKS.craftTime={sig='CraftTime',aa=[==[
[ENABLE]
alloc(tlc_craftTime,$2000,$SITE)
label(tlc_craftTime_ret)
label(tlc_craftTime_notnull)
label(tlc_craftTime_zero)
tlc_craftTime:
pushfq
cmp byte ptr [tlcFlags+5],0
jne tlc_craftTime_zero
popfq
test rdx,rdx
jne tlc_craftTime_notnull
xorps xmm0,xmm0
ret
tlc_craftTime_notnull:
jmp tlc_craftTime_ret
tlc_craftTime_zero:
popfq
movss xmm0,[tlcVars+48]
ret
$SITE:
jmp tlc_craftTime
$NOP
tlc_craftTime_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_craftTime)
]==]}

TLC.HOOKS.craftPower={sig='CraftElectricity',aa=[==[
[ENABLE]
alloc(tlc_craftPower,$2000,$SITE)
label(tlc_craftPower_ret)
label(tlc_craftPower_notnull)
label(tlc_craftPower_zero)
tlc_craftPower:
pushfq
cmp byte ptr [tlcFlags+6],0
jne tlc_craftPower_zero
popfq
test rdx,rdx
jne tlc_craftPower_notnull
xorps xmm0,xmm0
ret
tlc_craftPower_notnull:
jmp tlc_craftPower_ret
tlc_craftPower_zero:
popfq
xorps xmm0,xmm0
ret
$SITE:
jmp tlc_craftPower
$NOP
tlc_craftPower_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_craftPower)
]==]}

TLC.HOOKS.weightInventory={sig='InventoryWeight',aa=[==[
[ENABLE]
alloc(tlc_weightInventory,$2000,$SITE)
label(tlc_weightInventory_ret)
label(tlc_weightInventory_done)
tlc_weightInventory:
pushfq
cmp byte ptr [tlcFlags+3],0
je tlc_weightInventory_done
cmp rcx,[tlcPtrs+20]
jne tlc_weightInventory_done
popfq
xorps xmm0,xmm0
ret
tlc_weightInventory_done:
popfq
$ORIG
jmp tlc_weightInventory_ret
$SITE:
jmp tlc_weightInventory
$NOP
tlc_weightInventory_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_weightInventory)
]==]}

TLC.HOOKS.consumption={sig='ConsumptionMultiplier',aa=[==[
[ENABLE]
alloc(tlc_consumption,$2000,$SITE)
label(tlc_consumption_ret)
label(tlc_consumption_normal)
label(tlc_consumption_zero)
label(tlc_consumption_liquid)
label(tlc_consumption_fuel)
label(tlc_consumption_tank)
tlc_consumption:
pushfq
cmp dl,0
jne tlc_consumption_liquid
cmp byte ptr [tlcFlags+09],0
jne tlc_consumption_zero
jmp tlc_consumption_normal
tlc_consumption_liquid:
cmp dl,01
je tlc_consumption_fuel
cmp dl,10
jne tlc_consumption_tank
tlc_consumption_fuel:
cmp byte ptr [tlcFlags+08],0
jne tlc_consumption_zero
tlc_consumption_tank:
cmp byte ptr [tlcFlags+0A],0
je tlc_consumption_normal
cmp dl,05
je tlc_consumption_normal
cmp dl,06
je tlc_consumption_normal
cmp dl,07
jb tlc_consumption_zero
cmp dl,0A
jb tlc_consumption_normal
cmp dl,0D
jb tlc_consumption_zero
cmp dl,10
jae tlc_consumption_zero
jmp tlc_consumption_normal
tlc_consumption_zero:
popfq
xorps xmm0,xmm0
ret
tlc_consumption_normal:
popfq
$ORIG
jmp tlc_consumption_ret
$SITE:
jmp tlc_consumption
$NOP
tlc_consumption_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_consumption)
]==]}

TLC.HOOKS.ammoStore={sig='AmmoStore',aa=[==[
[ENABLE]
alloc(tlc_ammoStore,$2000,$SITE)
label(tlc_ammoStore_ret)
label(tlc_ammoStore_done)
tlc_ammoStore:
pushfq
cmp byte ptr [tlcFlags+0B],0
je tlc_ammoStore_done
push rax
mov rax,[rsi+158]
cmp rax,[tlcPtrs]
pop rax
jne tlc_ammoStore_done
cmp ebx,edx
jge tlc_ammoStore_done
mov ebx,edx
mov r8d,ebx
tlc_ammoStore_done:
popfq
$ORIG
jmp tlc_ammoStore_ret
$SITE:
jmp tlc_ammoStore
$NOP
tlc_ammoStore_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_ammoStore)
]==]}

TLC.HOOKS.ammoInventory={sig='InventoryRemove',aa=[==[
[ENABLE]
alloc(tlc_ammoInventory,$2000,$SITE)
label(tlc_ammoInventory_ret)
label(tlc_ammoInventory_normal)
label(tlc_ammoInventory_scope)
label(tlc_ammoInventory_yes)
tlc_ammoInventory:
pushfq
cmp byte ptr [tlcFlags+15],0
jne tlc_ammoInventory_normal
cmp byte ptr [tlcFlags+0B],0
je tlc_ammoInventory_normal
cmp rcx,[tlcPtrs+20]
je tlc_ammoInventory_scope
cmp rcx,[tlcPtrs+28]
jne tlc_ammoInventory_normal
tlc_ammoInventory_scope:
test rdx,rdx
je tlc_ammoInventory_normal
cmp byte ptr [rdx+B0],09
je tlc_ammoInventory_yes
cmp byte ptr [rdx+B0],0B
jne tlc_ammoInventory_normal
tlc_ammoInventory_yes:
popfq
mov eax,r8d
ret
tlc_ammoInventory_normal:
popfq
$ORIG
jmp tlc_ammoInventory_ret
$SITE:
jmp tlc_ammoInventory
$NOP
tlc_ammoInventory_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_ammoInventory)
]==]}

TLC.HOOKS.materials={sig='MaterialsResult',aa=[==[
[ENABLE]
alloc(tlc_materials,$2000,$SITE)
label(tlc_materials_ret)
label(tlc_materials_done)
label(tlc_materials_maps)
label(tlc_materials_hashloop)
label(tlc_materials_hashready)
label(tlc_materials_next)
tlc_materials:
pushfq
cmp byte ptr [tlcFlags+0C],0
je tlc_materials_done
push rax
push rcx
push rdx
push r8
push r9
mov r8,rsi
mov r9d,02
tlc_materials_maps:
mov dword ptr [r8+08],0
mov dword ptr [r8+28],0
mov dword ptr [r8+30],FFFFFFFF
mov dword ptr [r8+34],0
mov rcx,[r8+40]
test rcx,rcx
jne tlc_materials_hashready
lea rcx,[r8+38]
tlc_materials_hashready:
mov edx,[r8+48]
test edx,edx
je tlc_materials_next
tlc_materials_hashloop:
dec edx
mov dword ptr [rcx+rdx*4],FFFFFFFF
test edx,edx
jne tlc_materials_hashloop
tlc_materials_next:
add r8,50
dec r9d
jne tlc_materials_maps
pop r9
pop r8
pop rdx
pop rcx
pop rax
tlc_materials_done:
popfq
$ORIG
jmp tlc_materials_ret
$SITE:
jmp tlc_materials
$NOP
tlc_materials_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_materials)
]==]}

TLC.HOOKS.worldFreeze={sig='WorldStateCopyEnd',aa=[==[
[ENABLE]
alloc(tlc_worldFreeze,$2000,$SITE)
label(tlc_worldFreeze_ret)
label(tlc_worldFreeze_done)
label(tlc_worldFreeze_time)
label(tlc_worldFreeze_weather)
label(tlc_worldFreeze_copy)
label(tlc_worldFreeze_pop)
tlc_worldFreeze:
pushfq
cmp rdi,[tlcPtrs+30]
jne tlc_worldFreeze_done
push rax
push rcx
push rdx
cmp byte ptr [tlcFlags+11],0
je tlc_worldFreeze_time
mov eax,(float)12
mov [rdi+08],eax
jmp tlc_worldFreeze_weather
tlc_worldFreeze_time:
cmp byte ptr [tlcFlags+10],0
je tlc_worldFreeze_weather
mov eax,[tlcVars+2C]
mov [rdi+08],eax
tlc_worldFreeze_weather:
cmp byte ptr [tlcFlags+12],0
je tlc_worldFreeze_pop
xor ecx,ecx
tlc_worldFreeze_copy:
mov edx,[tlcFlags+B00+rcx]
mov [rdi+20+rcx],edx
add ecx,04
cmp ecx,38
jb tlc_worldFreeze_copy
tlc_worldFreeze_pop:
pop rdx
pop rcx
pop rax
tlc_worldFreeze_done:
popfq
$ORIG
jmp tlc_worldFreeze_ret
$SITE:
jmp tlc_worldFreeze
$NOP
tlc_worldFreeze_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_worldFreeze)
]==]}

-- Recovery is performed once per failed identifier per attachment. No global UObject scan.
TLC.resolution={};TLC.failures={};TLC.searchCount=0
local function q(a) return a and a&gt;0 and readQword(a) or nil end
local function same(a,t)
 if not a then return false end;local b=readBytes(a,#t,true);if not b then return false end
 for k=1,#t do if b[k]~=t[k] then return false end end;return true
end
function TLC.reason(n,s)
 TLC.failures[n]=s
 TLC.msg(n..': '..s,n..': '..s)
end
function TLC.missing(n)
 return TLC.T('Unavailable: ','利用不可: ')..n..' / '..(TLC.failures[n] or TLC.T('Not resolved','未解決'))
end
function TLC.refClass(name)
 if TLC.findMetadata074 then return TLC.findMetadata074(name,'Class')end
end
function TLC.refFieldLayout(obj,name,isClass)
 if not TLC.valid(obj) then return end
 if isClass then
  local expected=isClass==true and'Class'or isClass=='struct'and'ScriptStruct'or isClass=='function'and'Function'
  if not expected or TLC.U.c(obj)~=expected then return end
 end
 local c=isClass and obj or q(obj+0x10)
 for depth=1,64 do
  if not TLC.valid(c) then return end
  local f=q(c+0x50);local seen={}
  for k=1,1024 do
   if not f or f==0 or seen[f] then break end;seen[f]=true
   if TLC.U.name(readInteger(f+0x20)):lower()==name:lower() then
    local off=readInteger(f+0x44);local size=readInteger(f+0x34)
    if off and size and off&gt;=0 and off&lt;0x10000 and size&gt;0 and size&lt;0x10000 then return off,size end
   end
   f=q(f+0x18)
  end
  c=q(c+0x40)
 end
end
function TLC.refOffset(obj,name)
 local off=TLC.refFieldLayout(obj,name,false);return off
end
function TLC.refCode(n)
 if not TLC.U.go or not TLC.U.gn then return nil,'reflection globals unavailable' end
 local hints=TLC.REF_HINTS[n];if not hints then return nil,'no reflected function for this native site' end
 local candidates={};local b=TLC.moduleRequired();local s=TLC.SIGS[n]
 for _,h in ipairs(hints)do
  local c=TLC.refClass(h.owner);local fn=c and q(c+0x48);local seen={}
  for k=1,1024 do
   if not fn or fn==0 or seen[fn] or not TLC.valid(fn) then break end;seen[fn]=true
   if TLC.U.n(fn)==h.fn and TLC.U.c(fn)=='Function' then
    local native=q(fn+0xd8);local site=native and native+h.delta
    if site and TLC.executable038(site,5) and readBytes(site,1)==0xe8 then
     local rel=readInteger(site+1);if rel then if rel&gt;=0x80000000 then rel=rel-0x100000000 end
      local dest=site+5+rel
      if TLC.executable038(dest,#s.bytes) and same(dest,s.bytes) then candidates[dest]=true end
     end
    end
   end
   fn=q(fn+0x28)
  end
 end
 local out;local count=0;for a in pairs(candidates)do out=a;count=count+1 end
 if count==1 then return out end
 return nil,count&gt;1 and 'ambiguous reflection targets' or 'reflected native target not verified'
end
function TLC.resolveSig(n)
 if TLC.A[n] then return TLC.A[n] end
 if TLC.resolution[n] then return nil end
 local s=TLC.SIGS[n];if not s then TLC.reason(n,'unknown signature');return end
 local b=TLC.moduleRequired();local a=rawget(TLC.A,n)
 local method='RVA'
 if not same(a,s.bytes) then
  TLC.searchCount=TLC.searchCount+1;local candidates={};local ambiguous=false
  -- Scan only this failed identifier; cap matches at two and reject ambiguity.
  local function scan(lo,hi)
   local matches=TLC.aobAll(s.p,lo,hi,2)
   if #matches&gt;1 then ambiguous=true;return end
   if #matches==1 and same(matches[1],s.bytes) then candidates[matches[1]]=true end
  end
  local ok,why=pcall(function()
   scan(math.max(b+0x1000,(a or b)-0x10000),math.min(b+0x8b45000,(a or b)+0x10000))
   -- A full text-section scan occurs only on a failed RVA and failed local scan.
   if not next(candidates) and not ambiguous then scan(b+0x1000,b+0x8b45000) end
  end)
  local found;local count=0;for x in pairs(candidates)do found=x;count=count+1 end
  if ok and count==1 and not ambiguous then a=found;method='AOB'
  else
   local ref,whyRef=TLC.refCode(n)
   if ref and not ambiguous then a=ref;method='reflection'
   else
    local patched=a and readBytes(a,1)==0xe9
    local reason=(patched and 'original code replaced by a JMP; ' or '')..(not ok and ('AOB error: '..tostring(why)) or ambiguous and 'AOB ambiguous (2 or more matches)' or 'AOB not found')..'; '..tostring(whyRef or 'ambiguous target rejected')
    TLC.resolution[n]='failed';TLC.pend[n]=true;TLC.reason(n,reason);return
   end
  end
 end
 TLC.A[n]=a;TLC.resolution[n]=method;TLC.pend[n]=nil;TLC.failures[n]=nil
 registerSymbol('tlcA_'..n,a,true);return a
end
function TLC.requireSigs(names)
 for _,n in ipairs(names)do if not TLC.resolveSig(n) then error(TLC.missing(n),0) end end
end
function TLC.resolveAll()
 local good,bad=0,0
 -- Bootstrap name/object metadata before any reflected fallback is attempted.
 for _,n in ipairs({'Objects','Names','Engine'})do
  local a=TLC.resolveSig(n)
  if a then local rel=readInteger(a+3);if rel then if rel&gt;=0x80000000 then rel=rel-0x100000000 end;TLC.U[n=='Objects' and 'go' or n=='Names' and 'gn' or 'ge']=a+7+rel end end
 end
 for n in pairs(TLC.SIGS)do if TLC.resolveSig(n) then good=good+1 else bad=bad+1 end end
 TLC.msg(('Code verified %d; unavailable %d; fallback searches %d'):format(good,bad,TLC.searchCount),('コード確認 %d件／利用不可 %d件／再探索 %d件'):format(good,bad,TLC.searchCount))
 return good,bad
end
local forget=TLC.forgetProcess
function TLC.forgetProcess()
 forget();TLC.resolution={};TLC.failures={};TLC.searchCount=0;TLC.moduleCache=nil
end
function TLC.onAttach()
 local u=TLC.U
 if u.go then registerSymbol('tlcObjects',u.go,true) end
 if u.gc then registerSymbol('tlcObjectCount072',u.gc,true)end
 if u.ge then registerSymbol('tlcEngine',u.ge,true) end
 local a=rawget(TLC.A,'NPCClass')
 if a then local d=readInteger(a+3);if d&gt;=0x80000000 then d=d-0x100000000 end;registerSymbol('tlcNpcClassSlot',a+7+d,true) end
 a=rawget(TLC.A,'GameThread')
 if a then local d=readInteger(a+2);if d&gt;=0x80000000 then d=d-0x100000000 end;registerSymbol('tlcGameThreadId',a+6+d,true) end
 TLC.edits={}
 TLC.msg('Attached. Only features with verified dependencies are available.','接続済み。依存先を確認できた機能のみ利用できます。')
end
function TLC.require()
 if not TLC.attached() or getProcessIDFromProcessName(TLC.EXE)~=TLC.pid then error(TLC.T('Run ATTACH first.','先にアタッチを実行してください。'),0) end
 TLC.startTimer()
end
local world=TLC.world
function TLC.world()
 if not TLC.U.go or not TLC.U.gn or not TLC.U.ge then return nil end
 local w=world();if w then return w end
 local e=q(TLC.U.ge);local off=e and TLC.refOffset(e,'GameViewport');local v=off and q(e+off)
 local wo=v and TLC.refOffset(v,'World');w=wo and q(v+wo)
 if TLC.valid(w) and TLC.U.c(w)=='World' then return w end
end
local player=TLC.player
function TLC.player(required)
 local p=player(false);if p then return p end
 local w=TLC.world();local giOff=w and TLC.refOffset(w,'OwningGameInstance');local gi=giOff and q(w+giOff)
 local lOff=gi and TLC.refOffset(gi,'LocalPlayers');local arr=lOff and q(gi+lOff);local lp=arr and q(arr)
 local pcOff=lp and TLC.refOffset(lp,'PlayerController');local pc=pcOff and q(lp+pcOff)
 local pOff=pc and TLC.refOffset(pc,'AcknowledgedPawn');p=pOff and q(pc+pOff)
 if TLC.valid(p) and TLC.U.isA(p,'VoyageCharacter') then return p end
 if required then error(TLC.T('Player unavailable: reflection chain unresolved, or a vehicle is controlled.','プレイヤー取得不可：リフレクション経路未解決、または船などを操縦中です。'),0) end
end
-- Install dispatch infrastructure only for an action which actually needs native calls.
local job=TLC.job
function TLC.job(fn,args,guard,done)
 TLC.requireSigs({'Objects','Names','Engine','GameThread','GameTick'});TLC.hookOn('gameTick')
 if not fn then error(TLC.T('Native action unavailable: unresolved function.','ゲーム処理を実行できません：関数が未解決です。'),0) end
 return job(fn,args,guard,done)
end
local feature=TLC.feature
function TLC.feature(key,on)
 if not on then return feature(key,false) end
 local f=assert(TLC.F[key]);local installed={}
 local ok,e=pcall(function()
  TLC.require()
  for _,h in ipairs(f.hooks or {})do
   TLC.requireSigs({TLC.HOOKS[h].sig})
   if h=='attributes' then TLC.requireSigs({'NPCClass'}) end
  end
  if key=='oneshot' then TLC.requireSigs({'NPCClass'}) end
  for _,h in ipairs(f.hooks or {})do if not TLC.hookState[h] then installed[#installed+1]=h end end
  feature(key,true)
 end)
 if not ok then
  if f.flag and TLC.base() then writeBytes(TLC.flag(f.flag),0) end
  TLC.featOn[key]=nil;pcall(TLC.restore,key)
  for _,h in ipairs(installed)do local shared=false;for other in pairs(TLC.featOn)do for _,v in ipairs(TLC.F[other].hooks or {})do if h==v then shared=true end end end;if not shared then pcall(TLC.hookOff,h) end end
  TLC.reason(key,tostring(e));error(e,0)
 end
end
local function guardAction(name,deps)
 local fn=TLC[name];TLC[name]=function(...) TLC.require();TLC.requireSigs(deps);return fn(...) end
end
guardAction('addItemPath',{'SoftPathSet','SoftPathLoad','InventoryForCharacter','ItemDataCtor','InventoryAddItem'})
guardAction('setQuantity',{'SoftPathSet','SoftPathLoad','ItemDataCtor','InventoryAddSlot','InventoryRemove'})
guardAction('loadAsset',{'SoftPathSet','SoftPathLoad'})
guardAction('weatherSystem',{'WeatherClass','WorldSubsystemGet'})
-- User-facing errors stay in CT status/logs. Never show warning/confirmation popups.
function TLC.userRun(fn)
 local ok,e=pcall(fn);if not ok then TLC.reason('action',tostring(e)) end;return ok
end
function TLC.toggleRecord(mr,key,on)
 local ok=TLC.userRun(function()TLC.feature(key,on)end)
 if not ok and on then local t=createTimer(nil,false);t.Interval=50;t.OnTimer=function(tt)tt.destroy();pcall(function()mr.disableWithoutExecute()end)end;t.Enabled=true end
end

function TLC.need()
 TLC.require();TLC.requireSigs({'Objects','Names','Engine'});return TLC.player(true)
end
local cvar=TLC.cvar
function TLC.cvar(n) TLC.requireSigs({'CV_'..n});return cvar(n) end
local init=TLC.init
function TLC.init()
 if TLC.attached() then
  local retry={};for n,m in pairs(TLC.resolution)do if m=='failed' then retry[#retry+1]=n end end
  for _,n in ipairs(retry)do TLC.resolution[n]=nil;TLC.failures[n]=nil;TLC.resolveSig(n) end
 end
 return init()
end


function TLC.initCollapse()
  local al=getAddressList()
  for i=0,al.Count-1 do
    local m=al.getMemoryRecord(i)
    if m.Count&gt;0 then
      local opt='' pcall(function() opt=tostring(m.Options) end)
      if not opt:find('moHideChildren') then
        local inZero=false local p=m
        while p do if p.ID==TLC.ID_TOP0 then inZero=true break end p=p.Parent end
        pcall(function() m.Collapsed = not inZero end)
      end
    end
  end
end

TLC.NAMES={
[1]={"[ATTACH / ALL OFF] The Last Caretaker","【アタッチ／一括解除】The Last Caretaker"},
[2]={"0. Settings &amp; README","0. 設定・説明"},
[3]={"Language / 言語設定","言語設定 / Language"},
[4]={"English (default)","English（既定）"},
[5]={"日本語 / Japanese","日本語 / Japanese"},
[6]={"README","はじめに"},
[7]={"V01 / Ver. 0.10.0.653173 / Unreal Engine 5.8.2 / Steam build 25982825 / CheatVer: 0.10.0-001-003","V01／Ver. 0.10.0.653173／Unreal Engine 5.8.2／Steamビルド25982825／CheatVer: 0.10.0-001-003"},
[8]={"Attach after loading a save. Player and inventories are resolved automatically.","セーブ読込後にアタッチしてください。プレイヤーと所持品は自動取得します。"},
[20]={"Environment / connection information","環境・接続情報"},
[21]={"Signature validation","シグネチャ検証"},
[22]={"State","状態"},
[100]={"01. Gameplay","01. 便利機能"},
[101]={"Invincible (block incoming attacks)","無敵（敵の攻撃を受けない）"},
[102]={"Infinite health","体力無限"},
[103]={"Infinite battery","バッテリー無限"},
[104]={"Hold Space to ascend","スペース長押しで浮上"},
[107]={"Zero carried weight","重量0"},
[110]={"No fuel consumption","船などの燃料消費なし"},
[112]={"Cold immunity","寒さによる移動阻害なし"},
[105]={"One-hit kill (NPC only)","一撃必殺（NPCのみ）"},
[106]={"No ammo / grenade decrease","弾・グレネード減らない"},
[111]={"Boat durability protection","船の耐久度保護"},
[113]={"No module resource consumption (global)","モジュール資源消費なし（全体）"},
[115]={"Item survival countdown: target not yet verified","アイテム生存カウント：対象の処理が未確定"},
[108]={"Experience gain multiplier","経験値取得倍率"},
[109]={"Multiplier","倍率"},
[200]={"02. Player","02. プレイヤー"},
[201]={"Player editor / refresh","プレイヤーエディタ／再取得"},
[202]={"Movement speed multiplier","プレイヤー速度倍率"},
[203]={"Multiplier","倍率"},
[204]={"Jump multiplier","ジャンプ倍率"},
[205]={"Multiplier","倍率"},
[206]={"Ascent velocity (cm/s)","上昇速度（cm/秒）"},
[300]={"03. Items","03. アイテム"},
[301]={"Edit item quantities / refresh","アイテム個数変更／再取得"},
[302]={"Add item (category / quantity)...","アイテム追加（カテゴリ別・個数）…"},
[400]={"04. Build","04. ビルド"},
[401]={"No materials needed","作成に素材必要なし"},
[404]={"No building power consumption","ビルド物の電力消費なし"},
[405]={"No tank resource consumption","ビルド物のタンク消費なし"},
[406]={"Fill loaded building tanks / batteries","読み込み済みビルド物のタンク・蓄電池を満タン"},
[402]={"Instant fabrication / build","即クラフト・ビルド"},
[403]={"No fabrication electricity cost","作成時の電力消費なし"},
[500]={"05. World","05. ワールド"},
[501]={"Always daytime (12:00)","常に昼（12:00）"},
[502]={"Select weather preset...","天気指定…"},
[503]={"Freeze selected weather","指定した天気を固定"},
[504]={"Set / freeze time","時刻指定・固定"},
[505]={"Time of day (hours)","時刻（時間）"},
[506]={"Game time multiplier","ゲーム時間倍率"},
[507]={"Multiplier","倍率"},
[600]={"06. Other","06. その他"},
[601]={"Unlock all Steam achievements...","Steam実績全解除…"},
}

-- Native tank refill.
TLC.SIGS.GameTick={len=9,p='4D 89 7B D8 48 89 4C 24 50 E8 49 47 D2 FC E8 64 EC C3 FC 48 8B C8 E8 2C 47 C4 FC E8 07 EB C3 FC 33 D2 48 8B C8 E8 4D 5B',bytes={77,137,123,216,72,137,76,36,80,232,73,71,210,252,232,100,236,195,252,72,139,200,232,44,71,196,252,232,7,235,195,252,51,210,72,139,200,232,77,91}}
function TLC.fillModuleResource(m,t,maximum)
 if not TLC.featOn.fullTank or not TLC.valid(m)then return end
 local current=0;for _,entry in ipairs(TLC.map(m+0x920,24))do if readBytes(entry,1)==t then current=readDouble(entry+8)or 0;break end end
 if maximum and maximum==maximum and maximum&lt;1e15 and maximum&gt;current+0.001 then
  TLC.job(TLC.nativeSlot(m,0x510),{m,t,xmm2={double=maximum-current}},m,function()
   TLC.lastFilledTank={module=m,type=t,maximum=maximum};TLC.tankFillHistory=TLC.tankFillHistory or {};TLC.tankFillHistory[m]=true
  end)
 end
end
TLC.F.fullTank={on=function()TLC.need();TLC.tankMaxCache={};TLC.tankScanCursor=1;TLC.tankResourceCursor={};TLC.nextTankCheck=nil;TLC.tankCapacityRefresh=getTickCount()+30000 end,task=function()
 if TLC.pendingJob then return end
 local now=getTickCount();if TLC.nextTankCheck and now&lt;TLC.nextTankCheck then return end
 local types={[0]=true,[1]=true,[2]=true,[3]=true,[4]=true,[10]=true,[11]=true,[12]=true,[16]=true,[17]=true}
 TLC.tankMaxCache=TLC.tankMaxCache or {}
 local modules=TLC.modules();local count=#modules;if count==0 then return end
 local resourceTypes={0,1,2,3,4,10,11,12,16,17};TLC.tankResourceCursor=TLC.tankResourceCursor or {}
 local start=(TLC.tankScanCursor or 1)-1
 for step=0,count-1 do local index=(start+step)%count+1;local m=modules[index]
  local valid,entry=TLC.valid(m)
  if valid then
   local serial=readInteger(entry+0x10);local cache=TLC.tankMaxCache[m]
   if not cache or cache.serial~=serial then cache={serial=serial,values={}};TLC.tankMaxCache[m]=cache end
   local candidates={};local primary=readBytes(m+0x110,1);if types[primary]then candidates[primary]=true end
   for _,a in ipairs(TLC.map(m+0x9a8,32))do local t=readBytes(a+8,1);if types[t]then candidates[t]=true end end
   local amounts={};for _,a in ipairs(TLC.map(m+0x920,24))do local t=readBytes(a,1);if t then amounts[t]=readDouble(a+8)or 0;if types[t]then candidates[t]=true end end end
   local rstart=(TLC.tankResourceCursor[m]or 1)-1
   for rstep=0,#resourceTypes-1 do local ri=(rstart+rstep)%#resourceTypes+1;local t=resourceTypes[ri]
    if candidates[t]then
     local current=amounts[t]or 0;local estimated=TLC.moduleMax(m,t);local maximum=cache.values[t]
     if maximum==nil and(estimated&gt;0 or current&gt;0)then
      TLC.tankScanCursor=index%count+1;TLC.tankResourceCursor[m]=ri%#resourceTypes+1
      TLC.job(TLC.nativeSlot(m,0x588),{m,t},m,function()
       local maximum=readDouble(TLC.base()+0x588);if not maximum or maximum~=maximum or maximum&lt;0 or maximum&gt;=1e15 then return end
       cache.values[t]=maximum;TLC.fillModuleResource(m,t,maximum)
      end);TLC.nextTankCheck=now+50;return
     elseif maximum and maximum&gt;current+0.001 then
      TLC.tankScanCursor=index%count+1;TLC.tankResourceCursor[m]=ri%#resourceTypes+1
      TLC.fillModuleResource(m,t,maximum);TLC.nextTankCheck=now+50;return
     end
    end
   end
  end
 end
 if now&gt;=(TLC.tankCapacityRefresh or 0)then TLC.tankMaxCache={};TLC.tankCapacityRefresh=now+30000 end
 TLC.nextTankCheck=now+1000
end}


-- Gameplay execution paths verified against the installed EXE.
TLC.SIGS.GameTick={len=7,p='49 89 5B 10 4C 8B E1 49 89 73 18 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? E8 49 47 D2 FC E8 64 EC C3 FC 48 8B',bytes={73,137,91,16,76,139,225}}
TLC.SIGS.MaterialCheck={len=5,p='41 3B C1 7D 1F 45 84 FF 74 31 48 8B 13 44 2B C8 4D 8B C4 C6 44 24 20 01 49 8B CE E8 39 FD FF FF 84 C0 74 17 8B 45 0B 48',bytes={65,59,193,125,31,69,132,255,116,49,72,139,19,68,43,200,77,139,196,198,68,36,32,1,73,139,206,232,57,253,255,255,132,192,116,23,139,69,11,72}}
TLC.SIGS.MaterialConsume={len=6,p='40 55 53 57 41 54 41 55 41 56 41 57 48 8D AC 24 F0 FE FF FF 48 81 EC 10 02 00 00 48 8B 05 9E 68 FD 05 48 33 C4 48 89 85',bytes={64,85,83,87,65,84,65,85,65,86,65,87,72,141,172,36,240,254,255,255,72,129,236,16,2,0,0,72,139,5,158,104,253,5,72,51,196,72,137,133}}
TLC.SIGS.FabricationDuration={len=7,p='48 8D BB 50 02 00 00 F3 0F 11 83 34 02 00 00 F3 0F 11 83 38 02 00 00 83 7F 48 01 7F 0D 40 32 F6 48 8B CF E8 8E D6 DA FB',bytes={72,141,187,80,2,0,0,243,15,17,131,52,2,0,0,243,15,17,131,56,2,0,0,131,127,72,1,127,13,64,50,246,72,139,207,232,142,214,218,251}}
TLC.SIGS.WeaponResourceRemove={len=5,p='48 89 5C 24 08 88 54 24 10 57 48 83 EC 40 0F 57 C0 0F 29 74 24 30 66 0F 2F D0 0F B6 DA 48 8B F9 0F 28 F2 77 12 B0 01 48',bytes={72,137,92,36,8,136,84,36,16,87,72,131,236,64,15,87,192,15,41,116,36,48,102,15,47,208,15,182,218,72,139,249,15,40,242,119,18,176,1,72}}
TLC.SIGS.WeaponItemConsume={len=5,p='4C 8B DC 55 56 41 57 49 8D AB 08 FF FF FF 48 81 EC E0 01 00 00 48 8B 05 74 3B 0D 06 48 33 C4 48 89 85 C0 00 00 00 8B 42',bytes={76,139,220,85,86,65,87,73,141,171,8,255,255,255,72,129,236,224,1,0,0,72,139,5,116,59,13,6,72,51,196,72,137,133,192,0,0,0,139,66}}
TLC.SIGS.AmmoDelta={len=5,p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 8B F2 48 8B F9 BA 07 00 00 00 E8 A2 E2 00 00 48 8B D8 48 85 C0 74 61 33 C9',bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,32,139,242,72,139,249,186,7,0,0,0,232,162,226,0,0,72,139,216,72,133,192,116,97,51,201}}
TLC.SIGS.AmmoReserve={len=7,p='48 8B EC 48 83 EC 60 41 8B D9 45 8B F0 48 8B F2 48 8B F9 48 85 D2 0F 84 7B 04 00 00 45 85 C0 0F 8E 72 04 00 00 4C 89 AC',bytes={72,139,236,72,131,236,96,65,139,217,69,139,240,72,139,242,72,139,249,72,133,210,15,132,123,4,0,0,69,133,192,15,142,114,4,0,0,76,137,172}}
TLC.SIGS.MovementSpeedFinal={len=8,p='4C 8D 9C 24 A0 00 00 00 F3 0F 11 BB 88 02 00 00 41 0F 28 7B E0 F3 44 0F 11 83 8C 02 00 00 45 0F 28 43 D0 F3 0F 11 B3 90',bytes={76,141,156,36,160,0,0,0,243,15,17,187,136,2,0,0,65,15,40,123,224,243,68,15,17,131,140,2,0,0,69,15,40,67,208,243,15,17,179,144}}
TLC.SIGS.FabricationProgress={len=5,p='45 84 E4 74 1C F3 41 0F 10 86 74 01 00 00 F3 41 0F 5C C7 F3 41 0F 5F C6 F3 41 0F 11 86 74 01 00 00 F3 41 0F 10 8E 78 01',bytes={69,132,228,116,28,243,65,15,16,134,116,1,0,0,243,65,15,92,199,243,65,15,95,198,243,65,15,17,134,116,1,0,0,243,65,15,16,142,120,1}}
TLC.SIGS.FabricatorGate={len=7,p='49 8D 8E F0 01 00 00 E8 EC F7 17 FC 48 89 45 88 48 8B F8 48 85 C0 74 22 33 C9 E8 79 3F D6 FF 48 8B 57 10 48 63 48 38 4C',bytes={73,141,142,240,1,0,0,232,236,247,23,252,72,137,69,136,72,139,248,72,133,192,116,34,51,201,232,121,63,214,255,72,139,87,16,72,99,72,56,76}}
TLC.SIGS.FabricatorPowerReady={len=7,p='80 B8 76 09 00 00 00 0F 84 A3 09 00 00 45 0F 2F B6 78 01 00 00 0F 83 95 09 00 00 49 8B 86 E0 01 00 00 48 8B 10 48 85 D2',bytes={128,184,118,9,0,0,0,15,132,163,9,0,0,69,15,47,182,120,1,0,0,15,131,149,9,0,0,73,139,134,224,1,0,0,72,139,16,72,133,210}}
TLC.SIGS.FabricatorPowerUse={len=5,p='BB FF FF FF FF 4C 89 6D A0 48 81 C2 98 01 00 00 89 5D D0 48 8D 4D A0 48 C7 45 A8 00 00 00 00 4C 89 6D C0 44 89 6D C8 C7',bytes={187,255,255,255,255,76,137,109,160,72,129,194,152,1,0,0,137,93,208,72,141,77,160,72,199,69,168,0,0,0,0,76,137,109,192,68,137,109,200,199}}
TLC.HOOKS.materialCheck2={sig='MaterialCheck',aa=[==[
[ENABLE]
alloc(tlc_materialCheck2,$2000,$SITE)
label(tlc_materialCheck2_ret)
label(tlc_materialCheck2_normal)
label(tlc_materialCheck2_yes)
tlc_materialCheck2:
pushfq
cmp byte ptr [tlcFlags+0C],0
je tlc_materialCheck2_normal
popfq
jmp $SITE+24
tlc_materialCheck2_normal:
popfq
cmp eax,r9d
jge tlc_materialCheck2_yes
jmp tlc_materialCheck2_ret
tlc_materialCheck2_yes:
jmp $SITE+24
$SITE:
jmp tlc_materialCheck2
$NOP
tlc_materialCheck2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_materialCheck2)
]==]}
TLC.HOOKS.materialConsume2={sig='MaterialConsume',aa=[==[
[ENABLE]
alloc(tlc_materialConsume2,$2000,$SITE)
label(tlc_materialConsume2_ret)
label(tlc_materialConsume2_normal)
tlc_materialConsume2:
pushfq
cmp byte ptr [tlcFlags+0C],0
je tlc_materialConsume2_normal
popfq
mov al,1
ret
tlc_materialConsume2_normal:
popfq
$ORIG
jmp tlc_materialConsume2_ret
$SITE:
jmp tlc_materialConsume2
$NOP
tlc_materialConsume2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_materialConsume2)
]==]}
TLC.HOOKS.fabricationDuration2={sig='FabricationDuration',aa=[==[
[ENABLE]
alloc(tlc_fabricationDuration2,$2000,$SITE)
label(tlc_fabricationDuration2_ret)
label(tlc_fabricationDuration2_normal)
tlc_fabricationDuration2:
pushfq
cmp byte ptr [tlcFlags+05],0
je tlc_fabricationDuration2_normal
movss xmm0,[tlcVars+48]
inc dword ptr [tlcFlags+48]
tlc_fabricationDuration2_normal:
popfq
$ORIG
jmp tlc_fabricationDuration2_ret
$SITE:
jmp tlc_fabricationDuration2
$NOP
tlc_fabricationDuration2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_fabricationDuration2)
]==]}
TLC.HOOKS.ammoDelta2={sig='AmmoDelta',aa=[==[
[ENABLE]
alloc(tlc_ammoDelta2,$2000,$SITE)
label(tlc_ammoDelta2_ret)
label(tlc_ammoDelta2_normal)
tlc_ammoDelta2:
pushfq
cmp byte ptr [tlcFlags+0B],0
je tlc_ammoDelta2_normal
test edx,edx
jns tlc_ammoDelta2_normal
push rax
mov rax,[rcx+158]
cmp rax,[tlcPtrs]
pop rax
jne tlc_ammoDelta2_normal
inc dword ptr [tlcFlags+4C]
popfq
mov al,1
ret
tlc_ammoDelta2_normal:
popfq
$ORIG
jmp tlc_ammoDelta2_ret
$SITE:
jmp tlc_ammoDelta2
$NOP
tlc_ammoDelta2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_ammoDelta2)
]==]}
TLC.HOOKS.weaponResource2={sig='WeaponResourceRemove',aa=[==[
[ENABLE]
alloc(tlc_weaponResource2,$2000,$SITE)
label(tlc_weaponResource2_ret)
label(tlc_weaponResource2_normal)
label(tlc_weaponResource2_restore)
label(tlc_weaponResource2_yes)
label(tlc_weaponResource2_loop)
tlc_weaponResource2:
pushfq
cmp byte ptr [tlcFlags+0B],0
je tlc_weaponResource2_normal
push rax
push r10
push r11
mov rax,[rcx+A8]
test rax,rax
je tlc_weaponResource2_restore
mov r10,[rax+158]
cmp r10,[tlcPtrs]
jne tlc_weaponResource2_restore
mov rax,[rax+10]
mov r10,[tlcWeaponClassSlot]
mov r11d,40
tlc_weaponResource2_loop:
cmp rax,r10
je tlc_weaponResource2_yes
test rax,rax
je tlc_weaponResource2_restore
mov rax,[rax+40]
dec r11d
jne tlc_weaponResource2_loop
tlc_weaponResource2_restore:
pop r11
pop r10
pop rax
jmp tlc_weaponResource2_normal
tlc_weaponResource2_yes:
inc dword ptr [tlcFlags+50]
pop r11
pop r10
pop rax
popfq
mov al,1
ret
tlc_weaponResource2_normal:
popfq
$ORIG
jmp tlc_weaponResource2_ret
$SITE:
jmp tlc_weaponResource2
$NOP
tlc_weaponResource2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_weaponResource2)
]==]}
TLC.HOOKS.weaponItemConsume2={sig='WeaponItemConsume',aa=[==[
[ENABLE]
alloc(tlc_weaponItemConsume2,$2000,$SITE)
label(tlc_weaponItemConsume2_ret)
label(tlc_weaponItemConsume2_normal)
label(tlc_weaponItemConsume2_restore)
label(tlc_weaponItemConsume2_yes)
label(tlc_weaponItemConsume2_loop)
tlc_weaponItemConsume2:
pushfq
cmp byte ptr [tlcFlags+0B],0
je tlc_weaponItemConsume2_normal
push rax
push r10
push r11
mov rax,rcx
test rax,rax
je tlc_weaponItemConsume2_restore
mov r10,[rax+158]
cmp r10,[tlcPtrs]
jne tlc_weaponItemConsume2_restore
mov rax,[rax+10]
mov r10,[tlcWeaponClassSlot]
mov r11d,40
tlc_weaponItemConsume2_loop:
cmp rax,r10
je tlc_weaponItemConsume2_yes
test rax,rax
je tlc_weaponItemConsume2_restore
mov rax,[rax+40]
dec r11d
jne tlc_weaponItemConsume2_loop
tlc_weaponItemConsume2_restore:
pop r11
pop r10
pop rax
jmp tlc_weaponItemConsume2_normal
tlc_weaponItemConsume2_yes:
inc dword ptr [tlcFlags+54]
pop r11
pop r10
pop rax
popfq
mov al,1
ret
tlc_weaponItemConsume2_normal:
popfq
$ORIG
jmp tlc_weaponItemConsume2_ret
$SITE:
jmp tlc_weaponItemConsume2
$NOP
tlc_weaponItemConsume2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_weaponItemConsume2)
]==]}
TLC.HOOKS.ammoReserve2={sig='AmmoReserve',aa=[==[
[ENABLE]
alloc(tlc_ammoReserve2,$2000,$SITE)
label(tlc_ammoReserve2_ret)
label(tlc_ammoReserve2_normal)
label(tlc_ammoReserve2_category)
label(tlc_ammoReserve2_yes)
tlc_ammoReserve2:
pushfq
cmp byte ptr [tlcFlags+0B],0
je tlc_ammoReserve2_normal
cmp byte ptr [tlcFlags+15],0
jne tlc_ammoReserve2_normal
cmp rcx,[tlcPtrs+20]
je tlc_ammoReserve2_category
cmp rcx,[tlcPtrs+28]
jne tlc_ammoReserve2_normal
tlc_ammoReserve2_category:
test rdx,rdx
je tlc_ammoReserve2_normal
cmp byte ptr [rdx+B0],09
je tlc_ammoReserve2_yes
cmp byte ptr [rdx+B0],0B
jne tlc_ammoReserve2_normal
tlc_ammoReserve2_yes:
inc dword ptr [tlcFlags+58]
popfq
mov eax,r8d
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret
tlc_ammoReserve2_normal:
popfq
$ORIG
jmp tlc_ammoReserve2_ret
$SITE:
jmp tlc_ammoReserve2
$NOP
tlc_ammoReserve2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_ammoReserve2)
]==]}
TLC.HOOKS.movementSpeed2={sig='MovementSpeedFinal',aa=[==[
[ENABLE]
alloc(tlc_movementSpeed2,$2000,$SITE)
label(tlc_movementSpeed2_ret)
label(tlc_movementSpeed2_normal)
tlc_movementSpeed2:
pushfq
cmp byte ptr [tlcFlags+19],0
je tlc_movementSpeed2_normal
cmp rbx,[tlcPtrs+38]
jne tlc_movementSpeed2_normal
mulss xmm7,[tlcVars+20]
mulss xmm8,[tlcVars+20]
mulss xmm6,[tlcVars+20]
mulss xmm9,[tlcVars+20]
inc dword ptr [tlcFlags+5C]
tlc_movementSpeed2_normal:
popfq
$ORIG
jmp tlc_movementSpeed2_ret
$SITE:
jmp tlc_movementSpeed2
$NOP
tlc_movementSpeed2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_movementSpeed2)
]==]}
TLC.HOOKS.fabricationProgress2={sig='FabricationProgress',aa=[==[
[ENABLE]
alloc(tlc_fabricationProgress2,$2000,$SITE)
label(tlc_fabricationProgress2_ret)
label(tlc_fabricationProgress2_time)
label(tlc_fabricationProgress2_normal)
label(tlc_fabricationProgress2_skip)
tlc_fabricationProgress2:
pushfq
cmp byte ptr [tlcFlags+0C],0
je tlc_fabricationProgress2_time
mov r12b,1
movsd xmm8,[tlcVars+58]
tlc_fabricationProgress2_time:
cmp byte ptr [tlcFlags+05],0
je tlc_fabricationProgress2_normal
movss xmm0,[tlcVars+48]
movss [r14+174],xmm0
inc dword ptr [tlcFlags+64]
tlc_fabricationProgress2_normal:
popfq
test r12b,r12b
je tlc_fabricationProgress2_skip
jmp tlc_fabricationProgress2_ret
tlc_fabricationProgress2_skip:
jmp $SITE+21
$SITE:
jmp tlc_fabricationProgress2
$NOP
tlc_fabricationProgress2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_fabricationProgress2)
]==]}
TLC.HOOKS.fabricatorGate2={sig='FabricatorGate',aa=[==[
[ENABLE]
alloc(tlc_fabricatorGate2,$2000,$SITE)
label(tlc_fabricatorGate2_ret)
label(tlc_fabricatorGate2_normal)
label(tlc_fabricatorGate2_countNormal)
label(tlc_fabricatorGate2_countDone)
tlc_fabricatorGate2:
pushfq
cmp byte ptr [r14+16A],0
je tlc_fabricatorGate2_countNormal
inc dword ptr [tlcFlags+B0]
jmp tlc_fabricatorGate2_countDone
tlc_fabricatorGate2_countNormal:
inc dword ptr [tlcFlags+AC]
tlc_fabricatorGate2_countDone:
cmp byte ptr [tlcFlags+06],0
je tlc_fabricatorGate2_normal
mov ebx,1
tlc_fabricatorGate2_normal:
popfq
$ORIG
jmp tlc_fabricatorGate2_ret
$SITE:
jmp tlc_fabricatorGate2
$NOP
tlc_fabricatorGate2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_fabricatorGate2)
]==]}
TLC.HOOKS.fabricatorPowerReady2={sig='FabricatorPowerReady',aa=[==[
[ENABLE]
alloc(tlc_fabricatorPowerReady2,$2000,$SITE)
label(tlc_fabricatorPowerReady2_ret)
label(tlc_fabricatorPowerReady2_normal)
tlc_fabricatorPowerReady2:
pushfq
cmp byte ptr [tlcFlags+06],0
je tlc_fabricatorPowerReady2_normal
popfq
cmp byte ptr [tlcFlags+06],0
jmp tlc_fabricatorPowerReady2_ret
tlc_fabricatorPowerReady2_normal:
popfq
$ORIG
jmp tlc_fabricatorPowerReady2_ret
$SITE:
jmp tlc_fabricatorPowerReady2
$NOP
tlc_fabricatorPowerReady2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_fabricatorPowerReady2)
]==]}
TLC.HOOKS.fabricatorPowerUse2={sig='FabricatorPowerUse',aa=[==[
[ENABLE]
alloc(tlc_fabricatorPowerUse2,$2000,$SITE)
label(tlc_fabricatorPowerUse2_ret)
label(tlc_fabricatorPowerUse2_normal)
tlc_fabricatorPowerUse2:
pushfq
cmp byte ptr [tlcFlags+06],0
je tlc_fabricatorPowerUse2_normal
xorps xmm6,xmm6
tlc_fabricatorPowerUse2_normal:
popfq
$ORIG
jmp tlc_fabricatorPowerUse2_ret
$SITE:
jmp tlc_fabricatorPowerUse2
$NOP
tlc_fabricatorPowerUse2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_fabricatorPowerUse2)
]==]}

function TLC.gameplayPointers(weapon)
 local p=TLC.player(true);local m=TLC.readObjectField074(p,'CharacterMovement')
 assert(TLC.valid(m),'Movement unavailable');writeQword(TLC.base()+0x238,m)
 writeQword(TLC.base()+0x200,p);writeQword(TLC.base()+0x220,TLC.readObjectField074(p,'WeightInventory')or 0);writeQword(TLC.base()+0x228,TLC.readObjectField074(p,'VaultInventory')or 0)
 if not weapon then return end
 local state=TLC.weaponClassStorage074
 if not state or state.pid~=getOpenedProcessID()or state.module~=TLC.mod()then
  local okay,why=autoAssemble(('alloc(tlcWeaponClassStorage074,$1000,%X)\nregistersymbol(tlcWeaponClassStorage074)'):format(TLC.moduleRequired()))
  assert(okay,'Weapon class storage allocation failed: '..tostring(why))
  state={pid=getOpenedProcessID(),module=TLC.mod(),address=assert(getAddressSafe('tlcWeaponClassStorage074'))};TLC.weaponClassStorage074=state
 end
 local slot=state.address;local c=assert(TLC.refClass('VoyageWeapon'),'Weapon class unavailable')
 assert(writeQword(slot,c));pcall(unregisterSymbol,'tlcWeaponClassSlot');registerSymbol('tlcWeaponClassSlot',slot,true)
end
local tickBeforeGP=TLC.tick
function TLC.tick() tickBeforeGP();if not TLC.attached() or not TLC.base() then return end;local p=TLC.player();writeQword(TLC.base()+0x238,p and TLC.readObjectField074(p,'CharacterMovement') or 0)end
TLC.F.materials={flag=12,hooks={'materialCheck2','materialConsume2','fabricationProgress2'},on=function()writeDouble(TLC.var(0x58),1)end}
TLC.F.noCraftPower={flag=6,hooks={'fabricatorGate2','fabricatorPowerReady2','fabricatorPowerUse2'}}
TLC.F.instant={flag=5,hooks={'fabricationDuration2','fabricationProgress2'}}
TLC.F.ammo={flag=11,hooks={'ammoDelta2','weaponResource2','weaponItemConsume2','ammoReserve2'},on=function()TLC.need();TLC.gameplayPointers(true)end}
TLC.F.speed={flag=0x19,hooks={'movementSpeed2'},on=function()TLC.need();TLC.gameplayPointers()end}
local featureBeforeGP=TLC.feature
function TLC.feature(key,on)
 if on and (key=='ammo' or key=='speed' or key=='jump')then TLC.require();TLC.gameplayPointers(key=='ammo')end
 return featureBeforeGP(key,on)
end

TLC.ITEM_LABELS={}
TLC.ITEM_CATEGORIES={}
function TLC.itemLabels(name)
 local x=TLC.ITEM_LABELS[name];if x then return x[1],x[2]end
 return 'Name unavailable','表示名未取得'
end
function TLC.addItemPick()
 TLC.require();local cats={};for _,x in ipairs(TLC.CATALOG)do if TLC.ITEM_LABELS[x.label]then cats[x.cat]=true end end
 local keys={};for c in pairs(cats)do keys[#keys+1]=c end;table.sort(keys)
 local display={};for _,c in ipairs(keys)do local n=TLC.ITEM_CATEGORIES[c];display[#display+1]=n and TLC.T(n[1],n[2])or TLC.T('Other','その他')end
 local selected=TLC.pick(TLC.T('Category','カテゴリ'),display);if not selected then return end
 local rows={};for _,x in ipairs(TLC.CATALOG)do if x.cat==keys[selected]and TLC.ITEM_LABELS[x.label]then rows[#rows+1]=x end end
 table.sort(rows,function(a,b)local an=TLC.ITEM_LABELS[a.label];local bn=TLC.ITEM_LABELS[b.label];return TLC.T(an[1],an[2])&lt;TLC.T(bn[1],bn[2])end)
 local names={};for _,x in ipairs(rows)do local en,ja=TLC.itemLabels(x.label);names[#names+1]=TLC.T(en,ja)end
 local n=TLC.pick(TLC.T('Item (search)','アイテム（検索可）'),names);if not n then return end
 local amount=TLC.askInt(TLC.T('Quantity','個数'),TLC.T('Quantity to add','追加する個数'),1,1,99999)
 if amount then TLC.addItemPath(rows[n].path,amount)end
end


TLC.SIGS.WeatherNative={len=5,p='4C 8B DC 55 53 49 8D AB E8 FB FF FF 48 81 EC 08 05 00 00 48 8B 05 F6 7C DE 05 48 33 C4 48 89 85 20 03 00 00 49 89 73 E8',bytes={76,139,220,85,83,73,141,171,232,251,255,255,72,129,236,8,5,0,0,72,139,5,246,124,222,5,72,51,196,72,137,133,32,3,0,0,73,137,115,232}}
TLC.HOOKS.weatherOutput2={sig='WeatherNative',aa=[==[
[ENABLE]
alloc(tlc_weatherOutput2,$2000,$SITE)
label(tlc_weatherOutput2_ret)
label(tlc_weatherOutput2_done)
label(tlc_weatherOutput2_original)
tlc_weatherOutput2:
mov r11,[rsp+28]
sub rsp,58
mov [rsp+20],r11
mov [rsp+30],r8
mov [rsp+38],r9
call tlc_weatherOutput2_original
mov [rsp+48],rax
cmp byte ptr [tlcFlags+12],0
je tlc_weatherOutput2_done
mov r10,[rsp+30]
mov r11,[rsp+38]
test r10,r10
je tlc_weatherOutput2_done
test r11,r11
je tlc_weatherOutput2_done
movdqu xmm0,[tlcFlags+B00]
movdqu xmm1,[tlcFlags+B10]
movdqu [r10],xmm0
movdqu [r10+10],xmm1
mov rdx,[tlcFlags+B20]
mov [r10+20],rdx
movdqu xmm0,[tlcFlags+B28]
movdqu [r11],xmm0
inc dword ptr [tlcFlags+6C]
mov byte ptr [rsp+48],1
tlc_weatherOutput2_done:
mov rax,[rsp+48]
add rsp,58
ret
tlc_weatherOutput2_original:
$ORIG
jmp tlc_weatherOutput2_ret
$SITE:
jmp tlc_weatherOutput2
$NOP
tlc_weatherOutput2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_weatherOutput2)
]==]}


function TLC.environmentActors()
 local world=TLC.world();if not world then error(TLC.T('World unavailable.','ワールドを取得できません。'),0)end
 local level=readQword(world+0x30);assert(TLC.valid(level),'Invalid persistent level');local data=readQword(level+0xa0);local count=readInteger(level+0xa8)
 assert(data and count and count&gt;=0 and count&lt;=30000,'Invalid actor list')
 local sky,weather
 for k=0,count-1 do local a=readQword(data+k*8);if TLC.valid(a)then local name=TLC.U.c(a)
  if name=='Ultra_Dynamic_Sky_Voyage_C'then sky=a elseif name=='Ultra_Dynamic_Weather_Voyage_C'then weather=a end
  if sky and weather then break end
 end end
 if not sky then error(TLC.T('Sky actor not found in the current level.','現在のレベルの空制御を取得できません。'),0)end
 local off=TLC.refOffset(sky,'Time of Day');assert(off,'Sky time property unavailable')
 local valid,entry=TLC.valid(sky);assert(valid);TLC.environmentWorld=world;TLC.environmentSky=sky;TLC.environmentWeather=weather;writeQword(TLC.base()+0x258,sky+off);writeQword(TLC.base()+0x260,sky);writeInteger(TLC.base()+0x268,readInteger(sky+0xc));writeInteger(TLC.base()+0x26c,readInteger(entry+0x10))
 return sky,weather
end
function TLC.prepareSkyTime()
 TLC.requireSigs({'Objects','Names','Engine'});TLC.environmentActors()
 local name='VCRUNTIME140.dll';local base=getAddressSafe(name);local size=base and getModuleSize(name);local a=getAddressSafe('VCRUNTIME140.memcpy')
 assert(base and size and a,'Runtime copy function unavailable')
 if TLC.hookState.skyTimeHold2 then return end
 assert(readBytes(a,1)==0xe9,'Unsupported memcpy export entry')
 local rel=readInteger(a+1);if rel&gt;=0x80000000 then rel=rel-0x100000000 end;local dest=a+5+rel
 assert(dest&gt;=base and dest&lt;base+size,'Copy routine was modified outside its module')
 local prefix=readBytes(dest,10,true);assert(prefix and prefix[1]==0x48 and prefix[2]==0x8b and prefix[3]==0xc1 and prefix[4]==0x4c and prefix[5]==0x8d and prefix[6]==0x15,'Unsupported runtime copy implementation')
 local disp=readInteger(dest+6);if disp&gt;=0x80000000 then disp=disp-0x100000000 end;assert(dest+10+disp==base,'Copy routine identity mismatch')
 local bytes=readBytes(a,5,true);local pattern={};for _,v in ipairs(bytes)do pattern[#pattern+1]=string.format('%02X',v)end
 TLC.SIGS.SkyMemcpy={mod=name,export='memcpy',len=5,bytes=bytes,p=table.concat(pattern,' ')};TLC.A.SkyMemcpy=nil;TLC.resolution.SkyMemcpy=nil
 pcall(unregisterSymbol,'tlcMemcpyOriginal');registerSymbol('tlcMemcpyOriginal',dest,true)
end
local resolveBeforeSky=TLC.resolveSig
function TLC.resolveSig(n)
 local s=TLC.SIGS[n]
 if s and s.mod then
  if TLC.A[n]then return TLC.A[n]end
  local a=s.export and getAddressSafe(s.mod:gsub('%.dll$','')..'.'..s.export);local b=a and readBytes(a,#s.bytes,true)
  local okay=b~=nil;if b then for i=1,#s.bytes do if b[i]~=s.bytes[i]then okay=false end end end
  if not okay then TLC.reason(n,TLC.T('Runtime export changed; this feature was stopped.','ランタイム関数が変更されているため、この機能を停止しました。'));return end
  TLC.A[n]=a;registerSymbol('tlcA_'..n,a,true);return a
 end
 return resolveBeforeSky(n)
end
TLC.HOOKS.skyTimeHold2={sig='SkyMemcpy',aa=[==[
[ENABLE]
alloc(tlc_skyTimeHold2,$2000,$SITE)
label(tlc_skyTimeHold2_ret)
label(tlc_skyTimeHold2_normal)
label(tlc_skyTimeHold2_noon)
label(tlc_skyTimeHold2_write)
tlc_skyTimeHold2:
pushfq
push rdx
cmp r8,08
jne tlc_skyTimeHold2_normal
mov r11,tlcFlags
cmp rcx,[r11+258]
jne tlc_skyTimeHold2_normal
mov r10d,[r11+268]
mov rdx,tlcObjectCount072
cmp r10d,[rdx]
jae tlc_skyTimeHold2_normal
mov rdx,[tlcObjects]
test rdx,rdx
je tlc_skyTimeHold2_normal
mov eax,r10d
shr eax,10
mov rdx,[rdx+rax*8]
test rdx,rdx
je tlc_skyTimeHold2_normal
and r10d,FFFF
lea r10,[r10+r10*2]
shl r10,03
add rdx,r10
mov rax,[r11+260]
cmp [rdx+08],rax
jne tlc_skyTimeHold2_normal
mov eax,[r11+26C]
cmp eax,[rdx+10]
jne tlc_skyTimeHold2_normal
mov rax,[r11+260]
test rax,rax
je tlc_skyTimeHold2_normal
test dword ptr [rax+08],18010
jne tlc_skyTimeHold2_normal
cmp byte ptr [r11+11],0
jne tlc_skyTimeHold2_noon
cmp byte ptr [r11+10],0
je tlc_skyTimeHold2_normal
mov rax,[r11+160]
jmp tlc_skyTimeHold2_write
tlc_skyTimeHold2_noon:
mov rax,4092C00000000000
tlc_skyTimeHold2_write:
mov [rcx],rax
inc dword ptr [r11+80]
mov rax,rcx
pop rdx
popfq
ret
tlc_skyTimeHold2_normal:
pop rdx
popfq
jmp tlcMemcpyOriginal
$SITE:
jmp tlc_skyTimeHold2
tlc_skyTimeHold2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_skyTimeHold2)
]==]}
function TLC.skyHour()local h=readFloat(TLC.var(0x2c));if not h or h~=h or h&lt;0 or h&gt;24 then error(TLC.T('Time must be between 0 and 24 hours.','時刻は0～24時で指定してください。'),0)end;return h==24 and 0 or h end
local featureBeforeSky=TLC.feature
function TLC.feature(key,on)
 if on and(key=='noon'or key=='time')then TLC.require();TLC.prepareSkyTime();writeDouble(TLC.var(0x60),(key=='time' and TLC.skyHour()or 12)*100)end
 return featureBeforeSky(key,on)
end
local function skyTask()
 if TLC.environmentWorld~=TLC.world()or not TLC.valid(TLC.environmentSky)then writeQword(TLC.base()+0x258,0);error(TLC.T('Sky target changed; enable again.','空制御の対象が変わったため再有効化してください。'),0)end
 writeDouble(TLC.var(0x60),(TLC.featOn.time and TLC.skyHour()or 12)*100)
end
TLC.F.noon={flag=17,hooks={'skyTimeHold2'},task=skyTask}
TLC.F.time={flag=16,hooks={'skyTimeHold2'},task=skyTask}
TLC.F.weather={flag=18,hooks={'weatherOutput2'},on=function()
 if not TLC.selectedWeather then error(TLC.T('Select weather first.','先に天候を選択してください。'),0)end
end}

local forgetBeforeSky=TLC.forgetProcess
function TLC.forgetProcess() forgetBeforeSky();TLC.environmentWorld=nil;TLC.environmentSky=nil;TLC.environmentWeather=nil;TLC.nextTankCheck=nil end

TLC.SIGS.SeedCountdown={len=12,p='F3 0F 5C CE F3 0F 11 8B 18 03 00 00 E8 FE 35 EB FF 0F 57 C0 0F 2F 83 18 03 00 00 72 16 48 8B CB E8 7A 16 EB FF 48 8B 03',bytes={243,15,92,206,243,15,17,139,24,3,0,0,232,254,53,235,255,15,87,192,15,47,131,24,3,0,0,114,22,72,139,203,232,122,22,235,255,72,139,3}}
TLC.HOOKS.seedCountdown={sig='SeedCountdown',aa=[==[
[ENABLE]
alloc(tlc_seedCountdown,$1000,$SITE)
label(tlc_seedCountdown_ret)
label(tlc_seedCountdown_normal)
tlc_seedCountdown:
pushfq
cmp byte ptr [tlcFlags+1B],0
je tlc_seedCountdown_normal
movss [rbx+318],xmm1
inc dword ptr [tlcFlags+94]
popfq
jmp tlc_seedCountdown_ret
tlc_seedCountdown_normal:
popfq
$ORIG
jmp tlc_seedCountdown_ret
$SITE:
jmp tlc_seedCountdown
$NOP
tlc_seedCountdown_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_seedCountdown)
]==]}
TLC.F.seedCountdown={flag=0x1b,hooks={'seedCountdown'}}
TLC.NAMES[115]={'Freeze human seed survival countdown (unverified)','生存可能時間カウント停止（ヒューマンシード・実機未確認）'}

TLC.F.float={on=function()TLC.need()end,task=function()
 local p=TLC.player();local m=p and TLC.readObjectField074(p,'CharacterMovement')
 if TLC.valid(m)and isKeyPressed(VK_SPACE)then writeDouble(m+0xe8,readFloat(TLC.var(0x28)))end
end}

function TLC.addItemPick()
 TLC.need()
 if TLC.itemPicker and not TLC.itemPicker.closed then TLC.itemPicker.form.show();return end
 local st={selected={},rows={},closed=false,busy=false};TLC.itemPicker=st
 local form=TLC.uiCreate157('Form',false);st.form=form;form.Caption=TLC.T('Add items','アイテム追加');form.Width=740;form.Height=560;form.Position='poScreenCenter'
 local function bounds(c,x,y,w,h)c.Left=x;c.Top=y;c.Width=w;c.Height=h end
 local function button(text,x,y,width,fn)local b=createButton(form);b.Caption=text;bounds(b,x,y,width,30);b.OnClick=fn;return b end
 local back=button(TLC.T('Back','戻る'),12,12,90,function()st.goBack()end);st.back=back
 local search=TLC.uiCreate157('Edit',form);bounds(search,114,14,598,26);st.search=search
 local categories=TLC.uiCreate157('ListBox',form);bounds(categories,12,52,700,364);st.categories=categories
 local items=TLC.uiCreate157('ListView',form);bounds(items,12,52,700,364);items.ViewStyle='vsReport';items.RowSelect=true;items.MultiSelect=true;items.HideSelection=false;items.ReadOnly=true;local column=items.Columns.add();column.Caption=TLC.T('Item','アイテム');column.Width=670;items.Visible=false;st.items=items
 local hint=TLC.uiCreate157('Label',form);bounds(hint,12,424,700,22);hint.Caption=TLC.T('Ctrl / Shift: select multiple items. Selections are kept when going back.','Ctrl／Shiftで複数選択できます。「戻る」でも選択を保持します。')
 local label=TLC.uiCreate157('Label',form);bounds(label,12,460,150,24);label.Caption=TLC.T('Quantity per item','各アイテムの個数')
 local quantity=TLC.uiCreate157('Edit',form);bounds(quantity,164,456,84,28);quantity.Text='1';st.quantity=quantity
 local status=TLC.uiCreate157('Label',form);bounds(status,12,504,700,30);status.AutoSize=false;st.status=status
 local all=button(TLC.T('Select all','全選択'),264,454,100,function()for i=0,items.Items.Count-1 do items.Items[i].Selected=true end;st.sync()end)
 local none=button(TLC.T('Clear','選択解除'),374,454,100,function()st.selected={};for i=0,items.Items.Count-1 do items.Items[i].Selected=false end;st.sync()end)
 local add=button(TLC.T('Add selected','選択項目を追加'),484,454,228,function()st.submit()end);st.add=add
 local open=button(TLC.T('Open category','カテゴリを開く'),484,454,228,function()st.openCategory()end);st.open=open
 local keys={};local found={};for _,x in ipairs(TLC.CATALOG)do if TLC.ITEM_LABELS[x.label]then found[x.cat]=true end end
 for key in pairs(found)do keys[#keys+1]=key end;table.sort(keys);st.keys=keys
 for _,key in ipairs(keys)do local n=TLC.ITEM_CATEGORIES[key];categories.Items.add(TLC.T(n[1],n[2]))end
 function st.count()local n=0;for _ in pairs(st.selected)do n=n+1 end;return n end
 function st.sync()
  if st.rendering or not st.category or items.Items.Count~=#st.rows then return end
  for i,x in ipairs(st.rows)do st.selected[x.path]=items.Items[i-1].Selected and x or nil end
  local count=st.count();if not st.busy and st.lastCount~=count then status.Caption=TLC.T('Selected: ','選択数: ')..count end;st.lastCount=count
 end
 function st.render()
  st.rendering=true;items.Items.beginUpdate();local okay,why=pcall(function()items.Items.clear();st.rows={};local term=search.Text:lower()
  for _,x in ipairs(st.categoryRows)do local en,ja=TLC.itemLabels(x.label);local name=TLC.T(en,ja)
   if term==''or name:lower():find(term,1,true)or en:lower():find(term,1,true)or ja:find(term,1,true)then
    st.rows[#st.rows+1]=x;local row=items.Items.add();row.Caption=name;row.Selected=st.selected[x.path]~=nil
   end
  end
   end);items.Items.endUpdate();st.rendering=false;if not okay then error(why,0)end;st.sync()
 end
 function st.openCategory()
  if st.busy or categories.ItemIndex&lt;0 then return end
  st.category=keys[categories.ItemIndex+1];st.categoryRows={}
  for _,x in ipairs(TLC.CATALOG)do if x.cat==st.category and TLC.ITEM_LABELS[x.label]then st.categoryRows[#st.categoryRows+1]=x end end
  table.sort(st.categoryRows,function(a,b)local an,aj=TLC.itemLabels(a.label);local bn,bj=TLC.itemLabels(b.label);return TLC.T(an,aj)&lt;TLC.T(bn,bj)end)
  st.rendering=true;search.Text='';st.rendering=false
  categories.Visible=false;items.Visible=true;search.Enabled=true;back.Enabled=true;open.Visible=false;add.Visible=true;all.Visible=true;none.Visible=true;st.render()
 end
 function st.goBack()
  if st.busy then return end;st.sync();st.category=nil;categories.Visible=true;items.Visible=false;search.Enabled=false;back.Enabled=false;open.Visible=true;add.Visible=false;all.Visible=false;none.Visible=false
 end
 function st.finish(text)
  st.generation=(st.generation or 0)+1;st.busy=false;add.Enabled=true;back.Enabled=true;search.Enabled=true;items.Enabled=true;all.Enabled=true;none.Enabled=true;quantity.Enabled=true;status.Caption=text
 end
 function st.submit()
  if st.busy then return end;st.sync();local amount=tonumber(quantity.Text)
  if not amount or amount~=math.floor(amount)or amount&lt;1 or amount&gt;99999 then status.Caption=TLC.T('Enter a quantity from 1 to 99999.','個数は1～99999の整数で指定してください。');return end
  local queue={};for _,x in ipairs(TLC.CATALOG)do if st.selected[x.path]then queue[#queue+1]=x end end
  if #queue==0 then status.Caption=TLC.T('Select at least one item.','アイテムを選択してください。');return end
  if TLC.pendingJob then status.Caption=TLC.T('Another item operation is running.','別の追加処理が実行中です。');return end
  st.generation=(st.generation or 0)+1;local generation=st.generation;st.busy=true;st.queue=queue;st.index=0;st.pawn=TLC.player(true);add.Enabled=false;back.Enabled=false;search.Enabled=false;items.Enabled=false;all.Enabled=false;none.Enabled=false;quantity.Enabled=false
  function st.nextItem()
   if st.closed or st.generation~=generation or not st.busy then return end
   if TLC.player()~=st.pawn then st.finish(TLC.T('Player changed; remaining additions stopped.','プレイヤーが変わったため残りの追加を停止しました。'));return end
   st.index=st.index+1
   if st.index&gt;#queue then st.finish(TLC.T('Completed: ','追加完了: ')..#queue);return end
   local x=queue[st.index];st.started=getTickCount();local en,ja=TLC.itemLabels(x.label);status.Caption=st.index..' / '..#queue..'  '..TLC.T(en,ja)
   local ok,e=pcall(TLC.addItemPath,x.path,amount,function(added)
    if st.closed or st.generation~=generation or not st.busy then return end
    if added~=amount then st.finish(TLC.T('Stopped: requested / added = ','停止: 指定数／追加数 = ')..amount..' / '..tostring(added));return end
    st.nextItem()
   end)
   if not ok then st.finish(tostring(e))end
  end
  st.nextItem()
 end
 items.OnClick=st.sync;categories.OnDblClick=st.openCategory
 search.OnChange=function()if st.category and not st.rendering then st.sync();st.render()end end
 local timer=createTimer(form,false);timer.Interval=100;timer.OnTimer=function()
  if st.closed then return end
  if st.busy and getTickCount()-st.started&gt;20000 then st.finish(TLC.T('Addition did not complete; remaining items stopped.','追加が完了しないため、残りの処理を停止しました。'))elseif not st.busy then st.sync()end
 end;timer.Enabled=true
 form.OnClose=function()st.closed=true;st.queue=nil;timer.Enabled=false;if TLC.itemPicker==st then TLC.itemPicker=nil end;return caFree end
 st.goBack();form.show()
end
local disableBeforeItemPicker=TLC.disableAll
function TLC.disableAll(...)
 if TLC.itemPicker and not TLC.itemPicker.closed then TLC.itemPicker.form.close()end
 return disableBeforeItemPicker(...)
end


TLC.F.jump={on=function()TLC.err('Stopped: a position-only height adjustment is not yet ready for release.','速度・重力を変更しない高さ調整は未完成のため停止中です。')end}
TLC.NAMES[204]={'Jump height multiplier [stopped]','ジャンプ高さ倍率［停止中］'}

TLC.SIGS.WeatherNative={len=5,p='4C 8B DC 55 53 49 8D AB E8 FB FF FF 48 81 EC 08 05 00 00 48 8B 05 F6 7C DE 05 48 33 C4 48 89 85 20 03 00 00 49 89 73 E8',bytes={76,139,220,85,83,73,141,171,232,251,255,255,72,129,236,8,5,0,0,72,139,5,246,124,222,5,72,51,196,72,137,133,32,3,0,0,73,137,115,232}}
TLC.HOOKS.weatherOutput2={sig='WeatherNative',aa=[==[
[ENABLE]
alloc(tlc_weatherOutput2,$2000,$SITE)
label(tlc_weatherOutput2_ret)
label(tlc_weatherOutput2_done)
label(tlc_weatherOutput2_original)
label(tlc_weatherOutput2_apply)
tlc_weatherOutput2:
mov r11,[rsp+28]
mov r10,[rsp+30]
sub rsp,58
mov [rsp+20],r11
mov [rsp+28],r10
mov [rsp+30],r8
mov [rsp+38],r9
call tlc_weatherOutput2_original
mov [rsp+48],rax
mov r10,[rsp+30]
mov r11,[rsp+38]
test r10,r10
je tlc_weatherOutput2_done
test r11,r11
je tlc_weatherOutput2_done
cmp byte ptr [tlcFlags+C0],0
je tlc_weatherOutput2_apply
cmp byte ptr [rsp+48],0
je tlc_weatherOutput2_apply
mov rax,[rsp+58]
lea rdx,[$SITE-08]
cmp rax,rdx
jne tlc_weatherOutput2_apply
movdqu xmm0,[r10]
movdqu xmm1,[r10+10]
movdqu [tlcFlags+B00],xmm0
movdqu [tlcFlags+B10],xmm1
mov rdx,[r10+20]
mov [tlcFlags+B20],rdx
movdqu xmm0,[r11]
movdqu [tlcFlags+B28],xmm0
mov byte ptr [tlcFlags+C0],0
mov byte ptr [tlcFlags+12],1
inc dword ptr [tlcFlags+C4]
tlc_weatherOutput2_apply:
cmp byte ptr [tlcFlags+12],0
je tlc_weatherOutput2_done
movdqu xmm0,[tlcFlags+B00]
movdqu xmm1,[tlcFlags+B10]
movdqu [r10],xmm0
movdqu [r10+10],xmm1
mov rdx,[tlcFlags+B20]
mov [r10+20],rdx
movdqu xmm0,[tlcFlags+B28]
movdqu [r11],xmm0
inc dword ptr [tlcFlags+6C]
mov byte ptr [rsp+48],1
tlc_weatherOutput2_done:
mov rax,[rsp+48]
add rsp,58
ret
tlc_weatherOutput2_original:
$ORIG
jmp tlc_weatherOutput2_ret
$SITE:
jmp tlc_weatherOutput2
$NOP
tlc_weatherOutput2_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_weatherOutput2)
]==]}


TLC.WEATHER_LABELS={
 DA_WeatherPreset_Calm={'Calm','穏やか'},DA_WeatherPreset_Cheat_Default={'Default (test)','標準（テスト）'},
 DA_WeatherPreset_cloudy={'Cloudy','曇り'},DA_WeatherPreset_Cloudy_Rain={'Cloudy / rain','曇り・雨'},
 DA_WeatherPreset_Default={'Default','標準'},DA_WeatherPreset_Fog={'Fog','霧'},
 DA_WeatherPreset_HeavySnow={'Heavy snow','大雪'},DA_WeatherPreset_High_Waves={'High waves','高波'},
 DA_WeatherPreset_LightSnow={'Light snow','小雪'},DA_WeatherPreset_LightSnow_LowTemp={'Light snow / cold','小雪・低温'},
 DA_WeatherPreset_LightSnow_Test={'Light snow (test)','小雪（テスト）'},DA_WeatherPreset_MediumSnow={'Snow','雪'},
 DA_WeatherPreset_Mid_Waves={'Moderate waves','中程度の波'},DA_WeatherPreset_Mid_Waves_cloudy={'Moderate waves / cloudy','中程度の波・曇り'},
 DA_WeatherPreset_Rain={'Rain','雨'},DA_WeatherPreset_Snow_Biome_Default={'Snow biome default','雪地域の標準'},
 DA_WeatherPreset_Storm={'Storm','嵐'},DA_WeatherPreset_Storm_NoLightning={'Storm / no lightning','嵐・雷なし'},
 DA_WeatherPreset_Strong_Storm={'Strong storm','強い嵐'},DA_WeatherPreset_Sunny={'Sunny','晴れ'}
}
function TLC.weatherDisplayName(entry)
 local n=TLC.WEATHER_LABELS[entry.label];return n and TLC.T(n[1],n[2])or TLC.T('Weather preset','天候プリセット')
end
TLC.F.weather={flag=18,hooks={'weatherOutput2'},on=function()
 if TLC.selectedWeather and TLC.selectedWeatherIndex then return end
 writeBytes(TLC.flag(18),0);writeBytes(TLC.base()+0xc0,1)
 TLC.weatherCapture={started=getTickCount()}
end,task=function()
 local request=TLC.weatherCapture
 if request and readBytes(TLC.base()+0xc0,1)==0 and readBytes(TLC.flag(18),1)==1 then
  TLC.selectedWeather=TLC.T('Current weather','現在の天候');TLC.selectedWeatherIndex=nil;TLC.weatherCapture=nil
 elseif request and getTickCount()-request.started&gt;10000 then
  TLC.reason('weather',TLC.T('Current weather could not be captured; lock stopped.','現在の天候を取得できないため固定を停止しました。'));TLC.feature('weather',false)
  local mr=getAddressList().getMemoryRecordByID(503);if mr then mr.disableWithoutExecute()end
 end
end,off=function()TLC.weatherCapture=nil;writeBytes(TLC.base()+0xc0,0)end}
function TLC.weatherPick()
 TLC.need();local names={};for _,x in ipairs(TLC.WEATHER)do names[#names+1]=TLC.weatherDisplayName(x)end
 local n=TLC.pick(TLC.T('Choose and lock weather','天候を指定して固定'),names);if not n then return end
 TLC.loadAsset(TLC.WEATHER[n].path,function(asset)
  TLC.weatherSystem(function(o)
   local base=TLC.base()+0xb00;local mask=readBytes(asset+0x90,1)
   for offset=0,52,4 do writeInteger(base+offset,readInteger(o+0x238+offset))end
   for _,group in ipairs({{1,{8,12,16}},{2,{20}},{128,{24}},{4,{28}},{8,{32}},{16,{48,52}}})do
    if(mask&amp;group[1])~=0 then for _,offset in ipairs(group[2])do writeInteger(base+offset,TLC.weatherPresetWord024(asset+0x98+offset))end end
   end
   TLC.selectedWeather=TLC.weatherDisplayName(TLC.WEATHER[n]);TLC.selectedWeatherIndex=n
   local ok,e=pcall(TLC.feature,'weather',true)
   if not ok then TLC.reason('weather',tostring(e));return end
   local record=getAddressList().getMemoryRecordByID(503)
   if record and not record.Active then record.Active=true end
   TLC.msg('Weather locked: '..TLC.selectedWeather,'天候を固定: '..TLC.selectedWeather)
  end)
 end)
end
TLC.NAMES[502]={'Choose and lock weather...','天候を指定して固定…'}
TLC.NAMES[503]={'Freeze weather (current / selected)','天候固定（現在／指定）'}

local requireSigsBeforeRecovery=TLC.requireSigs
function TLC.requireSigs(names)return requireSigsBeforeRecovery(names)end

-- Point editing and repair material requirements, installed build 25982825.
TLC.SIGS.RepairMaterials={len=7,bytes={64,85,83,86,87,65,85,72,141,108,36,224,72,129,236,32,1,0,0,72,139,5,150,79,1,6,72,51,196,72,137,69,0,69,15,182,232,72,139,242},p="40 55 53 56 57 41 55 48 8D 6C 24 E0 48 81 EC 20 01 00 00 48 8B 05 96 4F 01 06 48 33 C4 48 89 45 00 45 0F B6 E8 48 8B F2"}
TLC.SIGS.SkillPointsBonus={len=5,bytes={72,139,108,36,72,68,43,243,72,139,92,36,64,72,139,124,36,88,68,15,72,246,72,139,116,36,80,65,139,198,72,131,196,48,65,94,195,204,204,204},p="48 8B 6C 24 48 44 2B F3 48 8B 5C 24 40 48 8B 7C 24 58 44 0F 48 F6 48 8B 74 24 50 41 8B C6 48 83 C4 30 41 5E C3 CC CC CC"}
TLC.SIGS.EnhancerPointsBonus={len=7,bytes={43,248,184,0,0,0,0,15,72,248,139,199,72,131,196,32,95,195,204,204,204,204,204,204,204,204,204,204,204,204,204,72,137,92,36,8,72,137,108,36},p="2B F8 B8 00 00 00 00 0F 48 F8 8B C7 48 83 C4 20 5F C3 CC CC CC CC CC CC CC CC CC CC CC CC CC 48 89 5C 24 08 48 89 6C 24"}
TLC.HOOKS.repairMaterials3={sig='RepairMaterials',aa=[==[
[ENABLE]
alloc(tlc_repairMaterials3,$1000,$SITE)
label(tlc_repairMaterials3_original)
label(tlc_repairMaterials3_ret)
tlc_repairMaterials3:
cmp byte ptr [tlcFlags+0C],0
je tlc_repairMaterials3_original
mov al,1
ret
tlc_repairMaterials3_original:
$ORIG
jmp tlc_repairMaterials3_ret
$SITE:
jmp tlc_repairMaterials3
$NOP
tlc_repairMaterials3_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_repairMaterials3)
]==]}
TLC.HOOKS.skillPoints3={sig='SkillPointsBonus',aa=[==[
[ENABLE]
alloc(tlc_skillPoints3,$1000,$SITE)
label(tlc_skillPoints3_original)
label(tlc_skillPoints3_ret)
tlc_skillPoints3:
pushfq
mov r11d,r14d
sub r11d,ebx
mov [tlcVars+90],r11d
add r14d,[tlcVars+80]
popfq
tlc_skillPoints3_original:
$ORIG
jmp tlc_skillPoints3_ret
$SITE:
jmp tlc_skillPoints3
$NOP
tlc_skillPoints3_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_skillPoints3)
]==]}
TLC.HOOKS.enhancerPoints3={sig='EnhancerPointsBonus',aa=[==[
[ENABLE]
alloc(tlc_enhancerPoints3,$1000,$SITE)
label(tlc_enhancerPoints3_original)
label(tlc_enhancerPoints3_ret)
tlc_enhancerPoints3:
pushfq
mov r11d,edi
sub r11d,eax
mov [tlcVars+94],r11d
add edi,[tlcVars+84]
popfq
tlc_enhancerPoints3_original:
$ORIG
jmp tlc_enhancerPoints3_ret
$SITE:
jmp tlc_enhancerPoints3
$NOP
tlc_enhancerPoints3_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_enhancerPoints3)
]==]}

TLC.F.materials.hooks[#TLC.F.materials.hooks+1]='repairMaterials3'
TLC.NAMES[401]={'No materials needed for crafting / repairs','作成・修復に素材必要なし'}
function TLC.pointController()
 local p=TLC.player(true);local off=TLC.refOffset(p,'Controller');local pc=off and readQword(p+off)
 assert(TLC.valid(pc) and TLC.U.isA(pc,'VoyagePlayerController'),TLC.T('Player controller unavailable.','プレイヤー制御を取得できません。'))
 return pc
end

TLC.NAMES[207]={'Skill points (session edit)','スキルポイント（セッション内編集）'}
TLC.NAMES[208]={'Enhancement points (session edit)','強化ポイント（セッション内編集）'}
function TLC.ensurePointRows()
 local parent=getAddressList().getMemoryRecordByID(201);if not parent then return end
 for _,d in ipairs({{207,'Skill points (session edit)','スキルポイント（セッション内編集）','tlcPointSkillPending',vtDword},{208,'Enhancement points (session edit)','強化ポイント（セッション内編集）','tlcPointEnhancerPending',vtDword},{206,'Ascent velocity (cm/s)','上昇速度（cm/秒）','tlcVars+28',vtSingle}})do
  local record=getAddressList().getMemoryRecordByID(d[1])
  if not record then record=getAddressList().createMemoryRecord();record.ID=d[1];record.Type=d[5];record.Address=d[4];record.appendToEntry(parent)end
  if not record.Parent or record.Parent.ID~=201 then record.appendToEntry(parent)end
  record.Description=TLC.T(d[2],d[3]);record.DontSave=false
 end
end
TLC.ensurePointRows()
local clearBeforePoints=TLC.clearChildren
function TLC.clearChildren(mr)
 if mr.ID~=201 then return clearBeforePoints(mr)end
 for index=mr.Count-1,0,-1 do local child=mr.Child[index];if child.ID~=206 and child.ID~=207 and child.ID~=208 then child.destroy()end end
end
function TLC.refreshPoints()
 TLC.require()
 if TLC.pointTimer then TLC.pointTimer.destroy();TLC.pointTimer=nil end
 local pc=TLC.pointController();local rows={
  {207,'GetAvailableSkillPoints',0x80,0x88,0x90,'SkillPointsBonus','skillPoints3'},
  {208,'GetAvailableEnhancerPoints',0x84,0x8c,0x94,'EnhancerPointsBonus','enhancerPoints3'}}
 local available={};TLC.pointReady=TLC.pointReady or{}
 for _,d in ipairs(rows)do
  local record=assert(getAddressList().getMemoryRecordByID(d[1]),'Point editor row missing')
  TLC.pointReady[d[1]]=nil
  record.OnActivate=function(_,before)if before then return false end end
  record.OnValueChangedByUser=function(_,old,new)
   local value,was=tonumber(new),tonumber(old)
   if not TLC.pointReady[d[1]]then TLC.reason('points',TLC.T('This point field is unavailable; refresh the player editor.','このポイント項目は取得できていません。プレイヤーエディタを再取得してください。'));return end
   if not value or not was or value&lt;0 or value&gt;10000000 or value%1~=0 then writeInteger(TLC.var(d[4]),was or 0);TLC.reason('points',TLC.T('Enter an integer from 0 to 10000000.','0～10000000の整数を指定してください。'));return end
   local raw=readInteger(TLC.var(d[5]))or 0;if raw&gt;=0x80000000 then raw=raw-0x100000000 end
   writeInteger(TLC.var(d[3]),value-raw)
  end
  local okay,why=pcall(function()
   local fn=TLC.reflectedFunction069('VoyageGameplayBlueprintFunctionLibrary',d[2])
   local size=readSmallInteger(fn+0xb6)
   local input,inputSize=TLC.refFieldLayout(fn,'InController','function')
   local output,outputSize=TLC.refFieldLayout(fn,'ReturnValue','function')
   assert(size and size&lt;=128 and inputSize==8 and outputSize==4 and input+8&lt;=size and output+4&lt;=size,'Point API parameter contract changed: '..d[2])
   local cdo=TLC.defaultObject074(assert(TLC.refClass('VoyageGameplayBlueprintFunctionLibrary')))
   local dispatch=TLC.processEvent074(cdo,true)
   local implementation=TLC.reflectedNativeBody069(fn);local first,last=TLC.runtimeFunction074(implementation)
   TLC.requireSigs({d[6]});local site=assert(TLC.A[d[6]])
   assert(site&gt;=first and site+TLC.SIGS[d[6]].len&lt;=last,'Point bonus hook does not belong to the named getter')
   TLC.hookOn(d[7])
   d.fn,d.cdo,d.dispatch,d.size,d.input,d.output=fn,cdo,dispatch,size,input,output
   available[#available+1]=d
  end)
  if not okay then TLC.reason(d[2],tostring(why))end
 end
 if #available==0 then return end
 local index=1;local started=getTickCount();local timer=createTimer(nil);TLC.pointTimer=timer;timer.Interval=100
 timer.OnTimer=function(t)
  if not TLC.attached()or not TLC.valid(pc)then t.destroy();TLC.pointTimer=nil;return end
  if (TLC.userActionDepth025 or 0)&gt;0 then return end
  if TLC.pendingJob then
   if getTickCount()-started&gt;20000 then t.destroy();TLC.pointTimer=nil;TLC.reason('points',TLC.T('Point retrieval timed out; refresh the editor.','ポイント取得がタイムアウトしました。エディタを再取得してください。'))end
   return
  end
  local d=available[index];if not d then t.destroy();TLC.pointTimer=nil;return end
  t.Enabled=false;local buffer=TLC.base()+0xe80
  for i=0,d.size-1 do assert(writeBytes(buffer+i,0))end
  assert(writeQword(buffer+d.input,pc))
  local okay,why=pcall(TLC.job,d.dispatch,{d.cdo,d.fn,buffer},{pc,d.fn},function()
   local value=readInteger(buffer+d.output)
   if not value or value&lt;0 or value&gt;=100000000 then t.destroy();TLC.pointTimer=nil;TLC.reason('points',TLC.T('Invalid point result; refresh stopped.','ポイント値が不正なため取得を停止しました。'));return end
   local address=TLC.var(d[4]);assert(writeInteger(address,value))
   local record=getAddressList().getMemoryRecordByID(d[1]);if record then record.Address=('%X'):format(address)end
   TLC.pointReady[d[1]]=true;index=index+1;t.Enabled=true
  end)
  if not okay then t.destroy();TLC.pointTimer=nil;TLC.reason('points',tostring(why))end
 end
end

-- Give the two editor reads a turn between background tank-filling calls.
local fillTaskBeforePoints=TLC.F.fullTank.task
TLC.F.fullTank.task=function()if TLC.pointTimer then return end;return fillTaskBeforePoints()end
local editorBeforePoints=TLC.playerEditor
function TLC.playerEditor(mr)
 editorBeforePoints(mr)
 TLC.refreshPoints()
end

TLC.WEATHER_LABELS={
 DA_WeatherPreset_Calm={'Calm','穏やか'},DA_WeatherPreset_Cheat_Default={'Default (test)','標準（テスト）'},
 DA_WeatherPreset_cloudy={'Cloudy','曇り'},DA_WeatherPreset_Cloudy_Rain={'Cloudy / rain','曇り・雨'},
 DA_WeatherPreset_Default={'Default','標準'},DA_WeatherPreset_Fog={'Fog','霧'},
 DA_WeatherPreset_HeavySnow={'Heavy snow','大雪'},DA_WeatherPreset_High_Waves={'High waves','高波'},
 DA_WeatherPreset_LightSnow={'Light snow','小雪'},DA_WeatherPreset_LightSnow_LowTemp={'Light snow / cold','小雪・低温'},
 DA_WeatherPreset_LightSnow_Test={'Light snow (test)','小雪（テスト）'},DA_WeatherPreset_MediumSnow={'Snow','雪'},
 DA_WeatherPreset_Mid_Waves={'Moderate waves','中程度の波'},DA_WeatherPreset_Mid_Waves_cloudy={'Moderate waves / cloudy','中程度の波・曇り'},
 DA_WeatherPreset_Rain={'Rain','雨'},DA_WeatherPreset_Snow_Biome_Default={'Snow biome default','雪地域の標準'},
 DA_WeatherPreset_Storm={'Storm','嵐'},DA_WeatherPreset_Storm_NoLightning={'Storm / no lightning','嵐・雷なし'},
 DA_WeatherPreset_Strong_Storm={'Strong storm','強い嵐'},DA_WeatherPreset_Sunny={'Sunny','晴れ'}
}
function TLC.weatherDisplayName(entry)
 local n=TLC.WEATHER_LABELS[entry.label];return n and TLC.T(n[1],n[2])or TLC.T('Weather preset','天候プリセット')
end
TLC.F.weather={flag=18,hooks={'weatherOutput2'},on=function()
 if TLC.selectedWeather and TLC.selectedWeatherIndex then return end
 writeBytes(TLC.flag(18),0);writeBytes(TLC.base()+0xc0,1)
 TLC.weatherCapture={started=getTickCount()}
end,task=function()
 local request=TLC.weatherCapture
 if request and readBytes(TLC.base()+0xc0,1)==0 and readBytes(TLC.flag(18),1)==1 then
  TLC.selectedWeather=TLC.T('Current weather','現在の天候');TLC.selectedWeatherIndex=nil;TLC.weatherCapture=nil
 elseif request and getTickCount()-request.started&gt;10000 then
  TLC.reason('weather',TLC.T('Current weather could not be captured; lock stopped.','現在の天候を取得できないため固定を停止しました。'));TLC.feature('weather',false)
  local mr=getAddressList().getMemoryRecordByID(503);if mr then mr.disableWithoutExecute()end
 end
end,off=function()TLC.weatherCapture=nil;writeBytes(TLC.base()+0xc0,0)end}
function TLC.weatherPick()
 TLC.need();local names={};for _,x in ipairs(TLC.WEATHER)do names[#names+1]=TLC.weatherDisplayName(x)end
 local n=TLC.pick(TLC.T('Choose and lock weather','天候を指定して固定'),names);if not n then return end
 TLC.loadAsset(TLC.WEATHER[n].path,function(asset)
  TLC.weatherSystem(function(o)
   local base=TLC.base()+0xb00;local mask=readBytes(asset+0x90,1)
   for offset=0,52,4 do writeInteger(base+offset,readInteger(o+0x238+offset))end
   for _,group in ipairs({{1,{8,12,16}},{2,{20}},{128,{24}},{4,{28}},{8,{32}},{16,{48,52}}})do
    if(mask&amp;group[1])~=0 then for _,offset in ipairs(group[2])do writeInteger(base+offset,TLC.weatherPresetWord024(asset+0x98+offset))end end
   end
   -- Sunny is a partial preset (mask 0x05): precipitation and thunder must be cleared explicitly.
   if TLC.WEATHER[n].label=='DA_WeatherPreset_Sunny' then
    for _,offset in ipairs({20,24,32})do writeInteger(base+offset,TLC.weatherPresetWord024(asset+0x98+offset))end
   end
   TLC.selectedWeather=TLC.weatherDisplayName(TLC.WEATHER[n]);TLC.selectedWeatherIndex=n
   local ok,e=pcall(TLC.feature,'weather',true)
   if not ok then TLC.reason('weather',tostring(e));return end
   local record=getAddressList().getMemoryRecordByID(503)
   if record and not record.Active then record.Active=true end
   TLC.msg('Weather locked: '..TLC.selectedWeather,'天候を固定: '..TLC.selectedWeather)
  end)
 end)
end
TLC.NAMES[502]={'Choose and lock weather...','天候を指定して固定…'}
TLC.NAMES[503]={'Freeze weather (current / selected)','天候固定（現在／指定）'}

-- Installed EXE: VoyageModuleRotorActor propulsion, RVA 0545319F.
-- Scale the native target speed before its existing velocity feedback.
-- No transform, buoyancy, damping, power, or speed-display writes.
TLC.VARDEF[0xa0]={'float',2}
TLC.SIGS.BoatPropulsionTarget={len=5,
 bytes={242,15,89,123,32,15,90,192,242,15,88,209,15,16,137,64,2,0,0,242,15,17,77,167,242,15,89,201,242,15,92,250,242,15,89,248},
 p='F2 0F 59 7B 20 0F 5A C0 F2 0F 58 D1 0F 10 89 40 02 00 00 F2 0F 11 4D A7 F2 0F 59 C9 F2 0F 5C FA F2 0F 59 F8'}

local function boatController()
 local world=TLC.world();if not TLC.valid(world)then return end
 local gi=readQword(world+0x228);if not TLC.valid(gi)then return end
 local players=readQword(gi+0x38);local lp=players and readQword(players)
 if not TLC.valid(lp)then return end
 local pc=readQword(lp+0x30);if TLC.valid(pc)then return pc end
end

local function sameBytes(address,expected)
 local actual=readBytes(address,#expected,true);if not actual then return false end
 for k,v in ipairs(expected)do if actual[k]~=v then return false end end
 return true
end

local function installBoatPropulsion()
 TLC.require();TLC.requireSigs({'Objects','Names','Engine'})
 local cache=rawget(_G,'TLCBoatPropulsion020')
 if cache and cache.pid==getOpenedProcessID() and cache.module==TLC.moduleRequired()then
  assert(readInteger(cache.data+0x60)==0x20504c54,'Boat propulsion allocation identity mismatch')
  assert(sameBytes(cache.site,cache.original)or sameBytes(cache.site,cache.patch),'Boat propulsion instruction was replaced by another hook')
  if sameBytes(cache.site,cache.original)then assert(writeBytes(cache.site,cache.patch),'Cannot enable boat propulsion hook')end
  TLC.boatPropulsion=cache;return cache
 end
 TLC.requireSigs({'BoatPropulsionTarget'})
 local site=TLC.A.BoatPropulsionTarget
 assert(sameBytes(site,TLC.SIGS.BoatPropulsionTarget.bytes),'Boat propulsion code identity mismatch')
 local original=readBytes(site,5,true)
 -- This small allocation is reused across OFF/ON and table reloads. It is
 -- deliberately retained until process exit, so a physics callback cannot
 -- resume inside freed executable memory during deactivation.
 pcall(unregisterSymbol,'tlcBoatPropulsion020')
 pcall(unregisterSymbol,'tlcBoatPropulsion020Data')
 local script=string.format([==[
alloc(tlcBoatPropulsion020,1000,%X)
registersymbol(tlcBoatPropulsion020)
label(tlcBoatPropulsion020Data)
registersymbol(tlcBoatPropulsion020Data)
label(tlcBoatPropulsion020Loop)
label(tlcBoatPropulsion020Match)
label(tlcBoatPropulsion020Done)
tlcBoatPropulsion020:
mulsd xmm7,[rbx+20]
pushfq
push rax
push rcx
push rdx
cmp byte ptr [tlcBoatPropulsion020Data],0
je tlcBoatPropulsion020Done
mov ecx,[tlcBoatPropulsion020Data+4]
lea rax,[tlcBoatPropulsion020Data+100]
tlcBoatPropulsion020Loop:
test ecx,ecx
jz tlcBoatPropulsion020Done
cmp [rax],rbx
je tlcBoatPropulsion020Match
add rax,20
dec ecx
jmp tlcBoatPropulsion020Loop
tlcBoatPropulsion020Match:
mov ecx,[rax+8]
cmp [rbx-2FC],ecx
jne tlcBoatPropulsion020Done
mov rdx,[rax+10]
mov ecx,[rax+C]
cmp [rdx+10],ecx
jne tlcBoatPropulsion020Done
lea rcx,[rbx-308]
cmp [rdx+8],rcx
jne tlcBoatPropulsion020Done
inc dword ptr [tlcBoatPropulsion020Data+10]
mov [tlcBoatPropulsion020Data+18],rbx
movsd [tlcBoatPropulsion020Data+20],xmm7
mulsd xmm7,[tlcBoatPropulsion020Data+8]
movsd [tlcBoatPropulsion020Data+28],xmm7
mov rax,[rbp-29]
mov [tlcBoatPropulsion020Data+30],rax
mov rax,[rbp-21]
mov [tlcBoatPropulsion020Data+38],rax
mov rax,[rbp-19]
mov [tlcBoatPropulsion020Data+40],rax
tlcBoatPropulsion020Done:
pop rdx
pop rcx
pop rax
popfq
jmp %X
align 10
tlcBoatPropulsion020Data:
resb 600
%X:
jmp tlcBoatPropulsion020
]==],site,site+5,site)
 local ok,info=autoAssemble(script);assert(ok,tostring(info))
 cache={pid=getOpenedProcessID(),module=TLC.moduleRequired(),site=site,original=original,
  patch=readBytes(site,5,true),code=getAddress('tlcBoatPropulsion020'),data=getAddress('tlcBoatPropulsion020Data')}
 assert(cache.patch and cache.patch[1]==0xe9,'Boat propulsion jump encoding mismatch')
 writeDouble(cache.data+8,1);writeInteger(cache.data+0x60,0x20504c54)
 _G.TLCBoatPropulsion020=cache;TLC.boatPropulsion=cache
 return cache
end

function TLC.stopBoatPropulsion()
 local c=TLC.boatPropulsion or rawget(_G,'TLCBoatPropulsion020')
 if not c or c.pid~=getOpenedProcessID()or c.module~=TLC.moduleRequired()then return end
 writeBytes(c.data,0);writeInteger(c.data+4,0)
 if sameBytes(c.site,c.patch)then assert(writeBytes(c.site,c.original),'Cannot restore boat propulsion instruction')
 elseif not sameBytes(c.site,c.original)then TLC.reason('boatSpeed','Boat propulsion site belongs to another hook; not overwritten')end
 c.targets=nil
end

function TLC.updateBoatPropulsion()
 local c=assert(TLC.boatPropulsion,'Boat propulsion hook unavailable')
 local ratio=readFloat(TLC.var(0xa0))
 assert(ratio and ratio==ratio and ratio&gt;0 and ratio&lt;math.huge,TLC.T('Boat speed multiplier must be a finite number greater than 0.','船の速度倍率は0より大きい有限の数値を指定してください。'))
 writeDouble(c.data+8,ratio)
 local pc=boatController();local boat=pc and readQword(pc+0x350)
 local rows={};local keys={}
 if TLC.valid(boat)and TLC.U.isA(boat,'VoyageBoatPawn')then
  local root=readQword(boat+0x1b8);local level=readQword(boat+0x388)
  assert(TLC.valid(root)and TLC.valid(level),'Boat hierarchy unavailable')
  assert(TLC.refOffset(level,'OwnedActors')==0x318,'Boat actor-list layout mismatch')
  local array=readQword(level+0x318);local count=readInteger(level+0x320)
  assert(count and count&gt;=0 and count&lt;=4096,'Invalid boat actor-list count')
  for k=0,count-1 do
   local actor=TLC.weak(array+k*8)
   if TLC.valid(actor)and TLC.U.isA(actor,'VoyageModuleRotorActor')then
    assert(TLC.refOffset(actor,'RotationSpeedToLinearSpeed')==0x314,'Rotor property layout mismatch')
    local parent=readQword(actor+0x1b8);local belongs=false
    for depth=1,64 do
     if parent==root then belongs=true;break end
     if not TLC.valid(parent)then break end
     parent=readQword(parent+0xd0)
    end
    if belongs then
     assert(readQword(readQword(actor+0x308)+8)==c.site-0x16f,'Rotor propulsion interface identity mismatch')
     local good,entry=TLC.valid(actor);assert(good)
     local index=readInteger(actor+0xc);local serial=readInteger(entry+0x10)
     rows[#rows+1]={actor+0x308,index,serial,entry}
     keys[#keys+1]=string.format('%X:%d:%d',actor,index,serial)
    end
   end
  end
 end
 assert(#rows&lt;=32,'Too many boat propellers')
 local key=table.concat(keys,';')
 if c.targets~=key then
  writeInteger(c.data+4,0)
  for k,row in ipairs(rows)do local p=c.data+0x100+(k-1)*0x20
   writeQword(p,row[1]);writeInteger(p+8,row[2]);writeInteger(p+0xc,row[3]);writeQword(p+0x10,row[4])
  end
  c.targets=key;writeInteger(c.data+4,#rows)
 end
 writeBytes(c.data,1)
end

TLC.F.boatSpeed={on=function()
 installBoatPropulsion()
 local ok,e=pcall(TLC.updateBoatPropulsion)
 if not ok then TLC.stopBoatPropulsion();error(e,0)end
end,task=TLC.updateBoatPropulsion,off=TLC.stopBoatPropulsion}
TLC.NAMES[209]={'Boat speed multiplier','船の速度倍率'}
TLC.NAMES[210]={'Multiplier','倍率'}
TLC.F.jump=nil;TLC.NAMES[204]=nil;TLC.NAMES[205]=nil

-- EXE GetDriver UHT wrapper RVA 0529AC75 reads VoyageVehiclePawn+0430.
-- Keep the controlled pawn separate from the human player's character.
function TLC.playerController(required)
 local world=TLC.world()
 local gi=world and readQword(world+0x228)
 local array=TLC.valid(gi)and readQword(gi+0x38)
 local lp=array and readQword(array)
 local pc=TLC.valid(lp)and readQword(lp+0x30)
 if TLC.valid(pc)and TLC.U.isA(pc,'VoyagePlayerController')then return pc end
 if required then error(TLC.T('Local player controller unavailable.','ローカルプレイヤーの制御を取得できません。'),0)end
end

function TLC.controlledPawn(required)
 local pc=TLC.playerController(false)
 local pawn=pc and readQword(pc+0x350)
 if TLC.valid(pawn)and TLC.U.isA(pawn,'Pawn')then return pawn end
 if required then error(TLC.T('Controlled pawn unavailable. Load a playable save.','操作対象を取得できません。プレイ可能なセーブを読み込んでください。'),0)end
end

function TLC.pointController()
 return TLC.playerController(true)
end

function TLC.player(required)
 local pawn=TLC.controlledPawn(false)
 if TLC.valid(pawn)then
  if TLC.U.isA(pawn,'VoyageCharacter')then return pawn end
  if TLC.U.isA(pawn,'VoyageVehiclePawn')then
   local offset=TLC.refOffset(pawn,'Driver')
   if offset==0x430 then
    local driver=readQword(pawn+offset)
    if TLC.valid(driver)and TLC.U.isA(driver,'VoyageCharacter')then return driver end
   end
  end
 end
 if required then error(TLC.T('Player character unavailable: neither the controlled pawn nor its verified driver is a player character.','プレイヤーキャラクターを取得できません。操作対象と搭乗者の参照を確認できませんでした。'),0)end
end

TLC.VARDEF[0xa4]={'float',0.001}
TLC.SIGS.DismantleItem022={len=8,bytes={243,15,16,179,116,2,0,0},p='F3 0F 10 B3 74 02 00 00 48 8B 5C 24 58 F3 0F 59 F7 0F 28 7C 24 20 0F 28 C6 0F 28 74 24 30 48 83 C4 40 5E C3 CC 40 53 48'}
TLC.HOOKS.DismantleItem022={sig='DismantleItem022',aa=[==[
[ENABLE]
alloc(tlc_DismantleItem022,$1000,$SITE)
label(tlc_DismantleItem022_ret)
label(tlc_DismantleItem022_done)
tlc_DismantleItem022:
$ORIG
pushfq
cmp byte ptr [tlcFlags+05],0
je tlc_DismantleItem022_done
movss xmm6,[tlcVars+A4]
inc dword ptr [tlcFlags+D30]
tlc_DismantleItem022_done:
popfq
jmp tlc_DismantleItem022_ret
$SITE:
jmp tlc_DismantleItem022
$NOP
tlc_DismantleItem022_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_DismantleItem022)
]==]}
TLC.SIGS.DismantleModule022={len=8,bytes={243,15,16,131,116,2,0,0},p='F3 0F 10 83 74 02 00 00 48 83 C4 20 5B C3 48 83 C4 20 5B E9 FC FE 0F 00 CC CC CC CC CC CC CC CC CC CC CC CC 40 53 48 83'}
TLC.HOOKS.DismantleModule022={sig='DismantleModule022',aa=[==[
[ENABLE]
alloc(tlc_DismantleModule022,$1000,$SITE)
label(tlc_DismantleModule022_ret)
label(tlc_DismantleModule022_done)
tlc_DismantleModule022:
$ORIG
pushfq
cmp byte ptr [tlcFlags+05],0
je tlc_DismantleModule022_done
movss xmm0,[tlcVars+A4]
inc dword ptr [tlcFlags+D30]
tlc_DismantleModule022_done:
popfq
jmp tlc_DismantleModule022_ret
$SITE:
jmp tlc_DismantleModule022
$NOP
tlc_DismantleModule022_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_DismantleModule022)
]==]}
TLC.SIGS.DismantleBase022={len=8,bytes={243,15,16,130,116,2,0,0},p='F3 0F 10 82 74 02 00 00 C3 CC 40 53 48 83 EC 20 44 0F B6 C2 48 8B D9 84 D2 74 65 41 83 E8 01 74 4F 41 83 E8 01 74 39 41'}
TLC.HOOKS.DismantleBase022={sig='DismantleBase022',aa=[==[
[ENABLE]
alloc(tlc_DismantleBase022,$1000,$SITE)
label(tlc_DismantleBase022_ret)
label(tlc_DismantleBase022_done)
tlc_DismantleBase022:
$ORIG
pushfq
cmp byte ptr [tlcFlags+05],0
je tlc_DismantleBase022_done
movss xmm0,[tlcVars+A4]
inc dword ptr [tlcFlags+D30]
tlc_DismantleBase022_done:
popfq
jmp tlc_DismantleBase022_ret
$SITE:
jmp tlc_DismantleBase022
$NOP
tlc_DismantleBase022_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_DismantleBase022)
]==]}
TLC.SIGS.RepairItem022={len=8,bytes={243,15,16,179,208,2,0,0},p='F3 0F 10 B3 D0 02 00 00 EB 08 F3 0F 10 B3 74 02 00 00 48 8B 5C 24 58 F3 0F 59 F7 0F 28 7C 24 20 0F 28 C6 0F 28 74 24 30'}
TLC.HOOKS.RepairItem022={sig='RepairItem022',aa=[==[
[ENABLE]
alloc(tlc_RepairItem022,$1000,$SITE)
label(tlc_RepairItem022_ret)
label(tlc_RepairItem022_done)
tlc_RepairItem022:
$ORIG
pushfq
cmp byte ptr [tlcFlags+05],0
je tlc_RepairItem022_done
movss xmm6,[tlcVars+A4]
inc dword ptr [tlcFlags+D30]
tlc_RepairItem022_done:
popfq
jmp tlc_RepairItem022_ret
$SITE:
jmp tlc_RepairItem022
$NOP
tlc_RepairItem022_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_RepairItem022)
]==]}
TLC.SIGS.RepairBase022={len=8,bytes={243,15,16,130,208,2,0,0},p='F3 0F 10 82 D0 02 00 00 C3 F3 0F 10 82 74 02 00 00 C3 CC 40 53 48 83 EC 20 44 0F B6 C2 48 8B D9 84 D2 74 65 41 83 E8 01'}
TLC.HOOKS.RepairBase022={sig='RepairBase022',aa=[==[
[ENABLE]
alloc(tlc_RepairBase022,$1000,$SITE)
label(tlc_RepairBase022_ret)
label(tlc_RepairBase022_done)
tlc_RepairBase022:
$ORIG
pushfq
cmp byte ptr [tlcFlags+05],0
je tlc_RepairBase022_done
movss xmm0,[tlcVars+A4]
inc dword ptr [tlcFlags+D30]
tlc_RepairBase022_done:
popfq
jmp tlc_RepairBase022_ret
$SITE:
jmp tlc_RepairBase022
$NOP
tlc_RepairBase022_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_RepairBase022)
]==]}
for _,name in ipairs({'DismantleItem022','DismantleModule022','DismantleBase022','RepairItem022','RepairBase022'})do TLC.F.instant.hooks[#TLC.F.instant.hooks+1]=name end
TLC.NAMES[402]={'Instant crafting / building / dismantling / repairs','即クラフト・ビルド・解体・修理'}

-- The installed game's map overlay asset and its reflected UI entry point.
function TLC.openMap()
 TLC.need()
 if TLC.mapLoading and not TLC.pendingJob and getTickCount()-(TLC.mapLoadStarted or 0)&gt;15000 then TLC.mapLoading=nil end
 if TLC.pendingJob or TLC.mapLoading then return end
 local pc=TLC.playerController(true)
 local function show(asset)
  if not TLC.valid(pc)or pc~=TLC.playerController(false)then TLC.mapLoading=nil;return end
  local cls=readQword(pc+0x10);local fn
  for depth=1,16 do
   if not TLC.valid(cls)then break end
   local f=readQword(cls+0x48)
   for k=1,1500 do
    if not TLC.valid(f)then break end
    if TLC.U.n(f)=='ShowOverlayWidget'then fn=f;break end
    f=readQword(f+0x28)
   end
   if fn then break end;cls=readQword(cls+0x40)
  end
  assert(fn and TLC.executable038(readQword(fn+0xd8)),'Named map overlay entry point unavailable')
  local parameterSize=readSmallInteger(fn+0xb6)
  local inputOffset,inputSize=TLC.refFieldLayout(fn,'InWidgetData','function')
  local modeOffset,modeSize=TLC.refFieldLayout(fn,'InputModeOverride','function')
  local resultOffset,resultSize=TLC.refFieldLayout(fn,'ReturnValue','function')
  assert(parameterSize and parameterSize&lt;=128 and inputSize==8 and modeSize==1 and resultSize==8 and inputOffset+8&lt;=parameterSize and modeOffset+1&lt;=parameterSize and resultOffset+8&lt;=parameterSize,'Map overlay parameter contract changed')
  local data=TLC.base()+0xc80
  for k=0,parameterSize-1 do writeBytes(data+k,0)end
  writeQword(data+inputOffset,asset)
  TLC.job(TLC.nativeSlot(pc,0x250),{pc,fn,data},{pc,asset},function()
   TLC.mapLoading=nil
   local widget=readQword(data+resultOffset)
   assert(TLC.valid(widget)and TLC.U.isA(widget,'UserWidget'),TLC.T('The game did not create the map overlay.','ゲーム側がマップ画面を作成できませんでした。'))
   TLC.lastMapWidget=widget;TLC.mapOpened=getTickCount()
  end)
 end
 TLC.mapLoading=true
 TLC.mapLoadStarted=getTickCount()
 local ok,e=pcall(function()
  if TLC.valid(TLC.mapAsset)then show(TLC.mapAsset)
  else TLC.loadAsset('/Game/Data/UI/OverlayWidgets/DA_Widget_Map.DA_Widget_Map',function(asset)TLC.mapAsset=asset;show(asset)end)end
 end)
 if not ok then TLC.mapLoading=nil;error(e,0)end
end

if TLC.mapHotkey then TLC.mapHotkey.destroy()end
TLC.mapHotkey=createHotkey(function()
 if TLC.attached()and getForegroundProcess()==TLC.pid then TLC.userRun(TLC.openMap)end
end,0x4d)
TLC.mapHotkey.DelayBetweenActivate=500
TLC.NAMES[117]={'Open map [M]','マップを開く [M]'}

-- Static Blueprint OnAction requires AbilityCharge &gt; .99 even when its duration is short.
-- Change charge only at the game's own action dispatch, for the equipped dismantle ability.
TLC.SIGS.DismantleDispatch023={len=8,bytes={0x48,0x8b,0x07,0x48,0x8d,0x54,0x24,0x20},p='48 8B 07 48 8D 54 24 20 48 8B CF FF 90 A0 05 00 00'}
TLC.HOOKS.DismantleDispatch023={sig='DismantleDispatch023',aa=[==[
[ENABLE]
alloc(tlc_DismantleDispatch023,$1000,$SITE)
label(tlc_DismantleDispatch023_ret)
label(tlc_DismantleDispatch023_done)
tlc_DismantleDispatch023:
pushfq
push r10
mov r10,[tlcFlags+DF0]
test r10,r10
jz tlc_DismantleDispatch023_done
cmp byte ptr [tlcFlags+05],0
je tlc_DismantleDispatch023_done
cmp [rdi+10],r10
jne tlc_DismantleDispatch023_done
mov r10d,[rdi+D4]
mov [tlcFlags+DFC],r10d
mov dword ptr [rdi+D4],3F800000
inc dword ptr [tlcFlags+DF8]
tlc_DismantleDispatch023_done:
pop r10
popfq
$ORIG
jmp tlc_DismantleDispatch023_ret
$SITE:
jmp tlc_DismantleDispatch023
$NOP
tlc_DismantleDispatch023_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_DismantleDispatch023)
]==]}
function TLC.updateDismantleClass023()
 local cls=0
 local p=TLC.player()
 local holster=p and readQword(p+0x6a0)
 if TLC.valid(holster)then
  for _,slot in ipairs(TLC.map(holster+0x7f0,24))do
   local tool=readQword(slot+8)
   if TLC.valid(tool)and TLC.U.isA(tool,'VoyageEquipmentActor')then
    for _,row in ipairs(TLC.map(tool+0x718,24))do
     local ability=readQword(row+8)
     if TLC.valid(ability)and TLC.U.isA(ability,'BP_ToolAbility_Maintenance_Dismantle_C')then
      cls=readQword(ability+0x10);break
     end
    end
   end
   if cls~=0 then break end
  end
 end
 writeQword(TLC.base()+0xdf0,cls)
end
local instantTask023=TLC.F.instant.task
local instantOn023=TLC.F.instant.on
TLC.F.instant.on=function()
 if instantOn023 then instantOn023()end
 TLC.updateDismantleClass023()
end
TLC.F.instant.task=function()
 if instantTask023 then instantTask023()end
 TLC.updateDismantleClass023()
end
TLC.F.instant.hooks[#TLC.F.instant.hooks+1]='DismantleDispatch023'

-- Static installed BP_WindManager reads CurrentClimate; cloud-mask objects read
-- WeatherVolume.Climate AND WeatherVolume.WeatherPreset.Climate directly.
-- Keep those inputs consistent with the native API output lock. No asset files change.
local weatherOn024=TLC.F.weather.on
local weatherOff024=TLC.F.weather.off
local weatherTask024=TLC.F.weather.task
TLC.WEATHER_CLIMATE_OFFSETS024={8,12,16,20,24,28,32}
function TLC.weatherPresetWord024(address)
 local edit=TLC.edits and TLC.edits[address]
 if edit and edit.key=='weather' then
  return string.unpack('&lt;I4',string.pack('&lt;f',edit.old))
 end
 return readInteger(address)
end
TLC.F.weather.on=function()
 if weatherOn024 then weatherOn024()end
 TLC.weatherGeneration024=(TLC.weatherGeneration024 or 0)+1
 local generation=TLC.weatherGeneration024
 TLC.weatherVolumes024=TLC.weatherVolumes024 or {};TLC.weatherNext024=nil
 TLC.weatherSystem(function(sys)
  if generation~=TLC.weatherGeneration024 then return end
  assert(TLC.valid(sys)and TLC.U.isA(sys,'VoyageWeatherSubsystem'),'Weather subsystem expired')
  TLC.weatherVolumeSystem024=sys;TLC.weatherVolumeWorld024=TLC.world()
  if TLC.weatherCapture then
   for offset=0,36,4 do writeInteger(TLC.base()+0xb00+offset,readInteger(sys+0xc8+offset))end
   for offset=0,12,4 do writeInteger(TLC.base()+0xb28+offset,readInteger(sys+0xf0+offset))end
   TLC.weatherCapture=nil;TLC.selectedWeatherIndex=nil
   TLC.selectedWeather=TLC.T('Current weather','現在の天候')
   writeBytes(TLC.base()+0xc0,0);writeBytes(TLC.flag(18),1)
  end
 end)
end
TLC.F.weather.task=function()
 if weatherTask024 then weatherTask024()end
 if not TLC.featOn.weather or TLC.weatherCapture then return end
 local sys=TLC.weatherVolumeSystem024
 if not sys then return end
 assert(TLC.world()==TLC.weatherVolumeWorld024 and TLC.valid(sys),'Weather world changed; enable weather lock again')
 local now=getTickCount()
 if TLC.weatherNext024 and now&lt;TLC.weatherNext024 then return end
 TLC.weatherNext024=now+200
 local target={}
 for _,off in ipairs(TLC.WEATHER_CLIMATE_OFFSETS024)do
  local v=readFloat(TLC.base()+0xb00+off)
  assert(v and v==v and math.abs(v)&lt;1000000,'Invalid frozen climate value')
  target[off]=v
 end
 local presets={};local count=0
 for _,row in ipairs(TLC.map(sys+0x60,24))do
  local volume=readQword(row+8)
  if TLC.valid(volume)and TLC.U.isA(volume,'VoyageWeatherVolume')then
   count=count+1
   local preset=readQword(volume+0x268)
   local dirty=false
   if TLC.valid(preset)and TLC.U.isA(preset,'VoyageWeatherPreset')then
    if presets[preset]==nil then
     local presetDirty=false
     for _,off in ipairs(TLC.WEATHER_CLIMATE_OFFSETS024)do
      if readFloat(preset+0x98+off)~=target[off]then
       TLC.changed(preset+0x98+off,'float',target[off],preset,'weather');presetDirty=true
      end
     end
     presets[preset]=presetDirty
    end
    dirty=presets[preset]
   end
   for _,off in ipairs(TLC.WEATHER_CLIMATE_OFFSETS024)do
    if readFloat(volume+0x278+off)~=target[off]then
     TLC.changed(volume+0x278+off,'float',target[off],volume,'weather');dirty=true
    end
   end
   local known=TLC.weatherVolumes024[volume]
   local _,entry=TLC.valid(volume);local serial=readInteger(entry+0x10)
   if not known or known~=serial then dirty=true end
   TLC.weatherVolumes024[volume]=serial
   if dirty then writeBytes(volume+0x2c8,1)end
  end
 end
 TLC.weatherVolumeCount024=count
end
TLC.F.weather.off=function()
 TLC.weatherGeneration024=(TLC.weatherGeneration024 or 0)+1
 TLC.weatherRestoreVolumes024=TLC.weatherVolumes024
 TLC.weatherVolumes024=nil;TLC.weatherVolumeSystem024=nil;TLC.weatherNext024=nil
 if weatherOff024 then weatherOff024()end
end
local weatherFeature024=TLC.feature
function TLC.feature(key,on)
 local result=weatherFeature024(key,on)
 if key~='weather'or on then return result end
 local rows=TLC.weatherRestoreVolumes024
 if not rows then return result end
 TLC.weatherRestoreVolumes024=nil
 if not TLC.attached()then return result end
 -- Feature-off has already restored climate floats; request the game's own redraw.
 for volume,serial in pairs(rows)do
  local valid,entry=TLC.valid(volume)
  if valid and TLC.U.isA(volume,'VoyageWeatherVolume')and TLC.world()==TLC.weatherVolumeWorld024 and readInteger(entry+0x10)==serial then writeBytes(volume+0x2c8,1)end
 end
 return result
end

TLC.VARDEF[0xa8]={'float',30}
TLC.VARDEF[0xac]={'float',0}
TLC.VARDEF[0xb0]={'float',30}
TLC.VARDEF[0xb4]={'float',0}
local aa=TLC.HOOKS.weatherOutput2.aa
local function replaceOnce(source,old,new)
 local p=assert(source:find(old,1,true),'Wind integration marker unavailable')
 assert(not source:find(old,p+#old,true),'Wind integration marker is ambiguous')
 return source:sub(1,p-1)..new..source:sub(p+#old)
end
aa=replaceOnce(aa,'label(tlc_weatherOutput2_apply)','label(tlc_weatherOutput2_apply)\nlabel(tlc_weatherOutput2_wind)')
aa=replaceOnce(aa,'cmp byte ptr [tlcFlags+12],0\nje tlc_weatherOutput2_done',
 'cmp byte ptr [tlcFlags+12],0\nje tlc_weatherOutput2_wind')
aa=replaceOnce(aa,'tlc_weatherOutput2_done:\n',[==[
tlc_weatherOutput2_wind:
cmp byte ptr [tlcFlags+1E],0
je tlc_weatherOutput2_done
movss xmm0,[tlcVars+B4]
movss [r11+08],xmm0
movss xmm0,[tlcVars+B0]
movss [r11+0C],xmm0
mov byte ptr [rsp+48],1
inc dword ptr [tlcFlags+D40]
tlc_weatherOutput2_done:
]==])
TLC.HOOKS.weatherOutput2.aa=aa
function TLC.applyWind024()
 local speed=readFloat(TLC.var(0xa8));local direction=readFloat(TLC.var(0xac))
 assert(speed and speed==speed and speed&gt;=0 and speed&lt;=300,TLC.T('Wind speed must be between 0 and 300 km/h.','風速は0～300 km/hで指定してください。'))
 assert(direction and direction==direction and direction&gt;=0 and direction&lt;=360,TLC.T('Wind direction must be between 0 and 360 degrees.','風向は0～360度で指定してください。'))
 -- The native hook reads only validated shadow values, never an unchecked editor input.
 writeFloat(TLC.var(0xb0),speed);writeFloat(TLC.var(0xb4),direction==360 and 0 or direction)
end
TLC.F.wind={flag=0x1e,hooks={'weatherOutput2'},on=TLC.applyWind024,task=TLC.applyWind024}
TLC.NAMES[510]={'Wind control / lock','風操作・固定'}
TLC.NAMES[511]={'Wind speed (km/h, 0-300)','風速（km/h・0～300）'}
TLC.NAMES[512]={'Wind direction (degrees, 0-360)','風向（度・0～360）'}

-- Queue complete user operations, never just native calls whose scratch buffers may be shared.
TLC.actions025={}
TLC.userActionDepth025=0
function TLC.actionBusy025()
 if TLC.pendingJob then return true end
 if not TLC.attached()then return false end
 local state=readInteger(TLC.base()+0x500)or 0
 if state==3 or state==4 then
  -- A completed/cancelled orphan has no executing native code.
  writeInteger(TLC.base()+0x500,0);return false
 end
 return state~=0
end
local immediateUserRun025=TLC.userRun
local function runUser025(fn)
 TLC.userActionDepth025=TLC.userActionDepth025+1
 local ok,result=pcall(immediateUserRun025,fn)
 TLC.userActionDepth025=TLC.userActionDepth025-1
 if not ok then TLC.reason('action',tostring(result));return false end
 return result
end
function TLC.enqueueAction025(fn,key,guard,cancelled)
 local queue=TLC.actions025
 if key then for i=#queue,1,-1 do if queue[i].key==key then local old=table.remove(queue,i);if old.cancelled then pcall(old.cancelled,'superseded')end end end end
 if #queue&gt;=32 then TLC.reason('action',TLC.T('Action queue is full (32).','操作の待機数が上限（32件）です。'));return false end
 queue[#queue+1]={fn=fn,key=key,guard=guard,cancelled=cancelled,pid=TLC.pid,world=TLC.world()}
 TLC.startTimer()
 return true
end
function TLC.userRun(fn)
 if not TLC.immediate025 and(TLC.actionBusy025()or #TLC.actions025&gt;0)then
  return TLC.enqueueAction025(fn)
 end
 return runUser025(fn)
end
function TLC.drainActions025()
 if TLC.userActionDepth025&gt;0 or TLC.actionBusy025()then return end
 local request=table.remove(TLC.actions025,1)
 if not request then return end
 if request.pid~=TLC.pid or not TLC.attached()or request.world~=TLC.world()then
  if request.cancelled then pcall(request.cancelled,'target/world identity changed')end
   TLC.msg('Queued action cancelled: process/world changed.','待機操作を取り消しました：プロセス／ワールドが変わりました。');return
 end
 if request.guard then local okay,valid=pcall(request.guard);if not okay or not valid then if request.cancelled then pcall(request.cancelled,okay and 'target/world identity changed'or tostring(valid))end;return end end
 -- Nested userRun calls in this operation must not jump behind later requests.
 TLC.immediate025=true
 runUser025(request.fn)
 TLC.immediate025=nil
end
local toggle025=TLC.toggleRecord
function TLC.toggleRecord(mr,key,on)
 local id=mr.ID;local queueKey='record:'..id
 if not on then
  for i=#TLC.actions025,1,-1 do if TLC.actions025[i].key==queueKey then table.remove(TLC.actions025,i)end end
  local old=TLC.immediate025;TLC.immediate025=true
  local ok,e=pcall(toggle025,mr,key,false);TLC.immediate025=old
  if not ok then error(e,0)end
  return
 end
 if not TLC.immediate025 and(TLC.actionBusy025()or #TLC.actions025&gt;0)then
  local accepted=TLC.enqueueAction025(function()
   local record=getAddressList().getMemoryRecordByID(id)
   if record and record.Active then toggle025(record,key,true)end
  end,queueKey,function()
   local record=getAddressList().getMemoryRecordByID(id)
   return record and record.Active
  end)
  if not accepted then
   local timer=createTimer(nil,false);timer.Interval=50
   timer.OnTimer=function(t)
    t.destroy();local record=getAddressList().getMemoryRecordByID(id)
    if record then record.disableWithoutExecute()end
   end
   timer.Enabled=true
  end
  return accepted
 end
 return toggle025(mr,key,true)
end
-- A modal user picker processes CE timers; keep background native dispatch out of it.
local tankTask025=TLC.F.fullTank.task
TLC.F.fullTank.task=function()
 if TLC.userActionDepth025&gt;0 or #TLC.actions025&gt;0 then return end
 return tankTask025()
end
local disable025=TLC.disableAll
function TLC.disableAll(...)
 TLC.actions025={}
 return disable025(...)
end
local forget025=TLC.forgetProcess
function TLC.forgetProcess(...)
 TLC.actions025={}
 return forget025(...)
end

TLC.VARDEF[0x34]={'float',10}
TLC.VARDEF[0x20]={'float',1.5}
TLC.VARDEF[0xa0]={'float',5}
TLC.NAMES[200]={'02. Player / Boats','02. プレイヤー・船'}
TLC.NAMES[110]={'No fuel consumption for boats / vehicles','船などの燃料消費なし'}
TLC.NAMES[115]={'Freeze human seed survival countdown','生存可能時間カウント停止（ヒューマンシード）'}
TLC.NAMES[113]={'No electricity / fuel / water / gas consumption (global)','電力・燃料・水・ガスなど消費なし（全体）'}
TLC.NAMES[117]={'Bind map to the M key','Mキーのマップをバインド'}
function TLC.bindMapKey026()
 if TLC.mapHotkey then TLC.mapHotkey.destroy();TLC.mapHotkey=nil end
 TLC.mapHotkey=createHotkey(function()
  if TLC.attached()and getForegroundProcess()==TLC.pid then TLC.userRun(TLC.openMap)end
 end,0x4d)
 TLC.mapHotkey.DelayBetweenActivate=500
end
TLC.NAMES[404]={'No building power / tank consumption','ビルド物の電力・タンク消費なし'}
TLC.NAMES[405]=nil
TLC.F.powerTank={hooks={},on=function()
 local powerWasOn=TLC.featOn.power
 local tankWasOn=TLC.featOn.tank
 local ok,e=pcall(function()
  TLC.feature('power',true)
  TLC.feature('tank',true)
 end)
 if not ok then
  if not powerWasOn then pcall(TLC.feature,'power',false)end
  if not tankWasOn then pcall(TLC.feature,'tank',false)end
  error(e,0)
 end
end,off=function()
 TLC.feature('power',false)
 TLC.feature('tank',false)
end}

-- Installed native damage entry, rather than the bypassable bIsDestructible flag.
TLC.SIGS.BoatDamage027={len=6,bytes={64,83,72,131,236,64,128,185,208,0,0,0,0,72,139,217,15,41,116,36,48,15,40,241,117,5,69,132,192,116,23,72,139,21,10,191,42,6,72,139},p='40 53 48 83 EC 40 80 B9 D0 00 00 00 00 48 8B D9 0F 29 74 24 30 0F 28 F1 75 05 45 84 C0 74 17 48 8B 15 0A BF 2A 06 48 8B'}
TLC.SIGS.BoatProtectClass027={len=0,bytes={72,139,5,82,80,95,6,72,133,192,15,133,189,0,0,0,72,141,5,250,89,64,253,73,137,67,16,76,141,13,95,148,0,0,72,141,5,72,251,46},p='48 8B 05 52 50 5F 06 48 85 C0 0F 85 BD 00 00 00 48 8D 05 FA 59 40 FD 49 89 43 10 4C 8D 0D 5F 94 00 00 48 8D 05 48 FB 2E'}
local function prepareBoatDamage027()
 local layout=TLC.boatProtectionLayout106()
 TLC.requireSigs({'BoatDamage027','Objects','Names'})
 local boatClass=layout.boatClass
 local site=TLC.A.BoatDamage027
 local cache=rawget(_G,'TLCBoatProtection106')
 if not(cache and cache.pid==TLC.pid and cache.module==TLC.moduleRequired())then
  local aa=string.format([==[
alloc(tlcBoatProtection027,1000,%X)
registersymbol(tlcBoatProtection027)
label(tlcBoatProtection027Data)
registersymbol(tlcBoatProtection027Data)
label(tlcBoatProtection027Loop)
label(tlcBoatProtection027Class)
label(tlcBoatProtection027Next)
label(tlcBoatProtection027Block)
label(tlcBoatProtection027Normal)
tlcBoatProtection027:
pushfq
push rax
push rdx
push r8
push r9
push r10
push r11
cmp byte ptr [tlcBoatProtection027Data],0
je tlcBoatProtection027Normal
ucomiss xmm1,[tlcBoatProtection027Data+20]
jbe tlcBoatProtection027Normal
mov r10,[tlcBoatProtection027Data+08]
test r10,r10
jz tlcBoatProtection027Normal
mov rax,[rcx+%X]
test rax,rax
jz tlcBoatProtection027Normal
test rax,07
jnz tlcBoatProtection027Normal
mov r9,[rax+%X]
mov r11d,40
tlcBoatProtection027Loop:
test r9,r9
jz tlcBoatProtection027Normal
test r9,07
jnz tlcBoatProtection027Normal
mov rax,[r9+20]
test rax,rax
jz tlcBoatProtection027Next
test rax,07
jnz tlcBoatProtection027Normal
mov rdx,[rax+10]
mov r8d,20
tlcBoatProtection027Class:
test rdx,rdx
jz tlcBoatProtection027Next
cmp rdx,r10
je tlcBoatProtection027Block
mov rdx,[rdx+40]
dec r8d
jnz tlcBoatProtection027Class
tlcBoatProtection027Next:
mov r9,[r9+%X]
dec r11d
jnz tlcBoatProtection027Loop
jmp tlcBoatProtection027Normal
tlcBoatProtection027Block:
inc dword ptr [tlcBoatProtection027Data+04]
mov [tlcBoatProtection027Data+10],rcx
movss [tlcBoatProtection027Data+18],xmm1
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rax
popfq
xorps xmm0,xmm0
ret
tlcBoatProtection027Normal:
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rax
popfq
db 40 53 48 83 EC 40
jmp %X
align 10
tlcBoatProtection027Data:
resb 40
]==],site,layout.componentOwner,layout.root,layout.parent,site+6)
  local ok,e=autoAssemble(aa);assert(ok,tostring(e))
  cache={pid=TLC.pid,module=TLC.moduleRequired(),site=site,code=getAddress('tlcBoatProtection027'),data=getAddress('tlcBoatProtection027Data')}
  assert(math.abs(cache.code-site-5)&lt;=0x7fffffff,'Boat protection allocation is out of range')
  writeInteger(cache.data+0x24,0x1060544c)
  cache.layoutKey=table.concat({layout.componentOwner,layout.root,layout.parent},':')
  _G.TLCBoatProtection106=cache
 else
  assert(cache.layoutKey==table.concat({layout.componentOwner,layout.root,layout.parent},':'),'Boat protection metadata changed; no stale allocation reused')
  assert(cache.site==site and readInteger(cache.data+0x24)==0x1060544c,'Boat protection allocation identity mismatch')
  pcall(unregisterSymbol,'tlcBoatProtection027');registerSymbol('tlcBoatProtection027',cache.code,true)
  pcall(unregisterSymbol,'tlcBoatProtection027Data');registerSymbol('tlcBoatProtection027Data',cache.data,true)
 end
 TLC.boatProtection027=cache
 writeQword(cache.data+8,boatClass)
 writeFloat(cache.data+0x20,0)
 writeBytes(cache.data,1)
end
TLC.HOOKS.boatProtection027={sig='BoatDamage027',aa=[==[
[ENABLE]
$SITE:
jmp tlcBoatProtection027
$NOP
[DISABLE]
$SITE:
$ORIG
]==]}
-- The small trampoline remains allocated until process exit, including across reloads.
-- OFF removes the site jump and disables its data flag before any pending callback resumes.
TLC.F.boat={hooks={'boatProtection027'},on=prepareBoatDamage027,off=function()
 local c=TLC.boatProtection027
 if c and TLC.attached()and c.pid==TLC.pid then writeBytes(c.data,0)end
end}

-- Native ballistic firing decrements EDX and calls SetAmmoAmount directly,
-- bypassing AddAmmoAmount/AmmoDelta. Preserve the normal shot/availability path.
TLC.SIGS.AmmoShot027={len=5,bytes={255,202,72,139,203,255,144,160,9,0,0,176,1,72,131,196,32,91,195,204,204,204,204,204,204,204,204,64,85,83,86,87,65,84,65,86,72,141,108,36},p='FF CA 48 8B CB FF 90 A0 09 00 00 B0 01 48 83 C4 20 5B C3 CC CC CC CC CC CC CC CC 40 55 53 56 57 41 54 41 56 48 8D 6C 24'}
TLC.HOOKS.ammoShot027={sig='AmmoShot027',aa=[==[
[ENABLE]
alloc(tlc_ammoShot027,$1000,$SITE)
label(tlc_ammoShot027_ret)
label(tlc_ammoShot027_normal)
tlc_ammoShot027:
pushfq
cmp byte ptr [tlcFlags+0B],0
je tlc_ammoShot027_normal
cmp byte ptr [tlcFlags+15],0
jne tlc_ammoShot027_normal
push rax
mov rax,[rbx+158]
cmp rax,[tlcPtrs]
pop rax
jne tlc_ammoShot027_normal
inc dword ptr [tlcFlags+D50]
popfq
mov rcx,rbx
jmp tlc_ammoShot027_ret
tlc_ammoShot027_normal:
popfq
$ORIG
jmp tlc_ammoShot027_ret
$SITE:
jmp tlc_ammoShot027
$NOP
tlc_ammoShot027_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_ammoShot027)
]==]}
TLC.F.ammo.hooks[#TLC.F.ammo.hooks+1]='ammoShot027'

TLC.SIGS.WarpLocator028={len=0,bytes={64,87,72,131,236,32,72,139,249,72,133,201,15,132,176,0,0,0,139,65,12,59,5,77,95,31,6,125,30,139,200,15,183,192,72,193,233,16,72,141},p='40 57 48 83 EC 20 48 8B F9 48 85 C9 0F 84 B0 00 00 00 8B 41 0C 3B 05 4D 5F 1F 06 7D 1E 8B C8 0F B7 C0 48 C1 E9 10 48 8D'}
TLC.SIGS.WarpClosest028={len=0,bytes={64,85,86,65,84,65,85,72,141,108,36,184,72,129,236,72,1,0,0,15,41,180,36,16,1,0,0,72,139,5,142,186,228,5,72,51,196,72,137,69},p='40 55 56 41 54 41 55 48 8D 6C 24 B8 48 81 EC 48 01 00 00 0F 29 B4 24 10 01 00 00 48 8B 05 8E BA E4 05 48 33 C4 48 89 45'}
TLC.SIGS.WarpLocation028={len=0,bytes={72,137,92,36,8,72,137,108,36,16,72,137,116,36,24,87,65,86,65,87,72,131,236,32,65,139,64,8,72,141,53,173,127,79,3,73,139,248,72,139},p='48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 20 41 8B 40 08 48 8D 35 AD 7F 4F 03 49 8B F8 48 8B'}
TLC.SIGS.WarpFree028={len=0,bytes={72,133,201,116,46,83,72,131,236,32,72,139,217,72,139,13,204,100,34,10,72,133,201,117,12,232,66,1,0,0,72,139,13,187,100,34,10,72,139,1},p='48 85 C9 74 2E 53 48 83 EC 20 48 8B D9 48 8B 0D CC 64 22 0A 48 85 C9 75 0C E8 42 01 00 00 48 8B 0D BB 64 22 0A 48 8B 01'}
TLC.SIGS.WarpRotation028={len=0,bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,96,15,16,137,240,1,0,0,72,141,185,216,1,0,0,72,131,63,0,72,139,242,15,16,145,0},p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 60 0F 10 89 F0 01 00 00 48 8D B9 D8 01 00 00 48 83 3F 00 48 8B F2 0F 10 91 00'}
TLC.SIGS.WarpCreate028={len=0,bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,64,73,139,216,15,40,203,68,15,182,68,36,112,72,139,250,232,125,28,255,255,72,141,84,36,32},p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 40 49 8B D8 0F 28 CB 44 0F B6 44 24 70 48 8B FA E8 7D 1C FF FF 48 8D 54 24 20'}
TLC.SIGS.WarpActivate028={len=0,bytes={72,137,92,36,8,72,137,108,36,24,72,137,116,36,32,87,72,129,236,224,0,0,0,72,139,217,72,139,13,47,58,29,6,72,133,201,15,132,204,2},p='48 89 5C 24 08 48 89 6C 24 18 48 89 74 24 20 57 48 81 EC E0 00 00 00 48 8B D9 48 8B 0D 2F 3A 1D 06 48 85 C9 0F 84 CC 02'}
-- All native entry points below are verified against the installed EXE.
-- Locator types: Boat=2, Waypoint=3 (native enum table RVA 09C33250).
-- Use the game's registered locator and asynchronous streaming/teleport action.
-- No boat transform or physics properties are written.
TLC.VARDEF[0xc0]={'float',200}
TLC.VARDEF[0xc4]={'float',200}
TLC.NAMES[211]={'Warp to boat','船までワープ'}
TLC.NAMES[212]={'Warp to waypoint','ウェイポイントまでワープ'}
TLC.NAMES[213]={'Height offset (cm)','高さ補正（cm）'}
TLC.NAMES[214]={'Height offset (cm)','高さ補正（cm）'}
local function warpError028(en,ja)error(TLC.T(en,ja),0)end
local function finite028(v)return type(v)=='number'and v==v and math.abs(v)&lt;1e12 end
function TLC.warpTo028(kind)
 TLC.need()
 assert(kind==2 or kind==3,'Invalid warp destination type')
 local previous=TLC.warp028
 if previous and TLC.valid(previous.action)and readBytes(previous.action+TLC.warpCompletionOffset109(),1)==0 then
  warpError028('A warp is already loading.','ワープ先を読み込み中です。')
 end
 local p=TLC.player(true)
 if TLC.controlledPawn(true)~=p then
  warpError028('Leave the vehicle controls before warping.','操縦席を離れてからワープしてください。')
 end
 TLC.requireSigs({'WarpLocator028','WarpClosest028','WarpLocation028','WarpFree028','WarpRotation028','WarpCreate028','WarpActivate028'})
 local world=TLC.world()
 local root=TLC.readObjectField074(p,'RootComponent')
 assert(TLC.valid(root),'Player root unavailable')
 local height=readFloat(TLC.var(kind==2 and 0xc0 or 0xc4))
 if not finite028(height)or height&lt;0 or height&gt;100000 then
  warpError028('Height offset must be between 0 and 100000 cm.','高さ補正は0～100000cmで指定してください。')
 end
 local mem=allocateMemory(0x100)
 assert(mem,'Warp buffer allocation failed')
 for k=0,0xff do writeBytes(mem+k,0)end
 for k=0,2 do
  local v=readDouble(root+TLC.sceneLocationLayout109().translation+TLC.sceneLocationLayout109().axes[k+1]);assert(finite028(v),'Player location unavailable')
  writeDouble(mem+0x20+k*8,v)
 end
 local request={pid=TLC.pid,world=world,player=p,kind=kind,started=getTickCount(),buffer=mem}
 TLC.warp028=request
 local function valid()
  if request.pid~=TLC.pid or not TLC.attached()or TLC.world()~=world or TLC.player(false)~=p or TLC.controlledPawn(false)~=p then
   warpError028('Warp cancelled: player or world changed.','ワープを取り消しました：プレイヤーまたはワールドが変わりました。')
  end
 end
 local function release()
  if request.buffer then deAlloc(request.buffer);request.buffer=nil end
 end
 local function step(fn)
  return function(...)
   local args={...}
   local ok,e=pcall(function()valid();fn(table.unpack(args))end)
   if not ok then release();request.error=tostring(e);TLC.reason('warp',tostring(e))end
  end
 end
 local function createAction()
  TLC.job(TLC.A.WarpRotation028,{p,mem+0x70},p,step(function()
   TLC.job(TLC.A.WarpCreate028,{p,mem+0x50,mem+0x70,0,0,xmm3={float=30}},p,step(function(action)
    assert(TLC.valid(action)and TLC.U.isA(action,'VoyageTeleportAsyncAction'),'Game warp action creation failed')
    request.action=action
    assert(TLC.virtualMethod109(action,TLC.A.WarpActivate028)==TLC.A.WarpActivate028,'Game warp activation identity mismatch')
    TLC.job(TLC.A.WarpActivate028,{action},action,step(function()
     request.activated=true;release()
     TLC.msg('Warp destination loading.','ワープ先を読み込んでいます。')
    end))
   end))
  end))
 end
 TLC.job(TLC.A.WarpLocator028,{world},world,step(function(sys)
  assert(TLC.valid(sys)and TLC.U.isA(sys,'VoyageLocatorSubsystem'),'Locator subsystem unavailable')
  TLC.job(TLC.A.WarpClosest028,{sys,mem,mem+0x20,mem+0x40,kind},sys,step(function()
   local text=readQword(mem);local n=readInteger(mem+8)
   if not text or text==0 or not n or n&lt;=1 or n&gt;1024 then
    release()
    if kind==2 then warpError028('No boat locator is registered in this world.','現在のワールドに船の位置が登録されていません。')
    else warpError028('No waypoint is set. Place a waypoint on the map first.','ウェイポイントがありません。先にマップで設定してください。')end
   end
   request.identifier=readString(text,(n-1)*2,true)
   TLC.job(TLC.A.WarpLocation028,{sys,mem+0x50,mem},sys,step(function()
    local destination={}
    for k=0,2 do destination[k+1]=readDouble(mem+0x50+k*8);assert(finite028(destination[k+1]),'Invalid destination coordinates')end
    request.locatorPosition=destination
    writeDouble(mem+0x60,destination[3]+height)
    request.destination={destination[1],destination[2],destination[3]+height}
    -- FindClosestLocator returns an owning FString. Free only its native allocation.
    TLC.job(TLC.A.WarpFree028,{text},sys,step(function()
     writeQword(mem,0);createAction()
    end))
   end))
  end))
 end))
end
local tick028=TLC.tick
function TLC.tick(...)
 tick028(...)
 local r=TLC.warp028
 if not r or not r.activated or r.reported or not TLC.attached()or r.pid~=TLC.pid then return end
 if r.world~=TLC.world()then r.reported=true;TLC.reason('warp',TLC.T('World changed during warp.','ワープ中にワールドが変わりました。'));return end
 local a=r.action
 if TLC.valid(a)and readBytes(a+TLC.warpCompletionOffset109(),1)~=0 then
  r.reported=true
  local p=TLC.player(false);local root=TLC.valid(p)and TLC.readObjectField074(p,'RootComponent')
  if TLC.valid(root)then
   r.arrival=TLC.actorLocation109(p)
   local dx=r.arrival[1]-r.destination[1];local dy=r.arrival[2]-r.destination[2]
   r.success=dx*dx+dy*dy&lt;250000
  end
  if r.success then TLC.msg('Warp completed.','ワープしました。')
  else TLC.reason('warp',TLC.T('The game did not complete the warp. Loading timeout or destination unavailable.','ゲーム側でワープが完了しませんでした。読み込みのタイムアウト、または移動先を取得できません。'))end
 elseif getTickCount()-r.started&gt;35000 then
  r.reported=true;TLC.reason('warp',TLC.T('Warp completion could not be confirmed.','ワープの完了を確認できませんでした。'))
 end
end

-- A zero FUObjectItem serial is not an identity: the slot can be reused with zero.
-- Include class, name, index and world identity before restoring any tracked edit.
function TLC.valid(o)
 if type(o)~='number'or o&lt;0x10000 or o%8~=0 or not TLC.U.go then return false end
 local idx=readInteger(o+0xc);local count=TLC.objectCount072()
 if not idx or not count or idx&lt;0 or idx&gt;=count then return false end
 local chunks=readQword(TLC.U.go);local ch=chunks and readQword(chunks+(idx//65536)*8)
 if not ch then return false end
 local entry=ch+(idx%65536)*24
 if readQword(entry+8)~=o then return false end
 local objectFlags=readInteger(o+8);local internalFlags=readInteger(entry+4)
 return objectFlags~=nil and internalFlags~=nil and (objectFlags&amp;0x18010)==0 and (internalFlags&amp;0x10200000)==0,entry
end
local function identity029(o)
 local good,entry=TLC.valid(o);if not good then return end
 return {object=o,index=readInteger(o+0xc),serial=readInteger(entry+0x10),class=readQword(o+0x10),name=readInteger(o+0x18),number=readInteger(o+0x1c)}
end
local function same029(s)
 if not s then return false end
 local good,entry=TLC.valid(s.object)
 return good and readInteger(s.object+0xc)==s.index and readInteger(entry+0x10)==s.serial and readQword(s.object+0x10)==s.class and readInteger(s.object+0x18)==s.name and readInteger(s.object+0x1c)==s.number
end
TLC.identity029=identity029
TLC.sameIdentity029=same029
function TLC.changed(a,typ,value,owner,key)
 local identity=owner and identity029(owner)
 if owner and not identity then return end
 TLC.edits=TLC.edits or {}
 local x=TLC.edits[a]
 if x and x.identity and not same029(x.identity)then
  TLC.edits[a]=nil
  error(TLC.T('Tracked object lifetime changed; write cancelled.','追跡対象の実体が変わったため書き込みを中止しました。'),0)
 end
 local read=typ=='float'and readFloat or typ=='double'and readDouble or typ=='byte'and function(p)return readBytes(p,1)end or readInteger
 local write=typ=='float'and writeFloat or typ=='double'and writeDouble or typ=='byte'and writeBytes or writeInteger
 if not x then
  local old=read(a);assert(old~=nil,'Unreadable value')
  x={old=old,owner=owner,serial=identity and identity.serial,key=key,write=write,identity=identity,world=owner and identity029(TLC.world())}
  TLC.edits[a]=x
 end
 if x.world and (not same029(x.world)or TLC.world()~=x.world.object)then return end
 assert(write(a,value),'Write failed')
end
function TLC.restore(key)
 for a,x in pairs(TLC.edits or {})do if not key or x.key==key then
  local allowed=not x.owner or (x.identity and same029(x.identity)and x.world and same029(x.world)and TLC.world()==x.world.object)
  if allowed and TLC.attached()then assert(x.write(a,x.old),'Restore failed')end
  TLC.edits[a]=nil
 end end
end
-- Capture world identity for callbacks and verify it again on the game thread.
local job029=TLC.job
function TLC.job(fn,args,guard,done)
 local world=TLC.world();local identity=identity029(world)
 assert(identity,TLC.T('No playable world is available.','プレイ中のワールドを取得できません。'))
 local result=job029(fn,args,guard,function(...)
  if TLC.world()~=world or not same029(identity)then
   TLC.msg('World changed; native completion cancelled.','ワールドが変わったため処理の続行を中止しました。');return
  end
  if done then return done(...)end
 end)
 return result
end
function TLC.publishJobWorld029(jb)
 local world=TLC.world();local identity=identity029(world)
 assert(identity,'World became unavailable before native dispatch')
 writeQword(jb+0xa0,world);writeInteger(jb+0xa8,identity.index);writeInteger(jb+0xac,identity.serial);writeQword(jb+0xb0,identity.class)
end
local aa029=TLC.HOOKS.gameTick.aa
local before029='mov rax,[rax+228]'
local pos029=assert(aa029:find(before029,1,true),'World dispatch guard insertion point unavailable')
aa029=aa029:sub(1,pos029-1)..[==[
cmp rax,[tlcFlags+5A0]
jne tlc_job_fail
test dword ptr [rax+08],18000
jne tlc_job_fail
mov ecx,[tlcFlags+5A8]
cmp ecx,[tlcObjectCount072]
jae tlc_job_fail
mov r8,[tlcObjects]
mov edx,ecx
shr ecx,10
and edx,FFFF
mov r8,[r8+rcx*8]
test r8,r8
je tlc_job_fail
imul rdx,rdx,18
cmp [r8+rdx+08],rax
jne tlc_job_fail
test dword ptr [r8+rdx+04],10200000
jne tlc_job_fail
mov ecx,[tlcFlags+5AC]
cmp [r8+rdx+10],ecx
jne tlc_job_fail
mov rcx,[tlcFlags+5B0]
cmp [rax+10],rcx
jne tlc_job_fail
]==]..aa029:sub(pos029)
TLC.HOOKS.gameTick.aa=aa029
-- Never restore dying-world objects or free native trampolines during travel.
function TLC.suspendWorld029()
 local b=TLC.base();if not b then return end
 for off=0,0xff do writeBytes(b+off,0)end
 for off=0x200,0x2ff do writeBytes(b+off,0)end
 if readInteger(b+0x500)==1 then writeInteger(b+0x500,0);TLC.pendingJob=nil end
 TLC.actions025={}
 for a,x in pairs(TLC.edits or {})do if x.owner then TLC.edits[a]=nil end end
 local c=TLC.boatPropulsion
 if c and c.pid==TLC.pid then writeBytes(c.data,0);writeInteger(c.data+4,0)end
 local boat=TLC.boatProtection027
 if boat and boat.pid==TLC.pid then writeBytes(boat.data,0)end
 if TLC.pointTimer then TLC.pointTimer.destroy();TLC.pointTimer=nil end
 TLC.featOn={}
 TLC.weatherGeneration024=(TLC.weatherGeneration024 or 0)+1
 TLC.weatherVolumes024=nil;TLC.weatherRestoreVolumes024=nil;TLC.weatherVolumeSystem024=nil
 TLC.weatherWorld=nil;TLC.weatherObject=nil;TLC.mapLoading=nil;TLC.warp028=nil
 TLC.environmentWorld=nil;TLC.environmentSky=nil;TLC.environmentWeather=nil
 local al=getAddressList()
 for k=al.Count-1,0,-1 do local row=al[k]
  if not TLC.keepChecks157 and row.ID~=1 and row.Active and row.Type==vtAutoAssembler then row.disableWithoutExecute()end
 end
 for _,id in ipairs({201,301})do local row=al.getMemoryRecordByID(id);if row then TLC.clearChildren(row)end end
 TLC.msg('World changed: features suspended. Enable them again after loading.','ワールド切替のため機能を停止しました。読込後に再有効化してください。')
end
local tick029=TLC.tick
function TLC.tick(...)
 -- Context readiness and world replacement are handled by the final context gate.
 return tick029(...)
end

TLC.SIGS.CV_clearWater={len=0,bytes={72,141,13,88,96,93,10,232,123,45,28,0,72,141,5,236,110,165,7,72,141,13,45,10,149,7,72,137,5,62,96,93,10,72,131,196,56,233,149,248},p='48 8D 0D 58 60 5D 0A E8 7B 2D 1C 00 48 8D 05 EC 6E A5 07 48 8D 0D 2D 0A 95 07 48 89 05 3E 60 5D 0A 48 83 C4 38 E9 95 F8'}
-- Installed renderer registration: r.Fog, flags 0x60, native integer default 1.
-- Both game-thread and render-thread CVar values are tracked and restored.
-- This disables atmospheric fog above water as well as the visible underwater haze.
TLC.CV.clearWater={sig='CV_clearWater',rip=0,typ='int'}
TLC.NAMES[513]={'Clear sea visibility (disable fog)','海の濁りを除去（霧描画なし）'}
TLC.F.clearWater={on=function()
 TLC.need();TLC.setCvar('clearWater',0,'clearWater')
end}
local suspendWater030=TLC.suspendWorld029
function TLC.suspendWorld029(...)
 -- Renderer CVar storage is process-wide, so restore it before suspending the feature.
 TLC.restore('clearWater')
 return suspendWater030(...)
end


TLC.SIGS.RootsNextTask031={len=0,bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,32,72,139,241,72,131,193,56,232,133,102,32,252,132,192,116,65,72,141,78,56,51,219,232,70,80},p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 48 8B F1 48 83 C1 38 E8 85 66 20 FC 84 C0 74 41 48 8D 4E 38 33 DB E8 46 50'}
TLC.SIGS.RootsSetInt031={len=0,bytes={72,137,92,36,8,85,86,87,65,86,65,87,72,139,236,72,131,236,80,69,51,255,72,139,218,76,137,125,208,232,30,68,159,254,72,141,187,136,0,0},p='48 89 5C 24 08 55 56 57 41 56 41 57 48 8B EC 48 83 EC 50 45 33 FF 48 8B DA 4C 89 7D D0 E8 1E 44 9F FE 48 8D BB 88 00 00'}
-- Restore only the missed fabrication completion for First Roots task 1.
-- SetIntPropertyByName runs on the game thread; ordinary quest evaluation advances it.
TLC.NAMES[602]={'First Roots: recover existing Eden Frame completion','ファースト・ルーツ：既存エデンフレームの建造完了を復旧'}
local function fail031(en,ja)error(TLC.T(en,ja),0)end
local function rows031(m,stride)
 local d=readQword(m);local n=readInteger(m+8);local out={}
 if not d or not n or n&lt;0 or n&gt;20000 then return out end
 local bits=readQword(m+0x20);if not bits or bits==0 then bits=m+0x10 end
 for k=0,n-1 do local b=readInteger(bits+(k//32)*4)
  if b and(b&amp;(1&lt;&lt;(k%32)))~=0 then out[#out+1]=d+k*stride end
 end
 return out
end
local function field031(o,name)
 local c=readQword(o+0x10)
 for depth=1,32 do
  if not TLC.valid(c)then break end
  local f=readQword(c+0x50)
  for k=1,2000 do
   if not f or f==0 then break end
   if TLC.U.name(readInteger(f+0x20))==name then return f end
   f=readQword(f+0x18)
  end
  c=readQword(c+0x40)
 end
end
local function off031(o,name)
 local f=field031(o,name);assert(f,'Property unavailable: '..name)
 return readInteger(f+0x44)
end
local function quest031(world,pc)
 local found={};local sys=TLC.worldSubsystem107('VoyageQuestSubsystem');local layout=TLC.questLayout107()
 for _,row in ipairs(rows031(sys+layout.objects,layout.registryStride))do
  local quest=readQword(row+layout.registryValue)
  if TLC.valid(quest)and TLC.U.isA(quest,'VoyageQuestObject')then
   local asset=TLC.weak(quest+off031(quest,'Quest'));local owner=TLC.weak(quest+off031(quest,'QuestOwner'))
   if asset and TLC.U.n(asset)=='DA_Quest_CU5_Eden_Crafting'and owner==pc then found[#found+1]=quest end
  end
 end
 if #found~=1 then fail031('The local First Roots quest is not active or is ambiguous.','自分の「ファースト・ルーツ」を一意に取得できません。クエストを受注したセーブを読み込んでください。')end
 return found[1]
end
local function logic031(q)
 local found,seen={},{}
 for _,name in ipairs({'BlueprintLogicInstances','DuplicatedLogicInstances'})do
  for _,r in ipairs(rows031(q+off031(q,name),24))do
   local o=readQword(r+8)
   if TLC.valid(o)and not seen[o]and TLC.U.c(o)=='BP_QuestLogic_IsFabricating_C'then
    seen[o]=true
    local item=readQword(o+off031(o,'Item'))
    if TLC.valid(item)and TLC.U.n(item)=='DA_Building_Eden_Frame_Small'and readInteger(o+off031(o,'TaskIndex'))==1 then found[#found+1]=o end
   end
  end
 end
 if #found~=1 then fail031('The Eden Frame completion check is unavailable or ambiguous.','エデン・フレーム小の完了判定を一意に取得できません。')end
 return found[1]
end
local function frame031(world)
 local found=TLC.recoveryActors112('BP_Eden_Frame_Small_C')
 if #found~=1 then fail031('Exactly one existing small Eden Frame must be loaded. Stand near it and retry.','既存のエデン・フレーム小を一意に取得できません。その近くで実行してください。')end
 return found[1]
end
local function setter031()
 local contract=TLC.apiContract075('KismetSystemLibrary','SetIntPropertyByName')
 return contract.fn,contract.cdo,{size=contract.size,object=TLC.apiMember075(contract,'Object',8),name=TLC.apiMember075(contract,'PropertyName',8),value=TLC.apiMember075(contract,'Value',4)}
end
function TLC.recoverFirstRoots031()
 TLC.need();
 local world=TLC.world();local pc=TLC.playerController(true)
 local q=quest031(world,pc);local logic=logic031(q);local frame=frame031(world)
 local prop=assert(field031(logic,'FinishCount'));local offset=readInteger(prop+0x44)
 assert(readInteger(prop+0x34)==4 ,'FinishCount layout mismatch')
 assert(readInteger(logic+off031(logic,'NeedsFinishCount'))==1,'Unexpected required completion count')
 assert(readBytes(logic+off031(logic,'NeedsBuilder'),1)==0 and readBytes(logic+off031(logic,'NeedsStarted'),1)==0,'Unexpected construction requirements')
 if readInteger(logic+offset)~=0 then fail031('Completion is already recorded; no change made.','建造完了は記録済みです。変更しませんでした。')end
 local qi,li,fi=TLC.identity029(q),TLC.identity029(logic),TLC.identity029(frame)
 local fn,cdo,setter=setter031()
 local function check()
  assert(TLC.world()==world and TLC.sameIdentity029(qi)and TLC.sameIdentity029(li)and TLC.sameIdentity029(fi),'Quest, frame or world lifetime changed')
  assert(TLC.playerController(false)==pc,'Local controller changed')
 end
 TLC.nextQuestTask112(q,function(index)
  check()
  if index~=1 then
   fail031('First Roots is not on the small-frame construction step; no change made.','現在はエデン・フレーム小の建造段階ではありません。変更しませんでした。')
  end
  assert(readInteger(logic+offset)==0,'Completion changed before recovery')
  local payload=assert(allocateMemory(math.max(24,setter.size)),'Recovery buffer allocation failed')
  for i=0,math.max(24,setter.size)-1 do writeBytes(payload+i,0)end
  writeQword(payload+setter.object,logic);writeQword(payload+setter.name,readQword(prop+0x20));writeInteger(payload+setter.value,1)
  local audit={quest=q,logic=logic,frame=frame,world=world,pid=TLC.pid,before=0,required=1,taskBefore=index,started=getTickCount()}
  TLC.firstRootsRecovery031=audit
  local ok,e=pcall(function()
   TLC.job(TLC.processEvent074(cdo,true),{cdo,fn,payload},{logic,frame},function()
    deAlloc(payload);check();audit.after=readInteger(logic+offset)
    assert(audit.after==1,'Completion write was not accepted')
    TLC.msg('First Roots: restored the missing construction completion. The game will evaluate the next step.','ファースト・ルーツ：未記録の建造完了1回を復旧しました。ゲーム側の再判定を待ちます。')
   end)
  end)
  if not ok then deAlloc(payload);error(e,0)end
 end)
end

-- PE DWORDs are unsigned; some CE environments/wrappers return signed integers.
local function dword032(address)
 local value=readInteger(address)
 if type(value)~='number'then return end
 return value&amp;0xffffffff
end
function TLC.checkBuild()
 local b=TLC.moduleRequired()
 local pe=dword032(b+0x3c)
 if not pe or pe&lt;0x40 or pe&gt;0x100000 then
  TLC.moduleCache=nil
  error(TLC.T('Executable header unavailable. Wait for loading, then attach again.','実行ファイルのヘッダーを取得できません。読込後に再アタッチしてください。'),0)
 end
 local signature=dword032(b+pe)
 local machine=readSmallInteger(b+pe+4)
 local magic=readSmallInteger(b+pe+0x18)
 if type(machine)=='number'then machine=machine&amp;0xffff end
 if type(magic)=='number'then magic=magic&amp;0xffff end
 local timestamp=dword032(b+pe+8)
 local size=dword032(b+pe+0x50)
 local expectedTime=tonumber(TLC.BUILD.ts)&amp;0xffffffff
 local expectedSize=tonumber(TLC.BUILD.size)&amp;0xffffffff
 if signature~=0x4550 or machine~=0x8664 or magic~=0x20b or not timestamp or not size then
  TLC.moduleCache=nil
  error(TLC.T('The loaded module is not a readable Win64 game executable; no writes made.','読込先をWin64ゲーム本体として確認できません。書き込みを中止しました。'),0)
 end
 if timestamp~=expectedTime or size~=expectedSize then
  local details=string.format('PID=%s / timestamp=%08X, expected=%08X / image=%08X, expected=%08X',tostring(getOpenedProcessID()),timestamp,expectedTime,size,expectedSize)
  error(TLC.T('Unsupported executable build; no writes made. ','未対応の実行ファイルです。書き込みを中止しました。 ')..details,0)
 end
 return true
end
-- Check the current task before looking for a logic instance that later stages remove.
local recoveryBefore032=TLC.recoverFirstRoots031
function TLC.recoverFirstRoots031()
 TLC.need();TLC.requireSigs({'RootsNextTask031'})
 local world=TLC.world();local q=quest031(world,TLC.playerController(true))
 local identity=TLC.identity029(q)
 TLC.job(TLC.A.RootsNextTask031,{q},q,function(index)
  assert(TLC.world()==world and TLC.sameIdentity029(identity),'Quest or world changed')
  if index~=1 then
   TLC.msg('First Roots is not on the frame-construction step; no change made.','現在はファースト・ルーツのフレーム建造段階ではありません。変更しませんでした。')
   TLC.firstRootsSkipped032=index
   return
  end
  return recoveryBefore032()
 end)
end

TLC.SIGS.HumanCopy033={len=0,bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,32,15,182,2,72,139,218,136,1,72,139,249,72,131,193,8,72,131,194,8,232,249,245,237,251,72},p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 0F B6 02 48 8B DA 88 01 48 8B F9 48 83 C1 08 48 83 C2 08 E8 F9 F5 ED FB 48'}
TLC.SIGS.HumanStringCopy033={len=0,bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,64,72,139,217,51,201,72,137,11,72,141,67,12,72,99,122,8,72,139,50,137,123,8,133,255,117},p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 40 48 8B D9 33 C9 48 89 0B 48 8D 43 0C 48 63 7A 08 48 8B 32 89 7B 08 85 FF 75'}
TLC.SIGS.HumanFree033={len=0,bytes={72,133,201,116,46,83,72,131,236,32,72,139,217,72,139,13,204,100,34,10,72,133,201,117,12,232,66,1,0,0,72,139,13,187,100,34,10,72,139,1},p='48 85 C9 74 2E 53 48 83 EC 20 48 8B D9 48 8B 0D CC 64 22 0A 48 85 C9 75 0C E8 42 01 00 00 48 8B 0D BB 64 22 0A 48 8B 01'}
TLC.SIGS.HumanGrow033={len=0,bytes={72,137,92,36,16,87,72,131,236,32,72,139,217,72,139,250,72,139,202,232,232,214,15,0,131,127,16,1,15,142,143,0,0,0,139,131,184,20,0,0},p='48 89 5C 24 10 57 48 83 EC 20 48 8B D9 48 8B FA 48 8B CA E8 E8 D6 0F 00 83 7F 10 01 0F 8E 8F 00 00 00 8B 83 B8 14 00 00'}
TLC.SIGS.HumanDelivery033={len=0,bytes={72,133,210,15,132,238,3,0,0,76,139,220,85,87,65,84,73,141,171,200,254,255,255,72,129,236,32,2,0,0,72,139,5,251,192,236,5,72,51,196},p='48 85 D2 0F 84 EE 03 00 00 4C 8B DC 55 57 41 54 49 8D AB C8 FE FF FF 48 81 EC 20 02 00 00 48 8B 05 FB C0 EC 05 48 33 C4'}
TLC.SIGS.HumanDestroy033={len=0,bytes={72,137,92,36,8,87,72,131,236,32,72,139,217,199,129,192,0,0,0,0,0,0,0,72,139,137,184,0,0,0,72,133,201,116,5,232,120,15,7,252},p='48 89 5C 24 08 57 48 83 EC 20 48 8B D9 C7 81 C0 00 00 00 00 00 00 00 48 8B 89 B8 00 00 00 48 85 C9 74 05 E8 78 0F 07 FC'}
TLC.SIGS.HumanRefresh033={len=0,bytes={72,137,92,36,24,86,87,65,86,72,131,236,64,72,139,249,72,129,193,248,22,0,0,232,84,62,15,0,72,139,159,176,20,0,0,72,99,135,184,20},p='48 89 5C 24 18 56 57 41 56 48 83 EC 40 48 8B F9 48 81 C1 F8 16 00 00 E8 54 3E 0F 00 48 8B 9F B0 14 00 00 48 63 87 B8 14'}
TLC.SIGS.HumanInfo034={len=0,bytes={64,85,86,87,65,84,65,86,72,141,172,36,224,253,255,255,72,129,236,32,3,0,0,72,139,5,34,108,0,6,72,51,196,72,137,133,240,1,0,0},p='40 55 56 57 41 54 41 56 48 8D AC 24 E0 FD FF FF 48 81 EC 20 03 00 00 48 8B 05 22 6C 00 06 48 33 C4 48 89 85 F0 01 00 00'}
TLC.SIGS.HumanInfoDestroy034={len=0,bytes={72,137,92,36,16,87,72,131,236,32,139,145,8,1,0,0,72,139,217,72,139,137,0,1,0,0,232,129,253,17,252,72,139,139,0,1,0,0,72,133},p='48 89 5C 24 10 57 48 83 EC 20 8B 91 08 01 00 00 48 8B D9 48 8B 89 00 01 00 00 E8 81 FD 11 FC 48 8B 8B 00 01 00 00 48 85'}
TLC.SIGS.HumanText034={len=0,bytes={72,139,81,48,72,131,193,32,72,133,210,72,141,66,8,72,15,68,193,195,204,204,204,204,204,204,204,204,204,204,204,204,72,141,65,24,195,204,204,204},p='48 8B 51 30 48 83 C1 20 48 85 D2 48 8D 42 08 48 0F 44 C1 C3 CC CC CC CC CC CC CC CC CC CC CC CC 48 8D 41 18 C3 CC CC CC'}
TLC.SIGS.HumanTraitCopy034={len=0,bytes={72,137,92,36,16,87,72,131,236,48,72,139,250,72,139,217,72,59,202,15,132,150,0,0,0,68,139,79,72,76,141,66,56,72,141,81,72,72,137,116},p='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 96 00 00 00 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74'}
TLC.SIGS.HumanTraitInsert034={len=0,bytes={64,83,86,87,65,85,72,131,236,56,72,137,108,36,96,72,139,242,76,137,100,36,104,72,141,84,36,32,76,137,124,36,48,77,139,225,73,139,248,72},p='40 53 56 57 41 55 48 83 EC 38 48 89 6C 24 60 48 8B F2 4C 89 64 24 68 48 8D 54 24 20 4C 89 7C 24 30 4D 8B E1 49 8B F8 48'}
TLC.SIGS.HumanPropertyInsert034={len=0,bytes={72,137,92,36,8,72,137,108,36,16,72,137,116,36,24,87,65,84,65,85,65,86,65,87,72,131,236,48,76,139,242,77,139,225,72,141,84,36,32,73},p='48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57 48 83 EC 30 4C 8B F2 4D 8B E1 48 8D 54 24 20 49'}
TLC.SIGS.HumanPropertyCopy034={len=0,bytes={72,137,92,36,16,87,72,131,236,48,72,139,250,72,139,217,72,59,202,15,132,151,0,0,0,68,139,79,72,76,141,66,56,72,141,81,72,72,137,116},p='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 97 00 00 00 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74'}
-- Human edits address persistent grow results, never the derived display cache.
TLC.NAMES[600]={'07. Other','07. その他'}
TLC.NAMES[700]={'06. Human editor','06. 人間エディタ'}
TLC.NAMES[701]={'Edit launched humans / add humans...','打ち上げ済みの人間を編集・人間を追加…'}
local H033={
 LifeExpectancy={'Life expectancy (years)','平均寿命（年）'},Height={'Height (cm)','身長（cm）'},Weight={'Weight (kg)','体重（kg）'},
 Intellect={'Intelligence','知力'},Strength={'Strength','筋力'},Patience={'Patience','忍耐'},Discipline={'Self-control','自制'},
 focus={'Concentration','集中力'},Focus={'Concentration','集中力'},Adaptability={'Adaptability','適応力'},Wisdom={'Wisdom','知恵'},
 Logic={'Logic','ロジック'},Creativity={'Creativity','創造性'},Empathy={'Empathy','共感力'},Communication={'Communication','コミュニケーション'},Leadership={'Leadership','統率力'},StarChild={'Star child','星の子'},['Star Child']={'Star child','星の子'}
}
local function string033(a)
 local p,n=readQword(a),readInteger(a+8)
 if not p or p==0 or not n or n&lt;=1 then return '' end
 assert(n&lt;=512,'Invalid human string length')
 return assert(readString(p,(n-1)*2,true),'Human string unreadable')
end
local function context033() return TLC.humanContext103() end
local function result033(id) return TLC.humanResult103(id) end
local function properties033(a) return TLC.humanProperties103(a,H033) end
function TLC.humanList033() return TLC.humanList103() end
local function refresh033(ps,done)
 TLC.requireSigs({'HumanRefresh033'})
 TLC.job(TLC.A.HumanRefresh033,{ps},ps,function()if done then done()end end)
end
function TLC.humanApply033(id,values,done)
 local a,ps=result033(id);assert(readBytes(a+TLC.humanLayout103().type,1)==TLC.humanLayout103().launched,'Selected human is not in space')
 local fields=properties033(a);local changes={}
 -- Resolve the ID and current map again immediately before the single user edit.
 for _,f in ipairs(fields)do local v=values[f.key]
  if v~=nil then assert(type(v)=='number'and v==v and math.abs(v)&lt;=1000000,'Human value must be finite, within +/-1000000');changes[#changes+1]={f.address,v,f.value}end
 end
 assert(#changes&gt;0,'No human parameters selected')
 TLC.requireSigs({'HumanRefresh033'})
 for _,x in ipairs(changes)do assert(writeDouble(x[1],x[2]),'Human property write failed')end
 for _,x in ipairs(changes)do assert(readDouble(x[1])==x[2],'Human property read-back failed')end
 TLC.humanAudit033={id=id,edited=#changes,pid=TLC.pid,world=TLC.world()}
 refresh033(ps,function()TLC.msg('Human parameters updated.','人間のパラメーターを更新しました。');if done then done()end end)
end
function TLC.humanAdd033(id,values,count,done,profession,spaceHours)
 local launched=TLC.humanList033()
 assert(#launched&gt;0,TLC.T('Launch the first human through normal gameplay before adding humans. This restriction protects quest progression.','クエストの進行を保護するため、最初の1人をゲーム内で打ち上げるまでは人間を追加できません。'))
 local sourceLaunched=false;for _,h in ipairs(launched)do if h.id==id then sourceLaunched=true;break end end
 assert(sourceLaunched,TLC.T('Select a launched human, then add humans.','打ち上げ済みの人間を選択してから追加してください。'))
 assert(count and count%1==0 and count&gt;=1 and count&lt;=20,'Human count must be 1-20')
 if spaceHours~=nil then assert(spaceHours==spaceHours and spaceHours&gt;=0 and spaceHours&lt;=1000000,'Invalid space residence hours')end
 for _,v in pairs(values)do assert(type(v)=='number'and v==v and math.abs(v)&lt;=1000000,'Human value must be finite, within +/-1000000')end
 TLC.requireSigs({'HumanCopy033','HumanStringCopy033','HumanGrow033','HumanDelivery033','HumanDestroy033','HumanRefresh033'})
 local remaining=count;local added={}
 local function addOne()
  local src,ps=result033(id);local pi=TLC.identity029(ps);local world=TLC.world()
  local function check()assert(TLC.sameIdentity029(pi)and TLC.world()==world,'Human world changed')end
  local used={};local _,data,n=context033();for k=0,n-1 do used[string033(data+k*TLC.humanLayout103().resultSize+TLC.humanLayout103().id)]=true end
  local newId
  repeat local t={};for k=1,8 do t[k]=string.format('%04X',math.random(0,65535))end;newId=table.concat(t)until not used[newId]
  local buf=assert(allocateMemory(1024),'Human buffer allocation failed')
  writeBytes(buf,table.unpack({0,0,0,0,0,0,0,0}))
  for k=8,1023 do writeBytes(buf+k,0)end
  writeString(buf+0x200,newId,true);writeSmallInteger(buf+0x200+64,0)
  writeQword(buf+0x180,buf+0x200);writeInteger(buf+0x188,33);writeInteger(buf+0x18c,33)
  TLC.copyHumanResult103(buf,src,ps,function()
   check()
    TLC.job(TLC.A.HumanStringCopy033,{buf+TLC.humanLayout103().id,buf+0x180},ps,function()
     check();writeBytes(buf+TLC.humanLayout103().type,TLC.humanLayout103().grown);writeQword(buf+TLC.humanLayout103().timestamp,os.time());writeQword(buf+TLC.humanLayout103().deliveryTimestamp,0)
     local edited=0
     for _,f in ipairs(properties033(buf))do local v=values[f.key]
      if v~=nil then assert(type(v)=='number'and v==v and math.abs(v)&lt;=1000000,'Invalid human parameter');writeDouble(f.address,v);edited=edited+1 end
     end
     assert(edited&gt;0,'No editable human parameters')
     local function registerPrepared()
     TLC.job(TLC.A.HumanGrow033,{ps,buf},ps,function()
      check();local found=result033(newId);assert(readBytes(found+TLC.humanLayout103().type,1)==TLC.humanLayout103().grown,'Human registration failed')
      TLC.job(TLC.A.HumanDelivery033,{ps,ps,buf+TLC.humanLayout103().id},ps,function()
       check();local found=result033(newId);assert(readBytes(found+TLC.humanLayout103().type,1)==TLC.humanLayout103().launched,'Human delivery failed')
       if spaceHours~=nil then local stamp=os.time()-math.ceil(spaceHours*3600);if readQword(found+TLC.humanLayout103().timestamp)&gt;stamp then assert(writeQword(found+TLC.humanLayout103().timestamp,stamp),'Human growth timestamp write failed')end;assert(writeQword(found+TLC.humanLayout103().deliveryTimestamp,stamp),'Space residence write failed');assert(readQword(found+TLC.humanLayout103().deliveryTimestamp)==stamp,'Space residence readback failed')end
       for _,f in ipairs(properties033(found))do if values[f.key]~=nil then assert(f.value==values[f.key],'Added human parameter mismatch')end end
       added[#added+1]=newId
       TLC.job(TLC.A.HumanDestroy033,{buf},ps,function()
        deAlloc(buf);check();remaining=remaining-1
        if remaining&gt;0 then addOne()else refresh033(ps,function()
         TLC.humanAddAudit033={ids=added,count=#added,pid=TLC.pid,world=world}
         TLC.msg('Added humans: '..#added,'人間を追加しました：'..#added..'人');if done then done(added)end
        end)end
       end)
      end)
     end)
     end
     TLC.prepareHumanValues034(buf,values,ps,function()TLC.prepareHumanProfession034(buf,profession,ps,registerPrepared)end)
    end)
  end)
 end
 addOne()
end
local PROFESSIONS034={
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Supplier/DA_Profession_Basic_Supplier.DA_Profession_Basic_Supplier",en="Basic Supplier",ja="基礎補給員"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Cultivators/DA_Profession_Biosphere_Director.DA_Profession_Biosphere_Director",en="Biosphere Director",ja="生物圏ディレクター"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Leader/DA_Profession_Colonel_of_Humanity.DA_Profession_Colonel_of_Humanity",en="Colonel of Humanity",ja="人類指揮官"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Artist/DA_Profession_Cultural_Archivist.DA_Profession_Cultural_Archivist",en="Cultural Archivist",ja="文化アーキビスト"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Supplier/DA_Profession_Distributor.DA_Profession_Distributor",en="Distributor",ja="補給責任者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Healer/DA_Profession_Doctor.DA_Profession_Doctor",en="Doctor",ja="医師"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Protector/DA_Profession_Door_Jammer.DA_Profession_Door_Jammer",en="Door Jammer",ja="ドアジャマー"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Engineer/DA_Profession_Energy_Engineer.DA_Profession_Energy_Engineer",en="Energy Engineer",ja="エネルギーエンジニア"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Teacher/DA_Profession_Existential_Chancellor.DA_Profession_Existential_Chancellor",en="Existential Chancellor",ja="実存主義大臣"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Artist/DA_Profession_Existential_Expressionist.DA_Profession_Existential_Expressionist",en="Existential Expressionist",ja="実存的表現主義者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Scientist/DA_Profession_Field_Research_Scientist.DA_Profession_Field_Research_Scientist",en="Field Research Scientist",ja="フィールド研究科学者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Explorer/DA_Profession_Frontier_Explorer.DA_Profession_Frontier_Explorer",en="Frontier Explorer",ja="フロンティア探検家"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Cultivators/DA_Profession_Growth_Specialist.DA_Profession_Growth_Specialist",en="Growth Specialist",ja="育成スペシャリスト"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Protector/DA_Profession_Guard.DA_Profession_Guard",en="Guard",ja="警備員"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Protector/DA_Profession_GuardianofHumanity.DA_Profession_GuardianofHumanity",en="Guardian of Humanity",ja="人類の守護者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Healer/DA_Profession_Health_Assistant.DA_Profession_Health_Assistant",en="Health Assistant",ja="医療アシスタント"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Scientist/DA_Profession_Lab_Technician.DA_Profession_Lab_Technician",en="Lab Technician",ja="実験室技術者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Supplier/DA_Profession_Logistics_High_Command.DA_Profession_Logistics_High_Command",en="Logistics High Command",ja="兵站最高司令部"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Engineer/DA_Profession_Engineer_Maintenance.DA_Profession_Engineer_Maintenance",en="Maintenance Engineer",ja="メンテナンスエンジニア"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Teacher/DA_Profession_Manual_Holder.DA_Profession_Manual_Holder",en="Manual Holder",ja="マニュアルホルダー"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Explorer/DA_Profession_Mission_Seeker.DA_Profession_Mission_Seeker",en="Mission Seeker",ja="ミッションシーカー"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Healer/DA_Profession_Neural_Architect.DA_Profession_Neural_Architect",en="Neural Architect",ja="神経設計士"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Healer/DA_Profession_Neuro_Specialist.DA_Profession_Neuro_Specialist",en="Neuro Specialist",ja="神経専門医"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Cultivators/DA_Profession_Nutrient_Handler.DA_Profession_Nutrient_Handler",en="Nutrient Handler",ja="栄養素ハンドラー"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Teacher/DA_Profession_Professor.DA_Profession_Professor",en="Professor",ja="教授"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Engineer/DA_Profession_Quantum_Engineer.DA_Profession_Quantum_Engineer",en="Quantum Engineer",ja="量子エンジニア"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Scientist/DA_Profession_Quantum_Physicist.DA_Profession_Quantum_Physicist",en="Quantum Physicist",ja="量子物理学者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Supplier/DA_Profession_Resource_Director.DA_Profession_Resource_Director",en="Resource Director",ja="リソースディレクター"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Leader/DA_Profession_Room_Supervisor.DA_Profession_Room_Supervisor",en="Room Supervisor",ja="ルーム監督官"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Artist/DA_Profession_Sculptor.DA_Profession_Sculptor",en="Sculptor",ja="彫刻家"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Leader/DA_Profession_Settlement_Governor.DA_Profession_Settlement_Governor",en="Settlement Governor",ja="居住地総督"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Explorer/DA_Profession_Star_Analyzer.DA_Profession_Star_Analyzer",en="Star Analyzer",ja="天体分析員"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/StarChild/DA_Profession_StarChild.DA_Profession_StarChild",en="Star Child",ja="スターチャイルド"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Protector/DA_Profession_Station_Protector.DA_Profession_Station_Protector",en="Station Protector",ja="ステーション守護者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Leader/DA_Profession_Station_Quartermaster.DA_Profession_Station_Quartermaster",en="Station Quartermaster",ja="ステーション補給係将校"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Explorer/DA_Profession_Station_Roamer.DA_Profession_Station_Roamer",en="Station Roamer",ja="ステーション放浪者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Cultivators/DA_Profession_Sustenance_Architect.DA_Profession_Sustenance_Architect",en="Sustenance Architect",ja="食料システム設計士"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Engineer/DA_Profession_Systems_Engineer.DA_Profession_Systems_Engineer",en="Systems Engineer",ja="システムエンジニア"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Teacher/DA_Profession_Teacher.DA_Profession_Teacher",en="Teacher",ja="教師"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Scientist/DA_Profession_Theoretical_Scientist.DA_Profession_Theoretical_Scientist",en="Theoretical Scientist",ja="理論科学者"},
 {path="/Game/Data/Assets/HumanGrow/Traits/Professions/Artist/DA_Profession_Visual_Technician.DA_Profession_Visual_Technician",en="Visual Technician",ja="ビジュアル技術者"},
}
local function professionText034(s)
 for _,p in ipairs(PROFESSIONS034)do if s==p.en or s==p.ja then return TLC.T(p.en,p.ja)end end
 return s
end
TLC.professionText103=professionText034
TLC.humanPropertyAssets034={}
function TLC.prepareHumanValues034(buf,values,ps,done)
 local present={};for _,f in ipairs(properties033(buf))do present[f.key]=true end
 local missing={}
 for key,value in pairs(values)do
  assert(type(value)=='number'and value==value and math.abs(value)&lt;=1000000,'Invalid human parameter')
  if not present[key]then missing[#missing+1]={asset=assert(TLC.humanPropertyAssets034[key],'Human parameter asset unavailable'),value=value}end
 end
 if #missing==0 then return done()end
 TLC.requireSigs({'HumanPropertyInsert034'})
 local index=0
 local function nextValue()
  index=index+1;local v=missing[index];if not v then return done()end
  assert(TLC.valid(v.asset),'Human property asset expired')
  writeQword(buf+0x3b0,v.asset);writeDouble(buf+0x3b8,v.value)
  writeQword(buf+0x3c0,buf+0x3b0);writeQword(buf+0x3c8,buf+0x3b8)
  TLC.job(TLC.A.HumanPropertyInsert034,{buf+TLC.humanLayout103().properties,buf+0x3d0,buf+0x3c0,0},{ps,v.asset},nextValue)
 end
 nextValue()
end
local function prepareProfession034(buf,asset,ps,done)
 if not asset then return done()end
 TLC.requireSigs({'HumanTraitCopy034','HumanTraitInsert034'})
 assert(TLC.valid(asset)and TLC.U.isA(asset,'VoyageItemMemoryTrait'),'Profession asset expired')
 local keep={}
 for _,r in ipairs(rows031(buf+TLC.humanLayout103().traits,TLC.humanLayout103().traitStride))do
  local t=readQword(r);assert(TLC.valid(t),'Human trait expired');local c=readQword(t+TLC.humanLayout103().traitClass)
  if TLC.valid(c)and (readBytes(c+TLC.humanLayout103().profession,1)&amp;TLC.humanLayout103().professionMask)==0 then keep[#keep+1]=t end
 end
 keep[#keep+1]=asset
 local empty=buf+0x340
 for k=0,79 do writeBytes(empty+k,0)end
 writeInteger(empty+0x2c,128);writeInteger(empty+0x30,-1)
 TLC.job(TLC.A.HumanTraitCopy034,{buf+TLC.humanLayout103().traits,empty},{ps,asset},function()
  local k=0
  local function nextTrait()
   k=k+1;if not keep[k]then return done()end
   writeQword(buf+0x3b0,keep[k])
   TLC.job(TLC.A.HumanTraitInsert034,{buf+TLC.humanLayout103().traits,buf+0x3a0,buf+0x3b0,0},{ps,asset},nextTrait)
  end
  nextTrait()
 end)
end
TLC.prepareHumanProfession034=prepareProfession034
-- Prediction is implemented below through GetSimulatedHumanInfo.
function TLC.humanApplyProfession034(id,values,profession,done)
 if not profession then return TLC.humanApply033(id,values,done)end
 TLC.requireSigs({'HumanCopy033','HumanDestroy033','HumanTraitCopy034','HumanPropertyCopy034'})
 local src,ps=result033(id);local buf=assert(allocateMemory(1024))
 for k=0,1023 do writeBytes(buf+k,0)end
 TLC.copyHumanResult103(buf,src,{ps,profession},function()
  TLC.prepareHumanValues034(buf,values,ps,function()
  prepareProfession034(buf,profession,ps,function()
   local current,owner=result033(id);assert(owner==ps,'Human owner changed')
   TLC.job(TLC.A.HumanTraitCopy034,{current+TLC.humanLayout103().traits,buf+TLC.humanLayout103().traits},{ps,profession},function()
    TLC.job(TLC.A.HumanPropertyCopy034,{current+TLC.humanLayout103().properties,buf+TLC.humanLayout103().properties},{ps,profession},function()
    TLC.job(TLC.A.HumanDestroy033,{buf},ps,function()
     deAlloc(buf);TLC.humanApply033(id,values,done)
    end)
    end)
   end)
  end)
  end)
 end)
end
-- Only populate the input controls. Do not edit a human or globally modify a trait asset.
function TLC.humanProfessionValues034(path,values,done)
 TLC.loadAsset(path,function(asset)
  assert(TLC.U.isA(asset,'VoyageItemMemoryTrait'),'Profession asset type mismatch')
  local klass=readQword(asset+TLC.humanLayout103().traitClass)
  assert(TLC.valid(klass)and (readBytes(klass+TLC.humanLayout103().profession,1)&amp;TLC.humanLayout103().professionMask)~=0,'Selected trait is not a profession')
  local limits,seen={},{}
  local function visit(t)
   assert(TLC.valid(t)and TLC.U.isA(t,'VoyageItemMemoryTrait'),'Profession prerequisite unavailable')
   if seen[t]then return end;seen[t]=true
   for _,r in ipairs(rows031(t+TLC.humanLayout103().requiresProperties,TLC.humanLayout103().propertyStride))do
    local p=readQword(r);assert(TLC.valid(p)and TLC.U.isA(p,'VoyageHumanProperty'),'Profession property unavailable')
    local key=TLC.U.name(readInteger(p+TLC.humanLayout103().propertyKey));local threshold=readFloat(r+TLC.humanLayout103().propertyValue+TLC.humanLayout103().requirementValue);local kind=readBytes(r+TLC.humanLayout103().propertyValue+TLC.humanLayout103().requirementType,1)
    assert(kind==TLC.humanLayout103().greater,'Unsupported profession requirement comparison: '..tostring(kind))
    TLC.humanPropertyAssets034[key]=p
    limits[key]=math.max(limits[key]or -math.huge,threshold)
   end
   for _,r in ipairs(rows031(t+TLC.humanLayout103().requires,TLC.humanLayout103().traitStride))do visit(readQword(r))end
  end
  visit(asset)
  local out={};for k,v in pairs(values)do out[k]=v end
  for key,minimum in pairs(limits)do
   out[key]=math.max(out[key]or 0,minimum+0.01)
  end
  done(out,readInteger(asset+TLC.humanLayout103().traitLevel),limits,asset)
 end)
end

-- Per-human delivery age only; never change the global committee requirements.
function TLC.humanSpace035(id)
 local a,ps=result033(id);local meta=readQword(ps+TLC.humanLayout103().metadata)
 assert(TLC.valid(meta)and TLC.U.isA(meta,'VoyageHumanGrowMetadataAsset'),'Human metadata unavailable')
 local minimum=readInteger(meta+TLC.humanLayout103().minimumHours);assert(minimum and minimum&gt;=0 and minimum&lt;=10000,'Invalid committee residence requirement')
 return math.max(0,(os.time()-readQword(a+TLC.humanLayout103().deliveryTimestamp))/3600),minimum
end
function TLC.setHumanSpace035(id,hours,done)
 assert(type(hours)=='number'and hours==hours and hours&gt;=0 and hours&lt;=1000000,TLC.T('Space residence must be 0-1000000 hours.','宇宙滞在時間は0～1000000時間で指定してください。'))
 TLC.requireSigs({'HumanRefresh033'})
 local a,ps=result033(id);assert(readBytes(a+TLC.humanLayout103().type,1)==TLC.humanLayout103().launched,'Human is not in space')
 local timestamp=os.time()-math.ceil(hours*3600)
 if readQword(a+TLC.humanLayout103().timestamp)&gt;timestamp then assert(writeQword(a+TLC.humanLayout103().timestamp,timestamp),'Human growth timestamp write failed')end
 assert(writeQword(a+TLC.humanLayout103().deliveryTimestamp,timestamp),'Space residence write failed')
 assert(readQword(a+TLC.humanLayout103().deliveryTimestamp)==timestamp,'Space residence readback failed')
 refresh033(ps,done)
end
function TLC.humanApplySpace035(id,values,profession,hours,done)
 if hours==nil then return TLC.humanApplyProfession034(id,values,profession,done)end
 assert(hours and hours==hours and hours&gt;=0 and hours&lt;=1000000,'Invalid space residence hours')
 TLC.humanApplyProfession034(id,values,profession,function()TLC.setHumanSpace035(id,hours,done)end)
end

function TLC.humanEditor033()
 TLC.need()
 if TLC.humanWindow033 then TLC.humanWindow033.form.show();return end
 local st={fields={}};TLC.humanWindow033=st
 local form=TLC.uiCreate157('Form',false);st.form=form;form.Caption=TLC.T('Human editor / add humans','人間エディタ・人間追加');form.Width=900;form.Height=650;form.Position='poScreenCenter'
 local function bounds(c,x,y,w,h)c.Left=x;c.Top=y;c.Width=w;c.Height=h end
 local function label(t,x,y,w)local l=TLC.uiCreate157('Label',form);l.Caption=t;bounds(l,x,y,w,24);return l end
 local list=TLC.uiCreate157('ListBox',form);bounds(list,12,44,350,500);st.list=list
 local title=label('',380,15,500);st.title=title
 local empty=label(TLC.T('Launch the first human through normal gameplay.','最初の1人はゲーム内で打ち上げてください。'),380,80,495);empty.AutoSize=false;empty.WordWrap=true;empty.Height=60;empty.Visible=false;st.empty=empty
 label(TLC.T('Base parameters (before age / trait adjustments)','基礎パラメーター（加齢・特性の補正前）'),380,44,500)
 local status=label('',12,600,865);status.AutoSize=false;status.WordWrap=true;st.status=status
 local function button(t,x,y,w,fn)local b=createButton(form);b.Caption=t;bounds(b,x,y,w,30);b.OnClick=fn;return b end
 function st.readValues()
  local vals={};for _,f in ipairs(st.fields)do local v=tonumber(f.edit.Text)
   assert(v and v==v and math.abs(v)&lt;=1000000,TLC.T('Enter finite numbers within +/-1000000.','-1000000～1000000の数値を入力してください。'));vals[f.key]=v
  end;return vals
 end
 function st.layout()
  local rows=math.max(1,math.ceil(#st.fields/2));local pitch=68
  for _,f in ipairs(st.fields)do pitch=math.max(pitch,f.label.Height+f.edit.Height+14)end
  for k,f in ipairs(st.fields)do f.row=(k-1)%rows;f.column=(k-1)//rows;f.label.Left=380+f.column*250;f.edit.Left=f.label.Left
   local y=78+f.row*pitch;f.label.Top=y;f.edit.Top=y+f.label.Height+6
  end
  local bottom=#st.fields&gt;0 and math.max(495,78+rows*pitch+10)or 160
  st.spaceLabel.Top=bottom+4;st.spaceHours.Top=bottom;st.readyOnAdd.Top=bottom+38
  bottom=bottom+76
  st.predLabel.Top=bottom;st.prediction.Top=bottom+30;st.predictButton.Top=bottom+28
  st.profLabel.Top=bottom+70;st.professions.Top=bottom+100;st.presetButton.Top=bottom+98
  bottom=bottom+146
  st.apply.Top=bottom;st.numberLabel.Top=bottom+42;st.count.Top=bottom+76;st.add.Top=bottom+72
  list.Height=bottom+50-list.Top;st.close.Top=bottom+76
  status.Top=bottom+120;status.Height=math.max(60,status.Font.Size*4+8)
  form.ClientWidth=900;form.ClientHeight=status.Top+status.Height+12
  st.rowPitch=pitch

 end
 function st.select()
  local h=st.rows[list.ItemIndex+1];if not h then return end
  st.selected=h;st.professionAsset=nil;title.Caption=h.name;st.empty.Visible=false
  for _,c in ipairs({st.apply,st.add,st.predictButton,st.presetButton,st.professions,st.count,st.spaceHours,st.readyOnAdd})do c.Enabled=true end
  local spaceHours,minimum=TLC.humanSpace035(h.id);st.spaceHours.Text=string.format('%.6f',spaceHours);st.loadedSpaceText=st.spaceHours.Text;st.spaceLabel.Caption=TLC.T('Space hours (committee: '..minimum..'+)','宇宙滞在 h（必要 '..minimum..'h）')
  for _,f in ipairs(st.fields)do f.edit.destroy();f.label.destroy()end;st.fields={}
  local a=result033(h.id);local fields=properties033(a)
  local rows=math.max(1,math.ceil(#fields/2));local pitch=68
  for k,f in ipairs(fields)do
   local col=(k-1)//rows;local row=(k-1)%rows;local x=380+col*250
   f.label=label(TLC.T(f.label[1],f.label[2]),x,0,240);f.edit=TLC.uiCreate157('Edit',form)
   bounds(f.edit,x,0,230,30)
   pitch=math.max(pitch,f.label.Height+f.edit.Height+14)
   f.column=col;f.row=row;f.edit.Text=string.format('%.17g',f.value);st.fields[#st.fields+1]=f
  end
  st.layout()
  status.Caption=TLC.T('Edit values, then apply to this human or add new humans with these values.','数値を変更し、「選択した人間へ反映」または「指定値で人間を追加」を押してください。')
  st.prediction.Text=TLC.T('Not calculated','未計算')
  for _,f in ipairs(st.fields)do f.edit.OnChange=function()st.revision=(st.revision or 0)+1;st.prediction.Text=TLC.T('Input changed - recalculate','入力値変更・予想を更新してください')end end
  local id=h.id;TLC.userRun(function()if not st.closed and st.selected and st.selected.id==id then st.predict()end end)

 end
 function st.refresh(prefer)
  st.rows=TLC.humanList033();list.Items.clear();local index=0
  for k,h in ipairs(st.rows)do list.Items.add(h.name);if h.id==prefer then index=k-1 end end
  if #st.rows&gt;0 then
   list.ItemIndex=index;st.select();TLC.requestHumanNames042(st)
  else
   TLC.cancelHumanNames042(st);st.selected=nil;st.professionAsset=nil;list.ItemIndex=-1
   for _,f in ipairs(st.fields)do f.edit.destroy();f.label.destroy()end;st.fields={}
   title.Caption=TLC.T('Launched humans: 0','打ち上げ済み：0人');st.empty.Visible=true
   st.spaceLabel.Caption=TLC.T('Space residence (hours)','宇宙滞在時間（h）');st.spaceHours.Text='0';st.loadedSpaceText='0'
   st.prediction.Text=TLC.T('No selected human','対象の人間なし')
   for _,c in ipairs({st.apply,st.add,st.predictButton,st.presetButton,st.professions,st.count,st.spaceHours,st.readyOnAdd})do c.Enabled=false end
   status.Caption=TLC.T('To protect quest progression, adding humans is unavailable until you launch the first human through normal gameplay. Launch one human, then refresh this list.','クエストの進行を保護するため、最初の1人をゲーム内で打ち上げるまでは追加できません。打ち上げ後に「人間一覧を再取得」を押してください。')
   st.layout()
  end
 end
 local function run(fn)
  TLC.userRun(function()
   assert(not st.closed,'Human editor closed');assert(st.selected,'Select a human')
   local vals=st.readValues();local hours=tonumber(st.spaceHours.Text);assert(hours and hours==hours and hours&gt;=0 and hours&lt;=1000000,TLC.T('Enter valid space hours.','宇宙滞在時間に0～1000000を指定してください。'));status.Caption=TLC.T('Applying...','反映中…');fn(st.selected.id,vals,hours,st.spaceHours.Text~=st.loadedSpaceText)
  end)
 end
 button(TLC.T('Refresh humans','人間一覧を再取得'),12,8,350,function()TLC.userRun(function()st.refresh(st.selected and st.selected.id)end)end)
 st.apply=button(TLC.T('Apply to selected human','選択した人間へ反映'),380,495,495,function()run(function(id,v,hours,changed)TLC.humanApplySpace035(id,v,st.professionAsset,changed and hours or nil,function()if not st.closed then st.refresh(id)end end)end)end)
 st.numberLabel=label(TLC.T('Number to add (1-20)','追加人数（1～20）'),380,540,495)
 local count=TLC.uiCreate157('Edit',form);bounds(count,380,536,100,30);count.Text='1';st.count=count
 st.add=button(TLC.T('Add humans with specified values','指定値で人間を追加'),500,534,375,function()run(function(id,v,hours,changed)local _,minimum=TLC.humanSpace035(id);if not changed then hours=st.readyOnAdd.Checked and minimum+1/3600 or 0 elseif st.readyOnAdd.Checked then hours=math.max(hours,minimum+1/3600)end;TLC.humanAdd033(id,v,tonumber(count.Text),function(ids)if not st.closed then st.refresh(ids[#ids])end end,st.professionAsset,hours)end)end)
 st.close=button(TLC.T('Close','閉じる'),12,554,350,function()form.close()end)
 form.OnClose=function()st.closed=true;TLC.cancelHumanNames042(st);TLC.humanWindow033=nil;return caFree end
 list.OnClick=function()TLC.userRun(st.select)end
 st.spaceLabel=label('',380,0,310)
 st.spaceHours=TLC.uiCreate157('Edit',form);bounds(st.spaceHours,700,0,175,30)
 st.readyOnAdd=createCheckBox(form);bounds(st.readyOnAdd,380,0,495,30);st.readyOnAdd.Caption=TLC.T('New humans: meet committee space-residence requirement','新規追加時は委員会の宇宙滞在条件を満たす');st.readyOnAdd.Checked=true
 st.predLabel=label(TLC.T('Expected profession (selected human age / traits)','予想される職業（選択した人間の年齢・特性で判定）'),380,0,495)
 st.prediction=TLC.uiCreate157('Edit',form);bounds(st.prediction,380,0,310,30);st.prediction.ReadOnly=true
 function st.predict()
  local h=assert(st.selected);local values=st.readValues();local revision=st.revision or 0
  st.prediction.Text=TLC.T('Calculating...','判定中…')
  TLC.humanPredict034(h.id,values,function(name,level)
   if not st.closed and st.selected and st.selected.id==h.id and revision==(st.revision or 0)then st.prediction.Text=name..' / '..TLC.T('Level ','レベル ')..level;status.Caption=TLC.T('Prediction calculated without changing the human.','人間を変更せず、入力値から職業を判定しました。')end
  end,st.professionAsset)
 end
 st.predictButton=button(TLC.T('Recalculate','予想を更新'),700,0,175,function()TLC.userRun(st.predict)end)
 st.profLabel=label(TLC.T('Generate base values for a profession','職業を選択して必要な基礎値を作成'),380,0,495)
 st.professions=TLC.uiCreate157('ComboBox',form);bounds(st.professions,380,0,310,30);st.professions.Style='csDropDownList'
 for _,p in ipairs(PROFESSIONS034)do st.professions.Items.add(TLC.T(p.en,p.ja))end;st.professions.ItemIndex=0
 st.presetButton=button(TLC.T('Generate values','基礎値を作成'),700,0,175,function()
  TLC.userRun(function()
   local selected=assert(PROFESSIONS034[st.professions.ItemIndex+1]);local id=st.selected.id
   TLC.humanProfessionValues034(selected.path,st.readValues(),function(values,level,limits,asset)
    if st.closed or not st.selected or st.selected.id~=id then return end
    st.professionAsset=asset
    local present={};for _,f in ipairs(st.fields)do present[f.key]=true end
    local keys={};for key in pairs(values)do if not present[key]then keys[#keys+1]=key end end;table.sort(keys)
    for _,key in ipairs(keys)do
     local names=assert(H033[key],'Human parameter label unavailable')
     local f={key=key,label=label(TLC.T(names[1],names[2]),380,0,240),edit=TLC.uiCreate157('Edit',form)}
     bounds(f.edit,380,0,230,30);f.edit.OnChange=function()st.revision=(st.revision or 0)+1;st.prediction.Text=TLC.T('Input changed - recalculate','入力値変更・予想を更新してください')end
     st.fields[#st.fields+1]=f
    end
    st.layout()
    for _,f in ipairs(st.fields)do f.edit.Text=string.format('%.17g',values[f.key])end
    status.Caption=TLC.T('Required minimums prepared; check the prediction before applying.','職業の必要値を入力しました。予想を確認してから反映してください。')
    st.predict()
   end)
  end)
 end)
 st.refresh();form.show()
end
-- Close the editor on world travel; pending jobs retain the standard lifetime guards.
local suspendHuman033=TLC.suspendWorld029
function TLC.suspendWorld029(...)
 if TLC.humanWindow033 then TLC.humanWindow033.form.close()end
 return suspendHuman033(...)
end
local disableHuman033=TLC.disableAll
function TLC.disableAll(...)
 if TLC.humanWindow033 then TLC.humanWindow033.form.close()end
 return disableHuman033(...)
end

TLC.SIGS.RocketScriptExec036={len=0,bytes={72,137,92,36,8,72,137,108,36,16,72,137,116,36,24,87,65,86,65,87,72,131,236,48,76,139,114,16,73,139,248,72,139,1,72,139,234,69,51,192},p='48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 30 4C 8B 72 10 49 8B F8 48 8B 01 48 8B EA 45 33 C0'}
TLC.SIGS.RocketActorLocation036={len=0,bytes={72,131,236,40,72,139,66,32,69,51,201,72,133,192,65,15,149,193,76,3,200,76,137,74,32,72,139,129,184,1,0,0,72,133,192,116,26,15,16,128},p='48 83 EC 28 48 8B 42 20 45 33 C9 48 85 C0 41 0F 95 C1 4C 03 C8 4C 89 4A 20 48 8B 81 B8 01 00 00 48 85 C0 74 1A 0F 10 80'}
-- Restore existing rocket top components through the shipped Blueprint events.
TLC.NAMES[603]={'Restore nearby rocket nose cone','近くのロケットの先端を復旧'}
local function fail036(en,ja)error(TLC.T(en,ja),0)end
local function location036(actor)return TLC.actorLocation109(actor)end
local function nearestRocket036(world,player)
 local origin=location036(player);local best,bestDistance,ambiguous=nil,10000*10000,false
 for _,actor in ipairs(TLC.recoveryActors112('BP_Rocket_Functional_C'))do
  local position=location036(actor);local distance=0
  for axis=1,3 do distance=distance+(position[axis]-origin[axis])^2 end
  if distance&lt;bestDistance then best=actor;bestDistance=distance;ambiguous=false
  elseif best and math.abs(distance-bestDistance)&lt;1 then ambiguous=true end
 end
 if not best then fail036('No loaded functional rocket within 100 metres. Stand near the rocket and retry.','100m以内のロケットを取得できません。対象の近くで実行してください。')end
 if ambiguous then fail036('Multiple rockets occupy the same location; recovery stopped.','同じ距離に複数のロケットがあるため、復旧を中止しました。')end
 return best,math.sqrt(bestDistance)/100
end
-- Blueprint event frames are resolved by rocketEvent114 below.
local function hidden036(component)
 local field=assert(field031(component,'bHiddenInGame'),'Visibility property unavailable')
 local offset=readInteger(field+0x44);local mask=readBytes(field+0x72,1)
 assert(mask and mask~=0 and readBytes(field+0x71,1)==0,'Visibility bool layout mismatch')
 return(readBytes(component+offset,1)&amp;mask)~=0
end
local function grounded036(state)return TLC.rocketGrounded114(state)end
function TLC.restoreRocketTop036()
 TLC.need();
 local world=TLC.world();local player=TLC.player(true);local actor,distance=nearestRocket036(world,player)
 local state=readQword(actor+off031(actor,'VoyageRocketState'));grounded036(state)
 local components={};local identities={TLC.identity029(actor),TLC.identity029(state),TLC.identity029(player)}
 for _,name in ipairs({'SM_Top','SM_Top_Door','SM_Top_Door_Handle','VoyagePhysicalSnapSocket_01','VoyagePhysicalSnapSocket_03','VoyagePhysicalSnapSocket_04','VoyagePhysicalSnapSocket_02','SpotLight1','SM_CeilingLight_Functional','SM_SamplesContainer','SM_ItemsContainer'})do
  local c=readQword(actor+off031(actor,name))
  assert(TLC.valid(c)and TLC.U.isA(c,'SceneComponent')and readQword(c+0x20)==actor,'Rocket component missing: '..name)
  components[#components+1]=c;identities[#identities+1]=TLC.identity029(c)
 end
 local top=components[1];local mesh=readQword(top+off031(top,'StaticMesh'))
 assert(TLC.valid(mesh)and TLC.U.n(mesh)=='SM_Rocket_Top','Original rocket nose mesh unavailable')
 local prop=assert(field031(actor,'bHasTop'));local topOffset=readInteger(prop+0x44)
 assert(readInteger(prop+0x34)==1 and (readBytes(prop+0x72,1)==1 or readBytes(prop+0x72,1)==255),'Rocket top bool layout mismatch')
 local before=readBytes(actor+topOffset,1);local wasHidden=hidden036(top)
 local gather=TLC.rocketEvent114(actor,'GatherComponents',0).fn
 local restore=TLC.rocketEvent114(actor,'SetRocketTopVisible',1)
 local setup=TLC.rocketEvent114(actor,'SetupInteractiveState',0).fn
 local function check()
  assert(TLC.world()==world,'Rocket world changed')
  for _,id in ipairs(identities)do assert(TLC.sameIdentity029(id),'Rocket object lifetime changed')end
  grounded036(state)
 end
 local audit={actor=actor,world=world,pid=TLC.pid,before=before,hiddenBefore=wasHidden,mesh=mesh,distance=distance}
 TLC.rocketRecovery036=audit
 local payload=assert(allocateMemory(math.max(8,restore.size)),'Rocket recovery buffer unavailable');for i=0,math.max(8,restore.size)-1 do assert(writeBytes(payload+i,0))end;assert(writeBytes(payload+restore.offset,restore.mask))
 local processEvent=TLC.processEvent074(actor)
 TLC.job(processEvent,{actor,gather,0},{actor,state},function()
  check()
  assert(readInteger(actor+off031(actor,'RocketTopComponents')+8)==11 and readInteger(actor+off031(actor,'RocketTopPrimitives')+8)==6,'Rocket component lists mismatch')
  TLC.job(processEvent,{actor,restore.fn,payload},{actor,state},function()
   check();audit.after=readBytes(actor+topOffset,1);audit.hiddenAfter=hidden036(top)
   assert(audit.after==1 and not audit.hiddenAfter,'Rocket nose restoration was not accepted')
   assert(readQword(top+off031(top,'StaticMesh'))==mesh,'Rocket nose mesh changed')
   TLC.job(processEvent,{actor,setup,0},{actor,state},function()
    deAlloc(payload);check();audit.done=true
    TLC.msg('Restored the nearby rocket nose cone.','近くのロケットの先端を復旧しました。')
   end)
  end)
 end)
end

TLC.SIGS.CellActive037={len=0,bytes={69,51,201,233,8,0,0,0,204,204,204,204,204,204,204,204,72,137,92,36,8,72,137,108,36,16,72,137,116,36,24,87,65,84,65,85,65,86,65,87},p='45 33 C9 E9 08 00 00 00 CC CC CC CC CC CC CC CC 48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57'}
TLC.SIGS.DetachActor037={len=0,bytes={72,137,92,36,32,85,86,87,72,141,108,36,185,72,129,236,144,0,0,0,72,139,5,133,249,228,5,72,51,196,72,137,69,55,65,15,182,240,72,139},p='48 89 5C 24 20 55 56 57 48 8D 6C 24 B9 48 81 EC 90 00 00 00 48 8B 05 85 F9 E4 05 48 33 C4 48 89 45 37 41 0F B6 F0 48 8B'}
TLC.SIGS.AreaResolve037={len=0,bytes={64,85,83,86,87,65,85,65,87,72,141,108,36,209,72,129,236,152,0,0,0,76,139,249,72,139,242,72,139,202,232,253,248,247,251,69,51,237,72,139},p='40 55 53 56 57 41 55 41 57 48 8D 6C 24 D1 48 81 EC 98 00 00 00 4C 8B F9 48 8B F2 48 8B CA E8 FD F8 F7 FB 45 33 ED 48 8B'}
TLC.SIGS.AreaDetachable037={len=0,bytes={72,137,92,36,8,87,72,131,236,32,72,139,218,72,139,249,72,133,210,116,101,72,139,21,156,117,26,6,72,139,203,232,236,250,249,252,132,192,116,82},p='48 89 5C 24 08 57 48 83 EC 20 48 8B DA 48 8B F9 48 85 D2 74 65 48 8B 15 9C 75 1A 06 48 8B CB E8 EC FA F9 FC 84 C0 74 52'}
-- Repair a stalled main-grid attachment restore using the game's own resolver/detach.
TLC.NAMES[604]={'Repair stalled area loading (unresolved attachments)','エリアの読み込み停止を修復（取り付け復元待ち）'}
local function stop037(en,ja)error(TLC.T(en,ja),0)end
local function context037()return TLC.areaContext117()end
local function parent037(actor)
 local root=readQword(actor+off031(actor,'RootComponent'))
 assert(TLC.valid(root)and TLC.U.isA(root,'SceneComponent'),'Pending actor root unavailable')
 local p=readQword(root+off031(root,'AttachParent'))
 return p and p~=0
end
local function reference037(entry)return TLC.areaReference117(entry)end
local function pending037(c)
 local out={}
 for _,row in ipairs(rows031(c.persistent+c.layout.pending,c.layout.outerStride))do
  if TLC.U.name(readInteger(row))==c.cell then
   for _,entry in ipairs(rows031(row+c.layout.set,c.layout.innerStride))do
    local actor=TLC.weak(entry);local ref=reference037(entry)
    if TLC.valid(actor)and TLC.U.isA(actor,'Actor')and ref and not parent037(actor)then
     out[#out+1]={actor=actor,identity=TLC.identity029(actor),reference=ref}
    end
   end
  end
 end
 return out
end
local function sameRef037(a,b)
 if a.path~=b.path or a.n~=b.n then return false end
 for i=a.prefix+1,#a.header do if a.header[i]~=b.header[i]then return false end end
 return true
end
local function current037(c,item)
 for _,x in ipairs(pending037(c))do
  if x.actor==item.actor and TLC.sameIdentity029(item.identity)and sameRef037(x.reference,item.reference)then return x end
 end
end
local function query037(c,done)
 local p=location036(c.player);local buffer=assert(allocateMemory(32))
 for i=1,3 do writeDouble(buffer+(i-1)*8,p[i])end
 TLC.job(TLC.A.CellActive037,{c.locator,buffer,0},{c.locator,c.player},function(result)deAlloc(buffer);done((result&amp;0xff)~=0)end)
end
local function check037(c)
 assert(TLC.pid==c.pid and TLC.world()==c.world and TLC.sameIdentity029(c.pi)and TLC.sameIdentity029(c.li)and TLC.sameIdentity029(c.si),'Area repair world/object changed')
 local now=context037();assert(now.cell==c.cell,'Player left the inspected area')
end
function TLC.cancelAreaRepair037()
 if TLC.areaRepairTimer037 then TLC.areaRepairTimer037.destroy();TLC.areaRepairTimer037=nil end
 if TLC.areaRepair037 then TLC.areaRepair037.cancelled=true end
end
function TLC.repairStalledArea037()
 TLC.need()
 TLC.requireSigs({'CellActive037','DetachActor037','AreaResolve037','AreaDetachable037'})
 TLC.cancelAreaRepair037()
 local c=context037();c.pi=TLC.identity029(c.player);c.li=TLC.identity029(c.locator);c.si=TLC.identity029(c.persistent)
 c.changed={};c.skipped={};TLC.areaRepair037=c
 query037(c,function(active)
  check037(c)
  if active then c.done=true;TLC.msg('The current area is active; no repair was needed.','現在地の更新は正常です。変更しませんでした。');return end
  local initial=pending037(c)
  if #initial==0 then stop037('The area is blocked, but no supported unresolved attachment was found. No changes made.','現在地の更新は停止していますが、修復対象の未解決な取り付け待ちを確認できません。変更しませんでした。')end
  assert(#initial&lt;=64,'Too many pending attachments; repair stopped')
  c.initial=initial
  TLC.msg('Inspecting '..#initial..' unresolved attachment(s) for 5 seconds...','未解決の取り付け待ち '..#initial..'件を5秒間確認します…')
  local start=getTickCount();local timer=createTimer(nil);TLC.areaRepairTimer037=timer;timer.Interval=250
  timer.OnTimer=function(t)
   local ok,e=pcall(function()
    if c.cancelled then t.destroy();return end
    check037(c)
    if getTickCount()-start&lt;5000 then return end
    t.destroy();TLC.areaRepairTimer037=nil
    TLC.userRun(function()
     check037(c);if c.cancelled then return end
     local index=0
     local function finish()
      query037(c,function(active)
       check037(c);c.activeAfter=active;c.done=true
       if active then TLC.msg('Area loading recovered. Repaired attachments: '..#c.changed,'エリアの更新が復旧しました。修復した取り付け待ち：'..#c.changed..'件')
       else TLC.reason('areaRepair',TLC.T('Area is still blocked. Repaired: '..#c.changed..'; other pending work was left intact.','まだ更新停止が残っています。修復：'..#c.changed..'件。別の待ち処理は変更していません。'))end
      end)
     end
     local function step()
      check037(c);if c.cancelled then return end
      index=index+1;local original=initial[index];if not original then return finish()end
      local item=current037(c,original);if not item then c.skipped[#c.skipped+1]='changed';return step()end
      TLC.job(TLC.A.AreaDetachable037,{c.persistent,item.actor},{c.persistent,item.actor},function(allowed)
       check037(c)
       if(allowed&amp;0xff)==0 then c.skipped[#c.skipped+1]='not detachable';return step()end
       item=current037(c,original);if not item then return step()end
       -- Deep-copy the UTF8 soft reference so an async queue change cannot free
       -- the argument string before the game-thread resolver reads it.
       local ref=item.reference;local buffer=TLC.copyAreaReference117(ref)
       TLC.job(TLC.A.AreaResolve037,{c.persistent,buffer,0},{c.persistent,item.actor},function(resolved)
        deAlloc(buffer);check037(c)
        if resolved and resolved~=0 then c.skipped[#c.skipped+1]='reference resolved';return step()end
        item=current037(c,original);if not item then return step()end
        TLC.job(TLC.A.DetachActor037,{c.persistent,item.actor,0},{c.persistent,item.actor},function()
         check037(c);c.changed[#c.changed+1]={actor=item.actor,path=item.reference.path}
         TLC.msg('Released stalled attachment: '..TLC.U.n(item.actor),'取り付け復元待ちを解除：'..TLC.U.n(item.actor))
         step()
        end)
       end)
      end)
     end
     query037(c,function(active)if active then c.activeAfter=true;c.done=true;TLC.msg('Area recovered while waiting; no changes made.','確認中に正常復帰しました。変更しませんでした。')else step()end end)
    end)
   end)
   if not ok then pcall(function()t.destroy()end);TLC.areaRepairTimer037=nil;TLC.reason('areaRepair',tostring(e))end
  end
 end)
end
local allOff037=TLC.disableAll
function TLC.disableAll(...)TLC.cancelAreaRepair037();return allOff037(...)end
local suspend037=TLC.suspendWorld029
function TLC.suspendWorld029(...)TLC.cancelAreaRepair037();return suspend037(...)end


TLC.SIGS.Objects.bootstrapPattern='48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? 48 83 C4 28 E9 ?? ?? ?? ?? 48 8D 0D 79'
TLC.SIGS.Names.bootstrapPattern='4C 8D 3D ?? ?? ?? ?? EB ?? 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 4C 8B F8 C6 05 ?? ?? ?? ?? 01 8B'
TLC.SIGS.Engine.bootstrapPattern='48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 85 C0 74 ?? 48 8B 80 28 02 00 00 48 89 07 48 8B 5C 24 30 48 83 C4 20 5F C3 48 8B'
-- Store-neutral discovery; optional code searches run only when requested.
-- A foreign PE identity is not evidence that private C++ layouts are compatible.
TLC.compat038={scanMs=1500,chunk=0x200000,portable={seedCountdown=true,noCraftPower=true,invincible=true,cold=true,noresources=true}}
local function exact038(a,bytes)
 if not a or not bytes then return false end
 local b=readBytes(a,#bytes,true);if not b or #b~=#bytes then return false end
 for k,v in ipairs(bytes)do if b[k]~=v then return false end end
 return true
end
local function u32(a)local n=readInteger(a);return type(n)=='number'and(n&amp;0xffffffff)or nil end
local function u16(a)local n=readSmallInteger(a);return type(n)=='number'and(n&amp;0xffff)or nil end
local function signed(n)return n&gt;=0x80000000 and n-0x100000000 or n end
local function fail038(en,ja)error(TLC.T(en,ja),0)end
local function gameName038(name)
 name=tostring(name or''):lower():match('([^\\/]+)$')or''
 return name:match('%.exe$')and(name:find('voyage',1,true)or name:find('lastcaretaker',1,true)or name:find('last_caretaker',1,true))~=nil
end
function TLC.findProcess038(list,opened)
 local candidates={};local shipping={}
 for pid,name in pairs(list)do
  if type(pid)=='number'and pid&gt;0 and gameName038(name)then
   local row={pid=pid,name=name};candidates[#candidates+1]=row
   if name:lower():find('shipping',1,true)then shipping[#shipping+1]=row end
  end
 end
 -- The Steam installation starts Voyage.exe as a launcher as well as the
 -- shipping process. It is not a second game instance.
 if #shipping&gt;0 then candidates=shipping end
 -- Never silently choose another installation when more than one is running.
 if #candidates~=1 then return nil,#candidates end
 return candidates[1],1
end
function TLC.attachGame()
 local candidate,count=TLC.findProcess038(getProcessList(),getOpenedProcessID())
 if not candidate then
  if count&gt;1 then fail038('Multiple shipping game processes found; close the other game before attaching.','ゲーム本体が複数起動しています。対象以外を終了してから再実行してください。')end
  fail038('No supported game process name found.','対象ゲームのプロセスが見つかりません。')
 end
 local changed=getOpenedProcessID()~=candidate.pid
 if changed then openProcess(candidate.pid)end
 local name=tostring(candidate.name):match('([^\\/]+)$')
 TLC.EXE=name;TLC.MODULE=name;TLC.moduleCache=nil
 if not TLC.mod()then pcall(reinitializeSymbolhandler,true)end
 TLC.moduleRequired()
 if changed then TLC.msg(('Attached to %s (PID %d).'):format(name,candidate.pid),('%s（PID %d）にアタッチしました。'):format(name,candidate.pid))end
 return changed
end
function TLC.checkBuild()
 local b=TLC.moduleRequired();local p=u32(b+0x3c)
 assert(u16(b)==0x5a4d and p and p&gt;=0x40 and p&lt;=0x100000,'Unreadable executable header')
 assert(u32(b+p)==0x4550 and u16(b+p+4)==0x8664 and u16(b+p+24)==0x20b,'Expected a Win64 PE32+ executable')
 local size=u32(b+p+0x50);local timestamp=u32(b+p+8)
 local count=u16(b+p+6);local optional=u16(b+p+20)
 assert(size and size&gt;=0x10000 and size&lt;=0x80000000 and count and count&gt;0 and count&lt;=96 and optional and optional&gt;=0xf0,'Invalid executable sections')
 local image={base=b,size=size,ts=timestamp,sections={}}
 for index=0,count-1 do
  local h=b+p+24+optional+index*40
  local rva=u32(h+12);local length=u32(h+8);local flags=u32(h+36)
  assert(rva and length and flags and rva&lt;=size and length&lt;=size-rva,'Invalid PE section bounds')
  if length&gt;0 and(flags&amp;0x20000000)~=0 then image.sections[#image.sections+1]={lo=b+rva,hi=b+rva+length}end
 end
 assert(#image.sections&gt;0,'No executable section')
 image.known=timestamp==(TLC.BUILD.ts&amp;0xffffffff)and size==(TLC.BUILD.size&amp;0xffffffff)
 TLC.image038=image
 return true
end
function TLC.executable038(a,length)
 local image=TLC.image038;if not image or type(a)~='number'then return false end
 length=length or 1
 for _,s in ipairs(image.sections)do if a&gt;=s.lo and a+length&lt;=s.hi then return true end end
 return false
end
-- Exhaust the executable sections before accepting a unique match. A time limit
-- yields no result, even if one candidate has already been seen.
function TLC.scanCode038(pattern,deadline)
 local found={};local seen={};local width=0
 for _ in pattern:gmatch('%S+')do width=width+1 end
 assert(width&gt;0 and width&lt;=512,'Invalid code signature width')
 for _,section in ipairs(assert(TLC.image038).sections)do
  local cursor=section.lo
  while cursor&lt;section.hi do
   if getTickCount()&gt;=deadline then return nil,'search time limit reached' end
   local finish=math.min(cursor+TLC.compat038.chunk,section.hi)
   local matches=TLC.aobAll(pattern,cursor,math.min(finish+width-1,section.hi),2)
   for _,a in ipairs(matches)do
    if a&gt;=section.lo and a+width&lt;=section.hi and not seen[a]then
     seen[a]=true;found[#found+1]=a
     if #found&gt;1 then return nil,'ambiguous code signature' end
    end
   end
   cursor=finish
  end
 end
 if getTickCount()&gt;=deadline then return nil,'search time limit reached' end
 return found[1],#found==0 and'code signature not found'or nil
end
local function publish038(n,a,method)
 TLC.A[n]=a;TLC.resolution[n]=method;TLC.pend[n]=nil;TLC.failures[n]=nil
 registerSymbol('tlcA_'..n,a,true)
 if n=='GameThread'then local d=u32(a+2);if d then registerSymbol('tlcGameThreadId',a+6+signed(d),true)end end
 if n=='NPCClass'then local d=u32(a+3);if d then registerSymbol('tlcNpcClassSlot',a+7+signed(d),true)end end
 return a
end
function TLC.resolveSig(n)
 if TLC.A[n]then return TLC.A[n]end
 local s=TLC.SIGS[n]
 if not s then TLC.reason(n,'unknown signature');return nil end
 local base=s.mod and TLC.mod(s.mod)or TLC.moduleRequired()
 local a=rawget(TLC.A,n)
 if(s.mod or TLC.executable038(a,#s.bytes))and exact038(a,s.bytes)then return publish038(n,a,'RVA')end
 if TLC.resolution[n]=='failed'then return nil end
 if s.mod then
  TLC.resolution[n]='failed';TLC.reason(n,'runtime export not verified');return nil
 end
 TLC.searchCount=(TLC.searchCount or 0)+1
 local deadline=getTickCount()+TLC.compat038.scanMs
 local pattern=s.bootstrapPattern or s.p
 local found,why=TLC.scanCode038(pattern,deadline)
 local method='AOB'
 if found and not s.bootstrapPattern and not exact038(found,s.bytes)then found=nil;why='original instructions not verified'end
 -- Ambiguous or incomplete scans must never be rescued by a guessed target.
 if not found and not s.bootstrapPattern then
  local prior=TLC.reflectionDeadline074
  local reflectionDeadline=getTickCount()+TLC.compat038.scanMs
  TLC.reflectionDeadline074=reflectionDeadline
  local okay,ref,reason=pcall(TLC.refCode,n)
  TLC.reflectionDeadline074=prior
  if okay and ref and TLC.executable038(ref,#s.bytes)and exact038(ref,s.bytes)and getTickCount()&lt;reflectionDeadline then found=ref;method='reflection'
  else why=tostring(why)..'; '..tostring(okay and(reason or'reflection budget exhausted')or ref)end
 end
 if not found then
  TLC.resolution[n]='failed';TLC.pend[n]=nil
  TLC.reason(n,TLC.T('Unavailable: ','利用不可: ')..tostring(why));return nil
 end
 return publish038(n,found,method)
end
function TLC.requireSigs(names)
 for _,n in ipairs(names)do if not TLC.resolveSig(n)then error(TLC.missing(n),0)end end
end
function TLC.refClass(name)
 TLC.classes038=TLC.classes038 or{}
 local cached=TLC.classes038[name]
 if cached and TLC.valid(cached)and TLC.U.n(cached)==name and TLC.U.c(cached)=='Class'then return cached end
 local count=TLC.U.go and TLC.objectCount072();local chunks=TLC.U.go and readQword(TLC.U.go)
 if not count or count&lt;1 or count&gt;4000000 or not chunks then return nil end
 local deadline=getTickCount()+250
 for index=0,count-1 do
  if index%256==0 and getTickCount()&gt;=deadline then return nil end
  local chunk=readQword(chunks+(index//65536)*8)
  local object=chunk and readQword(chunk+(index%65536)*24+8)
  if object and TLC.valid(object)and TLC.U.c(object)=='Class'then
   local actual=TLC.U.n(object);TLC.classes038[actual]=object
   if actual==name then return object end
  end
 end
end
function TLC.bootstrapValid038()
 local u=TLC.U
 assert(u.go and u.gn and u.ge,'Unresolved Unreal globals')
 u.names={};assert(u.name(0)=='None','Unreal name-pool layout not verified')
 local count=TLC.objectCount072();local chunks=readQword(u.go)
 assert(count and count&gt;=16 and count&lt;=4000000 and chunks and chunks&gt;0x10000,'Unreal object-array layout not verified')
 local verified=0
 for index=0,math.min(count-1,255)do
  local chunk=readQword(chunks+(index//65536)*8)
  local object=chunk and readQword(chunk+(index%65536)*24+8)
  if object and object&gt;0x10000 and readInteger(object+0xc)==index and TLC.valid(object)and TLC.U.n(object)~='?'then verified=verified+1 end
 end
 assert(verified&gt;=8,'Unreal object identity checks failed')
 local engine=readQword(u.ge)
 assert(engine and TLC.valid(engine)and u.isA(engine,'Engine'),'Engine class identity not verified')
 return true
end
function TLC.refreshMetadata074()
 local targets={};local errors={}
 for _,n in ipairs({'Objects','Names','Engine'})do
  local okay,address=pcall(TLC.resolveSig,n)
  if okay and address then
   local rel=u32(address+3);local target=rel and address+7+signed(rel);local image=TLC.image038
   if target and target&gt;=image.base and target+8&lt;=image.base+image.size then targets[n]=target
   else errors[#errors+1]=n..': invalid global reference'end
  else errors[#errors+1]=n..': '..tostring(okay and TLC.missing(n)or address)end
 end
 TLC.U.go=targets.Objects;TLC.U.gc=TLC.objectBootstrap072 and TLC.objectBootstrap072.countAddress
 TLC.U.gn=targets.Names;TLC.U.ge=targets.Engine;TLC.U.names={}
 local okay,why=false,nil
 if #errors==0 then okay,why=pcall(TLC.bootstrapValid038)end
 TLC.reflectionReady074=okay==true
 if not TLC.reflectionReady074 then
  TLC.metadataReason074=#errors&gt;0 and table.concat(errors,'; ')or tostring(why)
  TLC.U.go=nil;TLC.U.gc=nil;TLC.U.gn=nil;TLC.U.ge=nil;TLC.U.names={}
 else TLC.metadataReason074=nil end
 return TLC.reflectionReady074,TLC.metadataReason074
end
function TLC.resolveAll()
 local good,deferred=0,0
 TLC.U.go=nil;TLC.U.gc=nil;TLC.objectBootstrap072=nil;TLC.U.gn=nil;TLC.U.ge=nil;TLC.U.names={}
 TLC.refreshMetadata074()
 for n,s in pairs(TLC.SIGS)do
  if TLC.A[n]then good=good+1
  else
   if TLC.resolution[n]~='failed'then TLC.resolution[n]='deferred'end
   deferred=deferred+1
  end
 end
 if not TLC.reflectionReady074 then TLC.msg('Metadata unavailable; only independent verified features can be used: '..TLC.metadataReason074,'メタデータ未解決。独立して検証できる機能のみ利用できます: '..TLC.metadataReason074)end
 TLC.msg(('Code verified %d; deferred %d; searches %d'):format(good,deferred,TLC.searchCount),('コード確認 %d件／使用時に確認 %d件／再探索 %d件'):format(good,deferred,TLC.searchCount))
 return good,deferred
end
local forget038=TLC.forgetProcess
function TLC.forgetProcess()
 forget038();TLC.ready038=nil;TLC.image038=nil;TLC.classes038={};TLC.scope038=nil;TLC.reflectionReady074=nil;TLC.metadataReason074=nil
 TLC.U.go=nil;TLC.U.gc=nil;TLC.objectBootstrap072=nil;TLC.U.gn=nil;TLC.U.ge=nil;TLC.U.names={}
end
local attached038=TLC.attached
function TLC.attached()return TLC.ready038==true and attached038()end
function TLC.init()
 if TLC.attached()then return true end
 local started=getTickCount();TLC.forgetProcess()
 local allocated=false;local fallbackMemory
 local okay,why=pcall(function()
  TLC.checkBuild();TLC.resolveAll()
  -- Only allocate table-owned storage after the executable and UObject layouts
  -- have passed read-only checks. No failed-build short circuit is retained.
  for _,n in ipairs({'tlcFlags','tlcVars','tlcPtrs'})do pcall(unregisterSymbol,n)end
  local mem
  if autoAssemble(('alloc(tlcFlags,$2000,%X)\nregistersymbol(tlcFlags)\n'):format(TLC.moduleRequired()))then mem=getAddressSafe('tlcFlags')end
  if not mem or mem==0 then
   pcall(unregisterSymbol,'tlcFlags');mem=allocateMemory(0x2000)
   assert(mem and mem~=0,'Table storage allocation failed');registerSymbol('tlcFlags',mem,true)
   fallbackMemory=mem
  end
  allocated=true
  registerSymbol('tlcVars',mem+TLC.OFF_VARS,true);registerSymbol('tlcPtrs',mem+TLC.OFF_PTRS,true)
  for offset,d in pairs(TLC.VARDEF)do
   if d[1]=='float'then assert(writeFloat(TLC.var(offset),d[2]))
   elseif d[1]=='qword'then assert(writeQword(TLC.var(offset),d[2]))
   else assert(writeInteger(TLC.var(offset),d[2]))end
  end
  TLC.pid=getOpenedProcessID();TLC.ready038=true;TLC.onAttach()
  TLC.startTimer()
  TLC.attachMs038=getTickCount()-started
  TLC.msg(('Attach checks: %d ms; %s.'):format(TLC.attachMs038,TLC.image038.known and'known build'or'limited compatibility mode'),('接続確認: %d ms／%s。'):format(TLC.attachMs038,TLC.image038.known and'既知ビルド'or'別ビルド互換モード（機能別に制限）'))
 end)
 if not okay then
  if TLC.timer then TLC.timer.destroy();TLC.timer=nil end
  if allocated then
   if fallbackMemory then pcall(deAlloc,fallbackMemory)else pcall(autoAssemble,'unregistersymbol(tlcFlags)\ndealloc(tlcFlags)')end
  end
  for n in pairs(TLC.SIGS)do pcall(unregisterSymbol,'tlcA_'..n)end
  for _,n in ipairs({'tlcFlags','tlcVars','tlcPtrs','tlcObjects','tlcObjectCount072','tlcEngine','tlcNpcClassSlot','tlcGameThreadId'})do pcall(unregisterSymbol,n)end
  TLC.forgetProcess();error(why,0)
 end
 return true
end
local require038=TLC.require
local function compatible038()
 if TLC.image038 and not TLC.image038.known and not TLC.scope038 then
  fail038('This executable has no verified private-layout profile for this feature. No gameplay change made.','この機能の内部構造を別ビルドで確認できません。ゲームの状態は変更していません。')
 end
end
function TLC.require()compatible038();return require038()end
local start038=TLC.startTimer
function TLC.startTimer()
 -- Portable hooks have no polling tasks. Do not inspect fixed private offsets
 -- or retain world references in an unverified executable.
 if TLC.reflectionReady074==false or TLC.image038 and not TLC.image038.known then return end
 return start038()
end
local feature038=TLC.feature
function TLC.feature(key,on)
 if not on then return feature038(key,false)end
 if not TLC.image038 then return feature038(key,true)end
  if TLC.image038.known then local okay,reason=TLC.checkFeature074(key);if not okay then error(reason,0)end;return feature038(key,true)end
 local okay,reason=TLC.checkFeature074(key);if not okay then error(reason,0)end
 local previous=TLC.scope038;TLC.scope038=key
 local okay,why=pcall(feature038,key,true);TLC.scope038=previous
 if not okay then error(why,0)end
end
local selfTest038=TLC.scanSelfTest
function TLC.scanSelfTest()
 local previous=TLC.scope038;TLC.scope038='diagnostics'
 local okay,a,b=pcall(selfTest038);TLC.scope038=previous
 if not okay then error(a,0)end;return a,b
end

TLC.SIGS.FogFlagsGetter039={len=0,bytes={72,141,129,144,0,0,0,195},p='48 8D 81 90 00 00 00 C3'}
TLC.SIGS.FogIndex039={len=0,bytes={72,141,21,233,120,107,6,72,141,141,144,9,0,0,232,237,120,129,254,76,141,133,144,9,0,0,186,136,0,0,0,72,139,203,232,73,213,1,0},p='48 8D 15 E9 78 6B 06 48 8D 8D 90 09 00 00 E8 ED 78 81 FE 4C 8D 85 90 09 00 00 BA 88 00 00 00 48 8B CB E8 49 D5 01 00'}
TLC.SIGS.FogGetCase039={len=0,bytes={139,65,16,193,232,8,36,1,72,131,196,32,91,195},p='8B 41 10 C1 E8 08 24 01 48 83 C4 20 5B C3'}
TLC.SIGS.FogViewCopy039={len=0,bytes={76,141,143,144,0,0,0,73,139,213,72,141,141,192,3,0,0,232,207,119,79,0},p='4C 8D 8F 90 00 00 00 49 8B D5 48 8D 8D C0 03 00 00 E8 CF 77 4F 00'}
TLC.SIGS.FogFlagsCopy039={len=0,bytes={73,139,209,72,131,193,24,73,139,248,232,82,78,165,255},p='49 8B D1 48 83 C1 18 49 8B F8 E8 52 4E A5 FF'}
TLC.SIGS.FogConsumer039={len=0,bytes={72,141,81,72,72,141,76,36,32,232,141,198,74,255,247,68,36,48,0,1,0,0,116,43},p='48 8D 51 48 48 8D 4C 24 20 E8 8D C6 4A FF F7 44 24 30 00 01 00 00 74 2B'}
-- The renderer consumes a copied FSceneViewFamily::EngineShowFlags snapshot.
-- Never mutate r.Fog's render-thread shadow while a graph is being built.
TLC.safeFog039=true
TLC.CV.clearWater=nil;TLC.SIGS.CV_clearWater=nil
local function fogTarget039()return TLC.fogTarget116()end
local function stopFogTimer039()
 if TLC.fogTimer039 then TLC.fogTimer039.destroy();TLC.fogTimer039=nil end
end
function TLC.restoreFog039()
 stopFogTimer039();TLC.fogRequest039=nil
 local state=TLC.fogState039
 if not state then return end
 if state.pid~=getOpenedProcessID()or not TLC.attached()or not TLC.sameIdentity029(state.identity)then TLC.fogState039=nil;return end
 local current=readBytes(state.address,1);assert(current~=nil,'Viewport fog flag unreadable')
 local mask=state.mask or TLC.fogBitContract116().mask;local restored=(current&amp;(~mask&amp;0xff))|state.original
 if restored~=current then assert(writeBytes(state.address,restored),'Viewport fog flag restore failed')end
 TLC.fogState039=nil
end
function TLC.commitFog039()
 local request=TLC.fogRequest039
 if not request or getTickCount()&lt;request.due then return end
 stopFogTimer039();TLC.fogRequest039=nil
 if not request.on then TLC.restoreFog039();return end
 if request.pid~=getOpenedProcessID()or not TLC.attached()or not TLC.sameIdentity029(request.target.identity)then
  TLC.featOn.clearWater=nil;return
 end
 local target=fogTarget039()
 if target.identity.object~=request.target.identity.object or target.address~=request.target.address then
  TLC.featOn.clearWater=nil;return
 end
 local old=TLC.fogState039
 if old and(old.address~=target.address or not TLC.sameIdentity029(old.identity))then TLC.restoreFog039();old=nil end
 local current=readBytes(target.address,1);assert(current~=nil,'Viewport fog flag unreadable')
 if not old then target.original=current&amp;target.mask;TLC.fogState039=target end
 local value=current&amp;(~target.mask&amp;0xff)
 if value~=current then assert(writeBytes(target.address,value),'Viewport fog flag update failed')end
end
function TLC.queueFog039(on)
 if on then
  TLC.require()
  if TLC.legacyFogPID039==TLC.pid then error(TLC.T('Legacy r.Fog modification remains in this process. Restart the game before enabling clear sea visibility.','旧方式のr.Fog変更が残っています。ゲーム再起動後に海の濁り除去を有効にしてください。'),0)end
 end
 local target=on and fogTarget039()or nil
 TLC.fogRequest039={on=on,pid=getOpenedProcessID(),target=target,due=getTickCount()+750}
 stopFogTimer039()
 TLC.fogTimer039=createTimer(nil,false);TLC.fogTimer039.Interval=100
 TLC.fogTimer039.OnTimer=function()
  local okay,why=pcall(TLC.commitFog039)
  if not okay then
   stopFogTimer039();TLC.fogRequest039=nil;TLC.featOn.clearWater=nil
   pcall(TLC.restoreFog039);TLC.reason('clearWater',tostring(why))
  end
 end
 TLC.fogTimer039.Enabled=true
 TLC.featOn.clearWater=on and true or nil
end
TLC.F.clearWater={}
local feature039=TLC.feature
function TLC.feature(key,on)
 if key=='clearWater'then return TLC.queueFog039(on)end
 return feature039(key,on)
end
local restore039=TLC.restore
function TLC.restore(key)
 if key==nil or key=='clearWater'then TLC.restoreFog039()end
 return restore039(key)
end
local forget039=TLC.forgetProcess
function TLC.forgetProcess()
 stopFogTimer039();TLC.fogRequest039=nil;TLC.fogState039=nil
 return forget039()
end
local off039=TLC.disableAll
function TLC.disableAll(...)
 TLC.restoreFog039();return off039(...)
end

TLC.SIGS.NoClipTick040={len=7,bytes={64,85,83,86,87,65,86,65,87,72,141,172,36,168,254,255,255,72,129,236,88,2,0,0,15,41,180,36,64,2,0,0,72,139,5,185,15,244,5,72},p='40 55 53 56 57 41 56 41 57 48 8D AC 24 A8 FE FF FF 48 81 EC 58 02 00 00 0F 29 B4 24 40 02 00 00 48 8B 05 B9 0F F4 05 48'}
TLC.SIGS.NoClipOffset040={len=0,bytes={72,131,236,120,15,16,137,16,2,0,0,15,16,145,32,2,0,0,15,40,193,242,15,88,2,242,15,88,82,16,15,182,132,36,160,0,0,0,102,15},p='48 83 EC 78 0F 10 89 10 02 00 00 0F 10 91 20 02 00 00 0F 28 C1 F2 0F 58 02 F2 0F 58 52 10 0F B6 84 24 A0 00 00 00 66 0F'}
TLC.SIGS.NoClipLadder040={len=5,bytes={76,139,220,85,87,73,141,171,200,253,255,255,72,129,236,40,3,0,0,72,139,5,150,84,251,5,72,51,196,72,137,133,224,1,0,0,73,137,91,24},p='4C 8B DC 55 57 49 8D AB C8 FD FF FF 48 81 EC 28 03 00 00 48 8B 05 96 54 FB 05 48 33 C4 48 89 85 E0 01 00 00 49 89 5B 18'}
-- Free movement runs inside this player's movement tick. It calls the shipped
-- AddWorldOffset with Sweep=false; collision settings and movement mode stay intact.
TLC.VARDEF[0xc8]={'float',600}
TLC.NAMES[118]={'Wall pass / free movement (Space up, Ctrl down)','壁抜け・自由移動（Space上昇／Ctrl下降）'}
TLC.NAMES[119]={'Movement speed (cm/s)','移動速度（cm/秒）'}
TLC.HOOKS.noclip040={sig='NoClipTick040',aa=[==[
[ENABLE]
alloc(tlc_nc_mem040,$2000,$SITE)
label(tlc_nc_original040)
label(tlc_nc_return040)
label(tlc_nc_done040)
label(tlc_nc_vector040)
label(tlc_nc_no_ladder040)
label(tlc_nc_data040)
registersymbol(tlc_nc_data040)
tlc_nc_mem040:
pushfq
push rax
push rcx
push rdx
push r8
push r9
push r10
push r11
sub rsp,88
movdqu [rsp+70],xmm1
mov r11,rcx
cmp rcx,[tlc_nc_data040+8]
jne tlc_nc_original040
mov r10,[rcx+A8]
test r10,r10
je tlc_nc_original040
cmp r10,[tlc_nc_data040]
jne tlc_nc_original040
mov rax,[tlc_nc_data040+18]
test rax,rax
je tlc_nc_original040
cmp [rax+8],r10
jne tlc_nc_original040
mov edx,[rax+10]
cmp edx,[tlc_nc_data040+20]
jne tlc_nc_original040
mov rax,[tlc_nc_data040+28]
cmp [rax+8],r11
jne tlc_nc_original040
mov edx,[rax+10]
cmp edx,[tlc_nc_data040+30]
jne tlc_nc_original040
mov rdx,[r10+1B8]
cmp rdx,[tlc_nc_data040+10]
jne tlc_nc_original040
mov rax,[tlc_nc_data040+38]
cmp [rax+8],rdx
jne tlc_nc_original040
mov ecx,[rax+10]
cmp ecx,[tlc_nc_data040+40]
jne tlc_nc_original040
test dword ptr [r10+8],18010
jne tlc_nc_original040
test dword ptr [r11+8],18010
jne tlc_nc_original040
test dword ptr [rdx+8],18010
jne tlc_nc_original040
xorps xmm0,xmm0
ucomiss xmm1,xmm0
jbe tlc_nc_original040
mov eax,3DCCCCCD
movd xmm0,eax
minss xmm1,xmm0
movss xmm0,[tlc_nc_data040+48]
subss xmm0,xmm1
movss [tlc_nc_data040+48],xmm0
xorps xmm2,xmm2
ucomiss xmm0,xmm2
jbe tlc_nc_original040
cmp byte ptr [r10+E10],0
je tlc_nc_no_ladder040
mov rcx,r10
xor edx,edx
xor r8d,r8d
call tlcA_NoClipLadder040
jmp tlc_nc_done040
tlc_nc_no_ladder040:
cvtss2sd xmm1,xmm1
cvtss2sd xmm2,[tlc_nc_data040+4C]
mulsd xmm1,xmm2
movupd xmm3,[r10+2F0]
movsd xmm4,[r10+300]
movupd [r10+308],xmm3
movsd [r10+318],xmm4
xorpd xmm0,xmm0
movupd [r10+2F0],xmm0
movsd [r10+300],xmm0
movupd [r11+D8],xmm0
movsd [r11+E8],xmm0
cmp dword ptr [tlc_nc_data040+54],0
je tlc_nc_done040
movapd xmm0,xmm3
unpckhpd xmm0,xmm0
cvtss2sd xmm4,[tlc_nc_data040+50]
movapd xmm2,xmm3
mulsd xmm2,xmm2
movapd xmm5,xmm0
mulsd xmm5,xmm5
addsd xmm2,xmm5
movapd xmm5,xmm4
mulsd xmm5,xmm5
addsd xmm2,xmm5
ucomisd xmm2,xmm2
jp tlc_nc_done040
mov rax,426D1A94A2000000
movq xmm5,rax
ucomisd xmm2,xmm5
ja tlc_nc_done040
mov rax,3FF0000000000000
movq xmm5,rax
ucomisd xmm2,xmm5
jbe tlc_nc_vector040
sqrtsd xmm2,xmm2
divsd xmm3,xmm2
divsd xmm0,xmm2
divsd xmm4,xmm2
tlc_nc_vector040:
mulsd xmm3,xmm1
mulsd xmm0,xmm1
mulsd xmm4,xmm1
movsd [rsp+40],xmm3
movsd [rsp+48],xmm0
movsd [rsp+50],xmm4
mov rcx,rdx
lea rdx,[rsp+40]
xor r8d,r8d
xor r9d,r9d
mov byte ptr [rsp+20],1
call tlcA_NoClipOffset040
inc qword ptr [tlc_nc_data040+58]
tlc_nc_done040:
movdqu xmm1,[rsp+70]
add rsp,88
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
popfq
ret
tlc_nc_original040:
movdqu xmm1,[rsp+70]
add rsp,88
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
popfq
$ORIG
jmp tlc_nc_return040
align 10 CC
tlc_nc_data040:
db 00 00 00 00 00 00 00 00
dd 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
$SITE:
jmp tlc_nc_mem040
$NOP
tlc_nc_return040:
[DISABLE]
$SITE:
$ORIG
unregistersymbol(tlc_nc_data040)
// Keep the small code page alive until the process exits: a tick already inside
// the cave can return safely. The same page is reused on the next enable.
]==]}
TLC.HOOKS.noclipLadder040={sig='NoClipLadder040',aa=[==[
[ENABLE]
alloc(tlc_nc_ladder040,$1000,$SITE)
label(tlc_nc_ladder_original040)
label(tlc_nc_ladder_return040)
tlc_nc_ladder040:
pushfq
push rax
test rdx,rdx
je tlc_nc_ladder_original040
cmp rcx,[tlc_nc_data040]
jne tlc_nc_ladder_original040
cmp dword ptr [tlc_nc_data040+48],0
jle tlc_nc_ladder_original040
mov rax,[tlc_nc_data040+18]
test rax,rax
je tlc_nc_ladder_original040
mov eax,[rax+10]
cmp eax,[tlc_nc_data040+20]
jne tlc_nc_ladder_original040
pop rax
popfq
ret
tlc_nc_ladder_original040:
pop rax
popfq
$ORIG
jmp tlc_nc_ladder_return040
$SITE:
jmp tlc_nc_ladder040
$NOP
tlc_nc_ladder_return040:
[DISABLE]
$SITE:
$ORIG
// Retain this tiny cave too, so an already executing call can finish safely.
]==]}
local function ncData040()return getAddressSafe('tlc_nc_data040')end
local function ncTarget040()
 local p=TLC.need();assert(TLC.controlledPawn(false)==p,TLC.T('Exit the vehicle before enabling free movement.','乗り物の操縦を解除してから自由移動を有効にしてください。'))
 assert(TLC.refOffset(p,'CharacterMovement')==0x330 and TLC.refOffset(p,'RootComponent')==0x1b8 and TLC.refOffset(p,'ControlInputVector')==0x2f0 and TLC.refOffset(p,'LastControlInputVector')==0x308,'Player movement layout mismatch')
 local m=TLC.readObjectField074(p,'CharacterMovement');local root=readQword(p+0x1b8)
 assert(TLC.valid(m)and TLC.U.isA(m,'VoyageCharacterMovementComponent')and TLC.valid(root),'Player movement/root unavailable')
 assert(TLC.refOffset(m,'Velocity')==0xd8 and readQword(m+0xa8)==p,'Player movement owner mismatch')
 return{player=p,movement=m,root=root,world=TLC.world(),p=TLC.identity029(p),m=TLC.identity029(m),r=TLC.identity029(root)}
end
function TLC.publishNoClip040()
 local state=assert(TLC.noclip040,'Free movement state unavailable');local d=ncData040();assert(d,'Free movement hook unavailable')
 assert(TLC.world()==state.world and TLC.player(false)==state.player and TLC.controlledPawn(false)==state.player and readQword(state.player+0x1b8)==state.root and readQword(state.player+0x330)==state.movement and TLC.sameIdentity029(state.p)and TLC.sameIdentity029(state.m)and TLC.sameIdentity029(state.r),'Free movement target changed')
 local speed=readFloat(TLC.var(0xc8));assert(speed and speed==speed and speed&gt;0 and speed&lt;=10000,TLC.T('Free movement speed must be above 0 and at most 10000 cm/s.','自由移動速度は0より大きく10000cm/秒以下にしてください。'))
 local focus=getForegroundProcess()==TLC.pid
 writeFloat(d+0x4c,speed);writeFloat(d+0x50,focus and((isKeyPressed(0x20)and 1 or 0)-(isKeyPressed(0x11)and 1 or 0))or 0)
 writeInteger(d+0x54,focus and 1 or 0);writeFloat(d+0x48,0.6)
end
local hookOn040=TLC.hookOn
function TLC.hookOn(name)
 if name~='noclip040'and name~='noclipLadder040'then return hookOn040(name)end
 local old=TLC.ncRetired040 and TLC.ncRetired040[name]
 if not old then hookOn040(name);TLC.hookState[name].data=ncData040();return end
 local sig=TLC.HOOKS[name].sig
 local same=TLC.pid==old.pid and old.addr==TLC.resolveSig(sig)
 local bytes=same and readBytes(old.addr,#TLC.SIGS[sig].bytes,true)
 for i,v in ipairs(TLC.SIGS[sig].bytes)do if not bytes or bytes[i]~=v then same=false;break end end
 assert(same,'Free movement code ownership changed')
 if name=='noclip040'then registerSymbol('tlc_nc_data040',old.data,true)end
 assert(writeBytes(old.addr,old.patch),'Free movement hook restore failed');TLC.hookState[name]=old;TLC.ncRetired040[name]=nil
end
local hookOff040=TLC.hookOff
function TLC.hookOff(name)
 local old=(name=='noclip040'or name=='noclipLadder040')and TLC.hookState[name]
 if old then
  old.data=old.data or ncData040();old.pid=TLC.pid
  if old.data and TLC.attached()then writeQword(old.data,0)end
 end
 hookOff040(name)
 if old then TLC.ncRetired040=TLC.ncRetired040 or{};TLC.ncRetired040[name]=old end
end
TLC.F.noclip040={hooks={'noclip040','noclipLadder040'},on=function()
 TLC.requireSigs({'NoClipOffset040','NoClipLadder040'});TLC.noclip040=ncTarget040()
end,off=function()local d=ncData040();if d and TLC.attached()then writeQword(d,0)end;TLC.noclip040=nil end,task=TLC.publishNoClip040}
local feature040=TLC.feature
function TLC.feature(key,on)
 local result=feature040(key,on)
 if key=='noclip040'and on then
  local okay,why=pcall(function()
   local state=TLC.noclip040;local d=assert(ncData040())
   local _,pi=TLC.valid(state.player);local _,mi=TLC.valid(state.movement);local _,ri=TLC.valid(state.root)
   writeQword(d,0);writeQword(d+8,state.movement);writeQword(d+0x10,state.root)
   for _,v in ipairs({{0x18,pi},{0x28,mi},{0x38,ri}})do writeQword(d+v[1],v[2]);writeInteger(d+v[1]+8,readInteger(v[2]+0x10))end
   TLC.publishNoClip040();writeQword(d,state.player)
  end)
  if not okay then pcall(feature040,key,false);error(why,0)end
 end
 return result
end
local forget040=TLC.forgetProcess
function TLC.forgetProcess()TLC.noclip040=nil;TLC.ncRetired040=nil;return forget040()end

-- Resolve names from a temporary Type1 view of a saved human. The game display
-- cache may be empty; do not refresh or edit the persistent population to fill it.
local function humanContext042() return TLC.humanContext103() end
local function usableName042(name,id)
 return type(name)=='string'and name:find('%S')~=nil and name:upper()~=id:upper()and not(#name==32 and name:match('^[A-Fa-f0-9]+$'))
end
local function cache042(ps)
 local cache=TLC.humanNames042
 if not cache or cache.pid~=TLC.pid or cache.ps~=ps or not TLC.sameIdentity029(cache.identity)or cache.world~=TLC.world()then
  cache={pid=TLC.pid,ps=ps,identity=TLC.identity029(ps),world=TLC.world(),names={}};TLC.humanNames042=cache
 end
 return cache
end
-- Names are read below through the named human-info API.
local list042=TLC.humanList033
function TLC.humanList033()
 local rows=list042();local cache=cache042(humanContext042())
 for k,row in ipairs(rows)do
  if usableName042(row.name,row.id)then cache.names[row.id:upper()]=row.name
  else row.name=cache.names[row.id:upper()]end
  row.namePending042=not usableName042(row.name,row.id)
  if row.namePending042 then row.name=TLC.T('Loading name ','名前を取得中 ')..k end
 end
 return rows
end
function TLC.cancelHumanNames042(st)
 if not st then return end
 st.nameGeneration042=(st.nameGeneration042 or 0)+1;st.nameLoading042=nil
 if st.nameTimer042 then st.nameTimer042.destroy();st.nameTimer042=nil end
end
function TLC.requestHumanNames042(st)
 TLC.cancelHumanNames042(st)
 local generation=st.nameGeneration042;local ps=humanContext042();local identity=TLC.identity029(ps);local world=TLC.world()
 local function alive()return not st.closed and st.nameGeneration042==generation and TLC.world()==world and TLC.sameIdentity029(identity)end
 local function nextName()
  if not alive()then TLC.cancelHumanNames042(st);return end
  local row,index;local cache=cache042(ps)
  for k,h in ipairs(st.rows)do
   local name=cache.names[h.id:upper()]
   if name then
    h.namePending042=nil
    if h.name~=name then h.name=name;st.list.Items[k-1]=name end
    if st.selected and st.selected.id==h.id and st.title.Caption~=name then st.title.Caption=name end
   elseif h.namePending042 then row=h;index=k;break end
  end
  if not row then TLC.cancelHumanNames042(st);return end
  local accepted=TLC.enqueueAction025(function()
   if not alive()then return end
   st.nameLoading042=true;st.nameStarted042=getTickCount()
   TLC.readHumanName042(row.id,function(name)
    if not alive()then return end
    row.name=name;row.namePending042=nil;st.list.Items[index-1]=name
    if st.selected and st.selected.id==row.id then st.title.Caption=name end
    st.nameLoading042=nil;nextName()
   end)
  end,'humanNames042',alive)
  if not accepted then TLC.cancelHumanNames042(st)end
 end
 st.nameTimer042=createTimer(nil,false);st.nameTimer042.Interval=250
 st.nameTimer042.OnTimer=function()
  if not alive()then TLC.cancelHumanNames042(st);return end
  if st.nameLoading042 and getTickCount()-st.nameStarted042&gt;20000 then
   TLC.cancelHumanNames042(st)
   TLC.reason('humanNames',TLC.T('Name lookup timed out. Refresh the human list.','名前の取得が完了しませんでした。人間一覧を再取得してください。'))
  end
 end
 st.nameTimer042.Enabled=true;nextName()
end
local forget042=TLC.forgetProcess
function TLC.forgetProcess()
 TLC.cancelHumanNames042(TLC.humanWindow033);TLC.humanNames042=nil
 return forget042()
end

TLC.legacyBoatBytes043={242,15,89,123,32,156,80,81,82,128,61,176,0,0,0,0,15,132,156,0,0,0,139,13,168,0,0,0,72,141,5,157,1,0,0,133,201,15,132,135,0,0,0,72,57,24,15,132,8,0,0,0,72,131,192,32,255,201,235,231,139,72,8,57,139,4,253,255,255,15,133,103,0,0,0,72,139,80,16,139,72,12,57,74,16,15,133,87,0,0,0,72,141,139,248,252,255,255,72,57,74,8,15,133,70,0,0,0,255,5,94,0,0,0,72,137,29,95,0,0,0,242,15,17,61,95,0,0,0,242,15,89,61,63,0,0,0,242,15,17,61,87,0,0,0,72,139,69,215,72,137,5,84,0,0,0,72,139,69,223,72,137,5,81,0,0,0,72,139,69,231,72,137,5,78,0,0,0,90,89,88,157,233}
local function equal043(a,bytes)
 local b=type(a)=='number'and readBytes(a,#bytes,true)
 if not b then return false end
 for k,v in ipairs(bytes)do if b[k]~=v then return false end end
 return true
end
local function managed043()
 local all={}
 if TLC.pid~=getOpenedProcessID()then return all end
 for _,state in pairs(TLC.hookState or{})do
  if state.patch and state.orig and equal043(state.addr,state.patch)then all[#all+1]={addr=state.addr,patch=state.patch,original=state.orig}end
 end
 local boat=rawget(_G,'TLCBoatPropulsion020')
 if boat and boat.pid==TLC.pid and boat.module==TLC.mod()and readInteger(boat.data+0x60)==0x20504c54 and equal043(boat.site,boat.patch)then
  all[#all+1]={addr=boat.site,patch=boat.patch,original=boat.original}
 end
 return all
end
function TLC.originalView043(address,expected)
 local bytes=readBytes(address,#expected,true);if not bytes then return false end
 local original=true;for k,value in ipairs(expected)do if bytes[k]~=value then original=false;break end end
 if original then return true end
 for _,state in ipairs(managed043())do
  for k,value in ipairs(state.original)do
   local offset=state.addr+k-address
   if offset&gt;=1 and offset&lt;=#bytes then bytes[offset]=value end
  end
 end
 for k,value in ipairs(expected)do if bytes[k]~=value then return false end end
 return true
end
local function externalJump043(address,expected)
 local bytes=readBytes(address,#expected,true);if not bytes then return end
 for k=1,#bytes-4 do
  if bytes[k]==0xe9 and bytes[k]~=expected[k]then
   local d=readInteger(address+k);if d then
    if d&gt;=0x80000000 then d=d-0x100000000 end
    local target=address+k-1+5+d
    if not TLC.executable038(target)then return address+k-1 end
   end
  end
 end
end
local resolve043=TLC.resolveSig
function TLC.resolveSig(name)
 local sig=TLC.SIGS[name];if not sig then return resolve043(name)end
 local base=sig.mod and TLC.mod(sig.mod)or TLC.mod()
 local address=rawget(TLC.A,name)
 if address and TLC.originalView043(address,sig.bytes)then
  TLC.A[name]=address;TLC.pend[name]=nil;TLC.failures[name]=nil
  TLC.resolution[name]=equal043(address,sig.bytes)and(TLC.resolution[name]or'verified code')or'owned hook'
  registerSymbol('tlcA_'..name,address,true);return address
 end
 -- Preserve bootstrap relocation support while rejecting unowned code patches.
 if address and sig.bootstrapPattern and TLC.A[name]then
  local actual=readBytes(address,#sig.bytes,true);local matches=actual~=nil;local index=0
  for token in sig.bootstrapPattern:gmatch('%S+')do index=index+1;if token~='??'and(not actual or actual[index]~=tonumber(token,16))then matches=false end end
  if matches then return address end
 end
 -- Unknown-build RVAs may refer to unrelated instructions; retain lazy AOB/reflection fallback.
 local foreign=address and(not TLC.image038 or TLC.image038.known)and externalJump043(address,sig.bytes)
 if foreign then
  TLC.A[name]=nil;TLC.resolution[name]='failed';TLC.pend[name]=nil
  local reason=TLC.T('Unrecognized modification at this code site. Only dependent features are unavailable; no code overwritten.','この命令位置に照合できない変更があります。依存する機能のみ停止し、上書きしませんでした。')
  if TLC.failures[name]~=reason then TLC.reason(name,reason)end
  return nil
 end
 if TLC.A[name]then TLC.A[name]=nil;TLC.resolution[name]=nil end
 return resolve043(name)
end
function TLC.recoverDormantBoat043()
 local sig=TLC.SIGS.BoatPropulsionTarget;local site=TLC.legacySite074('BoatPropulsionTarget');if not site then return false end
 if equal043(site,sig.bytes)then return false end
 local cache=rawget(_G,'TLCBoatPropulsion020')
 if cache and cache.pid==getOpenedProcessID()and cache.module==TLC.mod()and equal043(site,cache.patch)then return false end
 local first=readBytes(site,5,true)
 if not first or first[1]~=0xe9 then return false end
 -- Every instruction after the patched five bytes must still match this build.
 for i=6,#sig.bytes do if readBytes(site+i-1,1)~=sig.bytes[i]then return false end end
 local delta=readInteger(site+1);if not delta then return false end
 if delta&gt;=0x80000000 then delta=delta-0x100000000 end
 local code=site+5+delta;local expected=TLC.legacyBoatBytes043
 if not expected or not equal043(code,expected)then return false end
 local back=readInteger(code+183);if not back then return false end
 if back&gt;=0x80000000 then back=back-0x100000000 end
 if code+187+back~=site+5 then return false end
 local displacement=readInteger(code+11);if not displacement then return false end
 if displacement&gt;=0x80000000 then displacement=displacement-0x100000000 end
 local data=code+16+displacement
 if readInteger(data+0x60)~=0x20504c54 then return false end
 local owner=readInteger(data+0x68)or 0
 local processes=getProcessList();local ownerAlive=owner&gt;0 and processes[owner]~=nil
 if readBytes(data,1)~=0 and(owner==0 or ownerAlive)then
  error(TLC.T('The recognized boat hook is still enabled in another/older CE. Disable it there first.','旧CTまたは別CEの船フックが有効です。使用中の側で先に解除してください。'),0)
 end
 writeBytes(data,0);writeInteger(data+4,0)
 assert(writeBytes(site,{table.unpack(sig.bytes,1,5)}),'Dormant boat hook recovery failed')
 TLC.A.BoatPropulsionTarget=nil;TLC.resolution.BoatPropulsionTarget=nil;TLC.failures.BoatPropulsionTarget=nil
 TLC.msg('Restored a verified inactive boat hook; resolving propulsion again.','識別できた停止中の旧船フックを復元し、推進処理を再照合します。')
 return true
end
local boatOn043=TLC.F.boatSpeed.on
TLC.F.boatSpeed.on=function()
 TLC.require();TLC.recoverDormantBoat043();boatOn043()
 local boat=TLC.boatPropulsion
 if boat then writeInteger(boat.data+0x68,getCheatEngineProcessID())end
end
local init043=TLC.init
function TLC.init()
 if not TLC.attached()then
  TLC.checkBuild()
  if TLC.image038 and TLC.image038.known then
   local okay,why=pcall(TLC.recoverDormantBoat043)
   if not okay then TLC.reason('BoatPropulsionTarget',tostring(why))end
  end
 end
 return init043()
end
local off043=TLC.disableAll
function TLC.disableAll(...)
 -- The private propulsion hook is outside hookState. Restore it even if an
 -- earlier failed enable removed the feature's flag from featOn.
 local boat=rawget(_G,'TLCBoatPropulsion020')
 if boat and TLC.attached()and boat.pid==getOpenedProcessID()and boat.module==TLC.mod()then TLC.stopBoatPropulsion()end
 return off043(...)
end
local function auditConnection043()
 local previous=TLC.scope038;TLC.scope038='diagnostics'
 local okay,why=pcall(TLC.require);TLC.scope038=previous
 if not okay then error(why,0)end
end
function TLC.scanSelfTest()
 auditConnection043();local good,bad=0,0
 for name,sig in pairs(TLC.SIGS)do
  local address=TLC.resolveSig(name)
  if address and(TLC.originalView043(address,sig.bytes)or sig.bootstrapPattern and TLC.resolution[name]~='failed')then good=good+1
  else bad=bad+1 end
 end
 TLC.msg(('Signatures verified: %d; unavailable: %d (owned hooks included).'):format(good,bad),('シグネチャ確認: 成功%d／利用不可%d（管理中のフックを含む）。'):format(good,bad))
 return good,bad
end

TLC.applyLang();TLC.initCollapse();_G.TLC=TLC


TLC.SIGS.QuestTick045={len=0,bytes={76,139,220,85,73,141,107,232,72,129,236,16,1,0,0,72,139,5,106,41,221,5,72,51,196,72,137,69,208,73,137,91,24,72,139,217,73,137,115,240},p='4C 8B DC 55 49 8D 6B E8 48 81 EC 10 01 00 00 48 8B 05 6A 29 DD 05 48 33 C4 48 89 45 D0 49 89 5B 18 48 8B D9 49 89 73 F0'}
TLC.SIGS.QuestBegin045={len=7,bytes={72,141,147,216,0,0,0,76,137,117,128,72,141,77,128,76,137,117,136,76,137,117,160,68,137,117,168,68,137,117,180,76,137,117,192,68,137,117,200,199},p='48 8D 93 D8 00 00 00 4C 89 75 80 48 8D 4D 80 4C 89 75 88 4C 89 75 A0 44 89 75 A8 44 89 75 B4 4C 89 75 C0 44 89 75 C8 C7'}
TLC.SIGS.QuestEnd045={len=12,bytes={72,139,77,192,15,40,180,36,224,0,0,0,76,139,188,36,240,0,0,0,72,139,188,36,0,1,0,0,72,139,180,36,8,1,0,0,72,139,156,36},p='48 8B 4D C0 0F 28 B4 24 E0 00 00 00 4C 8B BC 24 F0 00 00 00 48 8B BC 24 00 01 00 00 48 8B B4 24 08 01 00 00 48 8B 9C 24'}
TLC.SIGS.QuestEvaluated045={len=8,bytes={72,139,77,216,68,137,109,224,76,139,172,36,216,2,0,0,72,133,201,116,5,232,151,115,233,251,72,141,77,152,232,238,180,229,251,72,139,141,176,1},p='48 8B 4D D8 44 89 6D E0 4C 8B AC 24 D8 02 00 00 48 85 C9 74 05 E8 97 73 E9 FB 48 8D 4D 98 E8 EE B4 E5 FB 48 8B 8D B0 01'}
TLC.SIGS.QuestObserved045={len=9,bytes={139,68,36,92,72,141,76,36,88,247,208,33,68,36,104,232,163,214,187,251,72,139,68,36,80,235,162,137,92,36,68,233,80,255,255,255,72,139,77,192},p='8B 44 24 5C 48 8D 4C 24 58 F7 D0 21 44 24 68 E8 A3 D6 BB FB 48 8B 44 24 50 EB A2 89 5C 24 44 E9 50 FF FF FF 48 8B 4D C0'}
-- Keep native start durations and completion/event dispatch intact. A read-only
-- observer of the world's ordinary quest tick counts completed evaluation passes.
-- Only CE-owned bookkeeping is written by the observer; no quest call/state edit.
do
TLC.HOOKS.fabricationProgress2.aa=[==[
[ENABLE]
alloc(tlc_fabricationProgress2,$8000,$SITE)
label(tlc_fabricationProgress2_ret)
label(tlc_fabricationProgress2_time)
label(tlc_fabricationProgress2_normal)
label(tlc_fabricationProgress2_skip)
label(tlc_instant_gate045)
label(tlc_instant_rows045)
label(tlc_instant_find045)
label(tlc_instant_new045)
label(tlc_instant_job045)
label(tlc_instant_reset045)
label(tlc_instant_done045)
label(tlc_instant_guardmap045)
label(tlc_instant_filter045)
label(tlc_instant_filterloop045)
label(tlc_instant_filteritem045)
label(tlc_instant_filternext045)
label(tlc_instant_guarded045)
label(tlc_instant_accelerate045)
registersymbol(tlc_instant_gate045)

tlc_fabricationProgress2:
pushfq
cmp byte ptr [tlcFlags+0C],0
je tlc_fabricationProgress2_time
mov r12b,1
movsd xmm8,[tlcVars+58]
tlc_fabricationProgress2_time:
push rax
push rcx
push rdx
push r8
push r9
push r10
push r11
sub rsp,10
cmp byte ptr [tlcFlags+05],0
je tlc_instant_done045
test r12b,r12b
je tlc_instant_done045
cmp qword ptr [tlc_instant_gate045],0
je tlc_instant_done045
mov edx,[tlc_instant_gate045+1C]
test edx,1
jnz tlc_instant_done045
mov [rsp],edx
cmp dword ptr [r14+1E8],0
jle tlc_instant_done045
mov r8,[r14+1E0]
test r8,r8
jz tlc_instant_done045
mov r11d,[r8+10]
mov r8,[r8]
test r8,r8
jz tlc_instant_done045
mov eax,[r14+174]
test eax,eax
jle tlc_instant_done045
mov r9d,[r14+178]
cmp r9d,7F800000
jae tlc_instant_done045
test r9d,r9d
jle tlc_instant_done045
// A changed quest registry needs a fresh read-only recipe filter. Usually this
// is identical, so ordinary recipes do not wait for quest evaluation at all.
mov rdx,[tlc_instant_gate045]
mov r10,[rdx+D8]
cmp [tlc_instant_gate045+2C20],r10
jne tlc_instant_done045
mov ecx,[rdx+E0]
cmp [tlc_instant_gate045+2C28],ecx
jne tlc_instant_done045
cmp ecx,100
ja tlc_instant_done045
xor eax,eax
test ecx,ecx
jz tlc_instant_filter045
lea rdx,[tlc_instant_gate045+3430]
tlc_instant_guardmap045:
mov r9,[r10+10]
cmp [rdx+rax*8],r9
jne tlc_instant_done045
add r10,20
inc eax
cmp eax,ecx
jb tlc_instant_guardmap045
tlc_instant_filter045:
mov ecx,[tlc_instant_gate045+2C2C]
cmp ecx,80
ja tlc_instant_done045
test ecx,ecx
jz tlc_instant_accelerate045
lea r10,[tlc_instant_gate045+2C30]
tlc_instant_filterloop045:
cmp dword ptr [r10+08],0
je tlc_instant_filteritem045
mov r9,[r8+B8]
cmp [r10],r9
je tlc_instant_guarded045
jmp tlc_instant_filternext045
tlc_instant_filteritem045:
cmp [r10],r8
je tlc_instant_guarded045
tlc_instant_filternext045:
add r10,10
dec ecx
jnz tlc_instant_filterloop045
jmp tlc_instant_accelerate045
tlc_instant_guarded045:
mov eax,[r14+174]
mov r9d,[r14+178]
lea r10,[tlc_instant_rows045]
mov ecx,80
tlc_instant_find045:
cmp qword ptr [r10],0
je tlc_instant_new045
cmp [r10],r14
je tlc_instant_job045
add r10,28
dec ecx
jnz tlc_instant_find045
jmp tlc_instant_done045
tlc_instant_new045:
mov [r10],r14
tlc_instant_reset045:
mov edx,[r14-B4]
mov [r10+08],edx
mov edx,[r14+16C]
mov [r10+0C],edx
mov [r10+10],r8
mov [r10+18],r9d
mov [r10+20],r11d
mov edx,[tlc_instant_gate045+10]
mov [r10+1C],edx
jmp tlc_instant_done045
tlc_instant_job045:
mov edx,[r14-B4]
cmp [r10+08],edx
jne tlc_instant_reset045
mov edx,[r14+16C]
cmp [r10+0C],edx
jne tlc_instant_reset045
cmp [r10+10],r8
jne tlc_instant_reset045
cmp [r10+18],r9d
jne tlc_instant_reset045
cmp [r10+20],r11d
jne tlc_instant_reset045
mov edx,[tlc_instant_gate045+14]
sub edx,[r10+1C]
cmp edx,1
jl tlc_instant_done045
cmp eax,r9d
jae tlc_instant_done045
tlc_instant_accelerate045:
mov edx,[rsp]
cmp edx,[tlc_instant_gate045+1C]
jne tlc_instant_done045
mov eax,[r14+174]
movd edx,xmm15
test edx,edx
jle tlc_instant_done045
cmp edx,7F800000
jae tlc_instant_done045
cmp eax,edx
jbe tlc_instant_done045
mov [r14+174],edx
inc dword ptr [tlcFlags+64]
tlc_instant_done045:
add rsp,10
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
tlc_fabricationProgress2_normal:
popfq
test r12b,r12b
je tlc_fabricationProgress2_skip
jmp tlc_fabricationProgress2_ret
tlc_fabricationProgress2_skip:
jmp $SITE+21
align 10 CC
tlc_instant_gate045:
dq 0 0 0 0
tlc_instant_rows045:
// 128 rows of 40 bytes, zero-initialized by alloc.

$SITE:
jmp tlc_fabricationProgress2
$NOP
tlc_fabricationProgress2_ret:
[DISABLE]
$SITE:
$ORIG
unregistersymbol(tlc_instant_gate045)
// Allocation retained/reused until process exit to avoid in-flight code/data UAF.
]==]

TLC.HOOKS.questBegin045={sig='QuestBegin045',aa=[==[
[ENABLE]
alloc(tlc_questBegin045,$1000,$SITE)
label(tlc_questBegin045_ret)
label(tlc_questBegin045_done)
tlc_questBegin045:
pushfq
push rax
xor eax,eax
cmp byte ptr [tlcFlags+05],0
je tlc_questBegin045_done
cmp [tlc_instant_gate045],rbx
jne tlc_questBegin045_done
mov rax,rbx
inc dword ptr [tlc_instant_gate045+10]
mov dword ptr [tlc_instant_gate045+18],FFFFFFFF
tlc_questBegin045_done:
mov [tlc_instant_gate045+08],rax
pop rax
popfq
$ORIG
jmp tlc_questBegin045_ret
$SITE:
jmp tlc_questBegin045
$NOP
tlc_questBegin045_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]}
TLC.HOOKS.questEnd045={sig='QuestEnd045',aa=[==[
[ENABLE]
alloc(tlc_questEnd045,$1000,$SITE)
label(tlc_questEnd045_ret)
label(tlc_questEnd045_done)
label(tlc_questEnd045_publish)
tlc_questEnd045:
pushfq
push rax
mov rax,[tlc_instant_gate045+08]
test rax,rax
jz tlc_questEnd045_done
cmp [tlc_instant_gate045],rax
jne tlc_questEnd045_done
cmp byte ptr [tlcFlags+05],0
je tlc_questEnd045_done
mov eax,[tlc_instant_gate045+18]
cmp eax,FFFFFFFF
jne tlc_questEnd045_publish
mov eax,[tlc_instant_gate045+10]
tlc_questEnd045_publish:
mov [tlc_instant_gate045+14],eax
tlc_questEnd045_done:
mov qword ptr [tlc_instant_gate045+08],0
pop rax
popfq
$ORIG
jmp tlc_questEnd045_ret
$SITE:
jmp tlc_questEnd045
$NOP
tlc_questEnd045_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]}

-- This site is reached only after the real per-quest evaluation, not on its
-- interval-skipped return. Record its epoch exclusively in CE-owned storage.
TLC.HOOKS.questEvaluated045={sig='QuestEvaluated045',aa=[==[
[ENABLE]
alloc(tlc_questEvaluated045,$1000,$SITE)
label(tlc_questEvaluated045_ret)
label(tlc_questEvaluated045_done)
label(tlc_questEvaluated045_find)
label(tlc_questEvaluated045_store)
tlc_questEvaluated045:
pushfq
push rax
push rcx
push rdx
cmp byte ptr [tlcFlags+05],0
je tlc_questEvaluated045_done
cmp qword ptr [tlc_instant_gate045+08],0
je tlc_questEvaluated045_done
lea rax,[tlc_instant_gate045+1420]
mov ecx,100
tlc_questEvaluated045_find:
cmp qword ptr [rax],0
je tlc_questEvaluated045_store
cmp [rax],r14
je tlc_questEvaluated045_store
add rax,18
dec ecx
jnz tlc_questEvaluated045_find
jmp tlc_questEvaluated045_done
tlc_questEvaluated045_store:
mov [rax],r14
mov edx,[r14+0C]
mov [rax+08],edx
mov edx,[tlc_instant_gate045+10]
mov [rax+0C],edx
tlc_questEvaluated045_done:
pop rdx
pop rcx
pop rax
popfq
$ORIG
jmp tlc_questEvaluated045_ret
$SITE:
jmp tlc_questEvaluated045
$NOP
tlc_questEvaluated045_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]}

-- After each active quest's ordinary tick, include its last actual evaluation
-- in the world's conservative watermark. A throttled or untracked quest blocks
-- acceleration until it has really evaluated; no fixed delay is guessed.
TLC.HOOKS.questObserved045={sig='QuestObserved045',aa=[==[
[ENABLE]
alloc(tlc_questObserved045,$1000,$SITE)
label(tlc_questObserved045_ret)
label(tlc_questObserved045_done)
label(tlc_questObserved045_find)
label(tlc_questObserved045_found)
label(tlc_questObserved045_missing)
label(tlc_questObserved045_min)
tlc_questObserved045:
pushfq
push rax
push rcx
push rdx
push r8
cmp byte ptr [tlcFlags+05],0
je tlc_questObserved045_done
cmp qword ptr [tlc_instant_gate045+08],0
je tlc_questObserved045_done
mov r8,[rbx+rdi+10]
lea rdx,[tlc_instant_gate045+1420]
mov ecx,100
tlc_questObserved045_find:
cmp [rdx],r8
je tlc_questObserved045_found
add rdx,18
dec ecx
jnz tlc_questObserved045_find
jmp tlc_questObserved045_missing
tlc_questObserved045_found:
mov eax,[r8+0C]
cmp [rdx+08],eax
jne tlc_questObserved045_missing
mov eax,[rdx+0C]
jmp tlc_questObserved045_min
tlc_questObserved045_missing:
xor eax,eax
tlc_questObserved045_min:
cmp eax,[tlc_instant_gate045+18]
jae tlc_questObserved045_done
mov [tlc_instant_gate045+18],eax
tlc_questObserved045_done:
pop r8
pop rdx
pop rcx
pop rax
popfq
$ORIG
jmp tlc_questObserved045_ret
$SITE:
jmp tlc_questObserved045
$NOP
tlc_questObserved045_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]}

local oldOn=TLC.F.instant.on
local oldOff=TLC.F.instant.off
local oldTask=TLC.F.instant.task
local function gate045()return getAddressSafe('tlc_instant_gate045')end
local function context045()
 local found,world=TLC.worldSubsystem107('VoyageQuestSubsystem')
 TLC.questLayout107();TLC.questObserver107(found);TLC.verifyLegacyFabricator107()
 return world,found
end
local function filter045(state)
 local sys=state.identity.object or state.sys
 assert(TLC.sameIdentity029(state.identity),'Quest registry lifetime changed')
 local layout=TLC.questLayout107();local g=assert(gate045());local map=sys+layout.objects
 local data=readQword(map);local count=readInteger(map+8)
 assert(data and count and count&gt;=0 and count&lt;=256,'Quest registry exceeds verified observer capacity')
 local targets,seen,visited={},{},{}
 local function add(value,kind)
  if not TLC.valid(value)then return end
  local key=tostring(value)..'/'..kind
  if not seen[key]then seen[key]=true;targets[#targets+1]={value,kind}end
 end
 local function logic(o,depth)
  if depth&gt;16 or not TLC.valid(o)or visited[o]then return end
  visited[o]=true
  if TLC.U.isA(o,'BP_QuestLogic_IsFabricating_C')then
   local off=TLC.refOffset(o,'Item');assert(off,'Craft quest Item property unavailable');add(readQword(o+off),0)
  elseif TLC.U.isA(o,'BP_QuestLogic_IsFabricatingFromCategory_C')then
   local off=TLC.refOffset(o,'Category');assert(off,'Craft quest Category property unavailable');add(readQword(o+off),1)
  end
  for _,name in ipairs({'ChildLogics','LogicArray'})do
   local off=TLC.refOffset(o,name)
   if off then
    local a=readQword(o+off);local n=readInteger(o+off+8)
    assert(n and n&gt;=0 and n&lt;=256,'Quest logic array capacity mismatch')
    for k=0,n-1 do logic(readQword(a+k*8),depth+1)end
   end
  end
 end
 for _,row in ipairs(TLC.map(map,layout.registryStride))do
  local quest=readQword(row+layout.registryValue)
  if TLC.valid(quest)and TLC.U.isA(quest,'VoyageQuestObject')then
   local asset=TLC.weak(quest+layout.quest)
   if TLC.valid(asset)then
    local completed={}
    for _,r in ipairs(TLC.map(quest+layout.progress,layout.progressStride))do
     local index=readBytes(r,1);local value=readInteger(r+layout.progressValue)
     if index and value and value~=0 then completed[index]=true end
    end
    local tasks=readQword(asset+layout.tasks);local n=readInteger(asset+layout.tasks+8)
    assert(n and n&gt;=0 and n&lt;=256,'Quest task array capacity mismatch')
    for index=0,n-1 do
     local task=tasks+index*layout.taskSize
     if readBytes(task+layout.taskType,1)==layout.blueprint and not completed[index]then logic(readQword(task+layout.taskLogic),0)end
    end
    local a=readQword(asset+layout.logics);local size=readInteger(asset+layout.logics+8)
    assert(size and size&gt;=0 and size&lt;=256,'Quest root logic capacity mismatch')
    for k=0,size-1 do logic(readQword(a+k*8),0)end
   end
  end
 end
 assert(#targets&lt;=128,'Craft quest target filter capacity exceeded')
 local snapshot={tostring(data),tostring(count)}
 for _,row in ipairs(targets)do snapshot[#snapshot+1]=tostring(row[1])..'/'..row[2]end
 local pointers={}
 for i=0,count-1 do pointers[i+1]=readQword(data+i*layout.registryStride+layout.registryValue)or 0;snapshot[#snapshot+1]=tostring(pointers[i+1])end
 local fingerprint=table.concat(snapshot,':')
 if state.filterFingerprint==fingerprint then return end
 -- A publication generation prevents native readers using a partially updated
 -- filter. No quest records are ever written.
 local generation=readInteger(g+0x1c)or 0
 if generation%2~=0 then generation=generation+1 end
 writeInteger(g+0x1c,generation+1)
 for i,row in ipairs(targets)do local a=g+0x2c30+(i-1)*16;writeQword(a,row[1]);writeInteger(a+8,row[2])end
 for i=0,count-1 do writeQword(g+0x3430+i*8,pointers[i+1])end
 writeInteger(g+0x2c2c,#targets);writeInteger(g+0x2c28,count);writeQword(g+0x2c20,data)
 writeInteger(g+0x1c,generation+2)
 state.targetCount=#targets;state.filterFingerprint=fingerprint
end
TLC.F.instant.hooks={'fabricationProgress2','questBegin045','questEvaluated045','questObserved045','questEnd045','DismantleItem022','DismantleModule022','DismantleBase022','RepairItem022','RepairBase022','DismantleDispatch023'}
TLC.F.instant.on=function()
 TLC.requireSigs({'QuestTick045','QuestBegin045','QuestEnd045','QuestEvaluated045','QuestObserved045'})
 local world,sys=context045()
 if oldOn then oldOn()end
 TLC.hookOn('fabricationProgress2')
 local g=assert(gate045(),'Instant observer storage unavailable')
 local zeros={};for k=1,0x3c30 do zeros[k]=0 end
 assert(writeBytes(g,zeros),'Instant observer initialization failed')
 writeQword(g,sys+TLC.questObserver107(sys))
 TLC.instantContext045={world=world,sys=sys,identity=TLC.identity029(sys)}
 filter045(TLC.instantContext045)
 TLC.msg('Instant actions: native completion path; quest recipe filter ready ('..TLC.instantContext045.targetCount..' targets).','即時化: 通常の完成処理を使用／クエスト対象フィルター準備完了（'..TLC.instantContext045.targetCount..'種類）。')
end
TLC.F.instant.off=function()
 local g=gate045();if g then writeQword(g,0);writeQword(g+8,0)end
 TLC.instantContext045=nil
 if oldOff then oldOff()end
end
TLC.F.instant.task=function()
 local state=TLC.instantContext045
 if not(state and TLC.world()==state.world and TLC.sameIdentity029(state.identity))then if TLC.requestFeatureRebind157 then TLC.requestFeatureRebind157('instant','world changed');return end;error('World changed; instant context unavailable')end
 filter045(state)
 if oldTask then oldTask()end
end
-- Keep native threads that already entered a cave safe during disable/reload.
-- Reuse the exact same owned allocations instead of leaking one per toggle.
local retained=rawget(_G,'TLCInstantCaves045')
if not retained or retained.schema~='quest-evaluation-reflected108'then retained={schema='quest-evaluation-reflected108'}end
_G.TLCInstantCaves045=retained
local owns={fabricationProgress2=true,fabricationFree049=true,instantDuration049=true,questBegin045=true,questEnd045=true,questEvaluated045=true,questObserved045=true,dismantleScale050=true}
local hookOn=TLC.hookOn
local hookOff=TLC.hookOff
function TLC.hookOn(name)
 if not owns[name]or TLC.hookState[name]then return hookOn(name)end
 local old=retained[name]
 if old and old.pid==getOpenedProcessID()and old.module==TLC.mod()and old.flags==TLC.base()and(name=='fabricationProgress2'or old.gate==gate045())then
  local sig=TLC.HOOKS[name].sig
  assert(TLC.resolveSig(sig)==old.addr and TLC.originalView043(old.addr,TLC.SIGS[sig].bytes),'Instant code ownership changed')
  if name=='fabricationProgress2'then registerSymbol('tlc_instant_gate045',old.data,true)end
  assert(writeBytes(old.addr,old.patch),'Instant hook reactivation failed')
  TLC.hookState[name]=old;retained[name]=nil;return
 end
 retained[name]=nil;hookOn(name)
 local state=assert(TLC.hookState[name]);state.pid=getOpenedProcessID();state.module=TLC.mod();state.flags=TLC.base();state.gate=gate045()
 state.patch=readBytes(state.addr,#state.orig,true)
 if name=='fabricationProgress2'then state.data=assert(gate045())end
end
function TLC.hookOff(name)
 if not owns[name]then return hookOff(name)end
 local state=TLC.hookState[name];if not state then return end
 hookOff(name)
 if state.pid==getOpenedProcessID()and state.module==TLC.mod()then retained[name]=state end
end
end

TLC.SIGS.FabricationFree049={len=5,bytes={69,132,228,116,81,243,65,15,16,150,116,1,0,0,243,65,15,92,215,243,65,15,95,214,243,65,15,17,150,116,1,0,0,65,131,190,16,1,0,0},p="45 84 E4 74 51 F3 41 0F 10 96 74 01 00 00 F3 41 0F 5C D7 F3 41 0F 5F D6 F3 41 0F 11 96 74 01 00 00 41 83 BE 10 01 00 00"}
-- Both native decrement branches must be covered. The resource-free branch
-- bypasses FabricationProgress entirely (native 5514F66 vs 5514F0A).
do
local primary=TLC.HOOKS.fabricationProgress2.aa
local cut=assert(primary:find('align 10 CC',1,true))
local free=primary:sub(1,cut-1)
free=free:gsub('label%(tlc_instant_gate045%)\n',''):gsub('label%(tlc_instant_rows045%)\n',''):gsub('registersymbol%(tlc_instant_gate045%)\n','')
free=free:gsub('tlc_instant_rows045','tlc_instant_gate045+20')
local names={};for name in free:gmatch('label%(([%w_]+)%)')do names[#names+1]=name end
table.sort(names,function(a,b)return #a&gt;#b end)
for _,name in ipairs(names)do
 if not name:find('tlc_fabricationProgress2',1,true)then free=free:gsub(name,name..'_free049')end
end
free=free:gsub('tlc_fabricationProgress2','tlc_fabricationFree049'):gsub('%$8000','$1000'):gsub('%$SITE%+21','$SITE+56')
free=free..[==[
$SITE:
jmp tlc_fabricationFree049
$NOP
tlc_fabricationFree049_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]
TLC.HOOKS.fabricationFree049={sig='FabricationFree049',aa=free}

-- Preserve the old fast start for ordinary recipes. Only a matching current
-- quest Item/Category retains its normal duration for listener registration.
TLC.HOOKS.instantDuration049={sig='FabricationDuration',aa=[==[
[ENABLE]
alloc(tlc_instantDuration049,$1000,$SITE)
label(tlc_instantDuration049_ret)
label(tlc_id049_done)
label(tlc_id049_guard)
label(tlc_id049_filter)
label(tlc_id049_loop)
label(tlc_id049_item)
label(tlc_id049_next)
label(tlc_id049_fast)
tlc_instantDuration049:
pushfq
push rax
push rcx
push rdx
push r8
push r9
push r10
push r11
sub rsp,10
cmp byte ptr [tlcFlags+05],0
je tlc_id049_done
cmp qword ptr [tlc_instant_gate045],0
je tlc_id049_done
mov edx,[tlc_instant_gate045+1C]
test edx,1
jnz tlc_id049_done
mov [rsp],edx
cmp dword ptr [rbx+2A8],0
jle tlc_id049_done
mov r8,[rbx+2A0]
test r8,r8
jz tlc_id049_done
mov r8,[r8]
test r8,r8
jz tlc_id049_done
mov rdx,[tlc_instant_gate045]
mov r10,[rdx+D8]
cmp [tlc_instant_gate045+2C20],r10
jne tlc_id049_done
mov ecx,[rdx+E0]
cmp [tlc_instant_gate045+2C28],ecx
jne tlc_id049_done
cmp ecx,100
ja tlc_id049_done
xor eax,eax
test ecx,ecx
jz tlc_id049_filter
lea rdx,[tlc_instant_gate045+3430]
tlc_id049_guard:
mov r9,[r10+10]
cmp [rdx+rax*8],r9
jne tlc_id049_done
add r10,20
inc eax
cmp eax,ecx
jb tlc_id049_guard
tlc_id049_filter:
mov ecx,[tlc_instant_gate045+2C2C]
cmp ecx,80
ja tlc_id049_done
test ecx,ecx
jz tlc_id049_fast
lea r10,[tlc_instant_gate045+2C30]
tlc_id049_loop:
cmp dword ptr [r10+08],0
je tlc_id049_item
mov r9,[r8+B8]
cmp [r10],r9
je tlc_id049_done
jmp tlc_id049_next
tlc_id049_item:
cmp [r10],r8
je tlc_id049_done
tlc_id049_next:
add r10,10
dec ecx
jnz tlc_id049_loop
tlc_id049_fast:
mov edx,[rsp]
cmp edx,[tlc_instant_gate045+1C]
jne tlc_id049_done
movss xmm0,[tlcVars+48]
inc dword ptr [tlcFlags+48]
tlc_id049_done:
add rsp,10
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
popfq
$ORIG
jmp tlc_instantDuration049_ret
$SITE:
jmp tlc_instantDuration049
$NOP
tlc_instantDuration049_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]}
table.insert(TLC.F.instant.hooks,2,'fabricationFree049')
table.insert(TLC.F.instant.hooks,3,'instantDuration049')
TLC.F.materials.hooks[#TLC.F.materials.hooks+1]='fabricationFree049'
end

TLC.SIGS.DismantleScale050={len=6,bytes={139,129,96,22,0,0,76,139,209,68,15,182,202,59,129,140,22,0,0,116,80,76,139,129,152,22,0,0,72,141,129,144,22,0,0,139,137,160,22,0},p="8B 81 60 16 00 00 4C 8B D1 44 0F B6 CA 3B 81 8C 16 00 00 74 50 4C 8B 81 98 16 00 00 48 8D 81 90 16 00 00 8B 89 A0 16 00"}
-- The dismantle Blueprint always multiplies its target-specific duration by
-- GetEnhancerActionTotalTimeAdjustmentMulAdjust(0), then clamps to 0.1 seconds.
-- Return zero for that read-only calculation for this local player only. Do not
-- alter enhancement data, CanDismantle, Recycle, quests, or completion delegates.
do
TLC.HOOKS.dismantleScale050={sig='DismantleScale050',aa=[==[
[ENABLE]
alloc(tlc_dismantleScale050,$1000,$SITE)
label(tlc_dismantleScale050_ret)
label(tlc_dismantleScale050_normal)
tlc_dismantleScale050:
pushfq
push rax
cmp byte ptr [tlcFlags+05],0
je tlc_dismantleScale050_normal
test dl,dl
jne tlc_dismantleScale050_normal
mov rax,[tlc_instant_gate045+3C30]
test rax,rax
jz tlc_dismantleScale050_normal
cmp rcx,rax
jne tlc_dismantleScale050_normal
xorps xmm0,xmm0
inc dword ptr [tlc_instant_gate045+3C38]
pop rax
popfq
ret
tlc_dismantleScale050_normal:
pop rax
popfq
$ORIG
jmp tlc_dismantleScale050_ret
$SITE:
jmp tlc_dismantleScale050
$NOP
tlc_dismantleScale050_ret:
[DISABLE]
$SITE:
$ORIG
// Allocation retained/reused until process exit.
]==]}
local function update050()
 local g=getAddressSafe('tlc_instant_gate045');if not g then return end
 -- Controller.PlayerState remains available when the character is unpossessed.
 local state=0
 local pc=TLC.playerController(false)
 if TLC.valid(pc)then
  local off=TLC.refOffset(pc,'PlayerState')
  local candidate=off and readQword(pc+off)
  if TLC.valid(candidate)and TLC.U.isA(candidate,'VoyagePlayerState')then state=candidate end
 end
 if state==0 then
  local player=TLC.player(false)
  if TLC.valid(player)then
   local off=TLC.refOffset(player,'PlayerState')
   local candidate=off and readQword(player+off)
   if TLC.valid(candidate)and TLC.U.isA(candidate,'VoyagePlayerState')then state=candidate end
  end
 end
 if readQword(g+0x3c30)~=state then assert(writeQword(g+0x3c30,state),'Local dismantle calculation target update failed')end
 return state
end
local on=TLC.F.instant.on
local off=TLC.F.instant.off
local task=TLC.F.instant.task
TLC.F.instant.on=function()
 on();local state=update050();assert(state and state~=0,TLC.T('Local player state unavailable.','ローカルプレイヤーの状態を取得できません。'))
 local g=getAddressSafe('tlc_instant_gate045');writeInteger(g+0x3c38,0)
end
TLC.F.instant.off=function()
 local g=getAddressSafe('tlc_instant_gate045');if g then writeQword(g+0x3c30,0)end
 if off then off()end
end
TLC.F.instant.task=function()
 if task then task()end
 update050()
end
table.insert(TLC.F.instant.hooks,4,'dismantleScale050')
end


-- 051: Scale freshly generated native WaveProperties, never render/GPU buffers.
-- GetWeather rebuilds this output array on each call (stride 0x40).
-- WaveProperties UHT metadata and the installed EXE copy loop agree on these offsets.
TLC.VARDEF[0xd0]={'float',0}
TLC.VARDEF[0xd4]={'float',1}
TLC.VARDEF[0xd8]={'float',1}
TLC.VARDEF[0xe0]={'float',0}
TLC.VARDEF[0xe4]={'float',1}
TLC.VARDEF[0xe8]={'float',1}
do
 local aa=TLC.HOOKS.weatherOutput2.aa
 local function once(old,new)
  local p=assert(aa:find(old,1,true),'Wave hook integration marker missing')
  assert(not aa:find(old,p+#old,true),'Ambiguous wave hook integration marker')
  aa=aa:sub(1,p-1)..new..aa:sub(p+#old)
 end
 once('label(tlc_weatherOutput2_done)',[==[label(tlc_weatherOutput2_done)
label(tlc_wave051_loop)
label(tlc_wave051_return)]==])
 once('mov [rsp+20],r11','mov [rsp+20],r11\nmov [rsp+40],r11')
 once('tlc_weatherOutput2_done:\n',[==[tlc_weatherOutput2_done:
cmp byte ptr [tlcFlags+1F],0
je tlc_wave051_return
mov rdx,[rsp+40]
test rdx,rdx
je tlc_wave051_return
mov ecx,[rdx+08]
test ecx,ecx
jle tlc_wave051_return
cmp ecx,100
ja tlc_wave051_return
cmp ecx,[rdx+0C]
ja tlc_wave051_return
mov rdx,[rdx]
test rdx,rdx
je tlc_wave051_return
tlc_wave051_loop:
movss xmm0,[rdx+20]
mulss xmm0,[tlcVars+E0]
movss [rdx+20],xmm0
movss xmm0,[rdx+24]
mulss xmm0,[tlcVars+E0]
movss [rdx+24],xmm0
movss xmm0,[rdx+14]
mulss xmm0,[tlcVars+E4]
movss [rdx+14],xmm0
movss xmm0,[rdx+18]
mulss xmm0,[tlcVars+E4]
movss [rdx+18],xmm0
movss xmm0,[rdx+30]
mulss xmm0,[tlcVars+E8]
movss [rdx+30],xmm0
movss xmm0,[rdx+34]
mulss xmm0,[tlcVars+E8]
movss [rdx+34],xmm0
add rdx,40
dec ecx
jne tlc_wave051_loop
tlc_wave051_return:
]==])
 TLC.HOOKS.weatherOutput2.aa=aa
end
function TLC.applyWaves051()
 local values={readFloat(TLC.var(0xd0)),readFloat(TLC.var(0xd4)),readFloat(TLC.var(0xd8))}
 for i=1,3 do
  local v=values[i];local minimum=i==2 and 0.1 or 0
  assert(type(v)=='number'and v==v and v&gt;=minimum and v&lt;=5,TLC.T(
   'Wave height/steepness must be 0-5; wavelength must be 0.1-5.',
   '波高・波の鋭さは0～5、波長は0.1～5で指定してください。'))
 end
 -- Publish only after all inputs pass. The native output remains the baseline.
 for i=1,3 do writeFloat(TLC.var(0xdc+i*4),values[i])end
end
TLC.F.waves051={flag=0x1f,hooks={'weatherOutput2'},on=TLC.applyWaves051,task=TLC.applyWaves051}
TLC.NAMES[514]={'Wave control','波の状態を制御'}
TLC.NAMES[515]={'Wave height multiplier (0 = calm, 0-5)','波高倍率（0＝凪・0～5）'}
TLC.NAMES[516]={'Wavelength multiplier (0.1-5)','波長倍率（0.1～5）'}
TLC.NAMES[517]={'Wave steepness multiplier (0-5)','波の鋭さ倍率（0～5）'}


-- 052: Keep the generated wave topology for calm water. A zero MaxAmplitude
-- makes Voyage's generator omit that entire wave band, changing GPU array sizes.
-- This mitigates that transition; it does not identify the GPU faulting shader.
TLC.VARDEF[0xec]={'float',0.0001}
do
 local aa=TLC.HOOKS.weatherOutput2.aa
 local function once(old,new)
  local p=assert(aa:find(old,1,true),'Wave safety integration marker missing')
  assert(not aa:find(old,p+#old,true),'Ambiguous wave safety integration marker')
  aa=aa:sub(1,p-1)..new..aa:sub(p+#old)
 end
 once('label(tlc_wave051_return)','label(tlc_wave051_return)\nlabel(tlc_wave052_next)\nlabel(tlc_wave052_steepness)')
 once('tlc_wave051_loop:\n',[==[tlc_wave051_loop:
xorps xmm1,xmm1
ucomiss xmm1,[rdx+24]
jae tlc_wave052_next
]==])
 for _,offset in ipairs({'20','24'})do
  once('mulss xmm0,[tlcVars+E0]\nmovss [rdx+'..offset..'],xmm0',
   'mulss xmm0,[tlcVars+E0]\nmaxss xmm0,[tlcVars+EC]\nmovss [rdx+'..offset..'],xmm0')
 end
 once('movss xmm0,[rdx+30]',[==[xorps xmm1,xmm1
ucomiss xmm1,[tlcVars+E0]
jne tlc_wave052_steepness
movss [rdx+30],xmm1
movss [rdx+34],xmm1
jmp tlc_wave052_next
tlc_wave052_steepness:
movss xmm0,[rdx+30]]==])
 once('add rdx,40\ndec ecx','tlc_wave052_next:\nadd rdx,40\ndec ecx')
 TLC.HOOKS.weatherOutput2.aa=aa
end



-- Native environment controls: game input -&gt; game notifications -&gt; normal consumers.
-- No per-enemy overrides, render CVars, or writes to output climate/sun direction.
TLC.env055=nil
local function fn055(obj,name,size,isClass)
 assert(TLC.valid(obj),'Environment object expired')
 local cls=isClass and obj or readQword(obj+0x10)
 for depth=1,40 do
  if not TLC.valid(cls)then break end
  local f=readQword(cls+0x48)
  for i=1,2000 do
   if not TLC.valid(f)then break end
   if TLC.U.n(f)==name then
    assert(readSmallInteger(f+0xb6)==size,'Environment API parameter layout mismatch: '..name)
    assert(TLC.executable038(readQword(f+0xd8)),'Environment API native entry unavailable')
    return f
   end
   f=readQword(f+0x28)
  end
  cls=readQword(cls+0x40)
 end
 error('Environment API unavailable: '..name)
end
local function same055(s)
 return TLC.attached()and TLC.world()==s.world.object and TLC.sameIdentity029(s.world)
end
local function call055(s,obj,name,size,fill,done)
 assert(same055(s),'Environment world changed; operation cancelled')
 local fn=fn055(obj,name,size);local p=TLC.base()+0xe80
 for i=0,math.max(size,1)-1 do writeBytes(p+i,0)end
 if fill then fill(p)end
 TLC.job(TLC.processEvent074(obj,false),{obj,fn,p},{obj,fn},function()
  if not same055(s)then return end
  if done then done(p)end
 end)
end
local function actors055()return TLC.timeActors119()end
local function state055()
 local s=TLC.env055
 if s and same055(s)then return s end
 TLC.require();s=actors055();s.world=assert(TLC.identity029(TLC.world()))
 s.keys={};s.phase='idle';TLC.env055=s;return s
end
local function changeHour055(s,hour,done)return TLC.changeHour123(s,hour,done,call055)end
local function tick055(s,enabled,done)return TLC.tickTime123(s,enabled,done,call055)end
local function sky055(s,hour,done)return TLC.transitionTime123(s,hour,done,call055)end
local function finish055(s)
 s.phase='idle'
end
local function time055(s,hour)
 assert(TLC.valid(s.clock)and TLC.valid(s.sky),'Native day clock/sky unavailable')
 local _,skyOffset=TLC.timeFields119(s.clock,s.sky)
 -- Resolve every API before changing any game state.
 local contracts=TLC.timePreflight123(s,TLC.levelScript())
 s.phase='time';s.started=getTickCount()
 local function apply()
  changeHour055(s,hour,function()
   s.timeTouched=true
   tick055(s,false,function()
    sky055(s,hour,function()s.appliedHour=hour;finish055(s)end)
   end)
  end)
 end
 if s.originalTick==nil then
  s.originalSky=assert(readDouble(s.sky+skyOffset))/100
  call055(s,s.clock,'IsActorTickEnabled',contracts.is.size,nil,function(p)s.originalTick=TLC.timeReadBoolean123(contracts.is,'ReturnValue',p);apply()end)
 else apply()end
end
local function restoreTime055(s)
 s.phase='restoreTime';s.started=getTickCount()
 local function restoreClock()
  sky055(s,s.originalSky,function()
   tick055(s,s.originalTick,function()
    s.appliedHour=nil;s.originalTick=nil;s.originalHour=nil;s.originalSky=nil;s.timeTouched=nil;finish055(s)
   end)
  end)
 end
 if s.originalHour~=nil then changeHour055(s,s.originalHour,restoreClock)else restoreClock()end
end
local climate055={8,12,16,20,24,28,32}
-- The native weather sampler consumes Volume.Climate, not Preset.Climate.
-- Commit simulation inputs and notify Modified through the reflected property API.
local function notifyWeather067(s,done)
 local cls=assert(TLC.refClass('KismetSystemLibrary'),'Weather property API unavailable')
 local cdo=readQword(cls+0x118)
 assert(cdo and readQword(cdo+0x10)==cls and(readInteger(cdo+8)&amp;0x10)~=0,'Weather property API identity changed')
 local fn=fn055(cls,'SetBoolPropertyByName',17,true)
 local current=readQword(s.volume+0x10);local word
 for depth=1,64 do
  local field=readQword(current+0x50)
  for i=1,2000 do
   if not field or field==0 then break end
   if TLC.U.name(readInteger(field+0x20))=='Modified'then
    assert(readInteger(field+0x44)==0x2c8 and readInteger(field+0x34)==1,'Weather Modified layout changed')
    word=readQword(field+0x20);break
   end
   field=readQword(field+0x18)
  end
  if word then break end
  current=readQword(current+0x40);if not TLC.valid(current)then break end
 end
 assert(word,'Weather Modified property unavailable')
 local p=TLC.base()+0xe80
 writeQword(p,s.volume);writeQword(p+8,word);writeBytes(p+16,1)
 TLC.job(TLC.nativeSlot(s.volume,0x250),{cdo,fn,p},{s.volume,fn},function()
  if not same055(s)then return end
  if done then done()end
 end)
end
local function weather055(s)
 assert(TLC.valid(s.volume)and TLC.U.isA(s.volume,'VoyageWeatherVolume'),'Weather volume unavailable')
 assert(TLC.refOffset(s.volume,'Climate')==0x278 and TLC.refOffset(s.volume,'Priority')==0x2c0,'Weather simulation-input layout changed')
 if not s.weatherTarget then
  local source=TLC.base()+0xb00
  if not TLC.selectedWeatherIndex then
   local sys=assert(TLC.weatherObject);source=sys+assert(TLC.refOffset(sys,'CurrentClimate'))
  end
  local values={}
  for _,off in ipairs(climate055)do
   local v=readFloat(source+off)
   assert(v and v==v and math.abs(v)&lt;1000000,'Invalid weather input');values[off]=v
  end
  local row=TLC.selectedWeatherIndex and TLC.WEATHER and TLC.WEATHER[TLC.selectedWeatherIndex]
  if row and row.label=='DA_WeatherPreset_Sunny'then values[20]=0;values[24]=0 end
  s.weatherTarget=values
 end
 local changed=not s.weatherApplied
 for _,off in ipairs(climate055)do
  if readFloat(s.volume+0x278+off)~=s.weatherTarget[off]then changed=true end
 end
 if readFloat(s.volume+0x2c0)~=99 then changed=true end
 if not changed then return end
 -- Resolve and validate notification before editing any simulation input.
 local cls=assert(TLC.refClass('KismetSystemLibrary'),'Weather property API unavailable')
 fn055(cls,'SetBoolPropertyByName',17,true)
 for _,off in ipairs(climate055)do TLC.changed(s.volume+0x278+off,'float',s.weatherTarget[off],s.volume,'weather')end
 TLC.changed(s.volume+0x2c0,'float',99,s.volume,'weather')
 s.phase='weatherCommit067';s.started=getTickCount()
 notifyWeather067(s,function()s.weatherApplied=true;s.weatherRefresh=nil;finish055(s)end)
end

function TLC.pumpEnvironment055()
 local s=TLC.env055;if not s then return end
 if not(same055(s)and TLC.valid(s.clock)and TLC.valid(s.sky))then TLC.env055=nil;if TLC.requestFeatureRebind157 then for key in pairs(s.keys or{})do if TLC.featOn[key]then TLC.requestFeatureRebind157(key,'Time objects expired')end end end;return end
 if s.phase~='idle'then
  if not TLC.pendingJob and s.started and getTickCount()-s.started&gt;10000 then
   s.phase='idle'
   if TLC.requestFeatureRebind157 then for key in pairs(s.keys)do if TLC.featOn[key]then TLC.requestFeatureRebind157(key,'Environment objects expired')end end;TLC.env055=nil;return end
    if s.operation then s.keys[s.operation]=nil end
   TLC.reason('environment','Native environment operation did not finish; restoring captured state')
  else return end
 end
 if TLC.pendingJob then return end
 local hour=s.keys.noon and 12 or s.keys.time and TLC.skyHour()or nil
 if hour~=nil and hour~=s.appliedHour then s.operation=s.keys.noon and 'noon'or'time';time055(s,hour);return end
 if hour==nil and s.originalTick~=nil then
  if s.timeTouched or s.originalHour~=nil then s.operation='timeRestore';restoreTime055(s);return else s.originalTick=nil;s.originalSky=nil end
 end
 if s.keys.weather then
  s.operation='weather'
  if not s.nextWeather or getTickCount()&gt;=s.nextWeather then weather055(s);s.nextWeather=getTickCount()+500 end
 elseif s.weatherApplied then
  s.phase='weatherRestore';s.started=getTickCount()
  TLC.restore('weather')
  notifyWeather067(s,function()
   s.weatherTarget=nil;s.weatherApplied=nil;s.preset=nil;s.overridePreset=nil;s.originalPreset=nil;finish055(s)
  end)
 end
end
function TLC.prepareSkyTime()
 -- The previous implementation patched CRT memcpy. Native controls need no sky hook.
 state055()
end
local function on055(key)
 local s=state055();s.keys[key]=true
 if key=='weather'then s.weatherRefresh=s.weatherApplied or s.overridePreset~=nil;s.weatherTarget=nil;s.nextWeather=nil end
end
local function off055(key)
 local s=TLC.env055;if s then s.keys[key]=nil end
end
TLC.F.noon={on=function()on055('noon')end,off=function()off055('noon')end}
TLC.F.time={on=function()on055('time')end,off=function()off055('time')end}
TLC.F.weather={on=function()on055('weather')end,off=function()off055('weather')end}
-- Keep the wind/wave wrapper, but remove all climate-output capture/overrides.
do
 local aa=TLC.HOOKS.weatherOutput2.aa
 local start=aa:find('cmp byte ptr [tlcFlags+C0],0',1,true)
 if start then
  local stop=assert(aa:find('tlc_weatherOutput2_wind:',start,true))
  aa=aa:sub(1,start-1)..aa:sub(stop)
 end
 aa=aa:gsub('label%(tlc_weatherOutput2_apply%)\n','')
 TLC.HOOKS.weatherOutput2.aa=aa
end
local tickNative055=TLC.tick
function TLC.tick(...)
 local result=tickNative055(...)
 if TLC.attached()then
  local ok,e=pcall(TLC.pumpEnvironment055)
  if not ok then
   TLC.reason('environment',tostring(e))
   local s=TLC.env055
    if s and TLC.isTransient157 and TLC.isTransient157(e)then
     for key in pairs(s.keys or{})do if TLC.featOn[key]then TLC.requestFeatureRebind157(key,tostring(e))end end
     TLC.env055=nil;return result
    end
    if s then
    s.failed=tostring(e);local key=s.operation
    if key=='noon'or key=='time'or key=='weather'then
     s.keys[key]=nil;TLC.featOn[key]=nil;pcall(TLC.restore,key)
     local id=key=='noon'and 501 or key=='time'and 504 or 503
     local record=getAddressList().getMemoryRecordByID(id)
     if record then pcall(function()record.disableWithoutExecute()end)end
    end
   end
  end
 end
 return result
end
local forgetNative055=TLC.forgetProcess
function TLC.forgetProcess(...)TLC.env055=nil;return forgetNative055(...)end
local suspendNative055=TLC.suspendWorld029
function TLC.suspendWorld029(...)TLC.env055=nil;return suspendNative055(...)end
local allOffNative055=TLC.disableAll
function TLC.disableAll(...)
 local s=TLC.env055
 if s and same055(s)then
  s.keys={}
  local deadline=getTickCount()+3000
  repeat
   TLC.tick()
   if s.phase=='idle'and s.originalTick==nil and not s.weatherApplied then break end
   sleep(10)
  until getTickCount()&gt;=deadline
  assert(s.phase=='idle'and s.originalTick==nil and not s.weatherApplied,'Native environment restore is still pending; table retained')
 end
 return allOffNative055(...)
end

-- Vehicle TakeDamage entry verified from the installed EXE; no health/physics edits.
TLC.SIGS.BoatActorDamage055={len=6,bytes={64,83,72,131,236,64,72,139,68,36,112,72,139,217,15,41,116,36,48,15,40,241,72,137,68,36,32,232,0,205,151,253,72,141,139,32,4,0,0,232},p="40 53 48 83 EC 40 48 8B 44 24 70 48 8B D9 0F 29 74 24 30 0F 28 F1 48 89 44 24 20 E8 00 CD 97 FD 48 8D 8B 20 04 00 00 E8"}
TLC.HOOKS.boatActorDamage055={sig='BoatActorDamage055',aa=[==[
[ENABLE]
alloc(tlc_boatActorDamage055,1000,$SITE)
label(tlc_boatActorDamage055_normal)
label(tlc_boatActorDamage055_loop)
label(tlc_boatActorDamage055_zero)
label(tlc_boatActorDamage055_return)
tlc_boatActorDamage055:
pushfq
push rax
push rdx
push r10
push r11
cmp byte ptr [tlcBoatProtection027Data],0
je tlc_boatActorDamage055_normal
ucomiss xmm1,[tlcBoatProtection027Data+20]
jbe tlc_boatActorDamage055_normal
mov r10,[tlcBoatProtection027Data+08]
test r10,r10
je tlc_boatActorDamage055_normal
mov rax,[rcx+10]
mov r11d,40
tlc_boatActorDamage055_loop:
test rax,rax
je tlc_boatActorDamage055_normal
cmp rax,r10
je tlc_boatActorDamage055_zero
mov rax,[rax+40]
dec r11d
jne tlc_boatActorDamage055_loop
jmp tlc_boatActorDamage055_normal
tlc_boatActorDamage055_zero:
inc dword ptr [tlcBoatProtection027Data+28]
mov [tlcBoatProtection027Data+30],rcx
movss [tlcBoatProtection027Data+38],xmm1
pop r11
pop r10
pop rdx
pop rax
popfq
xorps xmm0,xmm0
ret
tlc_boatActorDamage055_normal:
pop r11
pop r10
pop rdx
pop rax
popfq
$ORIG
jmp tlc_boatActorDamage055_return
$SITE:
jmp tlc_boatActorDamage055
$NOP
tlc_boatActorDamage055_return:
[DISABLE]
$SITE:
$ORIG
// Retain for native calls already executing; reused on re-enable.
]==]}

local found=false
for _,name in ipairs(TLC.F.boat.hooks)do if name=='boatActorDamage055'then found=true end end
if not found then TLC.F.boat.hooks[#TLC.F.boat.hooks+1]='boatActorDamage055'end
-- Keep an in-flight native damage call valid when protection is switched off.
do
 local cached=rawget(_G,'TLCBoatActorRetained057')
 local on,off=TLC.hookOn,TLC.hookOff
 local function identify(st)
  st.pid=getOpenedProcessID();st.module=TLC.mod()
  st.ownerData=assert(TLC.boatProtection027,'Boat protection context unavailable').data
 end
 function TLC.hookOn(name)
  if name~='boatActorDamage055'or TLC.hookState[name]then return on(name)end
  local data=TLC.boatProtection027 and TLC.boatProtection027.data
  if cached and cached.pid==getOpenedProcessID()and cached.module==TLC.mod()and cached.ownerData==data then
   assert(TLC.resolveSig('BoatActorDamage055')==cached.addr and TLC.originalView043(cached.addr,TLC.SIGS.BoatActorDamage055.bytes),'Vehicle damage hook ownership changed')
   assert(writeBytes(cached.addr,cached.patch),'Vehicle damage hook reactivation failed')
   TLC.hookState[name]=cached;cached=nil;_G.TLCBoatActorRetained057=nil;return
  end
  on(name);identify(assert(TLC.hookState[name]))
 end
 function TLC.hookOff(name)
  if name~='boatActorDamage055'then return off(name)end
  local st=TLC.hookState[name];if not st then return end
  if not st.ownerData then identify(st)end
  st.script=st.script:gsub('dealloc%(tlc_boatActorDamage055%)','')
  off(name)
  if st.pid==getOpenedProcessID()and st.module==TLC.mod()then cached=st;_G.TLCBoatActorRetained057=st end
 end
end

-- Verified RemoveResource positive-amount path. Removal reasons 0/1 are consumption; 2 is transfer.
TLC.HOOKS.fuelDebit061={sig='FuelDebit061',aa=[==[
[ENABLE]
alloc(tlc_fuelDebit061,1000,$SITE)
label(tlc_fuelDebit061_normal)
label(tlc_fuelDebit061_type)
label(tlc_fuelDebit061_ownerLoop)
label(tlc_fuelDebit061_root)
label(tlc_fuelDebit061_rootLoop)
label(tlc_fuelDebit061_classLoop)
label(tlc_fuelDebit061_nextRoot)
label(tlc_fuelDebit061_skip)
label(tlc_fuelDebit061_return)
label(tlc_fuelDebit061Data)
registersymbol(tlc_fuelDebit061Data)
tlc_fuelDebit061:
pushfq
push rax
push rdx
push r8
push r9
push r10
push r11
cmp byte ptr [tlcFlags+08],0
je tlc_fuelDebit061_normal
cmp r9b,01
ja tlc_fuelDebit061_normal
cmp bl,00
je tlc_fuelDebit061_type
cmp bl,01
je tlc_fuelDebit061_type
cmp bl,02
je tlc_fuelDebit061_type
cmp bl,10
jne tlc_fuelDebit061_normal
tlc_fuelDebit061_type:
mov r10,[tlc_fuelDebit061Data]
test r10,r10
je tlc_fuelDebit061_normal
cmp qword ptr [tlc_fuelDebit061Data+08],0
je tlc_fuelDebit061_normal
mov rax,[rdi+A8]
test rax,rax
je tlc_fuelDebit061_normal
mov rdx,[rax+10]
mov r8d,40
tlc_fuelDebit061_ownerLoop:
test rdx,rdx
je tlc_fuelDebit061_normal
cmp rdx,r10
je tlc_fuelDebit061_skip
cmp rdx,[tlc_fuelDebit061Data+08]
je tlc_fuelDebit061_root
cmp rdx,[tlc_fuelDebit061Data+18]
je tlc_fuelDebit061_root
mov rdx,[rdx+40]
dec r8d
jne tlc_fuelDebit061_ownerLoop
jmp tlc_fuelDebit061_normal
tlc_fuelDebit061_root:
mov r11,[rax+1B8]
mov r9d,40
tlc_fuelDebit061_rootLoop:
test r11,r11
je tlc_fuelDebit061_normal
mov rax,[r11+20]
test rax,rax
je tlc_fuelDebit061_nextRoot
mov rdx,[rax+10]
mov r8d,40
tlc_fuelDebit061_classLoop:
test rdx,rdx
je tlc_fuelDebit061_nextRoot
cmp rdx,r10
je tlc_fuelDebit061_skip
mov rdx,[rdx+40]
dec r8d
jne tlc_fuelDebit061_classLoop
tlc_fuelDebit061_nextRoot:
mov r11,[r11+D0]
dec r9d
jne tlc_fuelDebit061_rootLoop
jmp tlc_fuelDebit061_normal
tlc_fuelDebit061_skip:
inc dword ptr [tlc_fuelDebit061Data+10]
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rax
popfq
// Native success epilogue, before XMM7 has been spilled by the original site.
jmp tlcA_FuelDebit061-12
tlc_fuelDebit061_normal:
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rax
popfq
$ORIG
jmp tlc_fuelDebit061_return
align 8
tlc_fuelDebit061Data:
dq 0
dq 0
dq 0
dq 0
$SITE:
jmp tlc_fuelDebit061
$NOP
tlc_fuelDebit061_return:
[DISABLE]
$SITE:
$ORIG
unregistersymbol(tlc_fuelDebit061Data)
// Keep the allocation valid for native calls already in flight.
]==]}
TLC.F.fuel.hooks={'fuelDebit061'}
TLC.F.fuel.on=function()
 local boat=TLC.refClass('VoyageBoatPawn');local module=TLC.refClass('VoyageModuleActor')
 assert(TLC.valid(boat)and TLC.U.n(boat)=='VoyageBoatPawn','Boat class unavailable')
 assert(TLC.valid(module)and TLC.U.n(module)=='VoyageModuleActor','Module actor class unavailable')
 local function field(cls,name)
  for depth=1,64 do
   if not TLC.valid(cls)then break end
   local f=readQword(cls+0x50)
   for i=1,2000 do if not f or f==0 then break end;if TLC.U.name(readInteger(f+0x20))==name then return readInteger(f+0x44)end;f=readQword(f+0x18)end
   cls=readQword(cls+0x40)
  end
 end
 local engine=TLC.refClass('VoyageModuleEngineActor')
 assert(TLC.valid(engine)and TLC.U.n(engine)=='VoyageModuleEngineActor','Engine actor class unavailable')
 local scene=TLC.refClass('SceneComponent')
 local root=field(boat,'RootComponent');local parent=field(scene,'AttachParent');assert(root and root&gt;0 and root&lt;0x10000 and field(module,'RootComponent')==root and field(engine,'RootComponent')==root and parent and parent&gt;0 and parent&lt;0x10000,'Boat attachment layout unavailable')
 TLC.hookOn('fuelDebit061')
 local d=getAddressSafe('tlc_fuelDebit061Data');assert(d,'Fuel debit hook data unavailable')
 assert(writeQword(d,boat)and writeQword(d+8,module)and writeQword(d+0x18,engine))
end
do
 local cached=rawget(_G,'TLCFuelDebitRetained061')
 local on,off=TLC.hookOn,TLC.hookOff
 function TLC.hookOn(name)
  if name~='fuelDebit061'or TLC.hookState[name]then return on(name)end
  if cached and cached.pid==getOpenedProcessID()and cached.module==TLC.mod()and cached.flags==TLC.base()and cached.schema=='boat-loss-v4'and cached.source==TLC.HOOKS[name].aa then
   assert(TLC.resolveSig('FuelDebit061')==cached.addr and TLC.originalView043(cached.addr,TLC.SIGS.FuelDebit061.bytes),'Fuel debit code ownership changed')
   registerSymbol('tlc_fuelDebit061Data',cached.data,true)
   assert(writeBytes(cached.addr,cached.patch));TLC.hookState[name]=cached;cached=nil;_G.TLCFuelDebitRetained061=nil;return
  end
  on(name);local st=assert(TLC.hookState[name]);st.pid=getOpenedProcessID();st.module=TLC.mod();st.flags=TLC.base()
  st.data=getAddressSafe('tlc_fuelDebit061Data');assert(st.data);st.schema='boat-loss-v4';st.source=TLC.HOOKS[name].aa
 end
 function TLC.hookOff(name)
  if name~='fuelDebit061'then return off(name)end
  local st=TLC.hookState[name];if not st then return end
  off(name)
  if st.pid==getOpenedProcessID()and st.module==TLC.mod()then cached=st;_G.TLCFuelDebitRetained061=st end
 end
end
TLC.SIGS.FuelDebit061={len=5,bytes={15,41,124,36,32,69,132,201,117,23,72,129,193,184,10,0,0,232,99,141,254,255,15,87,201,243,15,90,200,242,15,89,241,72,139,7,15,182,211,72},p="0F 29 7C 24 20 45 84 C9 75 17 48 81 C1 B8 0A 00 00 E8 63 8D FE FF 0F 57 C9 F3 0F 5A C8 F2 0F 59 F1 48 8B 07 0F B6 D3 48"}

-- Storage components override RemoveResource; verified separately from module base implementation.
TLC.SIGS.FuelStorage062={len=7,bytes={128,190,106,1,0,0,0,72,141,158,32,9,0,0,116,123,139,67,8,59,67,52,116,66,72,139,83,64,72,141,67,56,139,75,72,72,133,210,72,15},p="80 BE 6A 01 00 00 00 48 8D 9E 20 09 00 00 74 7B 8B 43 08 3B 43 34 74 42 48 8B 53 40 48 8D 43 38 8B 4B 48 48 85 D2 48 0F"}
local storage=TLC.HOOKS.fuelDebit061.aa:gsub('tlc_fuelDebit061','tlc_fuelStorage062')
storage=storage:gsub('cmp bl,','cmp dil,'):gsub('%[rdi%+A8%]','[rsi+A8]')
storage=storage:gsub('jmp tlcA_FuelDebit061%-12','mov al,1\njmp tlcA_FuelStorage062+BA')
TLC.HOOKS.fuelStorage062={sig='FuelStorage062',aa=storage}
TLC.F.fuel.hooks={'fuelDebit061','fuelStorage062'}
local prepare=TLC.F.fuel.on
TLC.F.fuel.on=function()
 prepare();TLC.hookOn('fuelStorage062')
 local base=assert(getAddressSafe('tlc_fuelDebit061Data'));local d=assert(getAddressSafe('tlc_fuelStorage062Data'))
 assert(writeQword(d,readQword(base))and writeQword(d+8,readQword(base+8))and writeQword(d+0x18,readQword(base+0x18)))
end
do
 local cached=rawget(_G,'TLCFuelStorageRetained062');local on,off=TLC.hookOn,TLC.hookOff
 function TLC.hookOn(name)
  if name~='fuelStorage062'or TLC.hookState[name]then return on(name)end
  if cached and cached.pid==getOpenedProcessID()and cached.module==TLC.mod()and cached.flags==TLC.base()and cached.source==TLC.HOOKS[name].aa then
   assert(TLC.resolveSig('FuelStorage062')==cached.addr and TLC.originalView043(cached.addr,TLC.SIGS.FuelStorage062.bytes),'Storage consumption code ownership changed')
   registerSymbol('tlc_fuelStorage062Data',cached.data,true);assert(writeBytes(cached.addr,cached.patch));TLC.hookState[name]=cached;cached=nil;_G.TLCFuelStorageRetained062=nil;return
  end
  on(name);local st=assert(TLC.hookState[name]);st.pid=getOpenedProcessID();st.module=TLC.mod();st.flags=TLC.base();st.data=assert(getAddressSafe('tlc_fuelStorage062Data'));st.source=TLC.HOOKS[name].aa
 end
 function TLC.hookOff(name)
  if name~='fuelStorage062'then return off(name)end
  local st=TLC.hookState[name];if not st then return end;off(name)
  if st.pid==getOpenedProcessID()and st.module==TLC.mod()then cached=st;_G.TLCFuelStorageRetained062=st end
 end
end

-- Strict recovery of the two published TLC attribute trampolines after CE detach/restart.
local legacy064={["AttributeChange"]={["pattern"]={156,72,59,13,-1,-1,-1,-1,15,132,125,0,0,0,128,61,-1,-1,-1,-1,0,15,132,167,0,0,0,128,250,8,15,133,158,0,0,0,80,65,82,65,83,102,65,15,126,210,65,247,194,0,0,0,128,15,132,70,0,0,0,72,139,65,32,72,133,192,15,132,57,0,0,0,72,139,64,16,76,139,21,-1,-1,-1,-1,65,187,64,0,0,0,72,133,192,15,132,31,0,0,0,76,57,208,15,132,14,0,0,0,72,139,64,64,65,255,203,117,229,233,8,0,0,0,243,15,16,21,-1,-1,-1,-1,65,91,65,90,88,233,55,0,0,0,128,250,8,15,133,21,0,0,0,128,61,-1,-1,-1,-1,0,15,132,33,0,0,0,15,87,210,233,25,0,0,0,128,250,10,15,133,16,0,0,0,128,61,-1,-1,-1,-1,0,15,132,3,0,0,0,15,87,210,157,64,87,72,131,236,32,233,-1,-1,-1,-1},["relocations"]={{["offset"]=4,["end"]=8,["role"]="tlcFlags",["add"]=520},{["offset"]=16,["end"]=21,["role"]="tlcFlags",["add"]=7},{["offset"]=79,["end"]=83,["role"]="tlcNpcClassSlot",["add"]=0},{["offset"]=125,["end"]=129,["role"]="tlcFlags",["add"]=316},{["offset"]=150,["end"]=155,["role"]="tlcFlags",["add"]=1},{["offset"]=180,["end"]=185,["role"]="tlcFlags",["add"]=2}},["returnOffset"]=201,["returnSize"]=5,["returnImmOffset"]=1},["AttributeSet"]={["pattern"]={156,72,59,13,-1,-1,-1,-1,15,133,23,0,0,0,128,61,-1,-1,-1,-1,0,15,132,41,0,0,0,243,15,16,73,12,233,31,0,0,0,72,59,13,-1,-1,-1,-1,15,133,18,0,0,0,128,61,-1,-1,-1,-1,0,15,132,5,0,0,0,243,15,16,73,12,157,243,15,16,65,12,233,-1,-1,-1,-1},["relocations"]={{["offset"]=4,["end"]=8,["role"]="tlcFlags",["add"]=528},{["offset"]=16,["end"]=21,["role"]="tlcFlags",["add"]=1},{["offset"]=40,["end"]=44,["role"]="tlcFlags",["add"]=536},{["offset"]=52,["end"]=57,["role"]="tlcFlags",["add"]=2}},["returnOffset"]=74,["returnSize"]=5,["returnImmOffset"]=1}}

local function signed064(v)if v&gt;=0x80000000 then return v-0x100000000 end;return v end
local function equal064(a,expected)
 local b=readBytes(a,#expected,true);if not b then return false end
 for k,v in ipairs(expected)do if b[k]~=v then return false end end
 return true
end
function TLC.recoverOldAttribute064(name)
 if TLC.pid~=getOpenedProcessID()then return false end
 local proof=legacy064[name];local sg=TLC.SIGS[name]
 if not proof or not sg or not TLC.image038 or not TLC.image038.known then return false end
 local base=TLC.mod();if not base then return false end;local site=TLC.legacySite074(name);if not site then return false end
 if TLC.originalView043(site,sg.bytes)then return false end
 for _,st in pairs(TLC.hookState or{})do if st.addr==site then return false end end
 local entry=readBytes(site,#sg.bytes,true);if not entry or entry[1]~=0xe9 then return false end
 for k=6,sg.len do if entry[k]~=0x90 then return false end end
 for k=sg.len+1,#sg.bytes do if entry[k]~=sg.bytes[k]then return false end end
 local displacement=readInteger(site+1);if displacement==nil then return false end
 local cave=site+5+signed064(displacement)
 local code=readBytes(cave,#proof.pattern,true);if not code then return false end
 for k,v in ipairs(proof.pattern)do if v~=-1 and code[k]~=v then return false end end
 local flags
 for _,rel in ipairs(proof.relocations)do
  local value=readInteger(cave+rel.offset);if value==nil then return false end
  local address=cave+rel['end']+signed064(value)
  if rel.role=='tlcFlags'then
   local candidate=address-rel.add
   if flags and flags~=candidate then return false end;flags=candidate
  elseif rel.role=='tlcNpcClassSlot'then
   local npc=TLC.SIGS.NPCClass;local ns=TLC.resolveSig('NPCClass');if not ns then return false end
   if not TLC.originalView043(ns,npc.bytes)then return false end
   local nd=readInteger(ns+3);if nd==nil or address~=ns+7+signed064(nd)then return false end
  else return false end
 end
 if not flags or flags&lt;0x10000 or(flags&gt;=cave and flags&lt;cave+#proof.pattern)then return false end
 for _,off in ipairs({1,2,7})do local flag=readBytes(flags+off,1);if flag~=0 and flag~=1 then return false end end
 local ending=readInteger(cave+proof.returnOffset+proof.returnImmOffset)
 if ending==nil or cave+proof.returnOffset+proof.returnSize+signed064(ending)~=site+sg.len then return false end
 -- Recheck ownership immediately before restoring only this site's original instructions.
 if not equal064(site,entry)or not equal064(cave,code)then return false end
 local original={};for k=1,sg.len do original[k]=sg.bytes[k]end
 assert(writeBytes(site,original),'Verified TLC attribute restoration failed')
 assert(equal064(site,sg.bytes),'Verified TLC attribute restore readback failed')
 TLC.recovered064=TLC.recovered064 or{};TLC.recovered064[name]={site=site,cave=cave,flags=flags,codeSize=#code}
 -- Old allocations remain valid for game threads that already entered them.
 TLC.msg('Verified the previous TLC hook and restored only this site: '..name,'以前のTLCフックを照合し、この箇所だけ復元しました: '..name)
 return true
end
local resolve064=TLC.resolveSig
function TLC.resolveSig(name)
 if legacy064[name]then TLC.recoverOldAttribute064(name)end
 return resolve064(name)
end
-- Do not free an executing attribute trampoline. Reuse it only for this CE/game/storage owner.
for _,name in ipairs({'attributes','attributeSet'})do
 TLC.HOOKS[name].aa=TLC.HOOKS[name].aa:gsub('dealloc%(tlc_'..name..'%)','// Retained until the game process exits.')
end
do
 local retained=rawget(_G,'TLCAttributeRetained064')or{};_G.TLCAttributeRetained064=retained
 local on,off=TLC.hookOn,TLC.hookOff
 function TLC.hookOn(name)
  if not(name=='attributes'or name=='attributeSet')or TLC.hookState[name]then return on(name)end
  local old=retained[name]
  if old and old.pid==getOpenedProcessID()and old.module==TLC.mod()and old.flags==TLC.base()and old.source==TLC.HOOKS[name].aa then
   local sig=TLC.HOOKS[name].sig
   assert(TLC.resolveSig(sig)==old.addr and TLC.originalView043(old.addr,TLC.SIGS[sig].bytes),'Attribute hook ownership changed')
   assert(writeBytes(old.addr,old.patch));TLC.hookState[name]=old;retained[name]=nil;return
  end
  retained[name]=nil;on(name);local st=assert(TLC.hookState[name]);st.pid=getOpenedProcessID();st.module=TLC.mod();st.flags=TLC.base();st.source=TLC.HOOKS[name].aa
 end
 function TLC.hookOff(name)
  if not(name=='attributes'or name=='attributeSet')then return off(name)end
  local st=TLC.hookState[name];if not st then return end
  off(name);if st.pid==getOpenedProcessID()and st.module==TLC.mod()then retained[name]=st end
 end
end

-- Verified published-code profiles, used only by the explicit attach/all-off action.
local oldCodeProfiles065=(function()return {[1]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=243,[2]=15,[3]=16,[4]=130,[5]=116,[6]=2,[7]=0,[8]=0,[9]=156,[10]=128,[11]=61,[12]=-1,[13]=-1,[14]=-1,[15]=-1,[16]=0,[17]=15,[18]=132,[19]=14,[20]=0,[21]=0,[22]=0,[23]=243,[24]=15,[25]=16,[26]=5,[27]=-1,[28]=-1,[29]=-1,[30]=-1,[31]=255,[32]=5,[33]=-1,[34]=-1,[35]=-1,[36]=-1,[37]=157,[38]=233,[39]=-1,[40]=-1,[41]=-1,[42]=-1},['constraints']={},['relocations']={[4]={['end']=42,['kind']='siteReturn',['offset']=38},[1]={['add']=5,['symbol']='tlcFlags',['offset']=11,['end']=16,['kind']='rip'},[2]={['add']=164,['symbol']='tlcVars',['offset']=26,['end']=30,['kind']='rip'},[3]={['add']=3376,['symbol']='tlcFlags',['offset']=32,['end']=36,['kind']='rip'}},['sig']='DismantleBase022',['name']='DismantleBase022'},[2]={['padding']={[2]=144,[1]=102},['pattern']={[1]=128,[2]=61,[3]=-1,[4]=-1,[5]=-1,[6]=-1,[7]=0,[8]=15,[9]=132,[10]=3,[11]=0,[12]=0,[13]=0,[14]=176,[15]=1,[16]=195,[17]=64,[18]=85,[19]=83,[20]=86,[21]=87,[22]=65,[23]=85,[24]=233,[25]=-1,[26]=-1,[27]=-1,[28]=-1},['constraints']={},['relocations']={[2]={['end']=28,['kind']='siteReturn',['offset']=24},[1]={['add']=12,['symbol']='tlcFlags',['offset']=2,['end']=7,['kind']='rip'}},['sig']='RepairMaterials',['name']='repairMaterials3'},[3]={['padding']={[1]=144},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=4,[12]=0,[13]=0,[14]=0,[15]=157,[16]=176,[17]=1,[18]=195,[19]=157,[20]=64,[21]=85,[22]=83,[23]=87,[24]=65,[25]=84,[26]=233,[27]=-1,[28]=-1,[29]=-1,[30]=-1},['constraints']={},['relocations']={[2]={['end']=30,['kind']='siteReturn',['offset']=26},[1]={['add']=12,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'}},['sig']='MaterialConsume',['name']='materialConsume2'},[4]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=91,[12]=0,[13]=0,[14]=0,[15]=128,[16]=61,[17]=-1,[18]=-1,[19]=-1,[20]=-1,[21]=0,[22]=15,[23]=133,[24]=78,[25]=0,[26]=0,[27]=0,[28]=72,[29]=59,[30]=13,[31]=-1,[32]=-1,[33]=-1,[34]=-1,[35]=15,[36]=132,[37]=13,[38]=0,[39]=0,[40]=0,[41]=72,[42]=59,[43]=13,[44]=-1,[45]=-1,[46]=-1,[47]=-1,[48]=15,[49]=133,[50]=52,[51]=0,[52]=0,[53]=0,[54]=72,[55]=133,[56]=210,[57]=15,[58]=132,[59]=43,[60]=0,[61]=0,[62]=0,[63]=128,[64]=186,[65]=176,[66]=0,[67]=0,[68]=0,[69]=9,[70]=15,[71]=132,[72]=13,[73]=0,[74]=0,[75]=0,[76]=128,[77]=186,[78]=176,[79]=0,[80]=0,[81]=0,[82]=11,[83]=15,[84]=133,[85]=17,[86]=0,[87]=0,[88]=0,[89]=255,[90]=5,[91]=-1,[92]=-1,[93]=-1,[94]=-1,[95]=157,[96]=65,[97]=139,[98]=192,[99]=65,[100]=94,[101]=95,[102]=94,[103]=91,[104]=93,[105]=195,[106]=157,[107]=72,[108]=139,[109]=236,[110]=72,[111]=131,[112]=236,[113]=96,[114]=233,[115]=-1,[116]=-1,[117]=-1,[118]=-1},['constraints']={},['relocations']={[1]={['add']=11,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=21,['symbol']='tlcFlags',['offset']=16,['end']=21,['kind']='rip'},[3]={['add']=32,['symbol']='tlcPtrs',['offset']=30,['end']=34,['kind']='rip'},[4]={['add']=40,['symbol']='tlcPtrs',['offset']=43,['end']=47,['kind']='rip'},[5]={['add']=88,['symbol']='tlcFlags',['offset']=90,['end']=94,['kind']='rip'},[6]={['end']=118,['kind']='siteReturn',['offset']=114}},['sig']='AmmoReserve',['name']='ammoReserve2'},[5]={['padding']={[1]=144},['pattern']={[1]=156,[2]=80,[3]=82,[4]=65,[5]=80,[6]=65,[7]=81,[8]=65,[9]=82,[10]=65,[11]=83,[12]=128,[13]=61,[14]=-1,[15]=-1,[16]=-1,[17]=-1,[18]=0,[19]=15,[20]=132,[21]=207,[22]=0,[23]=0,[24]=0,[25]=15,[26]=46,[27]=13,[28]=-1,[29]=-1,[30]=-1,[31]=-1,[32]=15,[33]=134,[34]=194,[35]=0,[36]=0,[37]=0,[38]=76,[39]=139,[40]=21,[41]=-1,[42]=-1,[43]=-1,[44]=-1,[45]=77,[46]=133,[47]=210,[48]=15,[49]=132,[50]=178,[51]=0,[52]=0,[53]=0,[54]=72,[55]=139,[56]=129,[57]=168,[58]=0,[59]=0,[60]=0,[61]=72,[62]=133,[63]=192,[64]=15,[65]=132,[66]=162,[67]=0,[68]=0,[69]=0,[70]=72,[71]=169,[72]=7,[73]=0,[74]=0,[75]=0,[76]=15,[77]=133,[78]=150,[79]=0,[80]=0,[81]=0,[82]=76,[83]=139,[84]=136,[85]=184,[86]=1,[87]=0,[88]=0,[89]=65,[90]=187,[91]=64,[92]=0,[93]=0,[94]=0,[95]=77,[96]=133,[97]=201,[98]=15,[99]=132,[100]=128,[101]=0,[102]=0,[103]=0,[104]=73,[105]=247,[106]=193,[107]=7,[108]=0,[109]=0,[110]=0,[111]=15,[112]=133,[113]=115,[114]=0,[115]=0,[116]=0,[117]=73,[118]=139,[119]=65,[120]=32,[121]=72,[122]=133,[123]=192,[124]=15,[125]=132,[126]=49,[127]=0,[128]=0,[129]=0,[130]=72,[131]=169,[132]=7,[133]=0,[134]=0,[135]=0,[136]=15,[137]=133,[138]=90,[139]=0,[140]=0,[141]=0,[142]=72,[143]=139,[144]=80,[145]=16,[146]=65,[147]=184,[148]=32,[149]=0,[150]=0,[151]=0,[152]=72,[153]=133,[154]=210,[155]=15,[156]=132,[157]=18,[158]=0,[159]=0,[160]=0,[161]=76,[162]=57,[163]=210,[164]=15,[165]=132,[166]=26,[167]=0,[168]=0,[169]=0,[170]=72,[171]=139,[172]=82,[173]=64,[174]=65,[175]=255,[176]=200,[177]=117,[178]=229,[179]=77,[180]=139,[181]=137,[182]=208,[183]=0,[184]=0,[185]=0,[186]=65,[187]=255,[188]=203,[189]=117,[190]=160,[191]=233,[192]=36,[193]=0,[194]=0,[195]=0,[196]=255,[197]=5,[198]=-1,[199]=-1,[200]=-1,[201]=-1,[202]=72,[203]=137,[204]=13,[205]=-1,[206]=-1,[207]=-1,[208]=-1,[209]=243,[210]=15,[211]=17,[212]=13,[213]=-1,[214]=-1,[215]=-1,[216]=-1,[217]=65,[218]=91,[219]=65,[220]=90,[221]=65,[222]=89,[223]=65,[224]=88,[225]=90,[226]=88,[227]=157,[228]=15,[229]=87,[230]=192,[231]=195,[232]=65,[233]=91,[234]=65,[235]=90,[236]=65,[237]=89,[238]=65,[239]=88,[240]=90,[241]=88,[242]=157,[243]=64,[244]=83,[245]=72,[246]=131,[247]=236,[248]=64,[249]=233,[250]=-1,[251]=-1,[252]=-1,[253]=-1},['constraints']={},['relocations']={[1]={['add']=0,['symbol']='tlcBoatProtection027Data',['offset']=13,['end']=18,['kind']='rip'},[2]={['add']=32,['symbol']='tlcBoatProtection027Data',['offset']=27,['end']=31,['kind']='rip'},[3]={['add']=8,['symbol']='tlcBoatProtection027Data',['offset']=40,['end']=44,['kind']='rip'},[4]={['add']=4,['symbol']='tlcBoatProtection027Data',['offset']=197,['end']=201,['kind']='rip'},[5]={['add']=16,['symbol']='tlcBoatProtection027Data',['offset']=204,['end']=208,['kind']='rip'},[6]={['add']=24,['symbol']='tlcBoatProtection027Data',['offset']=212,['end']=216,['kind']='rip'},[7]={['end']=253,['kind']='siteReturn',['offset']=249}},['sig']='BoatDamage027',['name']='boatProtection027'},[6]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=13,[12]=0,[13]=0,[14]=0,[15]=157,[16]=128,[17]=61,[18]=-1,[19]=-1,[20]=-1,[21]=-1,[22]=0,[23]=233,[24]=-1,[25]=-1,[26]=-1,[27]=-1,[28]=157,[29]=128,[30]=184,[31]=118,[32]=9,[33]=0,[34]=0,[35]=0,[36]=233,[37]=-1,[38]=-1,[39]=-1,[40]=-1},['constraints']={},['relocations']={[4]={['end']=40,['kind']='siteReturn',['offset']=36},[1]={['add']=6,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=6,['symbol']='tlcFlags',['offset']=17,['end']=22,['kind']='rip'},[3]={['end']=27,['kind']='siteReturn',['offset']=23}},['sig']='FabricatorPowerReady',['name']='fabricatorPowerReady2'},[7]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=65,[3]=128,[4]=190,[5]=106,[6]=1,[7]=0,[8]=0,[9]=0,[10]=15,[11]=132,[12]=11,[13]=0,[14]=0,[15]=0,[16]=255,[17]=5,[18]=-1,[19]=-1,[20]=-1,[21]=-1,[22]=233,[23]=6,[24]=0,[25]=0,[26]=0,[27]=255,[28]=5,[29]=-1,[30]=-1,[31]=-1,[32]=-1,[33]=128,[34]=61,[35]=-1,[36]=-1,[37]=-1,[38]=-1,[39]=0,[40]=15,[41]=132,[42]=5,[43]=0,[44]=0,[45]=0,[46]=187,[47]=1,[48]=0,[49]=0,[50]=0,[51]=157,[52]=73,[53]=141,[54]=142,[55]=240,[56]=1,[57]=0,[58]=0,[59]=233,[60]=-1,[61]=-1,[62]=-1,[63]=-1},['constraints']={},['relocations']={[4]={['end']=63,['kind']='siteReturn',['offset']=59},[1]={['add']=176,['symbol']='tlcFlags',['offset']=17,['end']=21,['kind']='rip'},[2]={['add']=172,['symbol']='tlcFlags',['offset']=28,['end']=32,['kind']='rip'},[3]={['add']=6,['symbol']='tlcFlags',['offset']=34,['end']=39,['kind']='rip'}},['sig']='FabricatorGate',['name']='fabricatorGate2'},[8]={['padding']={[2]=144,[1]=102},['pattern']={[1]=232,[2]=12,[3]=0,[4]=0,[5]=0,[6]=73,[7]=137,[8]=91,[9]=16,[10]=76,[11]=139,[12]=225,[13]=233,[14]=-1,[15]=-1,[16]=-1,[17]=-1,[18]=156,[19]=80,[20]=81,[21]=82,[22]=65,[23]=80,[24]=65,[25]=81,[26]=65,[27]=82,[28]=65,[29]=83,[30]=72,[31]=129,[32]=236,[33]=168,[34]=0,[35]=0,[36]=0,[37]=243,[38]=15,[39]=127,[40]=68,[41]=36,[42]=64,[43]=243,[44]=15,[45]=127,[46]=76,[47]=36,[48]=80,[49]=243,[50]=15,[51]=127,[52]=84,[53]=36,[54]=96,[55]=243,[56]=15,[57]=127,[58]=92,[59]=36,[60]=112,[61]=243,[62]=15,[63]=127,[64]=164,[65]=36,[66]=128,[67]=0,[68]=0,[69]=0,[70]=243,[71]=15,[72]=127,[73]=172,[74]=36,[75]=144,[76]=0,[77]=0,[78]=0,[79]=131,[80]=61,[81]=-1,[82]=-1,[83]=-1,[84]=-1,[85]=1,[86]=15,[87]=133,[88]=167,[89]=2,[90]=0,[91]=0,[92]=255,[93]=21,[94]=-1,[95]=-1,[96]=-1,[97]=-1,[98]=235,[99]=8,[100]=-1,[101]=-1,[102]=-1,[103]=-1,[104]=-1,[105]=-1,[106]=-1,[107]=-1,[108]=59,[109]=5,[110]=-1,[111]=-1,[112]=-1,[113]=-1,[114]=15,[115]=133,[116]=139,[117]=2,[118]=0,[119]=0,[120]=72,[121]=139,[122]=5,[123]=-1,[124]=-1,[125]=-1,[126]=-1,[127]=72,[128]=133,[129]=192,[130]=15,[131]=132,[132]=113,[133]=2,[134]=0,[135]=0,[136]=72,[137]=139,[138]=128,[139]=120,[140]=13,[141]=0,[142]=0,[143]=72,[144]=133,[145]=192,[146]=15,[147]=132,[148]=97,[149]=2,[150]=0,[151]=0,[152]=72,[153]=139,[154]=64,[155]=120,[156]=72,[157]=133,[158]=192,[159]=15,[160]=132,[161]=84,[162]=2,[163]=0,[164]=0,[165]=72,[166]=59,[167]=5,[168]=-1,[169]=-1,[170]=-1,[171]=-1,[172]=15,[173]=133,[174]=71,[175]=2,[176]=0,[177]=0,[178]=247,[179]=64,[180]=8,[181]=0,[182]=128,[183]=1,[184]=0,[185]=15,[186]=133,[187]=58,[188]=2,[189]=0,[190]=0,[191]=139,[192]=13,[193]=-1,[194]=-1,[195]=-1,[196]=-1,[197]=59,[198]=13,[199]=-1,[200]=-1,[201]=-1,[202]=-1,[203]=15,[204]=131,[205]=40,[206]=2,[207]=0,[208]=0,[209]=76,[210]=139,[211]=5,[212]=-1,[213]=-1,[214]=-1,[215]=-1,[216]=139,[217]=209,[218]=193,[219]=233,[220]=16,[221]=129,[222]=226,[223]=255,[224]=255,[225]=0,[226]=0,[227]=77,[228]=139,[229]=4,[230]=200,[231]=77,[232]=133,[233]=192,[234]=15,[235]=132,[236]=9,[237]=2,[238]=0,[239]=0,[240]=72,[241]=107,[242]=210,[243]=24,[244]=74,[245]=57,[246]=68,[247]=2,[248]=8,[249]=15,[250]=133,[251]=250,[252]=1,[253]=0,[254]=0,[255]=66,[256]=247,[257]=68,[258]=2,[259]=4,[260]=0,[261]=0,[262]=32,[263]=16,[264]=15,[265]=133,[266]=235,[267]=1,[268]=0,[269]=0,[270]=139,[271]=13,[272]=-1,[273]=-1,[274]=-1,[275]=-1,[276]=66,[277]=57,[278]=76,[279]=2,[280]=16,[281]=15,[282]=133,[283]=218,[284]=1,[285]=0,[286]=0,[287]=72,[288]=139,[289]=13,[290]=-1,[291]=-1,[292]=-1,[293]=-1,[294]=72,[295]=57,[296]=72,[297]=16,[298]=15,[299]=133,[300]=201,[301]=1,[302]=0,[303]=0,[304]=72,[305]=139,[306]=128,[307]=40,[308]=2,[309]=0,[310]=0,[311]=72,[312]=133,[313]=192,[314]=15,[315]=132,[316]=185,[317]=1,[318]=0,[319]=0,[320]=72,[321]=139,[322]=64,[323]=56,[324]=72,[325]=133,[326]=192,[327]=15,[328]=132,[329]=172,[330]=1,[331]=0,[332]=0,[333]=72,[334]=139,[335]=0,[336]=72,[337]=133,[338]=192,[339]=15,[340]=132,[341]=160,[342]=1,[343]=0,[344]=0,[345]=72,[346]=139,[347]=64,[348]=48,[349]=72,[350]=133,[351]=192,[352]=15,[353]=132,[354]=147,[355]=1,[356]=0,[357]=0,[358]=72,[359]=139,[360]=128,[361]=80,[362]=3,[363]=0,[364]=0,[365]=72,[366]=59,[367]=5,[368]=-1,[369]=-1,[370]=-1,[371]=-1,[372]=15,[373]=133,[374]=127,[375]=1,[376]=0,[377]=0,[378]=139,[379]=13,[380]=-1,[381]=-1,[382]=-1,[383]=-1,[384]=59,[385]=13,[386]=-1,[387]=-1,[388]=-1,[389]=-1,[390]=15,[391]=131,[392]=109,[393]=1,[394]=0,[395]=0,[396]=76,[397]=139,[398]=5,[399]=-1,[400]=-1,[401]=-1,[402]=-1,[403]=139,[404]=209,[405]=193,[406]=233,[407]=16,[408]=129,[409]=226,[410]=255,[411]=255,[412]=0,[413]=0,[414]=77,[415]=139,[416]=4,[417]=200,[418]=72,[419]=107,[420]=210,[421]=24,[422]=74,[423]=57,[424]=68,[425]=2,[426]=8,[427]=15,[428]=133,[429]=72,[430]=1,[431]=0,[432]=0,[433]=139,[434]=13,[435]=-1,[436]=-1,[437]=-1,[438]=-1,[439]=66,[440]=57,[441]=76,[442]=2,[443]=16,[444]=15,[445]=133,[446]=55,[447]=1,[448]=0,[449]=0,[450]=72,[451]=139,[452]=5,[453]=-1,[454]=-1,[455]=-1,[456]=-1,[457]=72,[458]=133,[459]=192,[460]=15,[461]=132,[462]=72,[463]=0,[464]=0,[465]=0,[466]=139,[467]=13,[468]=-1,[469]=-1,[470]=-1,[471]=-1,[472]=59,[473]=13,[474]=-1,[475]=-1,[476]=-1,[477]=-1,[478]=15,[479]=131,[480]=21,[481]=1,[482]=0,[483]=0,[484]=76,[485]=139,[486]=5,[487]=-1,[488]=-1,[489]=-1,[490]=-1,[491]=139,[492]=209,[493]=193,[494]=233,[495]=16,[496]=129,[497]=226,[498]=255,[499]=255,[500]=0,[501]=0,[502]=77,[503]=139,[504]=4,[505]=200,[506]=72,[507]=107,[508]=210,[509]=24,[510]=74,[511]=57,[512]=68,[513]=2,[514]=8,[515]=15,[516]=133,[517]=240,[518]=0,[519]=0,[520]=0,[521]=139,[522]=13,[523]=-1,[524]=-1,[525]=-1,[526]=-1,[527]=66,[528]=57,[529]=76,[530]=2,[531]=16,[532]=15,[533]=133,[534]=223,[535]=0,[536]=0,[537]=0,[538]=72,[539]=139,[540]=5,[541]=-1,[542]=-1,[543]=-1,[544]=-1,[545]=72,[546]=133,[547]=192,[548]=15,[549]=132,[550]=85,[551]=0,[552]=0,[553]=0,[554]=139,[555]=13,[556]=-1,[557]=-1,[558]=-1,[559]=-1,[560]=59,[561]=13,[562]=-1,[563]=-1,[564]=-1,[565]=-1,[566]=15,[567]=131,[568]=189,[569]=0,[570]=0,[571]=0,[572]=76,[573]=139,[574]=5,[575]=-1,[576]=-1,[577]=-1,[578]=-1,[579]=139,[580]=209,[581]=193,[582]=233,[583]=16,[584]=129,[585]=226,[586]=255,[587]=255,[588]=0,[589]=0,[590]=77,[591]=139,[592]=4,[593]=200,[594]=72,[595]=107,[596]=210,[597]=24,[598]=74,[599]=57,[600]=68,[601]=2,[602]=8,[603]=15,[604]=133,[605]=152,[606]=0,[607]=0,[608]=0,[609]=139,[610]=13,[611]=-1,[612]=-1,[613]=-1,[614]=-1,[615]=66,[616]=57,[617]=76,[618]=2,[619]=16,[620]=15,[621]=133,[622]=135,[623]=0,[624]=0,[625]=0,[626]=247,[627]=64,[628]=8,[629]=0,[630]=128,[631]=1,[632]=0,[633]=15,[634]=133,[635]=122,[636]=0,[637]=0,[638]=0,[639]=199,[640]=5,[641]=-1,[642]=-1,[643]=-1,[644]=-1,[645]=2,[646]=0,[647]=0,[648]=0,[649]=72,[650]=139,[651]=13,[652]=-1,[653]=-1,[654]=-1,[655]=-1,[656]=72,[657]=139,[658]=21,[659]=-1,[660]=-1,[661]=-1,[662]=-1,[663]=76,[664]=139,[665]=5,[666]=-1,[667]=-1,[668]=-1,[669]=-1,[670]=76,[671]=139,[672]=13,[673]=-1,[674]=-1,[675]=-1,[676]=-1,[677]=72,[678]=139,[679]=5,[680]=-1,[681]=-1,[682]=-1,[683]=-1,[684]=72,[685]=137,[686]=68,[687]=36,[688]=32,[689]=72,[690]=139,[691]=5,[692]=-1,[693]=-1,[694]=-1,[695]=-1,[696]=72,[697]=137,[698]=68,[699]=36,[700]=40,[701]=243,[702]=15,[703]=126,[704]=13,[705]=-1,[706]=-1,[707]=-1,[708]=-1,[709]=243,[710]=15,[711]=126,[712]=21,[713]=-1,[714]=-1,[715]=-1,[716]=-1,[717]=243,[718]=15,[719]=126,[720]=29,[721]=-1,[722]=-1,[723]=-1,[724]=-1,[725]=255,[726]=21,[727]=-1,[728]=-1,[729]=-1,[730]=-1,[731]=72,[732]=137,[733]=5,[734]=-1,[735]=-1,[736]=-1,[737]=-1,[738]=102,[739]=15,[740]=214,[741]=5,[742]=-1,[743]=-1,[744]=-1,[745]=-1,[746]=199,[747]=5,[748]=-1,[749]=-1,[750]=-1,[751]=-1,[752]=3,[753]=0,[754]=0,[755]=0,[756]=233,[757]=10,[758]=0,[759]=0,[760]=0,[761]=199,[762]=5,[763]=-1,[764]=-1,[765]=-1,[766]=-1,[767]=4,[768]=0,[769]=0,[770]=0,[771]=243,[772]=15,[773]=111,[774]=68,[775]=36,[776]=64,[777]=243,[778]=15,[779]=111,[780]=76,[781]=36,[782]=80,[783]=243,[784]=15,[785]=111,[786]=84,[787]=36,[788]=96,[789]=243,[790]=15,[791]=111,[792]=92,[793]=36,[794]=112,[795]=243,[796]=15,[797]=111,[798]=164,[799]=36,[800]=128,[801]=0,[802]=0,[803]=0,[804]=243,[805]=15,[806]=111,[807]=172,[808]=36,[809]=144,[810]=0,[811]=0,[812]=0,[813]=72,[814]=129,[815]=196,[816]=168,[817]=0,[818]=0,[819]=0,[820]=65,[821]=91,[822]=65,[823]=90,[824]=65,[825]=89,[826]=65,[827]=88,[828]=90,[829]=89,[830]=88,[831]=157,[832]=195},['constraints']={['tlcEngine']={['kind']='globalIdentity'},['tlcObjects']={['kind']='globalIdentity'},['tlcGameThreadId']={['kind']='globalIdentity'}},['relocations']={[1]={['end']=17,['kind']='siteReturn',['offset']=13},[2]={['add']=1280,['symbol']='tlcFlags',['offset']=80,['end']=85,['kind']='rip'},[3]={['add']=0,['symbol']='apiGetCurrentThreadId',['offset']=93,['end']=97,['kind']='rip'},[4]={['kind']='api',['offset']=99},[5]={['add']=0,['symbol']='tlcGameThreadId',['offset']=109,['end']=113,['kind']='rip'},[6]={['add']=0,['symbol']='tlcEngine',['offset']=122,['end']=126,['kind']='rip'},[7]={['add']=1440,['symbol']='tlcFlags',['offset']=167,['end']=171,['kind']='rip'},[8]={['add']=1448,['symbol']='tlcFlags',['offset']=192,['end']=196,['kind']='rip'},[9]={['add']=8,['symbol']='tlcObjects',['offset']=198,['end']=202,['kind']='rip'},[10]={['add']=0,['symbol']='tlcObjects',['offset']=211,['end']=215,['kind']='rip'},[11]={['add']=1452,['symbol']='tlcFlags',['offset']=271,['end']=275,['kind']='rip'},[12]={['add']=1456,['symbol']='tlcFlags',['offset']=289,['end']=293,['kind']='rip'},[13]={['add']=1288,['symbol']='tlcFlags',['offset']=367,['end']=371,['kind']='rip'},[14]={['add']=1296,['symbol']='tlcFlags',['offset']=379,['end']=383,['kind']='rip'},[15]={['add']=8,['symbol']='tlcObjects',['offset']=385,['end']=389,['kind']='rip'},[16]={['add']=0,['symbol']='tlcObjects',['offset']=398,['end']=402,['kind']='rip'},[17]={['add']=1300,['symbol']='tlcFlags',['offset']=434,['end']=438,['kind']='rip'},[18]={['add']=1304,['symbol']='tlcFlags',['offset']=452,['end']=456,['kind']='rip'},[19]={['add']=1312,['symbol']='tlcFlags',['offset']=467,['end']=471,['kind']='rip'},[20]={['add']=8,['symbol']='tlcObjects',['offset']=473,['end']=477,['kind']='rip'},[21]={['add']=0,['symbol']='tlcObjects',['offset']=486,['end']=490,['kind']='rip'},[22]={['add']=1316,['symbol']='tlcFlags',['offset']=522,['end']=526,['kind']='rip'},[23]={['add']=1424,['symbol']='tlcFlags',['offset']=540,['end']=544,['kind']='rip'},[24]={['add']=1432,['symbol']='tlcFlags',['offset']=555,['end']=559,['kind']='rip'},[25]={['add']=8,['symbol']='tlcObjects',['offset']=561,['end']=565,['kind']='rip'},[26]={['add']=0,['symbol']='tlcObjects',['offset']=574,['end']=578,['kind']='rip'},[27]={['add']=1436,['symbol']='tlcFlags',['offset']=610,['end']=614,['kind']='rip'},[28]={['add']=1280,['symbol']='tlcFlags',['offset']=640,['end']=648,['kind']='rip'},[29]={['add']=1328,['symbol']='tlcFlags',['offset']=651,['end']=655,['kind']='rip'},[30]={['add']=1336,['symbol']='tlcFlags',['offset']=658,['end']=662,['kind']='rip'},[31]={['add']=1344,['symbol']='tlcFlags',['offset']=665,['end']=669,['kind']='rip'},[32]={['add']=1352,['symbol']='tlcFlags',['offset']=672,['end']=676,['kind']='rip'},[33]={['add']=1360,['symbol']='tlcFlags',['offset']=679,['end']=683,['kind']='rip'},[34]={['add']=1368,['symbol']='tlcFlags',['offset']=691,['end']=695,['kind']='rip'},[35]={['add']=1384,['symbol']='tlcFlags',['offset']=704,['end']=708,['kind']='rip'},[36]={['add']=1392,['symbol']='tlcFlags',['offset']=712,['end']=716,['kind']='rip'},[37]={['add']=1400,['symbol']='tlcFlags',['offset']=720,['end']=724,['kind']='rip'},[38]={['add']=1320,['symbol']='tlcFlags',['offset']=726,['end']=730,['kind']='rip'},[39]={['add']=1408,['symbol']='tlcFlags',['offset']=733,['end']=737,['kind']='rip'},[40]={['add']=1416,['symbol']='tlcFlags',['offset']=741,['end']=745,['kind']='rip'},[41]={['add']=1280,['symbol']='tlcFlags',['offset']=747,['end']=755,['kind']='rip'},[42]={['add']=1280,['symbol']='tlcFlags',['offset']=762,['end']=770,['kind']='rip'}},['sig']='GameTick',['name']='gameTick'},[9]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=106,[12]=0,[13]=0,[14]=0,[15]=80,[16]=65,[17]=82,[18]=65,[19]=83,[20]=72,[21]=139,[22]=193,[23]=72,[24]=133,[25]=192,[26]=15,[27]=132,[28]=64,[29]=0,[30]=0,[31]=0,[32]=76,[33]=139,[34]=144,[35]=88,[36]=1,[37]=0,[38]=0,[39]=76,[40]=59,[41]=21,[42]=-1,[43]=-1,[44]=-1,[45]=-1,[46]=15,[47]=133,[48]=44,[49]=0,[50]=0,[51]=0,[52]=72,[53]=139,[54]=64,[55]=16,[56]=76,[57]=139,[58]=21,[59]=-1,[60]=-1,[61]=-1,[62]=-1,[63]=65,[64]=187,[65]=64,[66]=0,[67]=0,[68]=0,[69]=76,[70]=57,[71]=208,[72]=15,[73]=132,[74]=28,[75]=0,[76]=0,[77]=0,[78]=72,[79]=133,[80]=192,[81]=15,[82]=132,[83]=9,[84]=0,[85]=0,[86]=0,[87]=72,[88]=139,[89]=64,[90]=64,[91]=65,[92]=255,[93]=203,[94]=117,[95]=229,[96]=65,[97]=91,[98]=65,[99]=90,[100]=88,[101]=233,[102]=15,[103]=0,[104]=0,[105]=0,[106]=255,[107]=5,[108]=-1,[109]=-1,[110]=-1,[111]=-1,[112]=65,[113]=91,[114]=65,[115]=90,[116]=88,[117]=157,[118]=176,[119]=1,[120]=195,[121]=157,[122]=76,[123]=139,[124]=220,[125]=85,[126]=86,[127]=233,[128]=-1,[129]=-1,[130]=-1,[131]=-1},['constraints']={['tlcWeaponClassSlot']={['kind']='classPointer'}},['relocations']={[1]={['add']=11,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=0,['symbol']='tlcPtrs',['offset']=41,['end']=45,['kind']='rip'},[3]={['add']=0,['symbol']='tlcWeaponClassSlot',['offset']=58,['end']=62,['kind']='rip'},[4]={['add']=84,['symbol']='tlcFlags',['offset']=107,['end']=111,['kind']='rip'},[5]={['end']=131,['kind']='siteReturn',['offset']=127}},['sig']='WeaponItemConsume',['name']='weaponItemConsume2'},[10]={['padding']={[4]=0,[1]=15,[2]=31,[3]=64},['pattern']={[1]=156,[2]=80,[3]=81,[4]=82,[5]=65,[6]=80,[7]=128,[8]=61,[9]=-1,[10]=-1,[11]=-1,[12]=-1,[13]=0,[14]=15,[15]=132,[16]=94,[17]=0,[18]=0,[19]=0,[20]=72,[21]=131,[22]=61,[23]=-1,[24]=-1,[25]=-1,[26]=-1,[27]=0,[28]=15,[29]=132,[30]=80,[31]=0,[32]=0,[33]=0,[34]=76,[35]=139,[36]=68,[37]=59,[38]=16,[39]=72,[40]=141,[41]=21,[42]=-1,[43]=-1,[44]=-1,[45]=-1,[46]=185,[47]=0,[48]=1,[49]=0,[50]=0,[51]=76,[52]=57,[53]=2,[54]=15,[55]=132,[56]=13,[57]=0,[58]=0,[59]=0,[60]=72,[61]=131,[62]=194,[63]=24,[64]=255,[65]=201,[66]=117,[67]=239,[68]=233,[69]=21,[70]=0,[71]=0,[72]=0,[73]=65,[74]=139,[75]=64,[76]=12,[77]=57,[78]=66,[79]=8,[80]=15,[81]=133,[82]=8,[83]=0,[84]=0,[85]=0,[86]=139,[87]=66,[88]=12,[89]=233,[90]=2,[91]=0,[92]=0,[93]=0,[94]=49,[95]=192,[96]=59,[97]=5,[98]=-1,[99]=-1,[100]=-1,[101]=-1,[102]=15,[103]=131,[104]=6,[105]=0,[106]=0,[107]=0,[108]=137,[109]=5,[110]=-1,[111]=-1,[112]=-1,[113]=-1,[114]=65,[115]=88,[116]=90,[117]=89,[118]=88,[119]=157,[120]=139,[121]=68,[122]=36,[123]=92,[124]=72,[125]=141,[126]=76,[127]=36,[128]=88,[129]=233,[130]=-1,[131]=-1,[132]=-1,[133]=-1},['constraints']={},['relocations']={[1]={['add']=5,['symbol']='tlcFlags',['offset']=8,['end']=13,['kind']='rip'},[2]={['add']=8,['symbol']='tlc_instant_gate045',['offset']=22,['end']=27,['kind']='rip'},[3]={['add']=5152,['symbol']='tlc_instant_gate045',['offset']=41,['end']=45,['kind']='rip'},[4]={['add']=24,['symbol']='tlc_instant_gate045',['offset']=97,['end']=101,['kind']='rip'},[5]={['add']=24,['symbol']='tlc_instant_gate045',['offset']=109,['end']=113,['kind']='rip'},[6]={['end']=133,['kind']='siteReturn',['offset']=129}},['sig']='QuestObserved045',['name']='questObserved045'},[11]={['padding']={[1]=15,[2]=31,[3]=128,[4]=0,[5]=0,[6]=0,[7]=0},['pattern']={[1]=156,[2]=80,[3]=72,[4]=139,[5]=5,[6]=-1,[7]=-1,[8]=-1,[9]=-1,[10]=72,[11]=133,[12]=192,[13]=15,[14]=132,[15]=55,[16]=0,[17]=0,[18]=0,[19]=72,[20]=57,[21]=5,[22]=-1,[23]=-1,[24]=-1,[25]=-1,[26]=15,[27]=133,[28]=42,[29]=0,[30]=0,[31]=0,[32]=128,[33]=61,[34]=-1,[35]=-1,[36]=-1,[37]=-1,[38]=0,[39]=15,[40]=132,[41]=29,[42]=0,[43]=0,[44]=0,[45]=139,[46]=5,[47]=-1,[48]=-1,[49]=-1,[50]=-1,[51]=61,[52]=255,[53]=255,[54]=255,[55]=255,[56]=15,[57]=133,[58]=6,[59]=0,[60]=0,[61]=0,[62]=139,[63]=5,[64]=-1,[65]=-1,[66]=-1,[67]=-1,[68]=137,[69]=5,[70]=-1,[71]=-1,[72]=-1,[73]=-1,[74]=72,[75]=199,[76]=5,[77]=-1,[78]=-1,[79]=-1,[80]=-1,[81]=0,[82]=0,[83]=0,[84]=0,[85]=88,[86]=157,[87]=72,[88]=139,[89]=77,[90]=192,[91]=15,[92]=40,[93]=180,[94]=36,[95]=224,[96]=0,[97]=0,[98]=0,[99]=233,[100]=-1,[101]=-1,[102]=-1,[103]=-1},['constraints']={},['relocations']={[8]={['end']=103,['kind']='siteReturn',['offset']=99},[1]={['add']=8,['symbol']='tlc_instant_gate045',['offset']=5,['end']=9,['kind']='rip'},[2]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=21,['end']=25,['kind']='rip'},[3]={['add']=5,['symbol']='tlcFlags',['offset']=33,['end']=38,['kind']='rip'},[4]={['add']=24,['symbol']='tlc_instant_gate045',['offset']=46,['end']=50,['kind']='rip'},[5]={['add']=16,['symbol']='tlc_instant_gate045',['offset']=63,['end']=67,['kind']='rip'},[6]={['add']=20,['symbol']='tlc_instant_gate045',['offset']=69,['end']=73,['kind']='rip'},[7]={['add']=8,['symbol']='tlc_instant_gate045',['offset']=76,['end']=84,['kind']='rip'}},['sig']='QuestEnd045',['name']='questEnd045'},[12]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=12,[12]=0,[13]=0,[14]=0,[15]=65,[16]=180,[17]=1,[18]=242,[19]=68,[20]=15,[21]=16,[22]=5,[23]=-1,[24]=-1,[25]=-1,[26]=-1,[27]=80,[28]=81,[29]=82,[30]=65,[31]=80,[32]=65,[33]=81,[34]=65,[35]=82,[36]=65,[37]=83,[38]=72,[39]=131,[40]=236,[41]=16,[42]=128,[43]=61,[44]=-1,[45]=-1,[46]=-1,[47]=-1,[48]=0,[49]=15,[50]=132,[51]=57,[52]=2,[53]=0,[54]=0,[55]=69,[56]=132,[57]=228,[58]=15,[59]=132,[60]=48,[61]=2,[62]=0,[63]=0,[64]=72,[65]=131,[66]=61,[67]=-1,[68]=-1,[69]=-1,[70]=-1,[71]=0,[72]=15,[73]=132,[74]=34,[75]=2,[76]=0,[77]=0,[78]=139,[79]=21,[80]=-1,[81]=-1,[82]=-1,[83]=-1,[84]=247,[85]=194,[86]=1,[87]=0,[88]=0,[89]=0,[90]=15,[91]=133,[92]=16,[93]=2,[94]=0,[95]=0,[96]=137,[97]=20,[98]=36,[99]=65,[100]=131,[101]=190,[102]=232,[103]=1,[104]=0,[105]=0,[106]=0,[107]=15,[108]=142,[109]=255,[110]=1,[111]=0,[112]=0,[113]=77,[114]=139,[115]=134,[116]=224,[117]=1,[118]=0,[119]=0,[120]=77,[121]=133,[122]=192,[123]=15,[124]=132,[125]=239,[126]=1,[127]=0,[128]=0,[129]=69,[130]=139,[131]=88,[132]=16,[133]=77,[134]=139,[135]=0,[136]=77,[137]=133,[138]=192,[139]=15,[140]=132,[141]=223,[142]=1,[143]=0,[144]=0,[145]=65,[146]=139,[147]=134,[148]=116,[149]=1,[150]=0,[151]=0,[152]=133,[153]=192,[154]=15,[155]=142,[156]=208,[157]=1,[158]=0,[159]=0,[160]=69,[161]=139,[162]=142,[163]=120,[164]=1,[165]=0,[166]=0,[167]=65,[168]=129,[169]=249,[170]=0,[171]=0,[172]=128,[173]=127,[174]=15,[175]=131,[176]=188,[177]=1,[178]=0,[179]=0,[180]=69,[181]=133,[182]=201,[183]=15,[184]=142,[185]=179,[186]=1,[187]=0,[188]=0,[189]=72,[190]=139,[191]=21,[192]=-1,[193]=-1,[194]=-1,[195]=-1,[196]=76,[197]=139,[198]=146,[199]=216,[200]=0,[201]=0,[202]=0,[203]=76,[204]=57,[205]=21,[206]=-1,[207]=-1,[208]=-1,[209]=-1,[210]=15,[211]=133,[212]=152,[213]=1,[214]=0,[215]=0,[216]=139,[217]=138,[218]=224,[219]=0,[220]=0,[221]=0,[222]=57,[223]=13,[224]=-1,[225]=-1,[226]=-1,[227]=-1,[228]=15,[229]=133,[230]=134,[231]=1,[232]=0,[233]=0,[234]=129,[235]=249,[236]=0,[237]=1,[238]=0,[239]=0,[240]=15,[241]=135,[242]=122,[243]=1,[244]=0,[245]=0,[246]=49,[247]=192,[248]=133,[249]=201,[250]=15,[251]=132,[252]=31,[253]=0,[254]=0,[255]=0,[256]=72,[257]=141,[258]=21,[259]=-1,[260]=-1,[261]=-1,[262]=-1,[263]=77,[264]=139,[265]=74,[266]=16,[267]=76,[268]=57,[269]=12,[270]=194,[271]=15,[272]=133,[273]=91,[274]=1,[275]=0,[276]=0,[277]=73,[278]=131,[279]=194,[280]=32,[281]=255,[282]=192,[283]=57,[284]=200,[285]=114,[286]=232,[287]=139,[288]=13,[289]=-1,[290]=-1,[291]=-1,[292]=-1,[293]=129,[294]=249,[295]=128,[296]=0,[297]=0,[298]=0,[299]=15,[300]=135,[301]=63,[302]=1,[303]=0,[304]=0,[305]=133,[306]=201,[307]=15,[308]=132,[309]=243,[310]=0,[311]=0,[312]=0,[313]=76,[314]=141,[315]=21,[316]=-1,[317]=-1,[318]=-1,[319]=-1,[320]=65,[321]=131,[322]=122,[323]=8,[324]=0,[325]=15,[326]=132,[327]=21,[328]=0,[329]=0,[330]=0,[331]=77,[332]=139,[333]=136,[334]=184,[335]=0,[336]=0,[337]=0,[338]=77,[339]=57,[340]=10,[341]=15,[342]=132,[343]=27,[344]=0,[345]=0,[346]=0,[347]=233,[348]=9,[349]=0,[350]=0,[351]=0,[352]=77,[353]=57,[354]=2,[355]=15,[356]=132,[357]=13,[358]=0,[359]=0,[360]=0,[361]=73,[362]=131,[363]=194,[364]=16,[365]=255,[366]=201,[367]=117,[368]=207,[369]=233,[370]=182,[371]=0,[372]=0,[373]=0,[374]=65,[375]=139,[376]=134,[377]=116,[378]=1,[379]=0,[380]=0,[381]=69,[382]=139,[383]=142,[384]=120,[385]=1,[386]=0,[387]=0,[388]=76,[389]=141,[390]=21,[391]=-1,[392]=-1,[393]=-1,[394]=-1,[395]=185,[396]=128,[397]=0,[398]=0,[399]=0,[400]=73,[401]=131,[402]=58,[403]=0,[404]=15,[405]=132,[406]=22,[407]=0,[408]=0,[409]=0,[410]=77,[411]=57,[412]=50,[413]=15,[414]=132,[415]=65,[416]=0,[417]=0,[418]=0,[419]=73,[420]=131,[421]=194,[422]=40,[423]=255,[424]=201,[425]=117,[426]=229,[427]=233,[428]=192,[429]=0,[430]=0,[431]=0,[432]=77,[433]=137,[434]=50,[435]=65,[436]=139,[437]=150,[438]=76,[439]=255,[440]=255,[441]=255,[442]=65,[443]=137,[444]=82,[445]=8,[446]=65,[447]=139,[448]=150,[449]=108,[450]=1,[451]=0,[452]=0,[453]=65,[454]=137,[455]=82,[456]=12,[457]=77,[458]=137,[459]=66,[460]=16,[461]=69,[462]=137,[463]=74,[464]=24,[465]=69,[466]=137,[467]=90,[468]=32,[469]=139,[470]=21,[471]=-1,[472]=-1,[473]=-1,[474]=-1,[475]=65,[476]=137,[477]=82,[478]=28,[479]=233,[480]=140,[481]=0,[482]=0,[483]=0,[484]=65,[485]=139,[486]=150,[487]=76,[488]=255,[489]=255,[490]=255,[491]=65,[492]=57,[493]=82,[494]=8,[495]=117,[496]=194,[497]=65,[498]=139,[499]=150,[500]=108,[501]=1,[502]=0,[503]=0,[504]=65,[505]=57,[506]=82,[507]=12,[508]=117,[509]=181,[510]=77,[511]=57,[512]=66,[513]=16,[514]=117,[515]=175,[516]=69,[517]=57,[518]=74,[519]=24,[520]=117,[521]=169,[522]=69,[523]=57,[524]=90,[525]=32,[526]=117,[527]=163,[528]=139,[529]=21,[530]=-1,[531]=-1,[532]=-1,[533]=-1,[534]=65,[535]=43,[536]=82,[537]=28,[538]=131,[539]=250,[540]=1,[541]=15,[542]=140,[543]=77,[544]=0,[545]=0,[546]=0,[547]=68,[548]=57,[549]=200,[550]=15,[551]=131,[552]=68,[553]=0,[554]=0,[555]=0,[556]=139,[557]=20,[558]=36,[559]=59,[560]=21,[561]=-1,[562]=-1,[563]=-1,[564]=-1,[565]=15,[566]=133,[567]=53,[568]=0,[569]=0,[570]=0,[571]=65,[572]=139,[573]=134,[574]=116,[575]=1,[576]=0,[577]=0,[578]=102,[579]=68,[580]=15,[581]=126,[582]=250,[583]=133,[584]=210,[585]=15,[586]=142,[587]=33,[588]=0,[589]=0,[590]=0,[591]=129,[592]=250,[593]=0,[594]=0,[595]=128,[596]=127,[597]=15,[598]=131,[599]=21,[600]=0,[601]=0,[602]=0,[603]=57,[604]=208,[605]=15,[606]=134,[607]=13,[608]=0,[609]=0,[610]=0,[611]=65,[612]=137,[613]=150,[614]=116,[615]=1,[616]=0,[617]=0,[618]=255,[619]=5,[620]=-1,[621]=-1,[622]=-1,[623]=-1,[624]=72,[625]=131,[626]=196,[627]=16,[628]=65,[629]=91,[630]=65,[631]=90,[632]=65,[633]=89,[634]=65,[635]=88,[636]=90,[637]=89,[638]=88,[639]=157,[640]=69,[641]=132,[642]=228,[643]=15,[644]=132,[645]=5,[646]=0,[647]=0,[648]=0,[649]=233,[650]=-1,[651]=-1,[652]=-1,[653]=-1,[654]=233,[655]=-1,[656]=-1,[657]=-1,[658]=-1},['constraints']={},['relocations']={[1]={['add']=12,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=88,['symbol']='tlcVars',['offset']=22,['end']=26,['kind']='rip'},[3]={['add']=5,['symbol']='tlcFlags',['offset']=43,['end']=48,['kind']='rip'},[4]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=66,['end']=71,['kind']='rip'},[5]={['add']=28,['symbol']='tlc_instant_gate045',['offset']=79,['end']=83,['kind']='rip'},[6]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=191,['end']=195,['kind']='rip'},[7]={['add']=11296,['symbol']='tlc_instant_gate045',['offset']=205,['end']=209,['kind']='rip'},[8]={['add']=11304,['symbol']='tlc_instant_gate045',['offset']=223,['end']=227,['kind']='rip'},[9]={['add']=13360,['symbol']='tlc_instant_gate045',['offset']=258,['end']=262,['kind']='rip'},[10]={['add']=11308,['symbol']='tlc_instant_gate045',['offset']=288,['end']=292,['kind']='rip'},[11]={['add']=11312,['symbol']='tlc_instant_gate045',['offset']=315,['end']=319,['kind']='rip'},[12]={['add']=32,['symbol']='tlc_instant_gate045',['offset']=390,['end']=394,['kind']='rip'},[13]={['add']=16,['symbol']='tlc_instant_gate045',['offset']=470,['end']=474,['kind']='rip'},[14]={['add']=20,['symbol']='tlc_instant_gate045',['offset']=529,['end']=533,['kind']='rip'},[15]={['add']=28,['symbol']='tlc_instant_gate045',['offset']=560,['end']=564,['kind']='rip'},[16]={['add']=100,['symbol']='tlcFlags',['offset']=619,['end']=623,['kind']='rip'},[17]={['end']=653,['kind']='siteReturn',['offset']=649},[18]={['targetOffset']=16,['pattern']={[32]=148,[1]=15,[2]=92,[3]=218,[4]=243,[5]=15,[6]=17,[7]=68,[8]=36,[9]=32,[10]=51,[11]=210,[12]=232,[13]=100,[14]=167,[15]=253,[16]=255,[17]=72,[18]=139,[19]=77,[20]=224,[21]=68,[22]=137,[23]=109,[24]=232,[25]=72,[26]=133,[27]=201,[28]=116,[29]=5,[30]=232,[31]=178},['offset']=654,['end']=658,['kind']='scopedTarget'}},['sig']='FabricationFree049',['name']='fabricationFree049'},[13]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=3,[12]=0,[13]=0,[14]=0,[15]=15,[16]=87,[17]=246,[18]=157,[19]=187,[20]=255,[21]=255,[22]=255,[23]=255,[24]=233,[25]=-1,[26]=-1,[27]=-1,[28]=-1},['constraints']={},['relocations']={[2]={['end']=28,['kind']='siteReturn',['offset']=24},[1]={['add']=6,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'}},['sig']='FabricatorPowerUse',['name']='fabricatorPowerUse2'},[14]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=80,[3]=81,[4]=82,[5]=65,[6]=80,[7]=65,[8]=81,[9]=65,[10]=82,[11]=65,[12]=83,[13]=72,[14]=131,[15]=236,[16]=16,[17]=128,[18]=61,[19]=-1,[20]=-1,[21]=-1,[22]=-1,[23]=0,[24]=15,[25]=132,[26]=29,[27]=1,[28]=0,[29]=0,[30]=72,[31]=131,[32]=61,[33]=-1,[34]=-1,[35]=-1,[36]=-1,[37]=0,[38]=15,[39]=132,[40]=15,[41]=1,[42]=0,[43]=0,[44]=139,[45]=21,[46]=-1,[47]=-1,[48]=-1,[49]=-1,[50]=247,[51]=194,[52]=1,[53]=0,[54]=0,[55]=0,[56]=15,[57]=133,[58]=253,[59]=0,[60]=0,[61]=0,[62]=137,[63]=20,[64]=36,[65]=131,[66]=187,[67]=168,[68]=2,[69]=0,[70]=0,[71]=0,[72]=15,[73]=142,[74]=237,[75]=0,[76]=0,[77]=0,[78]=76,[79]=139,[80]=131,[81]=160,[82]=2,[83]=0,[84]=0,[85]=77,[86]=133,[87]=192,[88]=15,[89]=132,[90]=221,[91]=0,[92]=0,[93]=0,[94]=77,[95]=139,[96]=0,[97]=77,[98]=133,[99]=192,[100]=15,[101]=132,[102]=209,[103]=0,[104]=0,[105]=0,[106]=72,[107]=139,[108]=21,[109]=-1,[110]=-1,[111]=-1,[112]=-1,[113]=76,[114]=139,[115]=146,[116]=216,[117]=0,[118]=0,[119]=0,[120]=76,[121]=57,[122]=21,[123]=-1,[124]=-1,[125]=-1,[126]=-1,[127]=15,[128]=133,[129]=182,[130]=0,[131]=0,[132]=0,[133]=139,[134]=138,[135]=224,[136]=0,[137]=0,[138]=0,[139]=57,[140]=13,[141]=-1,[142]=-1,[143]=-1,[144]=-1,[145]=15,[146]=133,[147]=164,[148]=0,[149]=0,[150]=0,[151]=129,[152]=249,[153]=0,[154]=1,[155]=0,[156]=0,[157]=15,[158]=135,[159]=152,[160]=0,[161]=0,[162]=0,[163]=49,[164]=192,[165]=133,[166]=201,[167]=15,[168]=132,[169]=31,[170]=0,[171]=0,[172]=0,[173]=72,[174]=141,[175]=21,[176]=-1,[177]=-1,[178]=-1,[179]=-1,[180]=77,[181]=139,[182]=74,[183]=16,[184]=76,[185]=57,[186]=12,[187]=194,[188]=15,[189]=133,[190]=121,[191]=0,[192]=0,[193]=0,[194]=73,[195]=131,[196]=194,[197]=32,[198]=255,[199]=192,[200]=57,[201]=200,[202]=114,[203]=232,[204]=139,[205]=13,[206]=-1,[207]=-1,[208]=-1,[209]=-1,[210]=129,[211]=249,[212]=128,[213]=0,[214]=0,[215]=0,[216]=15,[217]=135,[218]=93,[219]=0,[220]=0,[221]=0,[222]=133,[223]=201,[224]=15,[225]=132,[226]=56,[227]=0,[228]=0,[229]=0,[230]=76,[231]=141,[232]=21,[233]=-1,[234]=-1,[235]=-1,[236]=-1,[237]=65,[238]=131,[239]=122,[240]=8,[241]=0,[242]=15,[243]=132,[244]=21,[245]=0,[246]=0,[247]=0,[248]=77,[249]=139,[250]=136,[251]=184,[252]=0,[253]=0,[254]=0,[255]=77,[256]=57,[257]=10,[258]=15,[259]=132,[260]=51,[261]=0,[262]=0,[263]=0,[264]=233,[265]=9,[266]=0,[267]=0,[268]=0,[269]=77,[270]=57,[271]=2,[272]=15,[273]=132,[274]=37,[275]=0,[276]=0,[277]=0,[278]=73,[279]=131,[280]=194,[281]=16,[282]=255,[283]=201,[284]=117,[285]=207,[286]=139,[287]=20,[288]=36,[289]=59,[290]=21,[291]=-1,[292]=-1,[293]=-1,[294]=-1,[295]=15,[296]=133,[297]=14,[298]=0,[299]=0,[300]=0,[301]=243,[302]=15,[303]=16,[304]=5,[305]=-1,[306]=-1,[307]=-1,[308]=-1,[309]=255,[310]=5,[311]=-1,[312]=-1,[313]=-1,[314]=-1,[315]=72,[316]=131,[317]=196,[318]=16,[319]=65,[320]=91,[321]=65,[322]=90,[323]=65,[324]=89,[325]=65,[326]=88,[327]=90,[328]=89,[329]=88,[330]=157,[331]=72,[332]=141,[333]=187,[334]=80,[335]=2,[336]=0,[337]=0,[338]=233,[339]=-1,[340]=-1,[341]=-1,[342]=-1},['constraints']={},['relocations']={[1]={['add']=5,['symbol']='tlcFlags',['offset']=18,['end']=23,['kind']='rip'},[2]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=32,['end']=37,['kind']='rip'},[3]={['add']=28,['symbol']='tlc_instant_gate045',['offset']=45,['end']=49,['kind']='rip'},[4]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=108,['end']=112,['kind']='rip'},[5]={['add']=11296,['symbol']='tlc_instant_gate045',['offset']=122,['end']=126,['kind']='rip'},[6]={['add']=11304,['symbol']='tlc_instant_gate045',['offset']=140,['end']=144,['kind']='rip'},[7]={['add']=13360,['symbol']='tlc_instant_gate045',['offset']=175,['end']=179,['kind']='rip'},[8]={['add']=11308,['symbol']='tlc_instant_gate045',['offset']=205,['end']=209,['kind']='rip'},[9]={['add']=11312,['symbol']='tlc_instant_gate045',['offset']=232,['end']=236,['kind']='rip'},[10]={['add']=28,['symbol']='tlc_instant_gate045',['offset']=290,['end']=294,['kind']='rip'},[11]={['add']=72,['symbol']='tlcVars',['offset']=304,['end']=308,['kind']='rip'},[12]={['add']=72,['symbol']='tlcFlags',['offset']=310,['end']=314,['kind']='rip'},[13]={['end']=342,['kind']='siteReturn',['offset']=338}},['sig']='FabricationDuration',['name']='instantDuration049'},[15]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=243,[2]=15,[3]=16,[4]=179,[5]=116,[6]=2,[7]=0,[8]=0,[9]=156,[10]=128,[11]=61,[12]=-1,[13]=-1,[14]=-1,[15]=-1,[16]=0,[17]=15,[18]=132,[19]=14,[20]=0,[21]=0,[22]=0,[23]=243,[24]=15,[25]=16,[26]=53,[27]=-1,[28]=-1,[29]=-1,[30]=-1,[31]=255,[32]=5,[33]=-1,[34]=-1,[35]=-1,[36]=-1,[37]=157,[38]=233,[39]=-1,[40]=-1,[41]=-1,[42]=-1},['constraints']={},['relocations']={[4]={['end']=42,['kind']='siteReturn',['offset']=38},[1]={['add']=5,['symbol']='tlcFlags',['offset']=11,['end']=16,['kind']='rip'},[2]={['add']=164,['symbol']='tlcVars',['offset']=26,['end']=30,['kind']='rip'},[3]={['add']=3376,['symbol']='tlcFlags',['offset']=32,['end']=36,['kind']='rip'}},['sig']='DismantleItem022',['name']='DismantleItem022'},[16]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=80,[3]=82,[4]=65,[5]=80,[6]=65,[7]=81,[8]=65,[9]=82,[10]=65,[11]=83,[12]=128,[13]=61,[14]=-1,[15]=-1,[16]=-1,[17]=-1,[18]=0,[19]=15,[20]=132,[21]=21,[22]=1,[23]=0,[24]=0,[25]=65,[26]=128,[27]=249,[28]=1,[29]=15,[30]=135,[31]=11,[32]=1,[33]=0,[34]=0,[35]=64,[36]=128,[37]=255,[38]=0,[39]=15,[40]=132,[41]=30,[42]=0,[43]=0,[44]=0,[45]=64,[46]=128,[47]=255,[48]=1,[49]=15,[50]=132,[51]=20,[52]=0,[53]=0,[54]=0,[55]=64,[56]=128,[57]=255,[58]=2,[59]=15,[60]=132,[61]=10,[62]=0,[63]=0,[64]=0,[65]=64,[66]=128,[67]=255,[68]=16,[69]=15,[70]=133,[71]=227,[72]=0,[73]=0,[74]=0,[75]=76,[76]=139,[77]=21,[78]=-1,[79]=-1,[80]=-1,[81]=-1,[82]=77,[83]=133,[84]=210,[85]=15,[86]=132,[87]=211,[88]=0,[89]=0,[90]=0,[91]=72,[92]=131,[93]=61,[94]=-1,[95]=-1,[96]=-1,[97]=-1,[98]=0,[99]=15,[100]=132,[101]=197,[102]=0,[103]=0,[104]=0,[105]=72,[106]=139,[107]=134,[108]=168,[109]=0,[110]=0,[111]=0,[112]=72,[113]=133,[114]=192,[115]=15,[116]=132,[117]=181,[118]=0,[119]=0,[120]=0,[121]=72,[122]=139,[123]=80,[124]=16,[125]=65,[126]=184,[127]=64,[128]=0,[129]=0,[130]=0,[131]=72,[132]=133,[133]=210,[134]=15,[135]=132,[136]=162,[137]=0,[138]=0,[139]=0,[140]=76,[141]=57,[142]=210,[143]=15,[144]=132,[145]=129,[146]=0,[147]=0,[148]=0,[149]=72,[150]=59,[151]=21,[152]=-1,[153]=-1,[154]=-1,[155]=-1,[156]=15,[157]=132,[158]=27,[159]=0,[160]=0,[161]=0,[162]=72,[163]=59,[164]=21,[165]=-1,[166]=-1,[167]=-1,[168]=-1,[169]=15,[170]=132,[171]=14,[172]=0,[173]=0,[174]=0,[175]=72,[176]=139,[177]=82,[178]=64,[179]=65,[180]=255,[181]=200,[182]=117,[183]=203,[184]=233,[185]=113,[186]=0,[187]=0,[188]=0,[189]=76,[190]=139,[191]=152,[192]=184,[193]=1,[194]=0,[195]=0,[196]=65,[197]=185,[198]=64,[199]=0,[200]=0,[201]=0,[202]=77,[203]=133,[204]=219,[205]=15,[206]=132,[207]=91,[208]=0,[209]=0,[210]=0,[211]=73,[212]=139,[213]=67,[214]=32,[215]=72,[216]=133,[217]=192,[218]=15,[219]=132,[220]=37,[221]=0,[222]=0,[223]=0,[224]=72,[225]=139,[226]=80,[227]=16,[228]=65,[229]=184,[230]=64,[231]=0,[232]=0,[233]=0,[234]=72,[235]=133,[236]=210,[237]=15,[238]=132,[239]=18,[240]=0,[241]=0,[242]=0,[243]=76,[244]=57,[245]=210,[246]=15,[247]=132,[248]=26,[249]=0,[250]=0,[251]=0,[252]=72,[253]=139,[254]=82,[255]=64,[256]=65,[257]=255,[258]=200,[259]=117,[260]=229,[261]=77,[262]=139,[263]=155,[264]=208,[265]=0,[266]=0,[267]=0,[268]=65,[269]=255,[270]=201,[271]=117,[272]=185,[273]=233,[274]=24,[275]=0,[276]=0,[277]=0,[278]=255,[279]=5,[280]=-1,[281]=-1,[282]=-1,[283]=-1,[284]=65,[285]=91,[286]=65,[287]=90,[288]=65,[289]=89,[290]=65,[291]=88,[292]=90,[293]=88,[294]=157,[295]=176,[296]=1,[297]=233,[298]=-1,[299]=-1,[300]=-1,[301]=-1,[302]=65,[303]=91,[304]=65,[305]=90,[306]=65,[307]=89,[308]=65,[309]=88,[310]=90,[311]=88,[312]=157,[313]=128,[314]=190,[315]=106,[316]=1,[317]=0,[318]=0,[319]=0,[320]=233,[321]=-1,[322]=-1,[323]=-1,[324]=-1},['constraints']={},['relocations']={[8]={['end']=324,['kind']='siteReturn',['offset']=320},[1]={['add']=8,['symbol']='tlcFlags',['offset']=13,['end']=18,['kind']='rip'},[2]={['add']=0,['symbol']='tlc_fuelStorage062Data',['offset']=77,['end']=81,['kind']='rip'},[3]={['add']=8,['symbol']='tlc_fuelStorage062Data',['offset']=93,['end']=98,['kind']='rip'},[4]={['add']=8,['symbol']='tlc_fuelStorage062Data',['offset']=151,['end']=155,['kind']='rip'},[5]={['add']=24,['symbol']='tlc_fuelStorage062Data',['offset']=164,['end']=168,['kind']='rip'},[6]={['add']=16,['symbol']='tlc_fuelStorage062Data',['offset']=279,['end']=283,['kind']='rip'},[7]={['targetOffset']=16,['pattern']={[32]=72,[1]=99,[2]=3,[3]=115,[4]=33,[5]=102,[6]=15,[7]=47,[8]=13,[9]=12,[10]=191,[11]=100,[12]=3,[13]=118,[14]=33,[15]=50,[16]=192,[17]=72,[18]=139,[19]=92,[20]=36,[21]=64,[22]=72,[23]=139,[24]=116,[25]=36,[26]=80,[27]=15,[28]=40,[29]=116,[30]=36,[31]=32},['offset']=297,['end']=301,['kind']='scopedTarget'}},['sig']='FuelStorage062',['name']='fuelStorage062'},[17]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=12,[12]=0,[13]=0,[14]=0,[15]=65,[16]=180,[17]=1,[18]=242,[19]=68,[20]=15,[21]=16,[22]=5,[23]=-1,[24]=-1,[25]=-1,[26]=-1,[27]=80,[28]=81,[29]=82,[30]=65,[31]=80,[32]=65,[33]=81,[34]=65,[35]=82,[36]=65,[37]=83,[38]=72,[39]=131,[40]=236,[41]=16,[42]=128,[43]=61,[44]=-1,[45]=-1,[46]=-1,[47]=-1,[48]=0,[49]=15,[50]=132,[51]=57,[52]=2,[53]=0,[54]=0,[55]=69,[56]=132,[57]=228,[58]=15,[59]=132,[60]=48,[61]=2,[62]=0,[63]=0,[64]=72,[65]=131,[66]=61,[67]=-1,[68]=-1,[69]=-1,[70]=-1,[71]=0,[72]=15,[73]=132,[74]=34,[75]=2,[76]=0,[77]=0,[78]=139,[79]=21,[80]=-1,[81]=-1,[82]=-1,[83]=-1,[84]=247,[85]=194,[86]=1,[87]=0,[88]=0,[89]=0,[90]=15,[91]=133,[92]=16,[93]=2,[94]=0,[95]=0,[96]=137,[97]=20,[98]=36,[99]=65,[100]=131,[101]=190,[102]=232,[103]=1,[104]=0,[105]=0,[106]=0,[107]=15,[108]=142,[109]=255,[110]=1,[111]=0,[112]=0,[113]=77,[114]=139,[115]=134,[116]=224,[117]=1,[118]=0,[119]=0,[120]=77,[121]=133,[122]=192,[123]=15,[124]=132,[125]=239,[126]=1,[127]=0,[128]=0,[129]=69,[130]=139,[131]=88,[132]=16,[133]=77,[134]=139,[135]=0,[136]=77,[137]=133,[138]=192,[139]=15,[140]=132,[141]=223,[142]=1,[143]=0,[144]=0,[145]=65,[146]=139,[147]=134,[148]=116,[149]=1,[150]=0,[151]=0,[152]=133,[153]=192,[154]=15,[155]=142,[156]=208,[157]=1,[158]=0,[159]=0,[160]=69,[161]=139,[162]=142,[163]=120,[164]=1,[165]=0,[166]=0,[167]=65,[168]=129,[169]=249,[170]=0,[171]=0,[172]=128,[173]=127,[174]=15,[175]=131,[176]=188,[177]=1,[178]=0,[179]=0,[180]=69,[181]=133,[182]=201,[183]=15,[184]=142,[185]=179,[186]=1,[187]=0,[188]=0,[189]=72,[190]=139,[191]=21,[192]=-1,[193]=-1,[194]=-1,[195]=-1,[196]=76,[197]=139,[198]=146,[199]=216,[200]=0,[201]=0,[202]=0,[203]=76,[204]=57,[205]=21,[206]=-1,[207]=-1,[208]=-1,[209]=-1,[210]=15,[211]=133,[212]=152,[213]=1,[214]=0,[215]=0,[216]=139,[217]=138,[218]=224,[219]=0,[220]=0,[221]=0,[222]=57,[223]=13,[224]=-1,[225]=-1,[226]=-1,[227]=-1,[228]=15,[229]=133,[230]=134,[231]=1,[232]=0,[233]=0,[234]=129,[235]=249,[236]=0,[237]=1,[238]=0,[239]=0,[240]=15,[241]=135,[242]=122,[243]=1,[244]=0,[245]=0,[246]=49,[247]=192,[248]=133,[249]=201,[250]=15,[251]=132,[252]=31,[253]=0,[254]=0,[255]=0,[256]=72,[257]=141,[258]=21,[259]=-1,[260]=-1,[261]=-1,[262]=-1,[263]=77,[264]=139,[265]=74,[266]=16,[267]=76,[268]=57,[269]=12,[270]=194,[271]=15,[272]=133,[273]=91,[274]=1,[275]=0,[276]=0,[277]=73,[278]=131,[279]=194,[280]=32,[281]=255,[282]=192,[283]=57,[284]=200,[285]=114,[286]=232,[287]=139,[288]=13,[289]=-1,[290]=-1,[291]=-1,[292]=-1,[293]=129,[294]=249,[295]=128,[296]=0,[297]=0,[298]=0,[299]=15,[300]=135,[301]=63,[302]=1,[303]=0,[304]=0,[305]=133,[306]=201,[307]=15,[308]=132,[309]=243,[310]=0,[311]=0,[312]=0,[313]=76,[314]=141,[315]=21,[316]=-1,[317]=-1,[318]=-1,[319]=-1,[320]=65,[321]=131,[322]=122,[323]=8,[324]=0,[325]=15,[326]=132,[327]=21,[328]=0,[329]=0,[330]=0,[331]=77,[332]=139,[333]=136,[334]=184,[335]=0,[336]=0,[337]=0,[338]=77,[339]=57,[340]=10,[341]=15,[342]=132,[343]=27,[344]=0,[345]=0,[346]=0,[347]=233,[348]=9,[349]=0,[350]=0,[351]=0,[352]=77,[353]=57,[354]=2,[355]=15,[356]=132,[357]=13,[358]=0,[359]=0,[360]=0,[361]=73,[362]=131,[363]=194,[364]=16,[365]=255,[366]=201,[367]=117,[368]=207,[369]=233,[370]=182,[371]=0,[372]=0,[373]=0,[374]=65,[375]=139,[376]=134,[377]=116,[378]=1,[379]=0,[380]=0,[381]=69,[382]=139,[383]=142,[384]=120,[385]=1,[386]=0,[387]=0,[388]=76,[389]=141,[390]=21,[391]=-1,[392]=-1,[393]=-1,[394]=-1,[395]=185,[396]=128,[397]=0,[398]=0,[399]=0,[400]=73,[401]=131,[402]=58,[403]=0,[404]=15,[405]=132,[406]=22,[407]=0,[408]=0,[409]=0,[410]=77,[411]=57,[412]=50,[413]=15,[414]=132,[415]=65,[416]=0,[417]=0,[418]=0,[419]=73,[420]=131,[421]=194,[422]=40,[423]=255,[424]=201,[425]=117,[426]=229,[427]=233,[428]=192,[429]=0,[430]=0,[431]=0,[432]=77,[433]=137,[434]=50,[435]=65,[436]=139,[437]=150,[438]=76,[439]=255,[440]=255,[441]=255,[442]=65,[443]=137,[444]=82,[445]=8,[446]=65,[447]=139,[448]=150,[449]=108,[450]=1,[451]=0,[452]=0,[453]=65,[454]=137,[455]=82,[456]=12,[457]=77,[458]=137,[459]=66,[460]=16,[461]=69,[462]=137,[463]=74,[464]=24,[465]=69,[466]=137,[467]=90,[468]=32,[469]=139,[470]=21,[471]=-1,[472]=-1,[473]=-1,[474]=-1,[475]=65,[476]=137,[477]=82,[478]=28,[479]=233,[480]=140,[481]=0,[482]=0,[483]=0,[484]=65,[485]=139,[486]=150,[487]=76,[488]=255,[489]=255,[490]=255,[491]=65,[492]=57,[493]=82,[494]=8,[495]=117,[496]=194,[497]=65,[498]=139,[499]=150,[500]=108,[501]=1,[502]=0,[503]=0,[504]=65,[505]=57,[506]=82,[507]=12,[508]=117,[509]=181,[510]=77,[511]=57,[512]=66,[513]=16,[514]=117,[515]=175,[516]=69,[517]=57,[518]=74,[519]=24,[520]=117,[521]=169,[522]=69,[523]=57,[524]=90,[525]=32,[526]=117,[527]=163,[528]=139,[529]=21,[530]=-1,[531]=-1,[532]=-1,[533]=-1,[534]=65,[535]=43,[536]=82,[537]=28,[538]=131,[539]=250,[540]=1,[541]=15,[542]=140,[543]=77,[544]=0,[545]=0,[546]=0,[547]=68,[548]=57,[549]=200,[550]=15,[551]=131,[552]=68,[553]=0,[554]=0,[555]=0,[556]=139,[557]=20,[558]=36,[559]=59,[560]=21,[561]=-1,[562]=-1,[563]=-1,[564]=-1,[565]=15,[566]=133,[567]=53,[568]=0,[569]=0,[570]=0,[571]=65,[572]=139,[573]=134,[574]=116,[575]=1,[576]=0,[577]=0,[578]=102,[579]=68,[580]=15,[581]=126,[582]=250,[583]=133,[584]=210,[585]=15,[586]=142,[587]=33,[588]=0,[589]=0,[590]=0,[591]=129,[592]=250,[593]=0,[594]=0,[595]=128,[596]=127,[597]=15,[598]=131,[599]=21,[600]=0,[601]=0,[602]=0,[603]=57,[604]=208,[605]=15,[606]=134,[607]=13,[608]=0,[609]=0,[610]=0,[611]=65,[612]=137,[613]=150,[614]=116,[615]=1,[616]=0,[617]=0,[618]=255,[619]=5,[620]=-1,[621]=-1,[622]=-1,[623]=-1,[624]=72,[625]=131,[626]=196,[627]=16,[628]=65,[629]=91,[630]=65,[631]=90,[632]=65,[633]=89,[634]=65,[635]=88,[636]=90,[637]=89,[638]=88,[639]=157,[640]=69,[641]=132,[642]=228,[643]=15,[644]=132,[645]=5,[646]=0,[647]=0,[648]=0,[649]=233,[650]=-1,[651]=-1,[652]=-1,[653]=-1,[654]=233,[655]=-1,[656]=-1,[657]=-1,[658]=-1},['constraints']={},['relocations']={[1]={['add']=12,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=88,['symbol']='tlcVars',['offset']=22,['end']=26,['kind']='rip'},[3]={['add']=5,['symbol']='tlcFlags',['offset']=43,['end']=48,['kind']='rip'},[4]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=66,['end']=71,['kind']='rip'},[5]={['add']=28,['symbol']='tlc_instant_gate045',['offset']=79,['end']=83,['kind']='rip'},[6]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=191,['end']=195,['kind']='rip'},[7]={['add']=11296,['symbol']='tlc_instant_gate045',['offset']=205,['end']=209,['kind']='rip'},[8]={['add']=11304,['symbol']='tlc_instant_gate045',['offset']=223,['end']=227,['kind']='rip'},[9]={['add']=13360,['symbol']='tlc_instant_gate045',['offset']=258,['end']=262,['kind']='rip'},[10]={['add']=11308,['symbol']='tlc_instant_gate045',['offset']=288,['end']=292,['kind']='rip'},[11]={['add']=11312,['symbol']='tlc_instant_gate045',['offset']=315,['end']=319,['kind']='rip'},[12]={['add']=0,['symbol']='tlc_instant_rows045',['offset']=390,['end']=394,['kind']='rip'},[13]={['add']=16,['symbol']='tlc_instant_gate045',['offset']=470,['end']=474,['kind']='rip'},[14]={['add']=20,['symbol']='tlc_instant_gate045',['offset']=529,['end']=533,['kind']='rip'},[15]={['add']=28,['symbol']='tlc_instant_gate045',['offset']=560,['end']=564,['kind']='rip'},[16]={['add']=100,['symbol']='tlcFlags',['offset']=619,['end']=623,['kind']='rip'},[17]={['end']=653,['kind']='siteReturn',['offset']=649},[18]={['targetOffset']=16,['pattern']={[32]=242,[1]=92,[2]=199,[3]=243,[4]=65,[5]=15,[6]=95,[7]=198,[8]=243,[9]=65,[10]=15,[11]=17,[12]=134,[13]=116,[14]=1,[15]=0,[16]=0,[17]=243,[18]=65,[19]=15,[20]=16,[21]=142,[22]=120,[23]=1,[24]=0,[25]=0,[26]=15,[27]=90,[28]=201,[29]=15,[30]=40,[31]=193},['offset']=654,['end']=658,['kind']='scopedTarget'}},['sig']='FabricationProgress',['name']='fabricationProgress2'},[18]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=6,[12]=0,[13]=0,[14]=0,[15]=157,[16]=233,[17]=-1,[18]=-1,[19]=-1,[20]=-1,[21]=157,[22]=68,[23]=57,[24]=200,[25]=15,[26]=141,[27]=5,[28]=0,[29]=0,[30]=0,[31]=233,[32]=-1,[33]=-1,[34]=-1,[35]=-1,[36]=233,[37]=-1,[38]=-1,[39]=-1,[40]=-1},['constraints']={},['relocations']={[4]={['targetOffset']=16,['pattern']={[32]=220,[1]=68,[2]=36,[3]=32,[4]=1,[5]=73,[6]=139,[7]=206,[8]=232,[9]=57,[10]=253,[11]=255,[12]=255,[13]=132,[14]=192,[15]=116,[16]=23,[17]=139,[18]=69,[19]=11,[20]=72,[21]=141,[22]=77,[23]=7,[24]=247,[25]=208,[26]=33,[27]=69,[28]=23,[29]=232,[30]=164,[31]=24},['offset']=36,['end']=40,['kind']='scopedTarget'},[1]={['add']=12,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['targetOffset']=16,['pattern']={[32]=220,[1]=68,[2]=36,[3]=32,[4]=1,[5]=73,[6]=139,[7]=206,[8]=232,[9]=57,[10]=253,[11]=255,[12]=255,[13]=132,[14]=192,[15]=116,[16]=23,[17]=139,[18]=69,[19]=11,[20]=72,[21]=141,[22]=77,[23]=7,[24]=247,[25]=208,[26]=33,[27]=69,[28]=23,[29]=232,[30]=164,[31]=24},['offset']=16,['end']=20,['kind']='scopedTarget'},[3]={['end']=35,['kind']='siteReturn',['offset']=31}},['sig']='MaterialCheck',['name']='materialCheck2'},[19]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=156,[2]=80,[3]=81,[4]=82,[5]=128,[6]=61,[7]=-1,[8]=-1,[9]=-1,[10]=-1,[11]=0,[12]=15,[13]=132,[14]=77,[15]=0,[16]=0,[17]=0,[18]=72,[19]=131,[20]=61,[21]=-1,[22]=-1,[23]=-1,[24]=-1,[25]=0,[26]=15,[27]=132,[28]=63,[29]=0,[30]=0,[31]=0,[32]=72,[33]=141,[34]=5,[35]=-1,[36]=-1,[37]=-1,[38]=-1,[39]=185,[40]=0,[41]=1,[42]=0,[43]=0,[44]=72,[45]=131,[46]=56,[47]=0,[48]=15,[49]=132,[50]=22,[51]=0,[52]=0,[53]=0,[54]=76,[55]=57,[56]=48,[57]=15,[58]=132,[59]=13,[60]=0,[61]=0,[62]=0,[63]=72,[64]=131,[65]=192,[66]=24,[67]=255,[68]=201,[69]=117,[70]=229,[71]=233,[72]=19,[73]=0,[74]=0,[75]=0,[76]=76,[77]=137,[78]=48,[79]=65,[80]=139,[81]=86,[82]=12,[83]=137,[84]=80,[85]=8,[86]=139,[87]=21,[88]=-1,[89]=-1,[90]=-1,[91]=-1,[92]=137,[93]=80,[94]=12,[95]=90,[96]=89,[97]=88,[98]=157,[99]=72,[100]=139,[101]=77,[102]=216,[103]=68,[104]=137,[105]=109,[106]=224,[107]=233,[108]=-1,[109]=-1,[110]=-1,[111]=-1},['constraints']={},['relocations']={[1]={['add']=5,['symbol']='tlcFlags',['offset']=6,['end']=11,['kind']='rip'},[2]={['add']=8,['symbol']='tlc_instant_gate045',['offset']=20,['end']=25,['kind']='rip'},[3]={['add']=5152,['symbol']='tlc_instant_gate045',['offset']=34,['end']=38,['kind']='rip'},[4]={['add']=16,['symbol']='tlc_instant_gate045',['offset']=87,['end']=91,['kind']='rip'},[5]={['end']=111,['kind']='siteReturn',['offset']=107}},['sig']='QuestEvaluated045',['name']='questEvaluated045'},[20]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=243,[2]=15,[3]=16,[4]=130,[5]=208,[6]=2,[7]=0,[8]=0,[9]=156,[10]=128,[11]=61,[12]=-1,[13]=-1,[14]=-1,[15]=-1,[16]=0,[17]=15,[18]=132,[19]=14,[20]=0,[21]=0,[22]=0,[23]=243,[24]=15,[25]=16,[26]=5,[27]=-1,[28]=-1,[29]=-1,[30]=-1,[31]=255,[32]=5,[33]=-1,[34]=-1,[35]=-1,[36]=-1,[37]=157,[38]=233,[39]=-1,[40]=-1,[41]=-1,[42]=-1},['constraints']={},['relocations']={[4]={['end']=42,['kind']='siteReturn',['offset']=38},[1]={['add']=5,['symbol']='tlcFlags',['offset']=11,['end']=16,['kind']='rip'},[2]={['add']=164,['symbol']='tlcVars',['offset']=26,['end']=30,['kind']='rip'},[3]={['add']=3376,['symbol']='tlcFlags',['offset']=32,['end']=36,['kind']='rip'}},['sig']='RepairBase022',['name']='RepairBase022'},[21]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=40,[12]=0,[13]=0,[14]=0,[15]=80,[16]=72,[17]=131,[18]=236,[19]=16,[20]=243,[21]=15,[22]=127,[23]=4,[24]=36,[25]=243,[26]=15,[27]=42,[28]=66,[29]=4,[30]=243,[31]=15,[32]=89,[33]=5,[34]=-1,[35]=-1,[36]=-1,[37]=-1,[38]=243,[39]=15,[40]=44,[41]=192,[42]=137,[43]=66,[44]=4,[45]=243,[46]=15,[47]=111,[48]=4,[49]=36,[50]=72,[51]=131,[52]=196,[53]=16,[54]=88,[55]=157,[56]=64,[57]=83,[58]=87,[59]=72,[60]=131,[61]=236,[62]=56,[63]=233,[64]=-1,[65]=-1,[66]=-1,[67]=-1},['constraints']={},['relocations']={[1]={['add']=4,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=52,['symbol']='tlcVars',['offset']=33,['end']=37,['kind']='rip'},[3]={['end']=67,['kind']='siteReturn',['offset']=63}},['sig']='Exp',['name']='exp'},[22]={['padding']={[1]=144},['pattern']={[1]=156,[2]=80,[3]=82,[4]=65,[5]=82,[6]=65,[7]=83,[8]=128,[9]=61,[10]=-1,[11]=-1,[12]=-1,[13]=-1,[14]=0,[15]=15,[16]=132,[17]=103,[18]=0,[19]=0,[20]=0,[21]=15,[22]=46,[23]=13,[24]=-1,[25]=-1,[26]=-1,[27]=-1,[28]=15,[29]=134,[30]=90,[31]=0,[32]=0,[33]=0,[34]=76,[35]=139,[36]=21,[37]=-1,[38]=-1,[39]=-1,[40]=-1,[41]=77,[42]=133,[43]=210,[44]=15,[45]=132,[46]=74,[47]=0,[48]=0,[49]=0,[50]=72,[51]=139,[52]=65,[53]=16,[54]=65,[55]=187,[56]=64,[57]=0,[58]=0,[59]=0,[60]=72,[61]=133,[62]=192,[63]=15,[64]=132,[65]=55,[66]=0,[67]=0,[68]=0,[69]=76,[70]=57,[71]=208,[72]=15,[73]=132,[74]=14,[75]=0,[76]=0,[77]=0,[78]=72,[79]=139,[80]=64,[81]=64,[82]=65,[83]=255,[84]=203,[85]=117,[86]=229,[87]=233,[88]=32,[89]=0,[90]=0,[91]=0,[92]=255,[93]=5,[94]=-1,[95]=-1,[96]=-1,[97]=-1,[98]=72,[99]=137,[100]=13,[101]=-1,[102]=-1,[103]=-1,[104]=-1,[105]=243,[106]=15,[107]=17,[108]=13,[109]=-1,[110]=-1,[111]=-1,[112]=-1,[113]=65,[114]=91,[115]=65,[116]=90,[117]=90,[118]=88,[119]=157,[120]=15,[121]=87,[122]=192,[123]=195,[124]=65,[125]=91,[126]=65,[127]=90,[128]=90,[129]=88,[130]=157,[131]=64,[132]=83,[133]=72,[134]=131,[135]=236,[136]=64,[137]=233,[138]=-1,[139]=-1,[140]=-1,[141]=-1},['constraints']={},['relocations']={[1]={['add']=0,['symbol']='tlcBoatProtection027Data',['offset']=9,['end']=14,['kind']='rip'},[2]={['add']=32,['symbol']='tlcBoatProtection027Data',['offset']=23,['end']=27,['kind']='rip'},[3]={['add']=8,['symbol']='tlcBoatProtection027Data',['offset']=36,['end']=40,['kind']='rip'},[4]={['add']=40,['symbol']='tlcBoatProtection027Data',['offset']=93,['end']=97,['kind']='rip'},[5]={['add']=48,['symbol']='tlcBoatProtection027Data',['offset']=100,['end']=104,['kind']='rip'},[6]={['add']=56,['symbol']='tlcBoatProtection027Data',['offset']=108,['end']=112,['kind']='rip'},[7]={['end']=141,['kind']='siteReturn',['offset']=137}},['sig']='BoatActorDamage055',['name']='boatActorDamage055'},[23]={['padding']={[1]=144},['pattern']={[1]=156,[2]=80,[3]=128,[4]=61,[5]=-1,[6]=-1,[7]=-1,[8]=-1,[9]=0,[10]=15,[11]=132,[12]=45,[13]=0,[14]=0,[15]=0,[16]=132,[17]=210,[18]=15,[19]=133,[20]=37,[21]=0,[22]=0,[23]=0,[24]=72,[25]=139,[26]=5,[27]=-1,[28]=-1,[29]=-1,[30]=-1,[31]=72,[32]=133,[33]=192,[34]=15,[35]=132,[36]=21,[37]=0,[38]=0,[39]=0,[40]=72,[41]=57,[42]=193,[43]=15,[44]=133,[45]=12,[46]=0,[47]=0,[48]=0,[49]=15,[50]=87,[51]=192,[52]=255,[53]=5,[54]=-1,[55]=-1,[56]=-1,[57]=-1,[58]=88,[59]=157,[60]=195,[61]=88,[62]=157,[63]=139,[64]=129,[65]=96,[66]=22,[67]=0,[68]=0,[69]=233,[70]=-1,[71]=-1,[72]=-1,[73]=-1},['constraints']={},['relocations']={[4]={['end']=73,['kind']='siteReturn',['offset']=69},[1]={['add']=5,['symbol']='tlcFlags',['offset']=4,['end']=9,['kind']='rip'},[2]={['add']=15408,['symbol']='tlc_instant_gate045',['offset']=26,['end']=30,['kind']='rip'},[3]={['add']=15416,['symbol']='tlc_instant_gate045',['offset']=53,['end']=57,['kind']='rip'}},['sig']='DismantleScale050',['name']='dismantleScale050'},[24]={['padding']={},['pattern']={[1]=156,[2]=80,[3]=82,[4]=65,[5]=80,[6]=65,[7]=81,[8]=65,[9]=82,[10]=65,[11]=83,[12]=128,[13]=61,[14]=-1,[15]=-1,[16]=-1,[17]=-1,[18]=0,[19]=15,[20]=132,[21]=15,[22]=1,[23]=0,[24]=0,[25]=65,[26]=128,[27]=249,[28]=1,[29]=15,[30]=135,[31]=5,[32]=1,[33]=0,[34]=0,[35]=128,[36]=251,[37]=0,[38]=15,[39]=132,[40]=27,[41]=0,[42]=0,[43]=0,[44]=128,[45]=251,[46]=1,[47]=15,[48]=132,[49]=18,[50]=0,[51]=0,[52]=0,[53]=128,[54]=251,[55]=2,[56]=15,[57]=132,[58]=9,[59]=0,[60]=0,[61]=0,[62]=128,[63]=251,[64]=16,[65]=15,[66]=133,[67]=225,[68]=0,[69]=0,[70]=0,[71]=76,[72]=139,[73]=21,[74]=-1,[75]=-1,[76]=-1,[77]=-1,[78]=77,[79]=133,[80]=210,[81]=15,[82]=132,[83]=209,[84]=0,[85]=0,[86]=0,[87]=72,[88]=131,[89]=61,[90]=-1,[91]=-1,[92]=-1,[93]=-1,[94]=0,[95]=15,[96]=132,[97]=195,[98]=0,[99]=0,[100]=0,[101]=72,[102]=139,[103]=135,[104]=168,[105]=0,[106]=0,[107]=0,[108]=72,[109]=133,[110]=192,[111]=15,[112]=132,[113]=179,[114]=0,[115]=0,[116]=0,[117]=72,[118]=139,[119]=80,[120]=16,[121]=65,[122]=184,[123]=64,[124]=0,[125]=0,[126]=0,[127]=72,[128]=133,[129]=210,[130]=15,[131]=132,[132]=160,[133]=0,[134]=0,[135]=0,[136]=76,[137]=57,[138]=210,[139]=15,[140]=132,[141]=129,[142]=0,[143]=0,[144]=0,[145]=72,[146]=59,[147]=21,[148]=-1,[149]=-1,[150]=-1,[151]=-1,[152]=15,[153]=132,[154]=27,[155]=0,[156]=0,[157]=0,[158]=72,[159]=59,[160]=21,[161]=-1,[162]=-1,[163]=-1,[164]=-1,[165]=15,[166]=132,[167]=14,[168]=0,[169]=0,[170]=0,[171]=72,[172]=139,[173]=82,[174]=64,[175]=65,[176]=255,[177]=200,[178]=117,[179]=203,[180]=233,[181]=111,[182]=0,[183]=0,[184]=0,[185]=76,[186]=139,[187]=152,[188]=184,[189]=1,[190]=0,[191]=0,[192]=65,[193]=185,[194]=64,[195]=0,[196]=0,[197]=0,[198]=77,[199]=133,[200]=219,[201]=15,[202]=132,[203]=89,[204]=0,[205]=0,[206]=0,[207]=73,[208]=139,[209]=67,[210]=32,[211]=72,[212]=133,[213]=192,[214]=15,[215]=132,[216]=37,[217]=0,[218]=0,[219]=0,[220]=72,[221]=139,[222]=80,[223]=16,[224]=65,[225]=184,[226]=64,[227]=0,[228]=0,[229]=0,[230]=72,[231]=133,[232]=210,[233]=15,[234]=132,[235]=18,[236]=0,[237]=0,[238]=0,[239]=76,[240]=57,[241]=210,[242]=15,[243]=132,[244]=26,[245]=0,[246]=0,[247]=0,[248]=72,[249]=139,[250]=82,[251]=64,[252]=65,[253]=255,[254]=200,[255]=117,[256]=229,[257]=77,[258]=139,[259]=155,[260]=208,[261]=0,[262]=0,[263]=0,[264]=65,[265]=255,[266]=201,[267]=117,[268]=185,[269]=233,[270]=22,[271]=0,[272]=0,[273]=0,[274]=255,[275]=5,[276]=-1,[277]=-1,[278]=-1,[279]=-1,[280]=65,[281]=91,[282]=65,[283]=90,[284]=65,[285]=89,[286]=65,[287]=88,[288]=90,[289]=88,[290]=157,[291]=233,[292]=-1,[293]=-1,[294]=-1,[295]=-1,[296]=65,[297]=91,[298]=65,[299]=90,[300]=65,[301]=89,[302]=65,[303]=88,[304]=90,[305]=88,[306]=157,[307]=15,[308]=41,[309]=124,[310]=36,[311]=32,[312]=233,[313]=-1,[314]=-1,[315]=-1,[316]=-1},['constraints']={},['relocations']={[8]={['end']=316,['kind']='siteReturn',['offset']=312},[1]={['add']=8,['symbol']='tlcFlags',['offset']=13,['end']=18,['kind']='rip'},[2]={['add']=0,['symbol']='tlc_fuelDebit061Data',['offset']=73,['end']=77,['kind']='rip'},[3]={['add']=8,['symbol']='tlc_fuelDebit061Data',['offset']=89,['end']=94,['kind']='rip'},[4]={['add']=8,['symbol']='tlc_fuelDebit061Data',['offset']=147,['end']=151,['kind']='rip'},[5]={['add']=24,['symbol']='tlc_fuelDebit061Data',['offset']=160,['end']=164,['kind']='rip'},[6]={['add']=16,['symbol']='tlc_fuelDebit061Data',['offset']=275,['end']=279,['kind']='rip'},[7]={['targetOffset']=16,['pattern']={[32]=64,[1]=48,[2]=102,[3]=15,[4]=47,[5]=208,[6]=15,[7]=182,[8]=218,[9]=72,[10]=139,[11]=249,[12]=15,[13]=40,[14]=242,[15]=119,[16]=18,[17]=176,[18]=1,[19]=72,[20]=139,[21]=92,[22]=36,[23]=80,[24]=15,[25]=40,[26]=116,[27]=36,[28]=48,[29]=72,[30]=131,[31]=196},['offset']=291,['end']=295,['kind']='scopedTarget'}},['sig']='FuelDebit061',['name']='fuelDebit061'},[25]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=53,[12]=0,[13]=0,[14]=0,[15]=72,[16]=59,[17]=29,[18]=-1,[19]=-1,[20]=-1,[21]=-1,[22]=15,[23]=133,[24]=40,[25]=0,[26]=0,[27]=0,[28]=243,[29]=15,[30]=89,[31]=61,[32]=-1,[33]=-1,[34]=-1,[35]=-1,[36]=243,[37]=68,[38]=15,[39]=89,[40]=5,[41]=-1,[42]=-1,[43]=-1,[44]=-1,[45]=243,[46]=15,[47]=89,[48]=53,[49]=-1,[50]=-1,[51]=-1,[52]=-1,[53]=243,[54]=68,[55]=15,[56]=89,[57]=13,[58]=-1,[59]=-1,[60]=-1,[61]=-1,[62]=255,[63]=5,[64]=-1,[65]=-1,[66]=-1,[67]=-1,[68]=157,[69]=76,[70]=141,[71]=156,[72]=36,[73]=160,[74]=0,[75]=0,[76]=0,[77]=233,[78]=-1,[79]=-1,[80]=-1,[81]=-1},['constraints']={},['relocations']={[8]={['end']=81,['kind']='siteReturn',['offset']=77},[1]={['add']=25,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=56,['symbol']='tlcPtrs',['offset']=17,['end']=21,['kind']='rip'},[3]={['add']=32,['symbol']='tlcVars',['offset']=31,['end']=35,['kind']='rip'},[4]={['add']=32,['symbol']='tlcVars',['offset']=40,['end']=44,['kind']='rip'},[5]={['add']=32,['symbol']='tlcVars',['offset']=48,['end']=52,['kind']='rip'},[6]={['add']=32,['symbol']='tlcVars',['offset']=57,['end']=61,['kind']='rip'},[7]={['add']=92,['symbol']='tlcFlags',['offset']=63,['end']=67,['kind']='rip'}},['sig']='MovementSpeedFinal',['name']='movementSpeed2'},[26]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=156,[2]=65,[3]=82,[4]=76,[5]=139,[6]=21,[7]=-1,[8]=-1,[9]=-1,[10]=-1,[11]=77,[12]=133,[13]=210,[14]=15,[15]=132,[16]=53,[17]=0,[18]=0,[19]=0,[20]=128,[21]=61,[22]=-1,[23]=-1,[24]=-1,[25]=-1,[26]=0,[27]=15,[28]=132,[29]=40,[30]=0,[31]=0,[32]=0,[33]=76,[34]=57,[35]=87,[36]=16,[37]=15,[38]=133,[39]=30,[40]=0,[41]=0,[42]=0,[43]=68,[44]=139,[45]=151,[46]=212,[47]=0,[48]=0,[49]=0,[50]=68,[51]=137,[52]=21,[53]=-1,[54]=-1,[55]=-1,[56]=-1,[57]=199,[58]=135,[59]=212,[60]=0,[61]=0,[62]=0,[63]=0,[64]=0,[65]=128,[66]=63,[67]=255,[68]=5,[69]=-1,[70]=-1,[71]=-1,[72]=-1,[73]=65,[74]=90,[75]=157,[76]=72,[77]=139,[78]=7,[79]=72,[80]=141,[81]=84,[82]=36,[83]=32,[84]=233,[85]=-1,[86]=-1,[87]=-1,[88]=-1},['constraints']={},['relocations']={[1]={['add']=3568,['symbol']='tlcFlags',['offset']=6,['end']=10,['kind']='rip'},[2]={['add']=5,['symbol']='tlcFlags',['offset']=21,['end']=26,['kind']='rip'},[3]={['add']=3580,['symbol']='tlcFlags',['offset']=52,['end']=56,['kind']='rip'},[4]={['add']=3576,['symbol']='tlcFlags',['offset']=68,['end']=72,['kind']='rip'},[5]={['end']=88,['kind']='siteReturn',['offset']=84}},['sig']='DismantleDispatch023',['name']='DismantleDispatch023'},[27]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=243,[2]=15,[3]=16,[4]=131,[5]=116,[6]=2,[7]=0,[8]=0,[9]=156,[10]=128,[11]=61,[12]=-1,[13]=-1,[14]=-1,[15]=-1,[16]=0,[17]=15,[18]=132,[19]=14,[20]=0,[21]=0,[22]=0,[23]=243,[24]=15,[25]=16,[26]=5,[27]=-1,[28]=-1,[29]=-1,[30]=-1,[31]=255,[32]=5,[33]=-1,[34]=-1,[35]=-1,[36]=-1,[37]=157,[38]=233,[39]=-1,[40]=-1,[41]=-1,[42]=-1},['constraints']={},['relocations']={[4]={['end']=42,['kind']='siteReturn',['offset']=38},[1]={['add']=5,['symbol']='tlcFlags',['offset']=11,['end']=16,['kind']='rip'},[2]={['add']=164,['symbol']='tlcVars',['offset']=26,['end']=30,['kind']='rip'},[3]={['add']=3376,['symbol']='tlcFlags',['offset']=32,['end']=36,['kind']='rip'}},['sig']='DismantleModule022',['name']='DismantleModule022'},[28]={['padding']={[1]=15,[2]=31,[3]=0},['pattern']={[1]=243,[2]=15,[3]=16,[4]=179,[5]=208,[6]=2,[7]=0,[8]=0,[9]=156,[10]=128,[11]=61,[12]=-1,[13]=-1,[14]=-1,[15]=-1,[16]=0,[17]=15,[18]=132,[19]=14,[20]=0,[21]=0,[22]=0,[23]=243,[24]=15,[25]=16,[26]=53,[27]=-1,[28]=-1,[29]=-1,[30]=-1,[31]=255,[32]=5,[33]=-1,[34]=-1,[35]=-1,[36]=-1,[37]=157,[38]=233,[39]=-1,[40]=-1,[41]=-1,[42]=-1},['constraints']={},['relocations']={[4]={['end']=42,['kind']='siteReturn',['offset']=38},[1]={['add']=5,['symbol']='tlcFlags',['offset']=11,['end']=16,['kind']='rip'},[2]={['add']=164,['symbol']='tlcVars',['offset']=26,['end']=30,['kind']='rip'},[3]={['add']=3376,['symbol']='tlcFlags',['offset']=32,['end']=36,['kind']='rip'}},['sig']='RepairItem022',['name']='RepairItem022'},[29]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=18,[12]=0,[13]=0,[14]=0,[15]=72,[16]=59,[17]=13,[18]=-1,[19]=-1,[20]=-1,[21]=-1,[22]=15,[23]=133,[24]=5,[25]=0,[26]=0,[27]=0,[28]=157,[29]=15,[30]=87,[31]=192,[32]=195,[33]=157,[34]=72,[35]=139,[36]=196,[37]=72,[38]=137,[39]=88,[40]=16,[41]=233,[42]=-1,[43]=-1,[44]=-1,[45]=-1},['constraints']={},['relocations']={[1]={['add']=3,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=32,['symbol']='tlcPtrs',['offset']=17,['end']=21,['kind']='rip'},[3]={['end']=45,['kind']='siteReturn',['offset']=41}},['sig']='InventoryWeight',['name']='weightInventory'},[30]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=40,[12]=0,[13]=0,[14]=0,[15]=133,[16]=210,[17]=15,[18]=137,[19]=32,[20]=0,[21]=0,[22]=0,[23]=80,[24]=72,[25]=139,[26]=129,[27]=88,[28]=1,[29]=0,[30]=0,[31]=72,[32]=59,[33]=5,[34]=-1,[35]=-1,[36]=-1,[37]=-1,[38]=88,[39]=15,[40]=133,[41]=10,[42]=0,[43]=0,[44]=0,[45]=255,[46]=5,[47]=-1,[48]=-1,[49]=-1,[50]=-1,[51]=157,[52]=176,[53]=1,[54]=195,[55]=157,[56]=72,[57]=137,[58]=92,[59]=36,[60]=8,[61]=233,[62]=-1,[63]=-1,[64]=-1,[65]=-1},['constraints']={},['relocations']={[4]={['end']=65,['kind']='siteReturn',['offset']=61},[1]={['add']=11,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=0,['symbol']='tlcPtrs',['offset']=33,['end']=37,['kind']='rip'},[3]={['add']=76,['symbol']='tlcFlags',['offset']=46,['end']=50,['kind']='rip'}},['sig']='AmmoDelta',['name']='ammoDelta2'},[31]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=50,[12]=0,[13]=0,[14]=0,[15]=128,[16]=61,[17]=-1,[18]=-1,[19]=-1,[20]=-1,[21]=0,[22]=15,[23]=133,[24]=37,[25]=0,[26]=0,[27]=0,[28]=80,[29]=72,[30]=139,[31]=131,[32]=88,[33]=1,[34]=0,[35]=0,[36]=72,[37]=59,[38]=5,[39]=-1,[40]=-1,[41]=-1,[42]=-1,[43]=88,[44]=15,[45]=133,[46]=15,[47]=0,[48]=0,[49]=0,[50]=255,[51]=5,[52]=-1,[53]=-1,[54]=-1,[55]=-1,[56]=157,[57]=72,[58]=139,[59]=203,[60]=233,[61]=-1,[62]=-1,[63]=-1,[64]=-1,[65]=157,[66]=255,[67]=202,[68]=72,[69]=139,[70]=203,[71]=233,[72]=-1,[73]=-1,[74]=-1,[75]=-1},['constraints']={},['relocations']={[1]={['add']=11,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=21,['symbol']='tlcFlags',['offset']=16,['end']=21,['kind']='rip'},[3]={['add']=0,['symbol']='tlcPtrs',['offset']=38,['end']=42,['kind']='rip'},[4]={['add']=3408,['symbol']='tlcFlags',['offset']=51,['end']=55,['kind']='rip'},[5]={['end']=64,['kind']='siteReturn',['offset']=60},[6]={['end']=75,['kind']='siteReturn',['offset']=71}},['sig']='AmmoShot027',['name']='ammoShot027'},[32]={['padding']={[1]=15,[2]=31,[3]=128,[4]=0,[5]=0,[6]=0,[7]=0},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=20,[12]=0,[13]=0,[14]=0,[15]=243,[16]=15,[17]=17,[18]=139,[19]=24,[20]=3,[21]=0,[22]=0,[23]=255,[24]=5,[25]=-1,[26]=-1,[27]=-1,[28]=-1,[29]=157,[30]=233,[31]=-1,[32]=-1,[33]=-1,[34]=-1,[35]=157,[36]=243,[37]=15,[38]=92,[39]=206,[40]=243,[41]=15,[42]=17,[43]=139,[44]=24,[45]=3,[46]=0,[47]=0,[48]=233,[49]=-1,[50]=-1,[51]=-1,[52]=-1},['constraints']={},['relocations']={[4]={['end']=52,['kind']='siteReturn',['offset']=48},[1]={['add']=27,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=148,['symbol']='tlcFlags',['offset']=24,['end']=28,['kind']='rip'},[3]={['end']=34,['kind']='siteReturn',['offset']=30}},['sig']='SeedCountdown',['name']='seedCountdown'},[33]={['padding']={},['pattern']={[1]=76,[2]=139,[3]=92,[4]=36,[5]=40,[6]=76,[7]=139,[8]=84,[9]=36,[10]=48,[11]=72,[12]=131,[13]=236,[14]=88,[15]=76,[16]=137,[17]=92,[18]=36,[19]=32,[20]=76,[21]=137,[22]=92,[23]=36,[24]=64,[25]=76,[26]=137,[27]=84,[28]=36,[29]=40,[30]=76,[31]=137,[32]=68,[33]=36,[34]=48,[35]=76,[36]=137,[37]=76,[38]=36,[39]=56,[40]=232,[41]=90,[42]=1,[43]=0,[44]=0,[45]=72,[46]=137,[47]=68,[48]=36,[49]=72,[50]=76,[51]=139,[52]=84,[53]=36,[54]=48,[55]=76,[56]=139,[57]=92,[58]=36,[59]=56,[60]=77,[61]=133,[62]=210,[63]=15,[64]=132,[65]=61,[66]=0,[67]=0,[68]=0,[69]=77,[70]=133,[71]=219,[72]=15,[73]=132,[74]=52,[75]=0,[76]=0,[77]=0,[78]=128,[79]=61,[80]=-1,[81]=-1,[82]=-1,[83]=-1,[84]=0,[85]=15,[86]=132,[87]=39,[88]=0,[89]=0,[90]=0,[91]=243,[92]=15,[93]=16,[94]=5,[95]=-1,[96]=-1,[97]=-1,[98]=-1,[99]=243,[100]=65,[101]=15,[102]=17,[103]=67,[104]=8,[105]=243,[106]=15,[107]=16,[108]=5,[109]=-1,[110]=-1,[111]=-1,[112]=-1,[113]=243,[114]=65,[115]=15,[116]=17,[117]=67,[118]=12,[119]=198,[120]=68,[121]=36,[122]=72,[123]=1,[124]=255,[125]=5,[126]=-1,[127]=-1,[128]=-1,[129]=-1,[130]=128,[131]=61,[132]=-1,[133]=-1,[134]=-1,[135]=-1,[136]=0,[137]=15,[138]=132,[139]=238,[140]=0,[141]=0,[142]=0,[143]=72,[144]=139,[145]=84,[146]=36,[147]=64,[148]=72,[149]=133,[150]=210,[151]=15,[152]=132,[153]=224,[154]=0,[155]=0,[156]=0,[157]=139,[158]=74,[159]=8,[160]=133,[161]=201,[162]=15,[163]=142,[164]=213,[165]=0,[166]=0,[167]=0,[168]=129,[169]=249,[170]=0,[171]=1,[172]=0,[173]=0,[174]=15,[175]=135,[176]=201,[177]=0,[178]=0,[179]=0,[180]=59,[181]=74,[182]=12,[183]=15,[184]=135,[185]=192,[186]=0,[187]=0,[188]=0,[189]=72,[190]=139,[191]=18,[192]=72,[193]=133,[194]=210,[195]=15,[196]=132,[197]=180,[198]=0,[199]=0,[200]=0,[201]=15,[202]=87,[203]=201,[204]=15,[205]=46,[206]=74,[207]=36,[208]=15,[209]=131,[210]=155,[211]=0,[212]=0,[213]=0,[214]=243,[215]=15,[216]=16,[217]=66,[218]=32,[219]=243,[220]=15,[221]=89,[222]=5,[223]=-1,[224]=-1,[225]=-1,[226]=-1,[227]=243,[228]=15,[229]=95,[230]=5,[231]=-1,[232]=-1,[233]=-1,[234]=-1,[235]=243,[236]=15,[237]=17,[238]=66,[239]=32,[240]=243,[241]=15,[242]=16,[243]=66,[244]=36,[245]=243,[246]=15,[247]=89,[248]=5,[249]=-1,[250]=-1,[251]=-1,[252]=-1,[253]=243,[254]=15,[255]=95,[256]=5,[257]=-1,[258]=-1,[259]=-1,[260]=-1,[261]=243,[262]=15,[263]=17,[264]=66,[265]=36,[266]=243,[267]=15,[268]=16,[269]=66,[270]=20,[271]=243,[272]=15,[273]=89,[274]=5,[275]=-1,[276]=-1,[277]=-1,[278]=-1,[279]=243,[280]=15,[281]=17,[282]=66,[283]=20,[284]=243,[285]=15,[286]=16,[287]=66,[288]=24,[289]=243,[290]=15,[291]=89,[292]=5,[293]=-1,[294]=-1,[295]=-1,[296]=-1,[297]=243,[298]=15,[299]=17,[300]=66,[301]=24,[302]=15,[303]=87,[304]=201,[305]=15,[306]=46,[307]=13,[308]=-1,[309]=-1,[310]=-1,[311]=-1,[312]=15,[313]=133,[314]=15,[315]=0,[316]=0,[317]=0,[318]=243,[319]=15,[320]=17,[321]=74,[322]=48,[323]=243,[324]=15,[325]=17,[326]=74,[327]=52,[328]=233,[329]=36,[330]=0,[331]=0,[332]=0,[333]=243,[334]=15,[335]=16,[336]=66,[337]=48,[338]=243,[339]=15,[340]=89,[341]=5,[342]=-1,[343]=-1,[344]=-1,[345]=-1,[346]=243,[347]=15,[348]=17,[349]=66,[350]=48,[351]=243,[352]=15,[353]=16,[354]=66,[355]=52,[356]=243,[357]=15,[358]=89,[359]=5,[360]=-1,[361]=-1,[362]=-1,[363]=-1,[364]=243,[365]=15,[366]=17,[367]=66,[368]=52,[369]=72,[370]=131,[371]=194,[372]=64,[373]=255,[374]=201,[375]=15,[376]=133,[377]=76,[378]=255,[379]=255,[380]=255,[381]=72,[382]=139,[383]=68,[384]=36,[385]=72,[386]=72,[387]=131,[388]=196,[389]=88,[390]=195,[391]=76,[392]=139,[393]=220,[394]=85,[395]=83,[396]=233,[397]=-1,[398]=-1,[399]=-1,[400]=-1},['constraints']={},['relocations']={[1]={['add']=30,['symbol']='tlcFlags',['offset']=79,['end']=84,['kind']='rip'},[2]={['add']=180,['symbol']='tlcVars',['offset']=94,['end']=98,['kind']='rip'},[3]={['add']=176,['symbol']='tlcVars',['offset']=108,['end']=112,['kind']='rip'},[4]={['add']=3392,['symbol']='tlcFlags',['offset']=125,['end']=129,['kind']='rip'},[5]={['add']=31,['symbol']='tlcFlags',['offset']=131,['end']=136,['kind']='rip'},[6]={['add']=224,['symbol']='tlcVars',['offset']=222,['end']=226,['kind']='rip'},[7]={['add']=236,['symbol']='tlcVars',['offset']=230,['end']=234,['kind']='rip'},[8]={['add']=224,['symbol']='tlcVars',['offset']=248,['end']=252,['kind']='rip'},[9]={['add']=236,['symbol']='tlcVars',['offset']=256,['end']=260,['kind']='rip'},[10]={['add']=228,['symbol']='tlcVars',['offset']=274,['end']=278,['kind']='rip'},[11]={['add']=228,['symbol']='tlcVars',['offset']=292,['end']=296,['kind']='rip'},[12]={['add']=224,['symbol']='tlcVars',['offset']=307,['end']=311,['kind']='rip'},[13]={['add']=232,['symbol']='tlcVars',['offset']=341,['end']=345,['kind']='rip'},[14]={['add']=232,['symbol']='tlcVars',['offset']=359,['end']=363,['kind']='rip'},[15]={['end']=400,['kind']='siteReturn',['offset']=396}},['sig']='WeatherNative',['name']='weatherOutput2'},[34]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=110,[12]=0,[13]=0,[14]=0,[15]=80,[16]=65,[17]=82,[18]=65,[19]=83,[20]=72,[21]=139,[22]=129,[23]=168,[24]=0,[25]=0,[26]=0,[27]=72,[28]=133,[29]=192,[30]=15,[31]=132,[32]=64,[33]=0,[34]=0,[35]=0,[36]=76,[37]=139,[38]=144,[39]=88,[40]=1,[41]=0,[42]=0,[43]=76,[44]=59,[45]=21,[46]=-1,[47]=-1,[48]=-1,[49]=-1,[50]=15,[51]=133,[52]=44,[53]=0,[54]=0,[55]=0,[56]=72,[57]=139,[58]=64,[59]=16,[60]=76,[61]=139,[62]=21,[63]=-1,[64]=-1,[65]=-1,[66]=-1,[67]=65,[68]=187,[69]=64,[70]=0,[71]=0,[72]=0,[73]=76,[74]=57,[75]=208,[76]=15,[77]=132,[78]=28,[79]=0,[80]=0,[81]=0,[82]=72,[83]=133,[84]=192,[85]=15,[86]=132,[87]=9,[88]=0,[89]=0,[90]=0,[91]=72,[92]=139,[93]=64,[94]=64,[95]=65,[96]=255,[97]=203,[98]=117,[99]=229,[100]=65,[101]=91,[102]=65,[103]=90,[104]=88,[105]=233,[106]=15,[107]=0,[108]=0,[109]=0,[110]=255,[111]=5,[112]=-1,[113]=-1,[114]=-1,[115]=-1,[116]=65,[117]=91,[118]=65,[119]=90,[120]=88,[121]=157,[122]=176,[123]=1,[124]=195,[125]=157,[126]=72,[127]=137,[128]=92,[129]=36,[130]=8,[131]=233,[132]=-1,[133]=-1,[134]=-1,[135]=-1},['constraints']={['tlcWeaponClassSlot']={['kind']='classPointer'}},['relocations']={[1]={['add']=11,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'},[2]={['add']=0,['symbol']='tlcPtrs',['offset']=45,['end']=49,['kind']='rip'},[3]={['add']=0,['symbol']='tlcWeaponClassSlot',['offset']=62,['end']=66,['kind']='rip'},[4]={['add']=80,['symbol']='tlcFlags',['offset']=111,['end']=115,['kind']='rip'},[5]={['end']=135,['kind']='siteReturn',['offset']=131}},['sig']='WeaponResourceRemove',['name']='weaponResource2'},[35]={['padding']={[2]=144,[1]=102},['pattern']={[1]=156,[2]=80,[3]=49,[4]=192,[5]=128,[6]=61,[7]=-1,[8]=-1,[9]=-1,[10]=-1,[11]=0,[12]=15,[13]=132,[14]=32,[15]=0,[16]=0,[17]=0,[18]=72,[19]=57,[20]=29,[21]=-1,[22]=-1,[23]=-1,[24]=-1,[25]=15,[26]=133,[27]=19,[28]=0,[29]=0,[30]=0,[31]=72,[32]=139,[33]=195,[34]=255,[35]=5,[36]=-1,[37]=-1,[38]=-1,[39]=-1,[40]=199,[41]=5,[42]=-1,[43]=-1,[44]=-1,[45]=-1,[46]=255,[47]=255,[48]=255,[49]=255,[50]=72,[51]=137,[52]=5,[53]=-1,[54]=-1,[55]=-1,[56]=-1,[57]=88,[58]=157,[59]=72,[60]=141,[61]=147,[62]=216,[63]=0,[64]=0,[65]=0,[66]=233,[67]=-1,[68]=-1,[69]=-1,[70]=-1},['constraints']={},['relocations']={[1]={['add']=5,['symbol']='tlcFlags',['offset']=6,['end']=11,['kind']='rip'},[2]={['add']=0,['symbol']='tlc_instant_gate045',['offset']=20,['end']=24,['kind']='rip'},[3]={['add']=16,['symbol']='tlc_instant_gate045',['offset']=35,['end']=39,['kind']='rip'},[4]={['add']=24,['symbol']='tlc_instant_gate045',['offset']=41,['end']=49,['kind']='rip'},[5]={['add']=8,['symbol']='tlc_instant_gate045',['offset']=52,['end']=56,['kind']='rip'},[6]={['end']=70,['kind']='siteReturn',['offset']=66}},['sig']='QuestBegin045',['name']='questBegin045'},[36]={['padding']={},['pattern']={[1]=156,[2]=128,[3]=61,[4]=-1,[5]=-1,[6]=-1,[7]=-1,[8]=0,[9]=15,[10]=132,[11]=5,[12]=0,[13]=0,[14]=0,[15]=157,[16]=15,[17]=87,[18]=192,[19]=195,[20]=157,[21]=72,[22]=137,[23]=92,[24]=36,[25]=16,[26]=233,[27]=-1,[28]=-1,[29]=-1,[30]=-1},['constraints']={},['relocations']={[2]={['end']=30,['kind']='siteReturn',['offset']=26},[1]={['add']=3,['symbol']='tlcFlags',['offset']=3,['end']=8,['kind']='rip'}},['sig']='Weight',['name']='capture'}} end)()

local function oldEqual065(a,b)
 local x=readBytes(a,#b,true);if not x then return false end
 for k,v in ipairs(b)do if x[k]~=v then return false end end;return true
end
local function oldSigned065(v)if v&gt;=0x80000000 then return v-0x100000000 end;return v end
local function oldThreadAPI065(a)
 local valid=false
 for _,name in ipairs({'kernelbase.GetCurrentThreadId','kernel32.GetCurrentThreadId','GetCurrentThreadId'})do
  if getAddressSafe(name)==a then valid=true;break end
 end
 return valid and oldEqual065(a,{0x65,0x48,0x8b,0x04,0x25,0x48,0,0,0,0xc3})
end
local function inspectOldCode065(p,base)
 local sg=TLC.SIGS[p.sig];if not sg then return end;if TLC.hookState[p.name]then return end;local site=TLC.legacySite074(p.sig);if not site then return end
 local original={};for k=1,sg.len do original[k]=sg.bytes[k]end
 if oldEqual065(site,original)then return end
 for _,st in pairs(TLC.hookState)do if st.addr==site then return end end
 local patch=readBytes(site,sg.len,true);if not patch or patch[1]~=0xe9 then return end
 for k,v in ipairs(p.padding)do if patch[k+5]~=v then return end end
 local delta=readInteger(site+1);if delta==nil then return end
 local cave=site+5+oldSigned065(delta);local code=readBytes(cave,#p.pattern,true);if not code then return end
 for k,v in ipairs(p.pattern)do if v~=-1 and code[k]~=v then return end end
 local symbols={}
 for _,r in ipairs(p.relocations)do
  if r.kind=='api'then
   local value=readQword(cave+r.offset);if not value or not oldThreadAPI065(value)then return end
  elseif r.kind=='siteReturn'or r.kind=='scopedTarget'then
   local value=readInteger(cave+r.offset);if value==nil or not TLC.legacyReturn074(site,sg,r,cave+r['end']+oldSigned065(value))then return end
  else
   local address
   if r.kind=='rip'then local value=readInteger(cave+r.offset);if value==nil then return end;address=cave+r['end']+oldSigned065(value)
   elseif r.kind=='absolute'then address=r.size==8 and readQword(cave+r.offset)or readInteger(cave+r.offset)
   else return end
   if not address then return end;local target=address-r.add
   if symbols[r.symbol]and symbols[r.symbol]~=target then return end
   local c=p.constraints[r.symbol];if c and not TLC.legacyConstraint074(r.symbol,target,c)then return end
   symbols[r.symbol]=target
  end
 end
 local flags=symbols.tlcFlags or(symbols.tlcVars and symbols.tlcVars-0x100)or(symbols.tlcPtrs and symbols.tlcPtrs-0x200)
 if flags then
  if flags%0x1000~=0 then return end
  if symbols.tlcFlags and symbols.tlcFlags~=flags then return end
  if symbols.tlcVars and symbols.tlcVars~=flags+0x100 then return end
  if symbols.tlcPtrs and symbols.tlcPtrs~=flags+0x200 then return end
  if readBytes(flags,1)==nil then return end
 end
 return{name=p.name,sig=p.sig,site=site,cave=cave,code=code,patch=patch,original=original,full=sg.bytes}
end
function TLC.restoreLegacyOwnedHooks065()
 if not TLC.image038 or not TLC.image038.known then return 0 end
 local base=TLC.mod();if not base then return 0 end
 local prepared={};for _,p in ipairs(oldCodeProfiles065)do local found=inspectOldCode065(p,base);if found then prepared[#prepared+1]=found end end
 local overlays={};for _,x in ipairs(prepared)do overlays[#overlays+1]={addr=x.site,patch=x.patch,orig=x.original}end
 for _,st in pairs(TLC.hookState)do if st.addr and st.orig and st.patch and oldEqual065(st.addr,st.patch)then overlays[#overlays+1]=st end end
 local verified={}
 for _,x in ipairs(prepared)do
  local view=readBytes(x.site,#x.full,true)
  if view then
   for _,st in ipairs(overlays)do
    for k,v in ipairs(st.orig)do local off=st.addr+k-x.site;if off&gt;=1 and off&lt;=#view then view[off]=v end end
   end
   local equal=true;for k,v in ipairs(x.full)do if view[k]~=v then equal=false;break end end
   if equal then verified[#verified+1]=x end
  end
 end
 local count=0
 for _,x in ipairs(verified)do
  if oldEqual065(x.site,x.patch)and oldEqual065(x.cave,x.code)then
   TLC.legacyRestorePending065=TLC.legacyRestorePending065 or{};TLC.legacyRestorePending065[x.site]=x
   assert(writeBytes(x.site,x.original),'Old TLC entry restoration failed: '..x.name)
   assert(oldEqual065(x.site,x.original),'Old TLC entry restore readback failed: '..x.name)
   TLC.legacyRestorePending065[x.site]=nil
   count=count+1
  end
 end
 TLC.lastLegacyRestore065=count
 if count&gt;0 then TLC.msg('Restored '..count..' verified previous TLC instruction sites.','照合した旧TLCの命令位置 '..count..'箇所を復元しました。')end
 return count
end

-- Game fields are resolved from UHT metadata / the current native function body.
-- No game member offset is presumed from the Steam build.
function TLC.reflectedFunction069(className,method)
 local cls=assert(TLC.refClass(className),'Class unavailable: '..className)
 for depth=1,64 do
  if not TLC.valid(cls)then break end
  local fn=readQword(cls+0x48);local seen={}
  for i=1,2048 do
   if not fn or fn==0 or seen[fn]then break end;seen[fn]=true
   if TLC.valid(fn)and TLC.U.n(fn)==method and TLC.U.c(fn)=='Function'then return fn end
   fn=readQword(fn+0x28)
  end
  cls=readQword(cls+0x40)
 end
 error('Reflected function unavailable: '..className..'.'..method)
end
function TLC.reflectedNativeBody069(fn)
 local start=readQword(fn+0xd8)
 assert(TLC.executable038(start,16),'Reflected native wrapper unavailable')
 -- Walk instructions, rather than presuming the wrapper's CALL displacement.
 local ip=start;local last;local redirects=0
 for step=1,160 do
  assert(TLC.executable038(ip,16),'Native wrapper leaves executable code')
  local op=readBytes(ip,1)
  if op==0xc3 or op==0xc2 then
   assert(last and TLC.executable038(last,32),'Native wrapper has no verified implementation call')
   return last
  end
  local size=getInstructionSize(ip)
  assert(size and size&gt;=1 and size&lt;=15,'Native wrapper instruction unavailable')
  if op==0xe8 and size==5 then
   local rel=assert(readInteger(ip+1));if rel&gt;=0x80000000 then rel=rel-0x100000000 end
   last=ip+5+rel
  elseif op==0xe9 and step&lt;=5 then
   redirects=redirects+1;assert(redirects&lt;=4,'Native wrapper redirection loop')
   local rel=assert(readInteger(ip+1));if rel&gt;=0x80000000 then rel=rel-0x100000000 end
   ip=ip+5+rel;size=0
  end
  ip=ip+size
  assert(math.abs(ip-start)&lt;2048,'Native wrapper exceeds bounded search')
 end
 error('Native wrapper return not found')
end
TLC.SIGS.HumanFeed069={len=9,
 bytes={64,85,83,86,72,141,108,36,185,72,129,236,160,0,0,0,15,41,180,36,128,0,0,0,72,139,217,15,40,241,232},
 p='40 55 53 56 48 8D 6C 24 B9 48 81 EC A0 00 00 00 0F 29 B4 24 80 00 00 00 48 8B D9 0F 28 F1 E8'}
local previousRef069=TLC.refCode
function TLC.refCode(name)
 if name~='HumanFeed069'then return previousRef069(name)end
 local ok,result=pcall(function()
  return TLC.reflectedNativeBody069(TLC.reflectedFunction069('VoyageLazarusPOD','FeedHuman'))
 end)
 if not ok then return nil,tostring(result)end
 local s=TLC.SIGS.HumanFeed069;local b=readBytes(result,#s.bytes,true)
 if not b or #b~=#s.bytes then return nil,'Reflected growth code unreadable'end
 for i,v in ipairs(s.bytes)do if b[i]~=v then return nil,'Reflected growth entry instruction shape differs'end end
 return result
end
local resolveBeforeHuman069=TLC.resolveSig
function TLC.resolveSig(name)
 if name~='HumanFeed069'then return resolveBeforeHuman069(name)end
 if TLC.A[name]then return TLC.A[name]end
 local okay,address,why=pcall(TLC.refCode,name)
 if okay and address then
  TLC.A[name]=address;TLC.resolution[name]='reflection';TLC.pend[name]=nil
  TLC.failures[name]=nil;registerSymbol('tlcA_'..name,address,true);return address
 end
 local reason=okay and why or address
 TLC.resolution[name]='failed';TLC.failures[name]=tostring(reason)
 TLC.reason(name,TLC.T('Unavailable: ','利用不可: ')..tostring(reason));return nil
end
local humanTemplate069=[==[
[ENABLE]
alloc(tlc_humanInstant069,512,$SITE)
label(tlc_humanInstant069_original)
label(tlc_humanInstant069_step)
label(tlc_humanInstant069_zero)
label(tlc_humanInstant069_return)
tlc_humanInstant069:
pushfq
cmp byte ptr [tlcFlags+22],0
je tlc_humanInstant069_original
cmp byte ptr [rcx+@SIM@],0
jne tlc_humanInstant069_original
cmp byte ptr [rcx+@HUMAN@],0
jne tlc_humanInstant069_original
ucomiss xmm1,[tlc_humanInstant069_zero]
jp tlc_humanInstant069_original
jbe tlc_humanInstant069_original
ucomiss xmm1,[tlc_humanInstant069_step]
jp tlc_humanInstant069_original
jae tlc_humanInstant069_original
movss xmm1,[tlc_humanInstant069_step]
tlc_humanInstant069_original:
popfq
$ORIG
jmp tlc_humanInstant069_return
align 4
tlc_humanInstant069_step:
dd (float)600
tlc_humanInstant069_zero:
dd (float)0
$SITE:
jmp tlc_humanInstant069
$NOP
tlc_humanInstant069_return:
[DISABLE]
$SITE:
$ORIG
]==]
TLC.HOOKS.humanInstant069={sig='HumanFeed069',aa=humanTemplate069}
local function one069(pattern,lo,size)
 assert(TLC.executable038(lo,size),'Growth validation range unavailable')
 local matches=TLC.aobAll(pattern,lo,lo+size,2)
 assert(#matches==1,#matches==0 and 'Growth validation pattern missing'or 'Growth validation pattern ambiguous')
 return matches[1]
end
local function le069(n)
 local out={};for i=0,3 do out[#out+1]=string.format('%02X',(n&gt;&gt;(i*8))&amp;255)end;return table.concat(out,' ')
end
TLC.F.humanInstant068={flag=0x22,hooks={'humanInstant069'},on=function()
 TLC.require()
 local cls=assert(TLC.refClass('VoyageLazarusPOD'),'Human pod class unavailable')
 local human,humanSize=TLC.refFieldLayout(cls,'bHasHumanCurrent',true)
 assert(human and human&gt;0 and human&lt;0x10000 and humanSize==1,'Human completion property unavailable')
 local feedFn=TLC.reflectedFunction069('VoyageLazarusPOD','FeedHuman')
 local simFn=TLC.reflectedFunction069('VoyageLazarusPOD','Simulate')
 assert(readSmallInteger(feedFn+0xb6)==4 and readSmallInteger(simFn+0xb6)==1,'Human growth API parameter layout differs')
 local feed=TLC.reflectedNativeBody069(feedFn);local sim=TLC.reflectedNativeBody069(simFn)
 assert(feed==TLC.resolveSig('HumanFeed069'),'Growth signature and reflection disagree')
 -- Simulation tests its private state before the seed refrigeration check.
 local test=one069('80 BB ?? ?? ?? ?? 00 75 ?? 33 D2 48 8B CE E8 ?? ?? ?? ?? 84 C0 0F 84',feed,256)
 local state=assert(readInteger(test+2));assert(state&gt;0 and state&lt;0x10000,'Simulation state displacement invalid')
 -- Cross-check the same member in Simulate immediately before its FeedHuman loop.
 local enter=one069('C6 87 '..le069(state)..' 01 0F 28 CE 48 8B CF E8 ?? ?? ?? ?? 0F 2F',sim,4096)
 local rel=assert(readInteger(enter+14));if rel&gt;=0x80000000 then rel=rel-0x100000000 end
 assert(enter+18+rel==feed,'Simulation loop calls another growth implementation')
 -- Confirm the public bool is used as a whole byte in the actual completion path.
 one069('C6 87 '..le069(human)..' 01',feed,4096)
 TLC.HOOKS.humanInstant069.aa=humanTemplate069:gsub('@SIM@',string.format('%X',state)):gsub('@HUMAN@',string.format('%X',human))
 TLC.humanLayout069={human=human,simulation=state,feed=feed,simulate=sim}
end}
-- This feature has no world polling. Unknown executables still need every code,
-- reflection, parameter, property, and native cross-reference check above to pass.
TLC.compat038.portable.humanInstant068=true
TLC.NAMES[702]={'Instant human creation (growth pod)','即人間作成（育成ポッド）'}

-- Network supply first credits the receiver, then debits its provider as Transfer.
-- Suppress only the provider debit. Failure rollback calls remain untouched.
local transferBytes071={255,144,32,5,0,0}
TLC.SIGS.FuelGridSupply071={len=6,bytes=transferBytes071,
 p='FF 90 20 05 00 00 84 C0 74 ?? F2 44 0F 5C C6 EB ?? 48 8B 03 41 B1 02 0F 28 D6 40 0F B6 D7 48 8B CB FF 90 20 05 00 00'}
TLC.SIGS.FuelCableSupply071={len=6,bytes=transferBytes071,
 p='FF 90 20 05 00 00 84 C0 74 ?? 49 8B 4D 10 B2 01 49 63 45 18 4C 8D 04 C1 49 3B C8 74 ?? 48 8B 01 48 85 C0'}
local template071=[==[
[ENABLE]
alloc(tlc_fuelGrid071,1024,$SITE)
label(tlc_fuelGrid071_normal)
label(tlc_fuelGrid071_eligible)
label(tlc_fuelGrid071_owner)
label(tlc_fuelGrid071_root)
label(tlc_fuelGrid071_scene)
label(tlc_fuelGrid071_sceneClass)
label(tlc_fuelGrid071_nextScene)
label(tlc_fuelGrid071_skip)
label(tlc_fuelGrid071_return)
label(tlc_fuelGrid071Data)
registersymbol(tlc_fuelGrid071Data)
tlc_fuelGrid071:
pushfq
push rax
push rdx
push r8
push r9
push r10
push r11
cmp byte ptr [tlcFlags+08],0
je tlc_fuelGrid071_normal
cmp r9b,02
jne tlc_fuelGrid071_normal
cmp dl,00
je tlc_fuelGrid071_eligible
cmp dl,01
je tlc_fuelGrid071_eligible
cmp dl,02
je tlc_fuelGrid071_eligible
cmp dl,10
jne tlc_fuelGrid071_normal
tlc_fuelGrid071_eligible:
mov r10,[tlc_fuelGrid071Data]
test r10,r10
je tlc_fuelGrid071_normal
// UObject.Outer, rather than the game-specific cached-owner field.
mov rax,[rcx+20]
test rax,rax
je tlc_fuelGrid071_normal
mov rdx,[rax+10]
mov r8d,40
tlc_fuelGrid071_owner:
test rdx,rdx
je tlc_fuelGrid071_normal
cmp rdx,r10
je tlc_fuelGrid071_skip
cmp rdx,[tlc_fuelGrid071Data+08]
je tlc_fuelGrid071_root
cmp rdx,[tlc_fuelGrid071Data+10]
je tlc_fuelGrid071_root
mov rdx,[rdx+40]
dec r8d
jne tlc_fuelGrid071_owner
jmp tlc_fuelGrid071_normal
tlc_fuelGrid071_root:
mov r11,[rax+@ROOT@]
mov r9d,40
tlc_fuelGrid071_scene:
test r11,r11
je tlc_fuelGrid071_normal
mov rax,[r11+20]
test rax,rax
je tlc_fuelGrid071_nextScene
mov rdx,[rax+10]
mov r8d,40
tlc_fuelGrid071_sceneClass:
test rdx,rdx
je tlc_fuelGrid071_nextScene
cmp rdx,r10
je tlc_fuelGrid071_skip
mov rdx,[rdx+40]
dec r8d
jne tlc_fuelGrid071_sceneClass
tlc_fuelGrid071_nextScene:
mov r11,[r11+@PARENT@]
dec r9d
jne tlc_fuelGrid071_scene
jmp tlc_fuelGrid071_normal
tlc_fuelGrid071_skip:
inc dword ptr [tlc_fuelGrid071Data+18]
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rax
popfq
mov al,1
jmp tlc_fuelGrid071_return
tlc_fuelGrid071_normal:
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rax
popfq
$ORIG
jmp tlc_fuelGrid071_return
align 8
tlc_fuelGrid071Data:
dq 0 0 0 0
$SITE:
jmp tlc_fuelGrid071
$NOP
tlc_fuelGrid071_return:
[DISABLE]
$SITE:
$ORIG
unregistersymbol(tlc_fuelGrid071Data)
]==]
TLC.HOOKS.fuelGrid071={sig='FuelGridSupply071',aa=template071}
TLC.HOOKS.fuelCable071={sig='FuelCableSupply071',aa=template071:gsub('tlc_fuelGrid071','tlc_fuelCable071')}
local prepareFuel071=TLC.F.fuel.on
TLC.F.fuel.hooks={'fuelDebit061','fuelStorage062','fuelGrid071','fuelCable071'}
TLC.F.fuel.on=function()
 local boat=assert(TLC.refClass('VoyageBoatPawn'),'Boat class unavailable')
 local module=assert(TLC.refClass('VoyageModuleActor'),'Module actor class unavailable')
 local engine=assert(TLC.refClass('VoyageModuleEngineActor'),'Engine actor class unavailable')
 local scene=assert(TLC.refClass('SceneComponent'),'Scene class unavailable')
 local root,size=TLC.refFieldLayout(boat,'RootComponent',true)
 local moduleRoot=TLC.refFieldLayout(module,'RootComponent',true)
 local engineRoot=TLC.refFieldLayout(engine,'RootComponent',true)
 local parent,parentSize=TLC.refFieldLayout(scene,'AttachParent',true)
 assert(root and root&gt;0 and size==8 and moduleRoot==root and engineRoot==root and parent and parent&gt;0 and parentSize==8,'Boat attachment metadata unavailable')
 local aa=template071:gsub('@ROOT@',string.format('%X',root)):gsub('@PARENT@',string.format('%X',parent))
 local semantics=assert(TLC.fuelSemantics074,'Fuel enum semantics not prepared')
 aa=aa:gsub('cmp r9b,02\n',('cmp r9b,%X\n'):format(semantics.removal.Transfer),1)
 for _,row in ipairs({{'00','Electricity'},{'01','Petrol'},{'02','Oil'},{'10','Diesel'}})do
  aa=aa:gsub('cmp dl,'..row[1]..'\n',('cmp dl,%X\n'):format(assert(semantics.resources[row[2]])),1)
 end
 TLC.HOOKS.fuelGrid071.aa=aa;TLC.HOOKS.fuelCable071.aa=aa:gsub('tlc_fuelGrid071','tlc_fuelCable071')
 prepareFuel071()
 for _,row in ipairs({{'fuelGrid071','tlc_fuelGrid071Data'},{'fuelCable071','tlc_fuelCable071Data'}})do
  TLC.hookOn(row[1]);local d=assert(getAddressSafe(row[2]),'Fuel supply hook data unavailable')
  assert(writeQword(d,boat)and writeQword(d+8,module)and writeQword(d+16,engine),'Fuel supply class setup failed')
 end
end


;(function(TLC)
-- Derive the UObject chunk pointer and count from the same checked accessor.
-- Pattern positions below are instruction positions, not UObject member offsets.
TLC.objectPattern072='3B 05 ?? ?? ?? ?? 7D 1E 8B C8 0F B7 C0 48 C1 E9 10 48 8D 14 40 48 8B 05 ?? ?? ?? ?? 48 8B 0C C8 48 8D 04 D1 EB 03 49 8B C7 48 8B 00 48 C1 F8 20 C1 E8 19 A8 01 0F 85 ?? ?? ?? ?? 41 8B 40 0C 3B 05 ?? ?? ?? ??'
function TLC.objectCount072()
 local address=TLC.U.gc
 if address then return readInteger(address)end
end
local function rip072(address,displacement,length)
 local d=readInteger(address+displacement);if not d then return end
 if d&gt;=0x80000000 then d=d-0x100000000 end
 return address+length+d
end
function TLC.objectCandidate072(start)
 local image=TLC.image038;if not image then return nil,'missing executable identity'end
 local objects=rip072(start+21,3,7)
 local countAddress=rip072(start,2,6)
 if not objects or not countAddress or countAddress~=rip072(start+63,2,6)then return nil,'object count references disagree'end
 for _,a in ipairs({objects,countAddress})do
  if a&lt;image.base or a+8&gt;image.base+image.size then return nil,'object metadata outside executable image'end
 end
 local count=readInteger(countAddress);local chunks=readQword(objects)
 if not count or count&lt;16 or count&gt;4000000 or not chunks or chunks&lt;0x10000 or chunks%8~=0 then return nil,'invalid object array header'end
 local chunk=readQword(chunks)
 if not chunk or chunk&lt;0x10000 or chunk%8~=0 then return nil,'invalid first object chunk'end
 local verified=0
 for index=0,math.min(count-1,63)do
  local object=readQword(chunk+index*24+8)
  if object and object&gt;=0x10000 and object%8==0 and readInteger(object+0xc)==index then
   local class=readQword(object+0x10)
   if class and class&gt;=0x10000 and class%8==0 and readQword(class)then verified=verified+1 end
  end
 end
 if verified&lt;8 then return nil,'object indices and class pointers failed validation'end
 return {objects=objects,countAddress=countAddress,site=start+21,start=start,verified=verified}
end
function TLC.resolveObjects072()
 local image=assert(TLC.image038,'Executable identity unavailable')
 local cached=rawget(_G,'TLCObjectLayout072')
 local function matches(start)
  local bytes=readBytes(start,69,true);if not bytes or #bytes~=69 then return false end
  local i=0;for token in TLC.objectPattern072:gmatch('%S+')do i=i+1;if token~='??'and bytes[i]~=tonumber(token,16)then return false end end
  return true
 end
 local function publish(row,method)
  TLC.objectBootstrap072=row;TLC.U.gc=row.countAddress
  TLC.A.Objects=row.site;TLC.resolution.Objects=method;TLC.pend.Objects=nil;TLC.failures.Objects=nil
  row.pid=getOpenedProcessID();row.base=image.base;row.size=image.size;row.ts=image.ts
  _G.TLCObjectLayout072=row
  registerSymbol('tlcA_Objects',row.site,true)
  return row.site
 end
 if cached and cached.pid==getOpenedProcessID()and cached.base==image.base and cached.size==image.size and cached.ts==image.ts and matches(cached.start)then
  local row=TLC.objectCandidate072(cached.start)
  if row and row.objects==cached.objects and row.countAddress==cached.countAddress then return publish(row,'verified accessor cache')end
 end
 local candidates,why=TLC.scanFile074(TLC.objectPattern072,function(start)
  return TLC.objectCandidate072(start)
 end)
 if candidates then
  local rows={};for _,row in ipairs(candidates)do rows[string.format('%X:%X',row.objects,row.countAddress)]=row end
  local count=0;local row;for _,value in pairs(rows)do count=count+1;row=value end
  if count==1 then return publish(row,'verified executable-file accessor')end
  TLC.resolution.Objects='failed';TLC.reason('Objects',count&gt;1 and'multiple verified object arrays'or'no verified object array in executable file');return nil
 end
 if TLC.resolution.Objects=='failed'then return nil end
 TLC.searchCount=(TLC.searchCount or 0)+1
 local deadline=getTickCount()+TLC.compat038.scanMs
 local candidates={};local seen={};local rejected=0;local lastReason
 for _,section in ipairs(image.sections)do
  local cursor=section.lo
  while cursor&lt;section.hi do
   if getTickCount()&gt;=deadline then lastReason='object accessor search time limit reached';break end
   local finish=math.min(cursor+TLC.compat038.chunk,section.hi)
   local found=TLC.aobAll(TLC.objectPattern072,cursor,math.min(finish+68,section.hi),33)
   if #found&gt;=33 then lastReason='object accessor candidate limit reached';break end
   for _,a in ipairs(found)do
    if a&gt;=section.lo and a+69&lt;=section.hi and not seen[a]then
     seen[a]=true
     local row,reason=TLC.objectCandidate072(a)
     if row then
      local key=string.format('%X:%X',row.objects,row.countAddress)
      candidates[key]=candidates[key]or row
     else rejected=rejected+1;lastReason=reason end
    end
   end
   cursor=finish
  end
  if cursor&lt;section.hi then
   TLC.resolution.Objects='failed';TLC.reason('Objects',lastReason);return nil
  end
 end
 if getTickCount()&gt;=deadline then TLC.resolution.Objects='failed';TLC.reason('Objects','object accessor search time limit reached');return nil end
 local count=0;local selected;for _,row in pairs(candidates)do count=count+1;selected=row end
 if count==1 then return publish(selected,'validated object accessor')end
 TLC.resolution.Objects='failed';TLC.pend.Objects=nil
 local reason=count&gt;1 and'object accessor refers to multiple validated arrays'or('no verified object accessor; rejected '..rejected..' candidate(s)'..(lastReason and': '..lastReason or''))
 TLC.reason('Objects',reason);return nil
end
local resolveBefore072=TLC.resolveSig
function TLC.resolveSig(name)
 if name=='Objects'then return TLC.resolveObjects072()end
 return resolveBefore072(name)
end

TLC.SIGS.Objects.bootstrapPattern=TLC.objectPattern072:match('48 8B 05.*')


-- Common object paths use named metadata on every build, including the known PE.
function TLC.cacheClass072(object)
 if not TLC.valid(object)then return end
 TLC.classes038=TLC.classes038 or{}
 local cls=readQword(object+0x10)
 for depth=1,64 do
  if not TLC.valid(cls)or not TLC.U.isA(cls,'Class')then break end
  if TLC.U.c(cls)=='Class'then TLC.classes038[TLC.U.n(cls)]=cls end
  cls=readQword(cls+0x40)
 end
end
local function objectProperty072(object,name)
 if not TLC.valid(object)then return end
 local off,size=TLC.refFieldLayout(object,name,false)
 if off and off&gt;=0 and off&lt;0x100000 and size==8 then
  local value=readQword(object+off)
  if TLC.valid(value)then TLC.cacheClass072(value);return value end
 end
end
function TLC.world()
 local engine=TLC.U.ge and readQword(TLC.U.ge)
 local viewport=objectProperty072(engine,'GameViewport')
 local world=objectProperty072(viewport,'World')
 if world and TLC.U.isA(world,'World')then return world end
end
function TLC.playerController(required)
 local gi=objectProperty072(TLC.world(),'OwningGameInstance')
 local off,size;if gi then off,size=TLC.refFieldLayout(gi,'LocalPlayers',false)end
 local array=off and size==16 and readQword(gi+off)
 local count=off and size==16 and readInteger(gi+off+8)
 local player=array and count and count&gt;=1 and count&lt;=8 and readQword(array)
 local controller=objectProperty072(player,'PlayerController')
 if controller and TLC.U.isA(controller,'VoyagePlayerController')then return controller end
 if required then error(TLC.T('Local player controller unavailable: reflected object path unresolved.','ローカルプレイヤーの制御を取得できません。リフレクションの参照経路が未解決です。'),0)end
end
function TLC.controlledPawn(required)
 local pawn=objectProperty072(TLC.playerController(false),'AcknowledgedPawn')
 if pawn and TLC.U.isA(pawn,'Pawn')then return pawn end
 if required then error(TLC.T('Controlled pawn unavailable. Load a playable save.','操作対象を取得できません。プレイ可能なセーブを読み込んでください。'),0)end
end
function TLC.player(required)
 local pawn=TLC.controlledPawn(false)
 if pawn and TLC.U.isA(pawn,'VoyageCharacter')then return pawn end
 if pawn and TLC.U.isA(pawn,'VoyageVehiclePawn')then
  local driver=objectProperty072(pawn,'Driver')
  if driver and TLC.U.isA(driver,'VoyageCharacter')then return driver end
 end
 if required then error(TLC.T('Player character unavailable: reflected pawn/driver path unresolved.','プレイヤーキャラクターを取得できません。操作対象・搭乗者の参照経路が未解決です。'),0)end
end
local refClassBefore072=TLC.refClass
function TLC.refClass(name)
 local cached=TLC.classes038 and TLC.classes038[name]
 if cached and TLC.valid(cached)and TLC.U.n(cached)==name and TLC.U.c(cached)=='Class'then return cached end
 if TLC.U.go and TLC.U.gn and TLC.U.ge then
  local pc=TLC.playerController(false)
  if pc then objectProperty072(pc,'PlayerState')end
  local player=TLC.player(false)
  if player then objectProperty072(player,'WeightInventory')end
  cached=TLC.classes038 and TLC.classes038[name]
  if cached and TLC.valid(cached)and TLC.U.n(cached)==name and TLC.U.c(cached)=='Class'then return cached end
 end
 return refClassBefore072(name)
end
-- Match the native implementation among decoded calls in its named UFunction.
-- No historical wrapper CALL displacement is used for reflected fallback.
local refBefore072=TLC.refCode
function TLC.refCode(name)
 local hints=TLC.REF_HINTS[name]
 if not hints then return refBefore072(name)end
 local sig=TLC.SIGS[name];local candidates={};local failures={}
 local function exact(address)
  if not TLC.executable038(address,#sig.bytes)then return false end
  local bytes=readBytes(address,#sig.bytes,true);if not bytes or #bytes~=#sig.bytes then return false end
  local ignored={};local portable=TLC.codePatterns074 and TLC.codePatterns074[name]
  for _,offset in ipairs(portable and portable.mask or{})do ignored[offset]=true end
  for i,v in ipairs(sig.bytes)do if bytes[i]~=v and not ignored[i]then return false end end
  return true
 end
 for _,hint in ipairs(hints)do
  local localCandidates={}
  local okay,why=pcall(function()
   local fn=TLC.reflectedFunction069(hint.owner,hint.fn)
   local start=readQword(fn+0xd8);assert(TLC.executable038(start,16),'Native wrapper unavailable')
   if exact(start)then localCandidates[start]=true end
   local ip=start;local seen={};local returned=false;local redirects=0
   for step=1,256 do
    if TLC.reflectionDeadline074 and getTickCount()&gt;=TLC.reflectionDeadline074 then error('reflection search time limit reached')end
    assert(not seen[ip]and TLC.executable038(ip,16),'Native wrapper loop or invalid address');seen[ip]=true
    local opcode=readBytes(ip,1)
    if opcode==0xc3 or opcode==0xc2 then returned=true;break end
    local size=getInstructionSize(ip);assert(size and size&gt;=1 and size&lt;=15,'Native wrapper instruction unavailable')
    if opcode==0xe8 and size==5 then
     local target=rip072(ip,1,5);if exact(target)then localCandidates[target]=true end
    elseif opcode==0xe9 and step&lt;=5 then
     redirects=redirects+1;assert(redirects&lt;=4,'Native wrapper redirection loop')
     ip=assert(rip072(ip,1,5));size=0
    end
    ip=ip+size;assert(math.abs(ip-start)&lt;4096,'Native wrapper exceeds bounded search')
   end
   assert(returned,'Native wrapper return not found')
  end)
  if okay then for target in pairs(localCandidates)do candidates[target]=true end
  else failures[#failures+1]=tostring(why)end
 end
 local count=0;local found;for target in pairs(candidates)do found=target;count=count+1 end
 if count==1 then return found end
 return nil,count&gt;1 and'ambiguous verified reflected implementations'or('no verified reflected implementation'..(#failures&gt;0 and': '..table.concat(failures,'; ')or''))
end


-- A no-argument float getter is identified by UFunction metadata and its result
-- store, not by an old function-entry byte sequence or wrapper CALL offset.
function TLC.floatGetter072(owner,method)
 local fn=TLC.reflectedFunction069(owner,method)
 assert(readSmallInteger(fn+0xb6)==4,'Float getter parameter size differs: '..method)
 local prop=readQword(fn+0x50);local count=0
 while prop and prop~=0 do
  count=count+1;assert(count==1,'Float getter has unexpected parameters: '..method)
  assert(TLC.U.name(readInteger(prop+0x20))=='ReturnValue'and readInteger(prop+0x44)==0 and readInteger(prop+0x34)==4,'Float getter result metadata differs: '..method)
  prop=readQword(prop+0x18)
 end
 assert(count==1,'Float getter return metadata missing: '..method)
 local start=readQword(fn+0xd8);local ip=start;local found={};local returned=false
 for step=1,128 do
  assert(TLC.executable038(ip,16),'Float getter wrapper leaves executable code')
  local op=readBytes(ip,1)
  if op==0xc3 or op==0xc2 then returned=true;break end
  local size=getInstructionSize(ip);assert(size and size&gt;=1 and size&lt;=15,'Float getter instruction unreadable')
  if op==0xe8 and size==5 then
   local next=readBytes(ip+5,4,true)
   -- These wrappers store the float return value to the VM result pointer in RBX.
   if next and next[1]==0xf3 and next[2]==0x0f and next[3]==0x11 and next[4]==0x03 then
    local target=rip072(ip,1,5);assert(TLC.executable038(target,16),'Float getter target unavailable');found[target]=true
   end
  end
  ip=ip+size;assert(ip-start&lt;1024,'Float getter wrapper exceeds bound')
 end
 assert(returned,'Float getter wrapper return missing')
 local number=0;local target;for a in pairs(found)do number=number+1;target=a end
 assert(number==1,'Float getter implementation is missing or ambiguous')
 return target,fn
end
function TLC.safeEntry072(address)
 local length=0
 while length&lt;5 do
  local ip=address+length;local size=getInstructionSize(ip)
  assert(size and size&gt;=1 and size&lt;=15 and length+size&lt;=16,'Native entry instruction length invalid')
  local b=readBytes(ip,size,true);assert(b and #b==size,'Native entry unreadable')
  local p=1;if b[p]&gt;=0x40 and b[p]&lt;=0x4f then p=p+1 end
  local opcode=b[p];local safe=false
  if opcode&gt;=0x50 and opcode&lt;=0x57 and size==p then safe=true
  elseif opcode==0x89 or opcode==0x8b or opcode==0x8d then
   local modrm=b[p+1];assert(modrm,'Native entry ModRM unavailable')
   local mode=modrm&gt;&gt;6;local rm=modrm&amp;7
   -- Register/indirect-base MOV/LEA can be copied unchanged. RIP-relative loads cannot.
   safe=not(mode==0 and rm==5)
   if mode==0 and rm==4 then local sib=b[p+2];safe=sib and(sib&amp;7)~=5 end
  elseif(opcode==0x83 or opcode==0x81)and b[p+1]==0xec and b[1]==0x48 then safe=true end
  assert(safe,'Native entry needs unsupported relocation; feature left unchanged')
  length=length+size
 end
 return length,assert(readBytes(address,length,true))
end
local getterInfo072={Weight={owner='VoyageCharacter',method='GetTotalCarriedWeight'},InventoryWeight={owner='VoyageInventoryWeightLimitedComponent',method='GetTotalWeight'}}
TLC.SIGS.Weight.dynamic072=true;TLC.SIGS.InventoryWeight.dynamic072=true
local resolveWeightBefore072=TLC.resolveSig
function TLC.resolveSig(name)
 local info=getterInfo072[name]
 if not info then return resolveWeightBefore072(name)end
 local okay,result=pcall(function()
  local address,fn=TLC.floatGetter072(info.owner,info.method)
  local sig=TLC.SIGS[name]
  if TLC.A[name]==address and TLC.originalView043(address,sig.bytes)then return address end
  local len,bytes=TLC.safeEntry072(address)
  sig.len=len;sig.bytes=bytes
  TLC.A[name]=address;TLC.resolution[name]='reflected float getter';TLC.failures[name]=nil;TLC.pend[name]=nil
  TLC.weightLayouts072=TLC.weightLayouts072 or{};TLC.weightLayouts072[name]={address=address,fn=fn,length=len}
  registerSymbol('tlcA_'..name,address,true);return address
 end)
 if okay then return result end
 TLC.A[name]=nil;TLC.resolution[name]='failed';TLC.reason(name,tostring(result));return nil
end
TLC.F.weight.on=function()
 local player=TLC.need();local inventory=objectProperty072(player,'WeightInventory')
 assert(inventory and TLC.U.isA(inventory,'VoyageInventoryWeightLimitedComponent'),'Reflected player weight inventory unavailable')
 assert(writeQword(TLC.base()+TLC.OFF_PTRS+0x20,inventory),'Weight inventory capture failed')
end
TLC.compat038.portable.weight=true


-- The experience argument member is read from the named struct descriptor linked
-- to GainExp's reflected parameter, then checked against the native integer test.
local expTemplate072=TLC.HOOKS.exp.aa
TLC.SIGS.Exp.dynamic072=true
function TLC.experienceLayout072()
 local fn=TLC.reflectedFunction069('VoyagePlayerState','GainExp')
 local inOffset,inSize=TLC.refFieldLayout(fn,'InExpArgument','function')
 local outOffset,outSize=TLC.refFieldLayout(fn,'ReturnValue','function')
 assert(inOffset==0 and inSize and outOffset==inSize and outSize==1 and readSmallInteger(fn+0xb6)==inSize+1,'Experience argument/result layout differs')
 local field=readQword(fn+0x50);local param
 for i=1,16 do
  if not field or field==0 then break end
  if TLC.U.name(readInteger(field+0x20))=='InExpArgument'then param=field;break end
  field=readQword(field+0x18)
 end
 assert(param,'Experience parameter metadata unavailable')
 local structs={}
 -- FStructProperty's metadata pointer location also need not be presumed.
 for off=0x50,0xf8,8 do
  local value=readQword(param+off)
  if TLC.valid(value)and TLC.U.c(value)=='ScriptStruct'and TLC.U.n(value)=='VoyageExperienceArguments'then structs[value]=true end
 end
 local count=0;local cls;for value in pairs(structs)do cls=value;count=count+1 end
 assert(count==1,'Experience parameter struct link is missing or ambiguous')
 local amount,size=TLC.refFieldLayout(cls,'Amount','struct')
 assert(amount and amount&gt;=0 and size==4 and amount+size&lt;=inSize,'Experience amount field unavailable')
 local native=TLC.reflectedNativeBody069(fn)
 local ip=native;local matched=false
 local owned=TLC.hookState.exp
 if owned and owned.addr==native then
  assert(TLC.originalView043(native,TLC.SIGS.Exp.bytes),'Experience hook ownership differs')
  ip=native+#owned.orig
 end
 for i=1,10 do
  local n=getInstructionSize(ip);assert(n and n&gt;=1 and n&lt;=15,'Experience entry instruction unreadable')
  local b=readBytes(ip,n,true)
  if n==4 and b[1]==0x83 and b[2]==0x7a and b[4]==0 then
   local displacement=b[3]&lt;128 and b[3]or b[3]-256;matched=displacement==amount;break
  elseif n==7 and b[1]==0x83 and b[2]==0xba and b[7]==0 then
   matched=readInteger(ip+2)==amount;break
  end
  -- Follow only a straight-line prologue until the argument check is confirmed.
  assert(b[1]~=0xc3 and b[1]~=0xe8 and b[1]~=0xe9 and not(b[1]&gt;=0x70 and b[1]&lt;=0x7f),'Experience native argument check unavailable')
  ip=ip+n
 end
 assert(matched,'Experience native argument access disagrees with reflected Amount')
 return {address=native,fn=fn,amount=amount,argumentSize=inSize,argumentStruct=cls}
end
local resolveExpBefore072=TLC.resolveSig
function TLC.resolveSig(name)
 if name~='Exp'then return resolveExpBefore072(name)end
 local okay,result=pcall(function()
  local layout=TLC.experienceLayout072();local sig=TLC.SIGS.Exp;local address=layout.address
  if TLC.A.Exp==address and TLC.originalView043(address,sig.bytes)then return address end
  local length,bytes=TLC.safeEntry072(address)
  sig.len=length;sig.bytes=bytes
  TLC.HOOKS.exp.aa=expTemplate072:gsub('%[rdx%+04%]','[rdx+'..string.format('%X',layout.amount)..']')
  TLC.expLayout072=layout;TLC.A.Exp=address;TLC.resolution.Exp='reflected experience argument';TLC.failures.Exp=nil;TLC.pend.Exp=nil
  registerSymbol('tlcA_Exp',address,true);return address
 end)
 if okay then return result end
 TLC.A.Exp=nil;TLC.resolution.Exp='failed';TLC.reason('Exp',tostring(result));return nil
end
TLC.F.exp.on=function()TLC.require()end
TLC.compat038.portable.exp=true

end)(TLC)


;(function(TLC)
local layoutDependencies={
 ammo='weapon ownership / resource consumption / magazine state',health='SurvivalAttributes container / survival value / health capture',battery='module resources / resource capacity',
 boat='boat damage dispatch / protected actor membership',boatSpeed='propulsion owner / propulsion parameters',
 clearWater='viewport show flags / render flag accessor',float='movement velocity / controlled character',
 fuel='resource debit owner / attachment / debit returns',fullTank='resource maps / installed tank capacity',
 gametime='WorldSettings time dilation',instant='fabrication / quest observer / dismantle-repair state',
 materials='fabrication material checks / repair requirements',noclip040='movement tick / ladder / transform call',
 noon='environment APIs / parameter layouts',oneshot='NPC class / survival component ownership',
 power='resource multiplier ABI',powerTank='resource multiplier / grid resource state',speed='movement component / final speed',
 tank='resource multiplier ABI',time='environment APIs / parameter layouts',waves051='wave arrays / weather output ABI',
 weather='weather API / climate state',wind='wind output ABI / wind arrays'
}
local metadataIndependent={invincible=true,cold=true,noresources=true,noCraftPower=true,seedCountdown=true,power=true,tank=true}
local extras={cold={'CV_cold'},noresources={'CV_consume'},oneshot={'NPCClass'}}
function TLC.checkFeature074(key)
 local feature=TLC.F[key];if not feature then return false,'Unknown feature: '..tostring(key)end
 if not metadataIndependent[key]and not TLC.reflectionReady074 then
  return false,'Unresolved dependency for '..key..': UObject metadata / '..tostring(TLC.metadataReason074)
 end
 if TLC.image038 and TLC.image038.known then return true end
 local layout=layoutDependencies[key]
 if layout then return false,'Unresolved layout dependency for '..key..': '..layout..'. No feature writes made.'end
 if not TLC.compat038.portable[key]then return false,'Unverified feature layout: '..key..'. No feature writes made.'end
 return true
end
local enable=TLC.feature
function TLC.feature(key,on)
 if on then
  local okay,reason=TLC.checkFeature074(key);if not okay then error(reason,0)end
  local f=TLC.F[key];local names={}
  for _,hook in ipairs(f and f.hooks or{})do local h=TLC.HOOKS[hook];if h then names[h.sig]=true end end
  for _,name in ipairs(extras[key]or{})do names[name]=true end
  -- A new explicit enable retries only its failed dependencies, never peers.
  for name in pairs(names)do if TLC.resolution[name]=='failed'then TLC.resolution[name]=nil;TLC.failures[name]=nil end end
 end
 return enable(key,on)
end
local validate=TLC.scanSelfTest
function TLC.scanSelfTest()
 -- This is a manual diagnostic, not a polling retry loop.
 for name in pairs(TLC.SIGS)do if TLC.resolution[name]=='failed'then TLC.resolution[name]=nil;TLC.failures[name]=nil end end
 TLC.refreshMetadata074()
 return validate()
end
end)(TLC)


;(function(TLC)
local function uint(data,offset,size)
 if not data or offset&lt;0 or offset+size&gt;#data then return end
 return string.unpack(size==2 and'&lt;I2'or'&lt;I4',data,offset+1)
end
function TLC.scanFile074(pattern,validate,allowManagedChange)
 local image=TLC.image038;if not image then return nil,'executable identity unavailable'end
 local path
 local okay,modules=pcall(enumModules)
 if okay then for _,m in ipairs(modules)do if m.Address==image.base then path=m.PathToFile;break end end end
 if type(path)~='string'or path==''then return nil,'module file path unavailable'end
 local file=io.open(path,'rb');if not file then return nil,'module file cannot be opened'end
 local function scan()
  local dos=file:read(64);assert(dos and dos:sub(1,2)=='MZ','file DOS header mismatch')
  local pe=assert(uint(dos,0x3c,4));assert(pe&gt;=64 and pe&lt;0x100000,'invalid file PE offset')
  file:seek('set',pe);local header=file:read(264)
  assert(header and header:sub(1,4)=='PE\0\0'and uint(header,4,2)==0x8664,'file PE identity mismatch')
  assert(uint(header,8,4)==image.ts and uint(header,0x50,4)==image.size,'loaded executable and file identity differ')
  local number=assert(uint(header,6,2));local optional=assert(uint(header,20,2));assert(number&gt;0 and number&lt;=96,'invalid file section count')
  file:seek('set',pe+24+optional);local sections=assert(file:read(number*40));assert(#sections==number*40,'file section table truncated')
  local width=0;local terms={}
  for token in pattern:gmatch('%S+')do
   width=width+1
   if token=='??'then terms[#terms+1]='.'else
    local byte=assert(tonumber(token,16));local ch=string.char(byte)
    if byte==0 then ch='%z'elseif ch:find('[%%%^%$%(%)%.%[%]%*%+%-%?]')then ch='%'..ch end
    terms[#terms+1]=ch
   end
  end
  assert(width&gt;0 and width&lt;=512,'invalid file pattern')
  local expression=table.concat(terms);local out={};local seen={};local deadline=getTickCount()+1500
  -- Search the strongest literal run first; do not backtrack a wildcard pattern
  -- over an entire executable for each optional feature.
  local anchor,anchorOffset='',0;local run,runOffset='',0;local index=0
  for token in (pattern..' ??'):gmatch('%S+')do
   if token=='??'then
    if #run&gt;#anchor then anchor,anchorOffset=run,runOffset end;run=''
   else if #run==0 then runOffset=index end;run=run..string.char(assert(tonumber(token,16)))end
   index=index+1
  end
  assert(#anchor&gt;0,'File pattern has no literal discriminator')
  for index=0,number-1 do
   local h=index*40;local flags=assert(uint(sections,h+36,4))
   if(flags&amp;0x20000000)~=0 then
    local rva=assert(uint(sections,h+12,4));local length=assert(uint(sections,h+16,4));local raw=assert(uint(sections,h+20,4))
    assert(rva&lt;image.size and length&lt;=image.size-rva+0x1000,'invalid file executable section')
    local cache=TLC.fileScanCache074
    if not cache or cache.pid~=getOpenedProcessID()or cache.base~=image.base or cache.path~=path or cache.ts~=image.ts or cache.size~=image.size then
     cache={pid=getOpenedProcessID(),base=image.base,path=path,ts=image.ts,size=image.size,bytes=0,chunks={}};TLC.fileScanCache074=cache
    end
    local cursor=0
    while cursor&lt;length do
     assert(getTickCount()&lt;deadline,'executable-file search time limit reached')
     local step=math.min(0x400000,length-cursor);local amount=math.min(step+511,length-cursor)
     local key=tostring(raw+cursor)..':'..amount;local bytes=cache.chunks[key]
     if not bytes then
      file:seek('set',raw+cursor);bytes=assert(file:read(amount))
      if cache.bytes+#bytes&lt;=0xc000000 then cache.chunks[key]=bytes;cache.bytes=cache.bytes+#bytes end
     end
     assert(#bytes&gt;=step,'executable file truncated')
     local from=1
     while true do
      local hit=bytes:find(anchor,from,true);if not hit then break end
      local at=hit-anchorOffset;from=hit+1
      local matches=at&gt;=1 and at+width-1&lt;=#bytes and bytes:sub(at,at+width-1):match('^'..expression..'$')~=nil
      local address=image.base+rva+cursor+at-1
      if matches and at&lt;=step and not seen[address]then
       seen[address]=true
       local actual=readBytes(address,width,true);local equal=actual and #actual==width
       if equal then for j=1,width do if actual[j]~=bytes:byte(at+j-1)then equal=false;break end end end
       if equal or allowManagedChange then local row;if validate then row=validate(address)else row=address end;if row then out[#out+1]=row end end
       assert(#out&lt;=4096,'too many executable-file candidates')
      end
     end
     cursor=cursor+step
    end
   end
  end
  assert(getTickCount()&lt;deadline,'executable-file search time limit reached')
  return out
 end
 local ok,result=pcall(scan);file:close()
 if ok then return result end
 return nil,tostring(result)
end
end)(TLC)


;(function(TLC)
local previous=TLC.resolveSig
local dynamic={Objects=true,HumanFeed069=true,Weight=true,InventoryWeight=true,Exp=true}
local function publish(name,address,method)
 TLC.A[name]=address;TLC.resolution[name]=method;TLC.pend[name]=nil;TLC.failures[name]=nil
 registerSymbol('tlcA_'..name,address,true)
 if name=='GameThread'then local d=readInteger(address+2);if d then if d&gt;=0x80000000 then d=d-0x100000000 end;registerSymbol('tlcGameThreadId',address+6+d,true)end end
 if name=='NPCClass'then local d=readInteger(address+3);if d then if d&gt;=0x80000000 then d=d-0x100000000 end;registerSymbol('tlcNpcClassSlot',address+7+d,true)end end
 return address
end
function TLC.resolveSig(name)
 if dynamic[name]then return previous(name)end
 local sig=TLC.SIGS[name]
 if not sig then TLC.reason(name,'Unknown dependency');return nil end
 if sig.mod then return TLC.resolveModuleExport074(name)end
 local cached=rawget(TLC.A,name)
 if cached and TLC.originalView043(cached,sig.bytes)then return publish(name,cached,'verified process cache')end
 if TLC.resolution[name]=='failed'then return nil end
 local portable=TLC.codePatterns074 and TLC.codePatterns074[name]
 local pattern=sig.bootstrapPattern or portable and portable.pattern or sig.p
 local function portableMatch(address)
  local actual=readBytes(address,#sig.bytes,true);if not actual or #actual~=#sig.bytes then return false end
  local mask={};for _,offset in ipairs(portable and portable.mask or{})do mask[offset]=true end
  for index,value in ipairs(sig.bytes)do if actual[index]~=value and not mask[index]then return false end end
  return actual
 end
 local function validate(address)
  local cvarName=TLC.cvarNames074 and TLC.cvarNames074[name]
  if cvarName then
   -- The actual console variable name disambiguates identical constructors.
   local d=readInteger(address+3);if not d then return end;if d&gt;=0x80000000 then d=d-0x100000000 end
   local text=readBytes(address+7+d,#cvarName*2+2,true)
   if not text or #text~=#cvarName*2+2 then return end
   for i=1,#cvarName do if text[i*2-1]~=cvarName:byte(i)or text[i*2]~=0 then return end end
   if text[#text-1]~=0 or text[#text]~=0 then return end
  end
  if name=='FogFlagsGetter039' then
   local engine=TLC.U.ge and readQword(TLC.U.ge)
   local viewport=engine and TLC.readObjectField074(engine,'GameViewport')
   if not viewport then return end
   local found=0
   for offset=8,0xf8,8 do
    local vtable=readQword(viewport+offset)
    if vtable and vtable&gt;=TLC.image038.base and vtable&lt;TLC.image038.base+TLC.image038.size then
     for slot=0,0xf8,8 do if readQword(vtable+slot)==address then found=found+1 end end
    end
   end
   if found~=1 then return end
  end
  if sig.bootstrapPattern or TLC.originalView043(address,sig.bytes)or portable and portableMatch(address)then return address end
 end
 -- Exact signatures remain a fast, stronger discriminator for unchanged code.
 -- Relocation-tolerant search is a fallback, not a replacement which merges
 -- unrelated CVar constructors / generated container helpers.
 local originalPattern=sig.bootstrapPattern or sig.p
 local rows,why=TLC.scanFile074(originalPattern,validate,not sig.bootstrapPattern)
 if(not rows or #rows~=1)and pattern~=originalPattern then
  local first=why or(rows and(#rows..' exact candidates'))or'no exact candidate'
  rows,why=TLC.scanFile074(pattern,validate,not sig.bootstrapPattern)
  if not rows or #rows~=1 then why=tostring(first)..'; '..tostring(why or rows and(#rows..' relocation candidates'))end
 end
 if rows and #rows==1 then
  local address=rows[1]
  if sig.bootstrapPattern then
   local width=#sig.bytes;if width==0 then for _ in pattern:gmatch('%S+')do width=width+1 end end
   sig.bytes=assert(readBytes(address,width,true),'Bootstrap signature bytes unreadable')
  elseif portable then local actual=portableMatch(address);if actual then sig.bytes=actual end end
  return publish(name,address,'verified executable-file signature')
 end
 why=rows and(#rows==0 and'no verified executable-file candidate'or'ambiguous executable-file signature')or why
 -- Reflection is independent of file-search failure/timeout/ambiguity.
 if not sig.bootstrapPattern and TLC.reflectionReady074 then
  local prior=TLC.reflectionDeadline074;TLC.reflectionDeadline074=getTickCount()+TLC.compat038.scanMs
  local okay,address,reason=pcall(TLC.refCode,name)
  local inBudget=getTickCount()&lt;TLC.reflectionDeadline074;TLC.reflectionDeadline074=prior
  if okay and inBudget and address and TLC.executable038(address,#sig.bytes)then
   local original=TLC.originalView043(address,sig.bytes);local actual=portable and portableMatch(address)
   if original or actual then if actual then sig.bytes=actual end;return publish(name,address,'verified named reflection')end
  end
  why=tostring(why)..'; '..tostring(okay and(reason or'no verified reflected implementation')or address)
 end
 TLC.A[name]=nil;TLC.resolution[name]='failed';TLC.pend[name]=nil
 local reason=TLC.T('Unavailable: ','利用不可: ')..tostring(why)
 if TLC.cvarNames074 and TLC.cvarNames074[name]then TLC.failures[name]=reason else TLC.reason(name,reason)end;return nil
end
end)(TLC)


;(function(TLC)
local function number(bytes,at,count)
 local result=0
 for i=count-1,0,-1 do local v=bytes[at+i];if v==nil then return end;result=(result&lt;&lt;8)|v end
 return result
end
function TLC.findMetadata074(name,kind)
 TLC.classes038=TLC.classes038 or{}
 local go=TLC.U.go;local count=go and TLC.objectCount072();local chunks=go and readQword(go)
 if not count or not chunks then return nil,'Object metadata unavailable'end
 local state=TLC.metaIndex074
 if not state or state.classKinds122~=true or state.go~=go or state.pid~=getOpenedProcessID()then
  state={classKinds122=true,go=go,pid=getOpenedProcessID(),cursor=0,types={},objects={Class={},Enum={},ScriptStruct={}}};TLC.metaIndex074=state
 end
 local map=state.objects[kind];assert(map,'Unsupported metadata category')
 local cached=map[name]
 if cached and TLC.valid(cached)and TLC.U.n(cached)==name and TLC.U.isA(cached,kind) then return cached end
 local deadline=math.min(getTickCount()+1500,TLC.reflectionDeadline074 or math.huge)
 while state.cursor&lt;count do
  if getTickCount()&gt;=deadline then return nil,'Metadata lookup time limit reached at object '..state.cursor end
  local index=state.cursor;local n=math.min(256,count-index,65536-index%65536)
  local chunk=readQword(chunks+(index//65536)*8);local entries=chunk and readBytes(chunk+(index%65536)*24,n*24,true)
  if not entries or #entries~=n*24 then return nil,'Object chunk unreadable'end
  for j=0,n-1 do
   state.cursor=index+j+1
   local object=number(entries,j*24+9,8)
   local header=object and object&gt;=0x10000 and readBytes(object,40,true)
   if header and #header==40 and number(header,13,4)==index+j and(number(header,9,4)&amp;0x18010)==0 then
    local cls=number(header,17,8)
    local category=state.types[cls]
    if category==nil then
     -- Class, Enum and ScriptStruct may themselves have generated subclasses.
     -- Classify by the metaclass inheritance chain, once per metaclass identity.
     local current=cls;local seen={}
     for depth=1,64 do
      if not TLC.valid(current)or seen[current]then break end;seen[current]=true
      local label=TLC.U.n(current)
      if state.objects[label]then category=label;break end
      current=readQword(current+0x40)
     end
     category=category or'?';state.types[cls]=category
    end
    local objects=state.objects[category]
    if objects then
     local label=TLC.U.name(number(header,25,4));objects[label]=object
     if category=='Class'then TLC.classes038[label]=object end
     if category==kind and label==name then return object end
    end
   end
  end
 end
 return nil,'Named metadata object not found: '..kind..'.'..name
end
function TLC.refClass(name)
 local cached=TLC.classes038 and TLC.classes038[name]
 if cached and TLC.valid(cached)and TLC.U.isA(cached,'Class')and TLC.U.n(cached)==name then return cached end
 return TLC.findMetadata074(name,'Class')
end
end)(TLC)


;(function(TLC)
function TLC.enumValues074(name)
 local object=assert(TLC.findMetadata074(name,'Enum'),'Enum metadata unavailable: '..name)
 local candidates={};local unique={}
 local function check(names,values,count,stride,valueStride,valueOffset)
  if not names or not values or names&lt;0x10000 or values&lt;0x10000 or not count or count&lt;2 or count&gt;256 then return end
  local row={};local seen={}
  for index=0,count-1 do
   local id=readInteger(names+index*stride);local okay,label=pcall(TLC.U.name,id)
   local value=readQword(values+index*valueStride+valueOffset)
   if not okay or type(label)~='string'or label:sub(1,#name+2)~=name..'::'or not value or value&lt;0 or value&gt;255 or seen[value]then return end
   row[label:sub(#name+3)]=value;seen[value]=true
  end
  local identity=tostring(names)..':'..tostring(values)..':'..count
  if not unique[identity]then unique[identity]=true;candidates[#candidates+1]=row end
 end
 -- Validate either standard TArray&lt;TPair&lt;FName,int64&gt;&gt; or the loaded engine's
 -- split name/value storage by contents. Neither member position is presumed.
 for off=0x28,0x100,8 do
  local data=readQword(object+off);local count=readInteger(object+off+8);local capacity=readInteger(object+off+12)
  if data and count and capacity and count&gt;=2 and count&lt;=capacity and capacity&lt;=256 then check(data,data,count,16,16,8)end
  local values=readQword(object+off+8);local n=readInteger(object+off+16)
  if data and values then check(data&amp;~1,values&amp;~1,n,8,8,0)end
 end
 assert(#candidates==1,'Enum storage is missing or ambiguous: '..name)
 return candidates[1]
end
local templates={}
for _,name in ipairs({'fuelDebit061','fuelStorage062'})do
 local aa=TLC.HOOKS[name].aa
 aa=aa:gsub('%[rdi%+A8%]','[rdi+20]'):gsub('%[rsi%+A8%]','[rsi+20]')
 aa=aa:gsub('%[rax%+1B8%]','[rax+@ROOT074@]'):gsub('%[r11%+D0%]','[r11+@PARENT074@]')
 templates[name]=aa
end
local before=TLC.F.fuel.on
function TLC.prepareFuelDebit074()
 local boat=assert(TLC.refClass('VoyageBoatPawn'),'Boat class unavailable')
 local scene=assert(TLC.refClass('SceneComponent'),'Scene class unavailable')
 local root,rootSize=TLC.refFieldLayout(boat,'RootComponent',true)
 local parent,parentSize=TLC.refFieldLayout(scene,'AttachParent',true)
 assert(root and root&gt;0 and rootSize==8 and parent and parent&gt;0 and parentSize==8,'Boat attachment metadata unavailable')
 local removal=TLC.enumValues074('EModuleResourceRemovalType')
 local resources=TLC.enumValues074('EModuleResourceType')
 for _,n in ipairs({'Consumption','ConsumptionAfterModifiers','Transfer','Overflow','Conversion','Leak','EfficiencyChange'})do assert(removal[n]~=nil,'Missing resource-removal reason: '..n)end
 local reasons={removal.Consumption,removal.ConsumptionAfterModifiers,removal.Conversion,removal.Leak}
 -- Overflow enforces the native capacity limit; it is not consumption. Keep it
 -- and EfficiencyChange normal, along with unrelated Transfer calls.
 for name,template in pairs(templates)do
  local prefix='tlc_'..name
  local gate={'label('..prefix..'_reason074)'}
  for _,value in ipairs(reasons)do gate[#gate+1]=('cmp r9b,%X\nje %s_reason074'):format(value,prefix)end
  gate[#gate+1]='jmp '..prefix..'_normal';gate[#gate+1]=prefix..'_reason074:'
  local aa=template:gsub('cmp r9b,01\nja '..prefix..'_normal',function()return table.concat(gate,'\n')end,1)
  local reg=name=='fuelStorage062'and'dil'or'bl'
  for _,row in ipairs({{'00','Electricity'},{'01','Petrol'},{'02','Oil'},{'10','Diesel'}})do
   local value=assert(resources[row[2]],'Fuel resource enum missing: '..row[2])
   aa=aa:gsub('cmp '..reg..','..row[1]..'\n',('cmp %s,%X\n'):format(reg,value),1)
  end
  aa=aa:gsub('@ROOT074@',('%X'):format(root)):gsub('@PARENT074@',('%X'):format(parent))
  TLC.HOOKS[name].aa=aa
 end
 TLC.fuelSemantics074={removal=removal,resources=resources,root=root,parent=parent}
 return TLC.fuelSemantics074
end
function TLC.F.fuel.on()
 TLC.prepareFuelDebit074()
 return before()
end
end)(TLC)


;(function(TLC)
function TLC.readObjectField074(object,name)
 if not TLC.valid(object)then return end
 local offset,size=TLC.refFieldLayout(object,name,false)
 if not offset or size~=8 then return end
 local target=readQword(object+offset)
 if TLC.valid(target)then TLC.cacheClass072(target);return target end
end
end)(TLC)


;(function(TLC)
function TLC.defaultObject074(cls)
 assert(TLC.valid(cls)and TLC.U.isA(cls,'Class'),'Class metadata unavailable')
 local found={}
 for off=0x80,0x240,8 do
  local object=readQword(cls+off)
  if object and object&gt;=0x10000 and object%8==0 and readQword(object+0x10)==cls then
   local flags=readInteger(object+8);local index=readInteger(object+0xc);local count=TLC.objectCount072()
   if flags and(flags&amp;0x10)~=0 and index and count and index&gt;=0 and index&lt;count then
    local chunks=readQword(TLC.U.go);local chunk=chunks and readQword(chunks+(index//65536)*8)
    if chunk and readQword(chunk+(index%65536)*24+8)==object and TLC.U.n(object)=='Default__'..TLC.U.n(cls)then found[object]=true end
   end
  end
 end
 local object;local n=0;for p in pairs(found)do object=p;n=n+1 end
 assert(n==1,'Class default-object reference missing or ambiguous')
 return object
end
TLC.SIGS.ProcessEventActor074={len=0,bytes={},p='48 89 5C 24 10 48 89 6C 24 18 57 48 83 EC 20 F7 82 B0 00 00 00 00 04 00 00 49 8B E8 48 8B DA 48 8B F9 75 06 83 7A 68 00 74 4A 48 89 74 24 30 0F B6 35 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 85 C0 74 11 48 8B C8 E8 ?? ?? ?? ??',bootstrapPattern='48 89 5C 24 10 48 89 6C 24 18 57 48 83 EC 20 F7 82 B0 00 00 00 00 04 00 00 49 8B E8 48 8B DA 48 8B F9 75 06 83 7A 68 00 74 4A 48 89 74 24 30 0F B6 35 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 85 C0 74 11 48 8B C8 E8 ?? ?? ?? ??'}
function TLC.processEvent074(object,isDefault)
 local cached=TLC.processEventLayout074
 if not cached then
  local actor=assert(TLC.resolveSig('ProcessEventActor074'),'ProcessEvent dispatcher unavailable')
  local cls=assert(TLC.refClass('Actor'),'Actor metadata unavailable');local cdo=TLC.defaultObject074(cls)
  local vt=assert(readQword(cdo));local slots={}
  for off=0,0x1000,8 do if readQword(vt+off)==actor then slots[#slots+1]=off end end
  assert(#slots==1,'ProcessEvent actor vtable identity is ambiguous')
  local ip=actor;local lastCall;local returned=false
  for i=1,192 do
   local n=getInstructionSize(ip);assert(n and n&gt;=1 and n&lt;=15 and TLC.executable038(ip,n),'ProcessEvent instruction unavailable')
   local op=readBytes(ip,1)
   if op==0xc3 then returned=true;break end
   if op==0xe8 and n==5 then
    local d=readInteger(ip+1);assert(d);if d&gt;=0x80000000 then d=d-0x100000000 end;lastCall=ip+5+d
   end
   ip=ip+n
  end
  assert(returned and lastCall and TLC.executable038(lastCall),'ProcessEvent base dispatcher unavailable')
  local plain=TLC.defaultObject074(assert(TLC.refClass('KismetSystemLibrary')))
  assert(readQword(assert(readQword(plain))+slots[1])==lastCall,'ProcessEvent base vtable does not match actor dispatch')
  cached={slot=slots[1],actor=actor,base=lastCall,pid=getOpenedProcessID()};TLC.processEventLayout074=cached
 end
 if not isDefault then assert(TLC.valid(object),'ProcessEvent target expired')
 else
  assert(object and(readInteger(object+8)&amp;0x10)~=0 and TLC.defaultObject074(readQword(object+0x10))==object,'Static API default-object identity mismatch')
 end
 local target=readQword(assert(readQword(object))+cached.slot)
 assert(target==cached.actor or target==cached.base,'Unverified ProcessEvent override; call cancelled')
 return target
end
local nativeSlot=TLC.nativeSlot
function TLC.nativeSlot(object,slot)
 if slot==0x250 then return TLC.processEvent074(object)end
 return nativeSlot(object,slot)
end
function TLC.weatherSystem(done)
 local world=TLC.world();assert(world,'World unavailable')
 if TLC.weatherObject and TLC.weatherWorld==world and TLC.valid(TLC.weatherObject)then done(TLC.weatherObject);return end
 local cls=assert(TLC.refClass('SubsystemBlueprintLibrary'),'Subsystem API class unavailable')
 local fn=TLC.reflectedFunction069('SubsystemBlueprintLibrary','GetWorldSubsystem')
 local context,cs=TLC.refFieldLayout(fn,'ContextObject','function')
 local kind,ks=TLC.refFieldLayout(fn,'Class','function');local result,rs=TLC.refFieldLayout(fn,'ReturnValue','function')
 local size=readSmallInteger(fn+0xb6)
 assert(context and cs==8 and kind and ks==8 and result and rs==8 and size and size&lt;=64,'Subsystem API parameter layout unavailable')
 local cdo=TLC.defaultObject074(cls);local weather=assert(TLC.refClass('VoyageWeatherSubsystem'))
 local p=TLC.base()+0xe80;for i=0,size-1 do writeBytes(p+i,0)end
 writeQword(p+context,world);writeQword(p+kind,weather)
 local identity=assert(TLC.identity029(world))
 TLC.job(TLC.processEvent074(cdo,true),{cdo,fn,p},{world,fn},function()
  if not TLC.sameIdentity029(identity)or TLC.world()~=world then return end
  local object=readQword(p+result)
  assert(TLC.valid(object)and TLC.U.isA(object,'VoyageWeatherSubsystem'),'Native weather subsystem API returned no instance')
  TLC.weatherObject=object;TLC.weatherWorld=world
  done(object)
 end)
end
end)(TLC)

TLC.codePatterns074={
 ['AmmoDelta']={pattern='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 8B F2 48 8B F9 BA 07 00 00 00 E8 ?? ?? ?? ?? 48 8B D8 48 85 C0 74 ?? 33 C9',mask={27,28,29,30,38}},
 ['AmmoGet']={pattern='8B 81 A8 0B 00 00 C3 CC CC CC CC CC CC CC CC CC 40 57 48 83 EC 20 48 8D 79 50 48 8B CF E8 ?? ?? ?? ?? 84 C0 74 ?? 48 8B',mask={31,32,33,34,38}},
 ['AmmoReserve']={pattern='48 8B EC 48 83 EC 60 41 8B D9 45 8B F0 48 8B F2 48 8B F9 48 85 D2 0F 84 ?? ?? ?? ?? 45 85 C0 0F 8E ?? ?? ?? ?? 4C 89 AC',mask={25,26,27,28,34,35,36,37}},
 ['AmmoStore']={pattern='89 9E A8 0B 00 00 E8 ?? ?? ?? ?? 48 8B 5C 24 30 B0 01 48 8B 6C 24 38 48 8B 74 24 40 48 83 C4 20 5F C3 CC CC CC CC CC 48',mask={8,9,10,11}},
 ['AreaDetachable037']={pattern='48 89 5C 24 08 57 48 83 EC 20 48 8B DA 48 8B F9 48 85 D2 74 ?? 48 8B 15 ?? ?? ?? ?? 48 8B CB E8 ?? ?? ?? ?? 84 C0 74 ??',mask={21,25,26,27,28,33,34,35,36,40}},
 ['AreaResolve037']={pattern='40 55 53 56 57 41 55 41 57 48 8D 6C 24 D1 48 81 EC 98 00 00 00 4C 8B F9 48 8B F2 48 8B CA E8 ?? ?? ?? ?? 45 33 ED 48 8B',mask={32,33,34,35}},
 ['AttributeChange']={pattern='40 57 48 83 EC 20 8B 81 48 02 00 00 48 8B F9 44 0F B6 CA 3B 81 74 02 00 00 74 ?? 4C 8B 81 80 02 00 00 48 8D 81 78 02 00',mask={27}},
 ['BoatActorDamage055']={pattern='40 53 48 83 EC 40 48 8B 44 24 70 48 8B D9 0F 29 74 24 30 0F 28 F1 48 89 44 24 20 E8 ?? ?? ?? ?? 48 8D 8B 20 04 00 00 E8',mask={29,30,31,32}},
 ['BoatDamage027']={pattern='40 53 48 83 EC 40 80 B9 D0 00 00 00 00 48 8B D9 0F 29 74 24 30 0F 28 F1 75 ?? 45 84 C0 74 ?? 48 8B 15 ?? ?? ?? ?? 48 8B',mask={26,31,35,36,37,38}},
 ['BoatProtectClass027']={pattern='48 8B 05 ?? ?? ?? ?? 48 85 C0 0F 85 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 49 89 43 10 4C 8D 0D ?? ?? ?? ?? 48 8D 05 48 FB 2E',mask={4,5,6,7,13,14,15,16,20,21,22,23,31,32,33,34}},
 ['CV_cold']={pattern='4C 8D 05 ?? ?? ?? ?? 33 D2 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 8D 0D 80',mask={4,5,6,7,13,14,15,16,18,19,20,21,25,26,27,28}},
 ['CV_consume']={pattern='4C 8D 05 ?? ?? ?? ?? 33 D2 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 8D 0D 80',mask={4,5,6,7,13,14,15,16,18,19,20,21,25,26,27,28}},
 ['CV_damage']={pattern='4C 8D 05 ?? ?? ?? ?? 33 D2 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 8D 0D E3',mask={4,5,6,7,13,14,15,16,18,19,20,21,25,26,27,28}},
 ['CV_impact']={pattern='4C 8D 05 ?? ?? ?? ?? 33 D2 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 8D 0D E0',mask={4,5,6,7,13,14,15,16,18,19,20,21,25,26,27,28}},
 ['CV_moduleSpeed']={pattern='4C 8D 05 ?? ?? ?? ?? 33 D2 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 8D 0D D0',mask={4,5,6,7,13,14,15,16,18,19,20,21,25,26,27,28}},
 ['CellActive037']={pattern='45 33 C9 E9 ?? ?? ?? ?? CC CC CC CC CC CC CC CC 48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57',mask={5,6,7,8}},
 ['ConsumptionMultiplier']={pattern='48 89 5C 24 08 57 48 83 EC 30 80 B9 54 01 00 00 00 48 8B D9 0F B6 FA 74 ?? F3 0F 10 05 ?? ?? ?? ?? 48 8B 5C 24 40 48 83',mask={25,30,31,32,33}},
 ['DetachActor037']={pattern='48 89 5C 24 20 55 56 57 48 8D 6C 24 B9 48 81 EC 90 00 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 37 41 0F B6 F0 48 8B',mask={24,25,26,27}},
 ['DismantleBase022']={pattern='F3 0F 10 82 74 02 00 00 C3 CC 40 53 48 83 EC 20 44 0F B6 C2 48 8B D9 84 D2 74 ?? 41 83 E8 01 74 ?? 41 83 E8 01 74 ?? 41',mask={}},
 ['DismantleModule022']={pattern='F3 0F 10 83 74 02 00 00 48 83 C4 20 5B C3 48 83 C4 20 5B E9 ?? ?? ?? ?? CC CC CC CC CC CC CC CC CC CC CC CC 40 53 48 83',mask={}},
 ['DismantleScale050']={pattern='8B 81 60 16 00 00 4C 8B D1 44 0F B6 CA 3B 81 8C 16 00 00 74 ?? 4C 8B 81 98 16 00 00 48 8D 81 90 16 00 00 8B 89 A0 16 00',mask={21}},
 ['Engine']={pattern='48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 85 C0 74 ?? 48 8B 80 28 02 00 00 48 89 07 48 8B 5C 24 30 48 83 C4 20 5F C3 48 8B',mask={4,5,6,7,9,10,11,12,17}},
 ['Fabricate']={pattern='48 89 5C 24 20 55 56 57 48 81 EC A0 00 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 90 00 00 00 48 8B F2 41 8B D9 48',mask={19,20,21,22}},
 ['FabricationDuration']={pattern='48 8D BB 50 02 00 00 F3 0F 11 83 34 02 00 00 F3 0F 11 83 38 02 00 00 83 7F 48 01 7F ?? 40 32 F6 48 8B CF E8 ?? ?? ?? ??',mask={29,37,38,39,40}},
 ['FabricatorGate']={pattern='49 8D 8E F0 01 00 00 E8 ?? ?? ?? ?? 48 89 45 88 48 8B F8 48 85 C0 74 ?? 33 C9 E8 ?? ?? ?? ?? 48 8B 57 10 48 63 48 38 4C',mask={9,10,11,12,24,28,29,30,31}},
 ['FabricatorPowerReady']={pattern='80 B8 76 09 00 00 00 0F 84 ?? ?? ?? ?? 45 0F 2F B6 78 01 00 00 0F 83 ?? ?? ?? ?? 49 8B 86 E0 01 00 00 48 8B 10 48 85 D2',mask={10,11,12,13,24,25,26,27}},
 ['FogConsumer039']={pattern='48 8D 51 48 48 8D 4C 24 20 E8 ?? ?? ?? ?? F7 44 24 30 00 01 00 00 74 ??',mask={11,12,13,14,24}},
 ['FogFlagsCopy039']={pattern='49 8B D1 48 83 C1 18 49 8B F8 E8 ?? ?? ?? ??',mask={12,13,14,15}},
 ['FogIndex039']={pattern='48 8D 15 ?? ?? ?? ?? 48 8D 8D 90 09 00 00 E8 ?? ?? ?? ?? 4C 8D 85 90 09 00 00 BA 88 00 00 00 48 8B CB E8 ?? ?? ?? ??',mask={4,5,6,7,16,17,18,19,36,37,38,39}},
 ['FogViewCopy039']={pattern='4C 8D 8F 90 00 00 00 49 8B D5 48 8D 8D C0 03 00 00 E8 ?? ?? ?? ??',mask={19,20,21,22}},
 ['FuelDebit061']={pattern='0F 29 7C 24 20 45 84 C9 75 ?? 48 81 C1 B8 0A 00 00 E8 ?? ?? ?? ?? 0F 57 C9 F3 0F 5A C8 F2 0F 59 F1 48 8B 07 0F B6 D3 48',mask={10,19,20,21,22}},
 ['FuelStorage062']={pattern='80 BE 6A 01 00 00 00 48 8D 9E 20 09 00 00 74 ?? 8B 43 08 3B 43 34 74 ?? 48 8B 53 40 48 8D 43 38 8B 4B 48 48 85 D2 48 0F',mask={16,24}},
 ['GameThread']={pattern='89 05 ?? ?? ?? ?? E8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B C8 E8 ?? ?? ?? ?? 48 8D 4D 6F E8 ?? ?? ?? ?? 48 8D 55 C7 48 8B C8',mask={3,4,5,6,8,9,10,11,13,14,15,16,21,22,23,24,30,31,32,33}},
 ['GameTick']={pattern='49 89 5B 10 4C 8B E1 49 89 73 18 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? E8 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B',mask={}},
 ['HumanCopy033']={pattern='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 0F B6 02 48 8B DA 88 01 48 8B F9 48 83 C1 08 48 83 C2 08 E8 ?? ?? ?? ?? 48',mask={36,37,38,39}},
 ['HumanDelivery033']={pattern='48 85 D2 0F 84 ?? ?? ?? ?? 4C 8B DC 55 57 41 54 49 8D AB C8 FE FF FF 48 81 EC 20 02 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4',mask={6,7,8,9,34,35,36,37}},
 ['HumanDestroy033']={pattern='48 89 5C 24 08 57 48 83 EC 20 48 8B D9 C7 81 C0 00 00 00 00 00 00 00 48 8B 89 B8 00 00 00 48 85 C9 74 ?? E8 ?? ?? ?? ??',mask={35,37,38,39,40}},
 ['HumanFree033']={pattern='48 85 C9 74 ?? 53 48 83 EC 20 48 8B D9 48 8B 0D ?? ?? ?? ?? 48 85 C9 75 ?? E8 ?? ?? ?? ?? 48 8B 0D ?? ?? ?? ?? 48 8B 01',mask={5,17,18,19,20,25,27,28,29,30,34,35,36,37}},
 ['HumanGrow033']={pattern='48 89 5C 24 10 57 48 83 EC 20 48 8B D9 48 8B FA 48 8B CA E8 ?? ?? ?? ?? 83 7F 10 01 0F 8E ?? ?? ?? ?? 8B 83 B8 14 00 00',mask={21,22,23,24,31,32,33,34}},
 ['HumanInfo034']={pattern='40 55 56 57 41 54 41 56 48 8D AC 24 E0 FD FF FF 48 81 EC 20 03 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 F0 01 00 00',mask={27,28,29,30}},
 ['HumanInfoDestroy034']={pattern='48 89 5C 24 10 57 48 83 EC 20 8B 91 08 01 00 00 48 8B D9 48 8B 89 00 01 00 00 E8 ?? ?? ?? ?? 48 8B 8B 00 01 00 00 48 85',mask={28,29,30,31}},
 ['HumanPropertyCopy034']={pattern='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 ?? ?? ?? ?? 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74',mask={22,23,24,25}},
 ['HumanRefresh033']={pattern='48 89 5C 24 18 56 57 41 56 48 83 EC 40 48 8B F9 48 81 C1 F8 16 00 00 E8 ?? ?? ?? ?? 48 8B 9F B0 14 00 00 48 63 87 B8 14',mask={25,26,27,28}},
 ['HumanTraitCopy034']={pattern='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 ?? ?? ?? ?? 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74',mask={22,23,24,25}},
 ['InventoryAddItem']={pattern='40 55 53 57 41 54 41 55 48 8D AC 24 D0 FE FF FF 48 81 EC 30 02 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 10 01 00 00',mask={27,28,29,30}},
 ['InventoryAddSlot']={pattern='40 55 53 56 57 41 54 41 56 41 57 48 8D AC 24 70 FF FF FF 48 81 EC 90 01 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 70',mask={30,31,32,33}},
 ['InventoryForCharacter']={pattern='48 89 5C 24 10 57 48 83 EC 20 48 8B 01 0F B6 FA 48 8B D9 FF 90 10 08 00 00 84 C0 74 ?? 48 8B 9B D8 02 00 00 48 85 DB 74',mask={29}},
 ['InventoryRemove']={pattern='40 55 53 56 57 41 56 48 8B EC 48 83 EC 60 41 8B D9 45 8B F0 48 8B F2 48 8B F9 48 85 D2 0F 84 ?? ?? ?? ?? 45 85 C0 0F 8E',mask={32,33,34,35}},
 ['MaterialConsume']={pattern='40 55 53 57 41 54 41 55 41 56 41 57 48 8D AC 24 F0 FE FF FF 48 81 EC 10 02 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85',mask={31,32,33,34}},
 ['MaterialsResult']={pattern='B0 01 48 8B BC 24 90 03 00 00 EB ?? 32 C0 48 8B 8D 70 02 00 00 48 33 CC E8 ?? ?? ?? ?? 48 81 C4 98 03 00 00 41 5F 41 5E',mask={12,26,27,28,29}},
 ['NPCClass']={pattern='48 8B 05 ?? ?? ?? ?? 48 85 C0 0F 85 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 49 89 43 10 4C 8D 0D ?? ?? ?? ?? 48 8D 05 18 BF 1D',mask={4,5,6,7,13,14,15,16,20,21,22,23,31,32,33,34}},
 ['Names']={pattern='4C 8D 3D ?? ?? ?? ?? EB ?? 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 4C 8B F8 C6 05 ?? ?? ?? ?? 01 8B',mask={4,5,6,7,9,13,14,15,16,18,19,20,21,27,28,29,30}},
 ['NoClipLadder040']={pattern='4C 8B DC 55 57 49 8D AB C8 FD FF FF 48 81 EC 28 03 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 E0 01 00 00 49 89 5B 18',mask={23,24,25,26}},
 ['NoClipTick040']={pattern='40 55 53 56 57 41 56 41 57 48 8D AC 24 A8 FE FF FF 48 81 EC 58 02 00 00 0F 29 B4 24 40 02 00 00 48 8B 05 ?? ?? ?? ?? 48',mask={36,37,38,39}},
 ['QuestEvaluated045']={pattern='48 8B 4D D8 44 89 6D E0 4C 8B AC 24 D8 02 00 00 48 85 C9 74 ?? E8 ?? ?? ?? ?? 48 8D 4D 98 E8 ?? ?? ?? ?? 48 8B 8D B0 01',mask={21,23,24,25,26,32,33,34,35}},
 ['QuestObserved045']={pattern='8B 44 24 5C 48 8D 4C 24 58 F7 D0 21 44 24 68 E8 ?? ?? ?? ?? 48 8B 44 24 50 EB ?? 89 5C 24 44 E9 ?? ?? ?? ?? 48 8B 4D C0',mask={17,18,19,20,27,33,34,35,36}},
 ['QuestTick045']={pattern='4C 8B DC 55 49 8D 6B E8 48 81 EC 10 01 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 D0 49 89 5B 18 48 8B D9 49 89 73 F0',mask={19,20,21,22}},
 ['RepairBase022']={pattern='F3 0F 10 82 D0 02 00 00 C3 F3 0F 10 82 74 02 00 00 C3 CC 40 53 48 83 EC 20 44 0F B6 C2 48 8B D9 84 D2 74 ?? 41 83 E8 01',mask={}},
 ['RepairItem022']={pattern='F3 0F 10 B3 D0 02 00 00 EB ?? F3 0F 10 B3 74 02 00 00 48 8B 5C 24 58 F3 0F 59 F7 0F 28 7C 24 20 0F 28 C6 0F 28 74 24 30',mask={}},
 ['RepairMaterials']={pattern='40 55 53 56 57 41 55 48 8D 6C 24 E0 48 81 EC 20 01 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 00 45 0F B6 E8 48 8B F2',mask={23,24,25,26}},
 ['RocketActorLocation036']={pattern='48 83 EC 28 48 8B 42 20 45 33 C9 48 85 C0 41 0F 95 C1 4C 03 C8 4C 89 4A 20 48 8B 81 B8 01 00 00 48 85 C0 74 ?? 0F 10 80',mask={37}},
 ['RootsNextTask031']={pattern='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 48 8B F1 48 83 C1 38 E8 ?? ?? ?? ?? 84 C0 74 ?? 48 8D 4E 38 33 DB E8 46 50',mask={24,25,26,27,31}},
 ['RootsSetInt031']={pattern='48 89 5C 24 08 55 56 57 41 56 41 57 48 8B EC 48 83 EC 50 45 33 FF 48 8B DA 4C 89 7D D0 E8 ?? ?? ?? ?? 48 8D BB 88 00 00',mask={31,32,33,34}},
 ['SeedCountdown']={pattern='F3 0F 5C CE F3 0F 11 8B 18 03 00 00 E8 ?? ?? ?? ?? 0F 57 C0 0F 2F 83 18 03 00 00 72 ?? 48 8B CB E8 ?? ?? ?? ?? 48 8B 03',mask={14,15,16,17,29,34,35,36,37}},
 ['SoftPathSet']={pattern='40 55 53 57 41 54 41 56 41 57 48 8B EC 48 83 EC 58 48 63 42 08 4C 8B E2 4C 8B F9 85 C0 0F 84 ?? ?? ?? ?? 49 8B 0C 24 48',mask={32,33,34,35}},
 ['WarpActivate028']={pattern='48 89 5C 24 08 48 89 6C 24 18 48 89 74 24 20 57 48 81 EC E0 00 00 00 48 8B D9 48 8B 0D ?? ?? ?? ?? 48 85 C9 0F 84 CC 02',mask={30,31,32,33}},
 ['WarpClosest028']={pattern='40 55 56 41 54 41 55 48 8D 6C 24 B8 48 81 EC 48 01 00 00 0F 29 B4 24 10 01 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45',mask={31,32,33,34}},
 ['WarpCreate028']={pattern='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 40 49 8B D8 0F 28 CB 44 0F B6 44 24 70 48 8B FA E8 ?? ?? ?? ?? 48 8D 54 24 20',mask={32,33,34,35}},
 ['WarpFree028']={pattern='48 85 C9 74 ?? 53 48 83 EC 20 48 8B D9 48 8B 0D ?? ?? ?? ?? 48 85 C9 75 ?? E8 ?? ?? ?? ?? 48 8B 0D ?? ?? ?? ?? 48 8B 01',mask={5,17,18,19,20,25,27,28,29,30,34,35,36,37}},
 ['WarpLocation028']={pattern='48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 20 41 8B 40 08 48 8D 35 ?? ?? ?? ?? 49 8B F8 48 8B',mask={32,33,34,35}},
 ['WarpLocator028']={pattern='40 57 48 83 EC 20 48 8B F9 48 85 C9 0F 84 ?? ?? ?? ?? 8B 41 0C 3B 05 ?? ?? ?? ?? 7D ?? 8B C8 0F B7 C0 48 C1 E9 10 48 8D',mask={15,16,17,18,24,25,26,27,29}},
 ['WeaponItemConsume']={pattern='4C 8B DC 55 56 41 57 49 8D AB 08 FF FF FF 48 81 EC E0 01 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 C0 00 00 00 8B 42',mask={25,26,27,28}},
 ['WeaponResourceRemove']={pattern='48 89 5C 24 08 88 54 24 10 57 48 83 EC 40 0F 57 C0 0F 29 74 24 30 66 0F 2F D0 0F B6 DA 48 8B F9 0F 28 F2 77 ?? B0 01 48',mask={37}},
 ['WeatherClass']={pattern='48 8B 05 ?? ?? ?? ?? 48 85 C0 0F 85 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 49 89 43 10 4C 8D 0D ?? ?? ?? ?? 48 8D 05 08 E8 16',mask={4,5,6,7,13,14,15,16,20,21,22,23,31,32,33,34}},
 ['WeatherNative']={pattern='4C 8B DC 55 53 49 8D AB E8 FB FF FF 48 81 EC 08 05 00 00 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 20 03 00 00 49 89 73 E8',mask={23,24,25,26}},
 ['WorldSettingsGet']={pattern='48 8B 81 B8 02 00 00 C3 CC CC CC CC CC CC CC CC 40 53 48 83 EC 20 48 8B D9 48 8B 89 C8 00 00 00 48 85 C9 74 ?? 48 8B D3',mask={37}},
 ['WorldStateCopyEnd']={pattern='48 8B 5C 24 70 48 8B C7 48 83 C4 60 5F C3 CC CC CC CC 48 83 EC 28 0F B6 01 4C 8B C1 3A 02 75 ?? 8B C8 83 E9 04 74 ?? 83',mask={32,39}},
 ['WorldSubsystemGet']={pattern='48 89 5C 24 08 57 48 83 EC 20 48 8B DA 48 8B F9 48 85 D2 0F 84 ?? ?? ?? ?? 80 3D ?? ?? ?? ?? 00 48 89 54 24 38 74 ?? 48',mask={22,23,24,25,28,29,30,31,39}},
 ['WorldTimeSet']={pattern='48 85 C9 74 ?? 0F 57 C0 F3 0F 5A C1 F2 0F 11 81 58 08 00 00 C3 CC CC CC CC CC CC CC CC CC CC CC 40 55 53 57 41 54 41 55',mask={5}},
}


;(function(TLC)
function TLC.levelActors074(level)
 assert(TLC.valid(level)and TLC.U.isA(level,'Level'),'Level identity unavailable')
 local field,size=TLC.refFieldLayout(level,'WorldSettings',false)
 local settings=field and size==8 and readQword(level+field)
 assert(TLC.valid(settings)and TLC.U.isA(settings,'WorldSettings'),'Level WorldSettings metadata unavailable')
 local candidates={}
 -- ULevel::Actors is not reflected in this executable. Discover its bounded
 -- array header by actual Actor identities and the reflected WorldSettings.
 for offset=0x28,0x280,8 do
  local data=readQword(level+offset);local count=readInteger(level+offset+8);local capacity=readInteger(level+offset+12)
  if data and data&gt;=0x10000 and data%8==0 and count and capacity and count&gt;=1 and count&lt;=30000 and capacity&gt;=count and capacity&lt;=65536 then
   local seenSettings=false;local verified=0;local okay=true
   for index=0,math.min(count-1,31)do
    local actor=readQword(data+index*8)
    if actor and actor~=0 then
     if not TLC.valid(actor)or not TLC.U.isA(actor,'Actor')or readQword(actor+0x20)~=level then okay=false;break end
     verified=verified+1;if actor==settings then seenSettings=true end
    end
   end
   if okay and seenSettings and verified&gt;=math.min(4,count)then candidates[#candidates+1]={offset=offset,data=data,count=count,level=level}end
  end
 end
 assert(#candidates==1,'Level actor array is missing or ambiguous; no guessed offset used')
 return candidates[1]
end
end)(TLC)


;(function(TLC)
local resolving={}
local function install()
 setmetatable(TLC.A,{__index=function(addresses,name)
  if not TLC.ready038 or not TLC.SIGS[name]or resolving[name]then return nil end
  resolving[name]=true
  local okay,value=pcall(TLC.resolveSig,name)
  resolving[name]=nil
  if not okay then TLC.reason(name,tostring(value));return nil end
  return rawget(addresses,name)or value
 end})
end
local forget=TLC.forgetProcess
function TLC.forgetProcess(...)
 local result=forget(...);resolving={};install();return result
end
install()
end)(TLC)

-- Derive the game-thread guard chain from named fields on the current objects.
;(function(TLC)
local template=TLC.HOOKS.gameTick.aa
function TLC.prepareDispatch074()
 TLC.requireSigs({'Objects','Names','Engine','GameThread','GameTick'})
 local engine=assert(TLC.U.ge and readQword(TLC.U.ge),'Engine unavailable')
 local values={}
 local function object(owner,field,token)
  local off,size=TLC.refFieldLayout(owner,field,false);assert(off and size==8,'Dispatch object field unavailable: '..field)
  values[token]=off;local target=readQword(owner+off);assert(TLC.valid(target),'Dispatch object unavailable: '..field);return target
 end
 local viewport=object(engine,'GameViewport','D78')
 local world=object(viewport,'World','78')
 local gi=object(world,'OwningGameInstance','228')
 local off,size=TLC.refFieldLayout(gi,'LocalPlayers',false)
 assert(off and size==16,'LocalPlayers metadata unavailable');values['38']=off
 local data=readQword(gi+off);local count=readInteger(gi+off+8)
 assert(data and count and count&gt;=1 and count&lt;=8,'LocalPlayers unavailable')
 local lp=readQword(data);assert(TLC.valid(lp),'LocalPlayer unavailable')
 local pc=object(lp,'PlayerController','30')
 object(pc,'AcknowledgedPawn','350')
 local aa=TLC.gameTickTemplate074 or template
 for key in pairs(values)do aa=aa:gsub('%[rax%+'..key..'%]','[rax+@DISPATCH'..key..'@]')end
 for key,value in pairs(values)do aa=aa:gsub('@DISPATCH'..key..'@',('%X'):format(value))end
 local old=TLC.hookState.gameTick
 if old then assert(TLC.HOOKS.gameTick.aa==aa,'Active dispatch guard layout changed; no code overwritten')end
 TLC.HOOKS.gameTick.aa=aa;return values
end
local job=TLC.job
function TLC.job(...)
 local prior=TLC.scope038;TLC.scope038='verified native dispatcher'
 local args=table.pack(...)
 local okay,result=pcall(function()TLC.prepareDispatch074();return job(table.unpack(args,1,args.n))end)
 TLC.scope038=prior
 if not okay then error(result,0)end
 return result
end
-- Foreign-build polling never runs the historical private-layout tick chain.
function TLC.portableTick074()
 if not TLC.attached()then return end
 if getOpenedProcessID()~=TLC.pid or getProcessIDFromProcessName(TLC.EXE)~=TLC.pid then TLC.forgetProcess();return end
 local pending=TLC.pendingJob
 if pending then
  local p=TLC.base()+0x500;local state=readInteger(p)
  if state==3 or state==4 then
   TLC.pendingJob=nil;local result=readQword(p+0x80)or 0;assert(writeInteger(p,0))
   if state==4 then if pending.cancelled074 then pcall(pending.cancelled074,'target/world identity changed')end;TLC.reason('action','Native call cancelled: target/world identity changed')
   elseif pending.done then local ok,why=pcall(pending.done,result);if not ok then TLC.reason('action',tostring(why))end end
  elseif state==1 and getTickCount()-pending.start&gt;15000 then
   assert(writeInteger(p,0));TLC.pendingJob=nil;TLC.reason('action','Native call timed out before execution')
  end
 end
 local player=TLC.player(false)
 local inventory=player and TLC.readObjectField074(player,'WeightInventory')
 assert(writeQword(TLC.base()+TLC.OFF_PTRS+0x20,inventory or 0))
 if TLC.pumpWeather074 then TLC.pumpWeather074()end
end
local start=TLC.startTimer
function TLC.startTimer()
 if not TLC.reflectionReady074 then return end
 if TLC.image038 and not TLC.image038.known then
  if not TLC.timer then
   TLC.timer=createTimer(nil,false);TLC.timer.Interval=TLC.TICK_MS
   TLC.timer.OnTimer=function()local ok,e=pcall(TLC.portableTick074);if not ok then TLC.reason('action',tostring(e))end end
  end
  TLC.timer.Enabled=true;return
 end
 return start()
end
end)(TLC)

-- Weather simulation inputs, native cloud-mask retirement, and the game's audio notification.
;(function(TLC)
local climateNames={'MaxTemp','MinTemp','Temperature','Precipitation','Thunder','CloudCoverage','FogDensity'}
local function field(object,name,size,kind)
 local offset,actual=TLC.refFieldLayout(object,name,kind or false)
 assert(offset and actual==size,'Weather field layout unavailable: '..name)
 return offset
end
local function functionFor(object,name)
 assert(TLC.valid(object),'Weather actor expired')
 local cls=readQword(object+0x10)
 for depth=1,64 do
  if not TLC.valid(cls)then break end
  local fn=readQword(cls+0x48)
  for i=1,4096 do
   if not fn or fn==0 then break end
   if TLC.valid(fn)and TLC.U.n(fn)==name then return fn end
   fn=readQword(fn+0x28)
  end
  cls=readQword(cls+0x40)
 end
 error('Weather function unavailable: '..name)
end
local function propertyWord(object,name)
 local cls=readQword(object+0x10)
 for depth=1,64 do
  if not TLC.valid(cls)then break end
  local f=readQword(cls+0x50)
  for i=1,4096 do
   if not f or f==0 then break end
   if TLC.U.name(readInteger(f+0x20))==name then return assert(readQword(f+0x20))end
   f=readQword(f+0x18)
  end
  cls=readQword(cls+0x40)
 end
 error('Weather property name unavailable: '..name)
end
function TLC.weatherActors074()
 local world=TLC.world();local level=TLC.readObjectField074(world,'PersistentLevel')
 local array=TLC.levelActors074(level);local result={};local all={}
 local classes={BP_WindManager_C='windManager',BP_CloudMaskGenerator_Voyage_C='generator',BP_AudioVolumeScanner_C='audio',Ultra_Dynamic_Weather_Voyage_C='udw',Ultra_Dynamic_Sky_Voyage_C='sky',BP_PersistentWorldTime_C='clock'}
 for index=0,array.count-1 do
  local actor=readQword(array.data+index*8)
  if TLC.valid(actor)then
   local cls=TLC.U.c(actor);local key=classes[cls]
   if key then assert(not result[key],'Ambiguous weather actor: '..key);result[key]=actor end
   if cls=='WeatherVolumeActor_C'then
    local volume=TLC.readObjectField074(actor,'Volume')
    if volume and TLC.U.isA(volume,'VoyageWeatherVolume')then
     local radius=readFloat(volume+field(volume,'Radius',4))
     if radius and radius&gt;=1e9 then assert(not result.volume,'Ambiguous global weather volume');result.volume=volume end
    end
   end
  end
 end
 for _,key in ipairs({'windManager','generator','audio','udw','volume'})do assert(result[key],'Weather dependency missing: '..key)end
 return result
end
local function climateLayout()
 local struct=assert(TLC.findMetadata074('VoyageWorldClimate','ScriptStruct'),'Climate struct metadata unavailable')
 local result={}
 for _,name in ipairs(climateNames)do result[name]=field(struct,name,4,'struct')end
 return result
end
local function climateValues(object,property,layout)
 local offset,size=TLC.refFieldLayout(object,property,false)
 assert(offset and size and size&lt;=256,'Climate property metadata unavailable')
 for _,name in ipairs(climateNames)do assert(layout[name]+4&lt;=size,'Climate member exceeds property bounds')end
 local result={}
 for _,name in ipairs(climateNames)do
  local value=readFloat(object+offset+layout[name])
  assert(value and value==value and math.abs(value)&lt;1000000,'Invalid weather value: '..name);result[name]=value
 end
 return result
end
local function alive(s)
 return TLC.weatherLock074==s and TLC.attached()and TLC.world()==s.world.object and TLC.sameIdentity029(s.world)
end
local function deferBinding137(s,reason,object,fn)
 if not alive(s)then return false end
 local now=getTickCount()
 if not s.bindingStarted137 then s.bindingStarted137=now end
 local identity=object and s.identities[object];local current=object and TLC.identity029(object)
 s.bindingReason137=tostring(reason)..' / '..tostring(fn and TLC.valid(fn)and TLC.U.n(fn)or 'unavailable function')..' / saved serial='..tostring(identity and identity.serial)..' current serial='..tostring(current and current.serial)
 s.bindingAttempts137=(s.bindingAttempts137 or 0)+1
 s.generation=s.generation+1;s.phase='idle';s.stage='rebind137';s.bindingRetry137=now+100
 return false
end
local function call(s,object,fn,values,done,isDefault)
 assert(alive(s),'Weather world changed; native call cancelled')
 assert(not TLC.pendingJob,'Weather native queue occupied')
 if not isDefault and not(s.identities[object]and TLC.sameIdentity029(s.identities[object]))then return deferBinding137(s,'actor identity changed',object,fn)end
 if not(s.identities[fn]and TLC.sameIdentity029(s.identities[fn])and TLC.U.c(fn)=='Function')then return deferBinding137(s,'function identity changed',fn,fn)end
 local guard=isDefault and(values and values.Object and values.Object.value or s.volume)or object
 if not(s.identities[guard]and TLC.sameIdentity029(s.identities[guard]))then return deferBinding137(s,s.identities[guard]and 'guard identity changed'or 'guard identity not registered',guard,fn)end
 local dispatcher=TLC.processEvent074(object,isDefault)
 local size=readSmallInteger(fn+0xb6);assert(size and size&lt;=256,'Weather native parameter block too large')
 assert(values~=nil or size==0,'Weather notification parameter contract changed')
 local p=TLC.base()+0xe80
 for i=0,math.max(size,1)-1 do assert(writeBytes(p+i,0))end
 for name,row in pairs(values or{})do
  local offset=field(fn,name,row.size,'function')
  assert(offset+row.size&lt;=size,'Weather native parameter out of bounds')
  assert(row.write(p+offset,row.value),'Weather native parameter write failed')
 end
 s.phase='native';s.started=getTickCount();local generation=s.generation
 TLC.job(dispatcher,{object,fn,p},{guard,fn},function()
  if not alive(s)or generation~=s.generation then return end
  s.phase='idle'
  local okay,why=pcall(function()if done then done(p)end end)
  if not okay then s.failed=tostring(why)end
 end)
 if TLC.pendingJob then TLC.pendingJob.cancelled074=function(reason)if alive(s)and generation==s.generation then if reason=='target/world identity changed'then deferBinding137(s,reason,guard,fn)else s.phase='idle';s.failed='Weather native call cancelled: '..tostring(reason)end end end end
end
local function notify(s,volume,done)
 local word=propertyWord(volume,'Modified')
 field(volume,'Modified',1)
 call(s,s.setterCDO,s.setter,{
  Object={size=8,write=writeQword,value=volume},PropertyName={size=8,write=writeQword,value=word},Value={size=1,write=writeBytes,value=1}
 },done,true)
end
local function capture(s,volume)
 local entry=s.volumes[volume]
 if entry and not TLC.sameIdentity029(entry.identity)then s.volumes[volume]=nil;entry=nil end
 if not entry then
  entry={identity=assert(TLC.identity029(volume)),mask=readBytes(volume+field(volume,'WeatherMask',1),1)}
  assert(entry.mask~=nil,'Weather mask unavailable');s.volumes[volume]=entry;s.identities[volume]=entry.identity
 end
 return entry
end
local function registered(s)
 local offset=field(s.system,'WeatherVolumes',80)
 local result={};local seen={}
 for _,row in ipairs(TLC.map(s.system+offset,24))do
  local volume=readQword(row+8)
  if TLC.valid(volume)and TLC.U.isA(volume,'VoyageWeatherVolume')then
   assert(not seen[volume],'Duplicate registered weather volume');seen[volume]=true;result[#result+1]=volume
  end
 end
 assert(seen[s.volume],'Global weather volume is not registered')
 return result
end
-- Retire expired weather ownership only; never redirect its old values into a
-- replacement UObject or alter another feature's tracked changes.
local originalRestore133=TLC.restore
local originalChanged133=TLC.changed
local function restoreWeather133()
 local failures={}
 for address,row in pairs(TLC.edits or{})do if row.key=='weather'then
  local same=not row.owner or(row.identity and TLC.sameIdentity029(row.identity)and row.world and TLC.sameIdentity029(row.world)and TLC.world()==row.world.object)
  if row.owner and(not row.identity or not row.world)then failures[#failures+1]='Weather restoration ownership metadata unavailable'
  elseif not same then TLC.edits[address]=nil
  elseif TLC.attached()then
   local okay,why=pcall(function()assert(row.write(address,row.old),'Weather input restoration failed')end)
   if okay then TLC.edits[address]=nil else failures[#failures+1]=tostring(why)end
  else failures[#failures+1]='Weather input restoration needs the original connection'end
 end end
 if #failures&gt;0 then error(table.concat(failures,'; '),0)end
end
function TLC.restore(key)
 if key=='weather'then return restoreWeather133()end
 return originalRestore133(key)
end
local function weatherChanged133(address,kind,value,owner)
 local row=TLC.edits and TLC.edits[address]
 if row then
  assert(row.key=='weather','Weather input is owned by another feature; no overwrite made')
  if row.identity and not TLC.sameIdentity029(row.identity)then TLC.edits[address]=nil end
 end
 return originalChanged133(address,kind,value,owner,'weather')
end
local function retireLegacyWeather133()
 -- This is a table-owned switch, shared dispatch code can still serve wind/waves.
 if TLC.attached()and TLC.pid==getOpenedProcessID()and TLC.base()then assert(writeBytes(TLC.flag(18),0))end
end
local function notifyIdentity133(s,volume)
 local identity=s.identities[volume]
 return identity and TLC.sameIdentity029(identity)and TLC.valid(volume)and TLC.U.isA(volume,'VoyageWeatherVolume')
end
local function prepareRestoreProbe133(s)
 local effect=assert(TLC.readObjectField074(s.system,'EffectSubsystem'),'Weather camera subsystem unavailable')
 assert(TLC.U.isA(effect,'VoyageEffectSubsystem'),'Weather camera subsystem type changed')
 local camera=TLC.objectApiContract076(effect,'VoyageEffectSubsystem','GetCameraTransform')
 local property=TLC.property076(camera.fn,'ReturnValue','function');local transform=assert(readQword(property+0x70))
 assert(TLC.valid(transform)and TLC.U.c(transform)=='ScriptStruct','Weather camera transform type unavailable')
 local size=assert(readInteger(transform+0x58));local result=TLC.apiMember075(camera,'ReturnValue',size)
 local translation=field(transform,'Translation',24,'struct');assert(translation+24&lt;=size,'Weather camera translation exceeds transform')
 local vector=assert(TLC.findMetadata074('Vector','ScriptStruct'))
 assert(readQword(TLC.property076(transform,'Translation','struct')+0x70)==vector,'Weather camera translation type changed')
 local sample=TLC.objectApiContract076(s.system,'VoyageWeatherSubsystem','GetWeather')
 TLC.apiMember075(sample,'Location',24);local climate=TLC.apiMember075(sample,'Climate',s.climateSize);local success=TLC.apiMember075(sample,'ReturnValue',1)
 assert(readQword(TLC.property076(sample.fn,'Location','function')+0x70)==vector,'Weather sample location type changed')
 local expected=assert(TLC.findMetadata074('VoyageWorldClimate','ScriptStruct'))
 assert(readQword(TLC.property076(sample.fn,'Climate','function')+0x70)==expected,'Weather sample climate type changed')
 local boolean=TLC.property076(assert(TLC.refClass('Actor')),'bHidden',true)
 assert(readQword(TLC.property076(sample.fn,'ReturnValue','function')+8)==readQword(boolean+8),'Weather sample result type changed')
 assert(camera.size&lt;=256 and sample.size&lt;=256,'Weather restoration probe frame exceeds limit')
 s.identities[effect]=assert(TLC.identity029(effect));s.identities[camera.fn]=assert(TLC.identity029(camera.fn));s.identities[sample.fn]=assert(TLC.identity029(sample.fn))
 local native=TLC.weatherOutputLayout121()
 local climateField=field(s.system,'CurrentClimate',s.climateSize)
 local windField=field(s.system,'CurrentWind',native.windSize)
 local wavesField=field(s.system,'CurrentWaveProps',16)
 local waves=assert(TLC.findMetadata074('WaveProperties','ScriptStruct'))
 local array=TLC.property076(s.system,'CurrentWaveProps',false);local inner=assert(readQword(array+0x78))
 assert(readQword(inner+0x70)==waves and readInteger(inner+0x34)==native.waveSize,'Current weather wave output type changed')
 local wind=assert(TLC.findMetadata074('VoyageWorldWind','ScriptStruct'))
 assert(readQword(TLC.property076(s.system,'CurrentWind',false)+0x70)==wind,'Current weather wind output type changed')
 assert(readQword(TLC.property076(s.system,'CurrentClimate',false)+0x70)==expected,'Current weather climate output type changed')
 s.restoreProbe133={effect=effect,camera=camera.fn,sample=sample.fn,transform=result,translation=translation,bridge=native.bridge,climateField=climateField,windField=windField,wavesField=wavesField}
end
local function rebindRestore133(s)
 local prior=TLC.scope038;TLC.scope038='weather'
 local okay,fresh=pcall(TLC.prepareWeather074);TLC.scope038=prior
 if not okay then return false,tostring(fresh)end
 for _,name in ipairs({'volume','generator','windManager','audio','udw','setter','setterCDO','updateMasks','updateWind','forceTick','updateAudio','instantSound','consumerLayout'})do s[name]=fresh[name]end
 for object,identity in pairs(fresh.identities)do s.identities[object]=identity end
 s.system=nil;s.restoreProbe133=nil;s.needsRebind133=nil;s.phase='idle';s.stage='restore';return true
end
local function recomputeClimate133(s,restoring)
 if not s.restoreProbe133 then prepareRestoreProbe133(s)end
 local probe=s.restoreProbe133
 call(s,probe.effect,probe.camera,{},function(frame)
  local location=assert(readBytes(frame+probe.transform+probe.translation,24,true))
  assert(alive(s)and not TLC.pendingJob and TLC.sameIdentity029(s.identities[s.system]),'Weather recomputation receiver expired')
  local p=TLC.base()+0xe80;assert(writeBytes(p,location))
  s.phase='native';s.started=getTickCount();local generation=s.generation
  -- Invoke the same verified native GetWeather bridge as the reflected API.
  -- The output receivers are the subsystem's own reflected Climate/Wind/Wave
  -- fields, exactly as in its normal tick. No Climate value is copied or set.
  -- The game's existing wave array is reused; no output TArray is zeroed/leaked.
  TLC.job(probe.bridge,{s.system,p,s.system+probe.climateField,s.system+probe.windField,s.system+probe.wavesField},{s.system,probe.sample},function(result)
   if not alive(s)then return end;s.phase='idle';if generation~=s.generation then return end
   if not result or(result&amp;0xff)==0 then s.failed='Native weather recomputation did not succeed';return end
   if restoring then s.restoredGeneration133=generation;s.restoredClimate133=climateValues(s.system,'CurrentClimate',s.climateLayout)end
   s.stage='refreshWind';s.restoring=restoring
  end)
  if TLC.pendingJob then TLC.pendingJob.cancelled074=function(reason)if alive(s)and generation==s.generation then s.phase='idle';s.failed='Weather recomputation cancelled: '..tostring(reason)end end end
 end)
end

local function number(object,name)
 local off,size=TLC.refFieldLayout(object,name,false);assert(off and(size==4 or size==8),'Weather consumer scalar metadata changed: '..name)
 local value=size==8 and readDouble(object+off)or readFloat(object+off)
 assert(value and value==value and math.abs(value)&lt;1000000,'Invalid weather consumer value: '..name);return value
end
local function close(a,b)return math.abs(a-b)&lt;=math.max(.0001,math.abs(b)*.0001)end
local function restoredConsumersMatch133(s)
 local state=TLC.readObjectField074(s.udw,'Local Weather State')
 if not state then return false,'Local weather state is unavailable'end
 local expected={}
 for _,name in ipairs({'Rain','Snow','Thunder/Lightning','Cloud Coverage'})do expected[name]=number(s.udw,name)end
 for _,n in ipairs({'Rain','Snow','Thunder/Lightning','Cloud Coverage'})do
  if not close(number(s.udw,n),expected[n])then return false,'Manual weather input did not update: '..n end
  if not close(number(state,n),expected[n])then return false,'Local weather state did not update: '..n end
 end
 local layout=assert(s.consumerLayout)
 if TLC.readObjectField074(s.audio,'WeatherMetaSound')~=layout.audio then return false,'Weather audio component changed'end
 local header=layout.audio+layout.parameters;local data,count,capacity=readQword(header),readInteger(header+8),readInteger(header+12)
 if not count or not capacity or count&lt;0 or count&gt;capacity or capacity&gt;256 or count&gt;0 and not data then return false,'Weather audio parameters are unavailable'end
 local values
 for i=0,count-1 do
  local p=data+i*layout.stride;local word=readQword(p+layout.name)
  if word and TLC.U.name(word&amp;0xffffffff)=='WeatherValues'then
   if values then return false,'Weather audio parameter is ambiguous'end
   local a,n,cap=readQword(p+layout.array),readInteger(p+layout.array+8),readInteger(p+layout.array+12)
   if not a or n~=3 or not cap or cap&lt;3 or cap&gt;256 then return false,'Weather audio array contract changed'end
   values={readFloat(a),readFloat(a+4),readFloat(a+8)}
  end
 end
 if readQword(header)~=data or readInteger(header+8)~=count then return false,'Weather audio parameters are updating'end
 if not values then return false,'Weather audio state has not been notified'end
 if not values[2]or not values[3]or not close(values[2],expected.Rain)or not close(values[3],expected['Thunder/Lightning'])then return false,'Weather audio rain/lightning inputs did not update'end
 local p=s.audio+layout.tags+layout.tagArray
 local tags,n,cap=readQword(p),readInteger(p+8),readInteger(p+12)
 if not n or not cap or n&lt;0 or n&gt;cap or cap&gt;256 or n&gt;0 and not tags then return false,'Weather audio tags unavailable'end
 local found={};for i=0,n-1 do local word=readQword(tags+i*layout.tagStride+layout.tagName);if word then found[word]=true end end
 if readQword(p)~=tags or readInteger(p+8)~=n then return false,'Weather audio tags are updating'end
 for key,active in pairs({thunder=expected['Thunder/Lightning']&gt;0,rainLight=expected.Rain&gt;0,rainMedium=expected.Rain&gt;3,rainHard=expected.Rain&gt;7})do
  local word=readQword(s.audio+layout[key]);if not word or not not found[word]~=active then return false,'Weather audio tag did not update: '..key end
 end
 return true
end

local function queueApply(s)
 local list=registered(s);local dirty={};local offsets=s.climateLayout
 local climateOffset=field(s.volume,'Climate',s.climateSize)
 local global=capture(s,s.volume);local fullMask=global.mask|s.climateMask
 for _,volume in ipairs(list)do
  local record=capture(s,volume);local offset=field(volume,'WeatherMask',1)
  local wanted=volume==s.volume and(fullMask&amp;~s.cloudBit)or(record.mask&amp;~s.climateMask)
  if readBytes(volume+offset,1)~=wanted then weatherChanged133(volume+offset,'byte',wanted,volume)end
  dirty[#dirty+1]=volume
 end
 for _,name in ipairs(climateNames)do weatherChanged133(s.volume+climateOffset+offsets[name],'float',s.target[name],s.volume)end
 -- Positive-priority volumes create spatial cloud masks. The global background
 -- remains at normal priority while regional climate channels are excluded.
 weatherChanged133(s.volume+field(s.volume,'Priority',4),'float',0,s.volume)
 s.dirty=dirty;s.dirtyIndex=1;s.fullMask=fullMask;s.stage='notifyInputs';s.applied=nil
end
local function simulationMatches(s)
 local offset=field(s.system,'CurrentClimate',s.climateSize)
 for _,name in ipairs({'Temperature','Precipitation','Thunder','CloudCoverage','FogDensity'})do
  local value=readFloat(s.system+offset+s.climateLayout[name]);local expected=s.target[name]
  if not value or math.abs(value-expected)&gt;math.max(.0001,math.abs(expected)*.00001)then return false end
 end
 return true
end
local function requestRefresh(s,restore)
 s.restoring=restore;s.stage='refreshWind'
end
local function fail(s,why)
 if TLC.retryWeather157 and TLC.retryWeather157(s,why)then return end
 s.failed=nil;s.on=false;s.applied=nil;s.generation=s.generation+1;s.phase='idle'
 s.stage='restore';s.restoring=true;s.restoredGeneration133=nil;s.needsRebind133=true;s.retryAt133=getTickCount()+1000
 TLC.featOn.weather=nil;retireLegacyWeather133()
 local message=tostring(why)
 if s.lastRestoreError133~=message then TLC.reason('weather',message);s.lastRestoreError133=message end
 local record=getAddressList().getMemoryRecordByID(503);if record then pcall(function()record.disableWithoutExecute()end)end
end
function TLC.pumpWeather074()
 local s=TLC.weatherLock074;if not s then return end
 if not alive(s)then
  TLC.weatherLock074=nil;TLC.featOn.weather=nil;TLC.restore('weather')
  local record=getAddressList().getMemoryRecordByID(503);if record then pcall(function()record.disableWithoutExecute()end)end
  return
 end
 if s.stage=='rebind137'then
  if TLC.pendingJob or getTickCount()&lt;(s.bindingRetry137 or 0)then return end
  if getTickCount()-(s.bindingStarted137 or getTickCount())&gt;=15000 then fail(s,'Weather dependencies did not stabilize: '..tostring(s.bindingReason137));return end
  local okay,fresh=pcall(TLC.prepareWeather074,s.target)
  if not okay then s.bindingReason137=tostring(fresh);s.bindingRetry137=getTickCount()+200;return end
  for _,name in ipairs({'volume','generator','windManager','audio','udw','setter','setterCDO','updateMasks','updateWind','forceTick','updateAudio','instantSound','consumerLayout','climateLayout','climateSize','climateMask','cloudBit'})do s[name]=fresh[name]end
  for object,identity in pairs(fresh.identities)do s.identities[object]=identity end
  s.system=nil;s.restoreProbe133=nil;s.phase='idle';s.failed=nil;s.needsRebind133=nil;s.retryAt133=nil
  s.stage=s.on and 'prepare'or 'restore';s.bindingRetry137=nil
  return
 end
 if s.failed then fail(s,s.failed)end
 if s.retryAt133 and getTickCount()&lt;s.retryAt133 then return end
 if s.needsRebind133 then
  local okay,why=rebindRestore133(s)
  if not okay then s.retryAt133=getTickCount()+1000;if s.lastRestoreError133~=why then TLC.reason('weather',why);s.lastRestoreError133=why end;return end
 end
 if s.phase=='native'then
  if not TLC.pendingJob and getTickCount()-s.started&gt;15000 then fail(s,'Weather native notification did not finish')else return end
 end
 if TLC.pendingJob then return end
 if not s.system then
  s.phase='native';s.started=getTickCount()
  TLC.weatherSystem(function(system)
   if not alive(s)then return end
   s.system=system;s.identities[system]=assert(TLC.identity029(system));s.phase='idle'
   if not s.target then s.target=climateValues(system,'CurrentClimate',s.climateLayout)end
  end)
  return
 end
 if not s.on and s.stage~='restore'and not s.restoring then s.stage='restore'end
 if s.stage=='prepare'then if not s.restoreProbe133 then prepareRestoreProbe133(s)end;queueApply(s);return end
 if s.stage=='notifyInputs'then
  local volume=s.dirty[s.dirtyIndex]
  if volume then
   s.dirtyIndex=s.dirtyIndex+1
   if notifyIdentity133(s,volume)then notify(s,volume)end
  else s.stage='retireMasks'end
  return
 end
 if s.stage=='retireMasks'then
  call(s,s.generator,s.updateMasks,nil,function()
   if not s.on then s.stage='restore';return end
   weatherChanged133(s.volume+field(s.volume,'WeatherMask',1),'byte',s.fullMask,s.volume)
   s.stage='notifyGlobal'
  end);return
 end
 if s.stage=='notifyGlobal'then notify(s,s.volume,function()s.stage='rebuildMasks'end);return end
 if s.stage=='rebuildMasks'then
  call(s,s.generator,s.updateMasks,nil,function()s.stage='applyRecompute133'end);return
 end
 if s.stage=='waitSimulation'then
  if simulationMatches(s)then requestRefresh(s,false)
  elseif getTickCount()&gt;=s.simulationDeadline then fail(s,'Selected climate did not reach the native weather subsystem')end
  return
 end
 if s.stage=='refreshWind'then call(s,s.windManager,s.updateWind,nil,function()s.stage='refreshWeather'end);return end
 if s.stage=='refreshWeather'then call(s,s.udw,s.forceTick,nil,function()s.stage='refreshUDWAudio'end);return end
 if s.stage=='refreshUDWAudio'then
  call(s,s.udw,s.instantSound,nil,function()s.stage='refreshAudio'end);return
 end
 if s.stage=='refreshAudio'then
  call(s,s.audio,s.updateAudio,nil,function()
   if s.restoring then s.stage='verifyRestoreConsumers133';s.nextRestoreCheck133=getTickCount()+100;return end
   s.stage='waitConsumers';s.consumerDeadline=getTickCount()+10000
  end);return
 end
 if s.stage=='waitConsumers'then
  local okay,why=TLC.weatherConsumersMatch074(s)
  if okay then
   s.stage='hold';s.applied=true;s.nextCheck=getTickCount()+500
   s.bindingStarted137=nil;s.bindingRetry137=nil;s.bindingReason137=nil
   TLC.msg('Selected climate, local rain/snow/lightning, audio parameters and tags verified: '..tostring(TLC.selectedWeather or'current'),
    '指定気候・局地の雨雪／雷・音声パラメーター／タグを照合: '..tostring(TLC.selectedWeather or'現在の天候'))
  elseif getTickCount()&gt;=s.consumerDeadline then fail(s,why)end
  return
 end
 if s.stage=='hold'then
  if getTickCount()&lt;(s.nextCheck or 0)then return end;s.nextCheck=getTickCount()+500
  local matching=simulationMatches(s)and TLC.weatherConsumersMatch074(s)
  s.mismatchChecks=matching and 0 or(s.mismatchChecks or 0)+1
  local changed=s.mismatchChecks&gt;=2
  for _,volume in ipairs(registered(s))do
   local record=capture(s,volume);local mask=readBytes(volume+field(volume,'WeatherMask',1),1)
   local expected=volume==s.volume and(record.mask|s.climateMask)or(record.mask&amp;~s.climateMask)
   if mask~=expected then changed=true end
  end
  if changed then s.stage='prepare'end
  return
 end
 if s.stage=='applyRecompute133'then recomputeClimate133(s,false);return end
 if s.stage=='restoreRecompute133'then recomputeClimate133(s,true);return end
 if s.stage=='verifyRestoreConsumers133'then
  if getTickCount()&lt;(s.nextRestoreCheck133 or 0)then return end
  local okay=restoredConsumersMatch133(s)
  if okay and s.restoredGeneration133==s.generation then
   assert(not next((function()local rows={};for a,x in pairs(TLC.edits or{})do if x.key=='weather'then rows[a]=true end end;return rows end)()),'Weather input restoration is incomplete')
   TLC.weatherLock074=nil
  else s.stage='restoreRecompute133'end
  return
 end
 if s.stage=='restore'then
  TLC.restore('weather');s.dirty={};s.dirtyIndex=1
  for volume,row in pairs(s.volumes)do if TLC.sameIdentity029(row.identity)then s.dirty[#s.dirty+1]=volume end end
  s.stage='notifyRestore';s.restoring=true;return
 end
 if s.stage=='notifyRestore'then
  local volume=s.dirty[s.dirtyIndex]
  if volume then s.dirtyIndex=s.dirtyIndex+1;if notifyIdentity133(s,volume)then notify(s,volume)end
  else s.stage='restoreMasks'end
  return
 end
 if s.stage=='restoreMasks'then call(s,s.generator,s.updateMasks,nil,function()s.stage='restoreRecompute133'end);return end
end
function TLC.prepareWeather074(target)
 TLC.require();TLC.prepareDispatch074()
 local actors=TLC.weatherActors074();local world=assert(TLC.identity029(TLC.world()))
 local climate=climateLayout();local struct=assert(TLC.findMetadata074('VoyageWorldClimate','ScriptStruct'))
 local _,climateSize=TLC.refFieldLayout(actors.volume,'Climate',false);assert(climateSize and climateSize&lt;=256,'Climate property size unavailable')
 local masks=TLC.enumValues074('EVoyageWorldWeatherMask');local climateMask=0
 for _,name in ipairs({'Temperature','Precipitation','Thunder','CloudCoverage','FogDensity'})do climateMask=climateMask|assert(masks[name],'Weather mask enum missing: '..name)end
 assert(climateMask&lt;=255,'Weather mask does not fit its property')
 local setter=TLC.reflectedFunction069('KismetSystemLibrary','SetBoolPropertyByName')
 field(setter,'Object',8,'function');field(setter,'PropertyName',8,'function');field(setter,'Value',1,'function')
 local s={world=world,volume=actors.volume,generator=actors.generator,windManager=actors.windManager,audio=actors.audio,udw=actors.udw,
  climateLayout=climate,climateSize=climateSize,climateMask=climateMask,cloudBit=masks.CloudCoverage,
  identities={},setter=setter,setterCDO=TLC.defaultObject074(assert(TLC.refClass('KismetSystemLibrary'))),volumes={},target=target,
  phase='idle',stage='prepare',generation=1,on=true}
 s.updateMasks=functionFor(s.generator,'UpdateCloudMasks');s.updateWind=functionFor(s.windManager,'UpdateWeather')
 s.forceTick=functionFor(s.udw,'Force Tick');s.updateAudio=functionFor(s.audio,'OnWeatherChanged')
 s.instantSound=functionFor(s.udw,'Instant Sound Update')
 for _,fn in ipairs({s.updateMasks,s.updateWind,s.forceTick,s.instantSound,s.updateAudio})do
  assert(readSmallInteger(fn+0xb6)==0,'Weather notification parameters changed');s.identities[fn]=assert(TLC.identity029(fn))
 end
 s.identities[s.setter]=assert(TLC.identity029(s.setter))
 for _,object in ipairs({s.volume,s.generator,s.windManager,s.audio,s.udw})do s.identities[object]=assert(TLC.identity029(object));TLC.processEvent074(object)end
 TLC.processEvent074(s.setterCDO,true)
 field(s.volume,'Climate',climateSize);field(s.volume,'Priority',4);field(s.volume,'WeatherMask',1);field(s.volume,'Modified',1)
 TLC.prepareWeatherConsumers074(s)
 return s
end
TLC.F.weather={on=function()
 retireLegacyWeather133()
 local old=TLC.weatherLock074;local target=TLC.weatherSelection074
 local okay,state=pcall(TLC.prepareWeather074,target)
 if not okay then if old and alive(old)then fail(old,state)end;error(state,0)end
 if old and alive(old)then
  -- A fresh enable supersedes a failed/unfinished restoration. Keep its original
  -- value journal, but bind notifications to the currently verified consumers.
  local selected=target or(old.system and TLC.valid(old.system)and climateValues(old.system,'CurrentClimate',old.climateLayout))
  for _,name in ipairs({'volume','generator','windManager','audio','udw','setter','setterCDO','updateMasks','updateWind','forceTick','updateAudio','instantSound','consumerLayout','climateLayout','climateSize','climateMask','cloudBit'})do old[name]=state[name]end
  for object,identity in pairs(state.identities)do old.identities[object]=identity end
  old.generation=old.generation+1;old.on=true;old.restoring=nil;old.target=selected;old.stage='prepare';old.applied=nil
  old.failed=nil;old.needsRebind133=nil;old.retryAt133=nil;old.restoredGeneration133=nil;old.restoredClimate133=nil;old.restoreProbe133=nil
  if old.system and not TLC.valid(old.system)then old.system=nil end
  old.phase='idle';old.bindingStarted137=nil;old.bindingRetry137=nil;old.bindingReason137=nil
 else TLC.weatherLock074=state end
end,off=function()
 retireLegacyWeather133()
 local s=TLC.weatherLock074;if s and alive(s)then s.on=false;s.generation=s.generation+1;s.stage='restore'end
end}
function TLC.weatherPick()
 local prior=TLC.scope038;TLC.scope038='weather'
 local okay,why=pcall(function()
  TLC.need();local names={};for _,entry in ipairs(TLC.WEATHER)do names[#names+1]=TLC.weatherDisplayName(entry)end
  local index=TLC.pick(TLC.T('Choose and lock weather','天候を指定して固定'),names);if not index then return end
  TLC.loadAsset(TLC.WEATHER[index].path,function(asset)
   local values=climateValues(asset,'Climate',climateLayout())
   TLC.weatherSelection074=values;TLC.selectedWeather=TLC.weatherDisplayName(TLC.WEATHER[index]);TLC.selectedWeatherIndex=index
   local record=getAddressList().getMemoryRecordByID(503)
   if record and not record.Active then record.Active=true else TLC.feature('weather',true)end
  end)
 end)
 TLC.scope038=prior;if not okay then error(why,0)end
end
local tick=TLC.tick
function TLC.tick(...)
 local result=tick(...)
 if TLC.attached()then
  local okay,why=pcall(TLC.pumpWeather074)
  if not okay then local s=TLC.weatherLock074;if s and alive(s)then fail(s,why)else TLC.reason('weather',tostring(why))end end
 end
 return result
end
local forget=TLC.forgetProcess
function TLC.forgetProcess(...)TLC.weatherLock074=nil;TLC.weatherSelection074=nil;return forget(...)end
local off=TLC.disableAll
function TLC.disableAll(...)
 local s=TLC.weatherLock074
 if s and alive(s)then
  TLC.F.weather.off();TLC.restore('weather');local deadline=getTickCount()+5000
  repeat
   if TLC.image038.known then TLC.tick()else TLC.portableTick074()end
   if not TLC.weatherLock074 then break end
   sleep(10)
  until getTickCount()&gt;=deadline
  assert(not TLC.weatherLock074,'Weather restoration is still pending; ownership retained')
 end
 return off(...)
end
end)(TLC)

-- Recheck class/name identity on the game thread, including serial-zero slots.
;(function(TLC)
local aa=TLC.HOOKS.gameTick.aa
local function extend(serial,classSlot,nameSlot)
 local marker='mov ecx,[tlcFlags+'..serial..']\ncmp [r8+rdx+10],ecx\njne tlc_job_fail'
 local extra=marker..'\ntest dword ptr [rax+08],18010\njne tlc_job_fail\ntest dword ptr [r8+rdx+04],10200000\njne tlc_job_fail\nmov rcx,[rax+10]\ncmp rcx,[tlcFlags+'..classSlot..']\njne tlc_job_fail\nmov rcx,[rax+18]\ncmp rcx,[tlcFlags+'..nameSlot..']\njne tlc_job_fail'
 local at=assert(aa:find(marker,1,true),'Native identity guard insertion point missing')
 assert(not aa:find(marker,at+#marker,true),'Native identity guard insertion point ambiguous')
 aa=aa:sub(1,at-1)..extra..aa:sub(at+#marker)
end
extend('514','5B8','5C0');extend('524','5C8','5D0');extend('59C','5D8','5E0')
local marker='mov rcx,[tlcFlags+5B0]\ncmp [rax+10],rcx\njne tlc_job_fail'
local at=assert(aa:find(marker,1,true),'Native world guard insertion point missing')
aa=aa:sub(1,at-1)..marker..'\nmov rcx,[rax+18]\ncmp rcx,[tlcFlags+5E8]\njne tlc_job_fail'..aa:sub(at+#marker)
TLC.gameTickTemplate074=aa;TLC.HOOKS.gameTick.aa=aa
local publish=TLC.publishJobWorld029
function TLC.publishJobWorld029(p)
 publish(p)
 for _,row in ipairs({{0x08,0xb8},{0x18,0xc8},{0x90,0xd8}})do
  local object=readQword(p+row[1])
  if object and object~=0 then
   assert(TLC.valid(object),'Native guard object expired')
   assert(writeQword(p+row[2],readQword(object+0x10))and writeQword(p+row[2]+8,readQword(object+0x18)))
  end
 end
 assert(writeQword(p+0xe8,readQword(TLC.world()+0x18)))
end
end)(TLC)

-- Longer generated-helper discriminators, with only instruction relocations masked.
;(function(TLC)
TLC.SIGS.HumanPropertyCopy034.p='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 97 00 00 00 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74 24 40 48 83 C1 38 E8 ED 43 D3 FF 48 63 77 08 48 8B CB 8B D6 E8 9F 7A 00 00 48 8D 4B 08 4C 8B CB 48 8D 43 0C 44 8B C6 48 89 44 24 28 BA 08 00 00 00 48 89 4C 24 20 B9 18 00 00 00';TLC.SIGS.HumanPropertyCopy034.bytes={72,137,92,36,16,87,72,131,236,48,72,139,250,72,139,217,72,59,202,15,132,151,0,0,0,68,139,79,72,76,141,66,56,72,141,81,72,72,137,116,36,64,72,131,193,56,232,237,67,211,255,72,99,119,8,72,139,203,139,214,232,159,122,0,0,72,141,75,8,76,139,203,72,141,67,12,68,139,198,72,137,68,36,40,186,8,0,0,0,72,137,76,36,32,185,24,0,0,0}
TLC.codePatterns074.HumanPropertyCopy034={pattern='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 ?? ?? ?? ?? 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74 24 40 48 83 C1 38 E8 ?? ?? ?? ?? 48 63 77 08 48 8B CB 8B D6 E8 ?? ?? ?? ?? 48 8D 4B 08 4C 8B CB 48 8D 43 0C 44 8B C6 48 89 44 24 28 BA 08 00 00 00 48 89 4C 24 20 B9 18 00 00 00',mask={22,23,24,25,48,49,50,51,62,63,64,65}}
TLC.SIGS.HumanPropertyInsert034.p='48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57 48 83 EC 30 4C 8B F2 4D 8B E1 48 8D 54 24 20 49 8B D8 48 8B F1 E8 1E FE EC FB 48 8B 7C 24 28 48 85 FF 74 1B 48 8B 03 4C 8B 53 08 4C 8B 00 49 8B 02 48 89 47 08 4C 89 07 C7 47 10 FF FF FF FF 4C 8B 07 48 B9 CD 8C 55 ED D7 AF 51 FF';TLC.SIGS.HumanPropertyInsert034.bytes={72,137,92,36,8,72,137,108,36,16,72,137,116,36,24,87,65,84,65,85,65,86,65,87,72,131,236,48,76,139,242,77,139,225,72,141,84,36,32,73,139,216,72,139,241,232,30,254,236,251,72,139,124,36,40,72,133,255,116,27,72,139,3,76,139,83,8,76,139,0,73,139,2,72,137,71,8,76,137,7,199,71,16,255,255,255,255,76,139,7,72,185,205,140,85,237,215,175,81,255}
TLC.codePatterns074.HumanPropertyInsert034={pattern='48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57 48 83 EC 30 4C 8B F2 4D 8B E1 48 8D 54 24 20 49 8B D8 48 8B F1 E8 ?? ?? ?? ?? 48 8B 7C 24 28 48 85 FF 74 ?? 48 8B 03 4C 8B 53 08 4C 8B 00 49 8B 02 48 89 47 08 4C 89 07 C7 47 10 FF FF FF FF 4C 8B 07 48 B9 CD 8C 55 ED D7 AF 51 FF',mask={47,48,49,50,60}}
TLC.SIGS.HumanStringCopy033.p='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 40 48 8B D9 33 C9 48 89 0B 48 8D 43 0C 48 63 7A 08 48 8B 32 89 7B 08 85 FF 75 15 89 08 48 8B C3 48 8B 5C 24 50 48 8B 74 24 58 48 83 C4 40 5F C3 48 89 44 24 30 BA 02 00 00 00 8B CA 89 7C 24 28 45 33 C9 48 89 5C 24 20 44 8B C7 E8 B2 EB FF FF 48 8B 0B';TLC.SIGS.HumanStringCopy033.bytes={72,137,92,36,8,72,137,116,36,16,87,72,131,236,64,72,139,217,51,201,72,137,11,72,141,67,12,72,99,122,8,72,139,50,137,123,8,133,255,117,21,137,8,72,139,195,72,139,92,36,80,72,139,116,36,88,72,131,196,64,95,195,72,137,68,36,48,186,2,0,0,0,139,202,137,124,36,40,69,51,201,72,137,92,36,32,68,139,199,232,178,235,255,255,72,139,11}
TLC.codePatterns074.HumanStringCopy033={pattern='48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 40 48 8B D9 33 C9 48 89 0B 48 8D 43 0C 48 63 7A 08 48 8B 32 89 7B 08 85 FF 75 ?? 89 08 48 8B C3 48 8B 5C 24 50 48 8B 74 24 58 48 83 C4 40 5F C3 48 89 44 24 30 BA 02 00 00 00 8B CA 89 7C 24 28 45 33 C9 48 89 5C 24 20 44 8B C7 E8 ?? ?? ?? ?? 48 8B 0B',mask={41,91,92,93,94}}
TLC.SIGS.HumanTraitCopy034.p='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 96 00 00 00 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74 24 40 48 83 C1 38 E8 CD 43 DE FF 48 63 77 08 48 8B CB 8B D6 E8 CF 73 DF FF 48 8D 4B 08 4C 8B CB 48 8D 43 0C 44 8B C6 48 89 44 24 28 BA 08 00 00 00 48 89 4C 24 20 B9 10 00 00 00';TLC.SIGS.HumanTraitCopy034.bytes={72,137,92,36,16,87,72,131,236,48,72,139,250,72,139,217,72,59,202,15,132,150,0,0,0,68,139,79,72,76,141,66,56,72,141,81,72,72,137,116,36,64,72,131,193,56,232,205,67,222,255,72,99,119,8,72,139,203,139,214,232,207,115,223,255,72,141,75,8,76,139,203,72,141,67,12,68,139,198,72,137,68,36,40,186,8,0,0,0,72,137,76,36,32,185,16,0,0,0}
TLC.codePatterns074.HumanTraitCopy034={pattern='48 89 5C 24 10 57 48 83 EC 30 48 8B FA 48 8B D9 48 3B CA 0F 84 ?? ?? ?? ?? 44 8B 4F 48 4C 8D 42 38 48 8D 51 48 48 89 74 24 40 48 83 C1 38 E8 ?? ?? ?? ?? 48 63 77 08 48 8B CB 8B D6 E8 ?? ?? ?? ?? 48 8D 4B 08 4C 8B CB 48 8D 43 0C 44 8B C6 48 89 44 24 28 BA 08 00 00 00 48 89 4C 24 20 B9 10 00 00 00',mask={22,23,24,25,48,49,50,51,62,63,64,65}}
TLC.SIGS.HumanTraitInsert034.p='40 53 56 57 41 55 48 83 EC 38 48 89 6C 24 60 48 8B F2 4C 89 64 24 68 48 8D 54 24 20 4C 89 7C 24 30 4D 8B E1 49 8B F8 48 8B D9 E8 31 BD 00 00 4C 8B 5C 24 28 41 BF FF FF FF FF 4D 85 DB 74 0A 48 8B 07 49 89 03 45 89 7B 08 4D 8B 03 48 B9 CD 8C 55 ED D7 AF 51 FF 48 63 7C 24 20 49 8B C0 48 C1 E8 21';TLC.SIGS.HumanTraitInsert034.bytes={64,83,86,87,65,85,72,131,236,56,72,137,108,36,96,72,139,242,76,137,100,36,104,72,141,84,36,32,76,137,124,36,48,77,139,225,73,139,248,72,139,217,232,49,189,0,0,76,139,92,36,40,65,191,255,255,255,255,77,133,219,116,10,72,139,7,73,137,3,69,137,123,8,77,139,3,72,185,205,140,85,237,215,175,81,255,72,99,124,36,32,73,139,192,72,193,232,33}
TLC.codePatterns074.HumanTraitInsert034={pattern='40 53 56 57 41 55 48 83 EC 38 48 89 6C 24 60 48 8B F2 4C 89 64 24 68 48 8D 54 24 20 4C 89 7C 24 30 4D 8B E1 49 8B F8 48 8B D9 E8 ?? ?? ?? ?? 4C 8B 5C 24 28 41 BF FF FF FF FF 4D 85 DB 74 ?? 48 8B 07 49 89 03 45 89 7B 08 4D 8B 03 48 B9 CD 8C 55 ED D7 AF 51 FF 48 63 7C 24 20 49 8B C0 48 C1 E8 21',mask={44,45,46,47,63}}
end)(TLC)

-- Resolve resource removal from the current typed wrapper and PE unwind records.
;(function(TLC)
local function u32(a)return assert(readInteger(a),'PE function metadata unreadable')&amp;0xffffffff end
local function runtime(address)
 local image=assert(TLC.image038);local pe=image.base+u32(image.base+0x3c)
 local directory=u32(pe+0xa0);local bytes=u32(pe+0xa4)
 assert(directory&gt;0 and bytes&gt;0 and bytes%12==0 and directory+bytes&lt;=image.size,'PE unwind directory unavailable')
 local low,high=0,bytes//12-1;local target=address-image.base;local found
 while low&lt;=high do
  local mid=(low+high)//2;local entry=image.base+directory+mid*12
  local first,last=u32(entry),u32(entry+4)
  if target&lt;first then high=mid-1 elseif target&gt;=last then low=mid+1 else found=entry;break end
 end
 assert(found,'Native function has no bounded unwind identity')
 local first,last=u32(found),u32(found+4);local unwind=u32(found+8)
 for depth=1,8 do
  assert(unwind&gt;0 and unwind+4&lt;image.size,'Invalid unwind record')
  local a=image.base+unwind;local flags=assert(readBytes(a,1))&gt;&gt;3
  if flags&amp;4==0 then
   local nextEntry=found+12
   for extra=1,32 do
    if nextEntry&gt;=image.base+directory+bytes or u32(nextEntry)~=last then break end
    local finish=u32(nextEntry+4);local u=u32(nextEntry+8);local root=u32(nextEntry)
    for link=1,8 do
     local record=image.base+u;local f=assert(readBytes(record,1))&gt;&gt;3
     if f&amp;4==0 then break end
     local count=assert(readBytes(record+2,1));local parent=record+4+((count*2+3)&amp;~3)
     root=math.min(root,u32(parent));u=u32(parent+8)
    end
    if root~=first then break end
    last=math.max(last,finish);nextEntry=nextEntry+12
   end
   return image.base+first,image.base+last
  end
  local count=assert(readBytes(a+2,1));local parent=a+4+((count*2+3)&amp;~3)
  local begin,finish=u32(parent),u32(parent+4)
  first=math.min(first,begin);last=math.max(last,finish);unwind=u32(parent+8)
 end
 error('Unwind chain exceeds bound')
end
TLC.runtimeFunction074=runtime
local function bytesAt(a,n)
 local b=assert(readBytes(a,n,true),'Native code unreadable');assert(#b==n)
 for _,state in pairs(TLC.hookState)do
  if state.addr and state.orig then
   for i,v in ipairs(state.orig)do local offset=state.addr+i-1-a;if offset&gt;=0 and offset&lt;n then b[offset+1]=v end end
  end
 end
 local c={} ;for i,v in ipairs(b)do c[i]=string.char(v)end;return table.concat(c)
end
local function unique(first,last,pattern)
 assert(last&gt;first and last-first&lt;=0x4000,'Native function scope exceeds bound')
 local escaped={};for i=1,#pattern do local c=pattern:sub(i,i);if c~='.'and c:find('[%%%^%$%(%)%[%]%*%+%-%?]')then c='%'..c end;escaped[#escaped+1]=c end;pattern=table.concat(escaped)
 local data=bytesAt(first,last-first);local at=data:find(pattern)
 assert(at and not data:find(pattern,at+1),'Native success path is missing or ambiguous')
 return first+at-1
end
local function signed(a)
 local x=u32(a);return x&gt;=0x80000000 and x-0x100000000 or x
end
local function typedImplementations()
 local fn=assert(TLC.reflectedFunction069('VoyageModuleComponent','RemoveResource'))
 assert(readSmallInteger(fn+0xb6)==18,'RemoveResource parameter contract changed')
 for _,row in ipairs({{'Type',0,1},{'RemoveAmount',8,8},{'RemovalType',16,1},{'ReturnValue',17,1}})do
  local off,size=TLC.refFieldLayout(fn,row[1],'function')
  assert(off==row[2]and size==row[3],'RemoveResource parameter ABI changed: '..row[1])
 end
 local begin=assert(readQword(fn+0xd8));local first,last=runtime(begin);local ip=begin;local slots={}
 while ip&lt;last and ip-begin&lt;0x1000 do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15)
  -- Reflected native wrapper invokes this method through its virtual table.
  if n==6 and readBytes(ip,1)==0xff and readBytes(ip+1,1)==0x90 then slots[#slots+1]=u32(ip+2)end
  if readBytes(ip,1)==0xc3 then break end;ip=ip+n
 end
 assert(#slots==1 and slots[1]%8==0 and slots[1]&lt;0x2000,'RemoveResource virtual dispatch is missing or ambiguous')
 local result={slot=slots[1]}
 for key,name in pairs({custom='VoyageCustomModuleComponent',storage='VoyageModuleComponent'})do
  local cls=assert(TLC.refClass(name),'Resource component metadata unavailable: '..name)
  local cdo=assert(TLC.defaultObject074(cls));local vtable=assert(readQword(cdo))
  local entry=assert(readQword(vtable+slots[1]));assert(TLC.executable038(entry,16),'Resource implementation is not executable')
  local lo,hi=runtime(entry);assert(lo==entry,'Resource virtual entry/unwind identity mismatch');result[key]={first=lo,last=hi,entry=entry}
 end
 return result
end
function TLC.prepareFuelSites074()
 local sites=typedImplementations();local custom,storage=sites.custom,sites.storage
 -- Patterns describe the verified register/stack ABI. No historical target RVA,
 -- CALL displacement, success-path delta, or resource field offset is used.
 local customSite=unique(custom.first,custom.last,'\15\41\124\36.\69\132\201')
 local customReturn=unique(custom.first,custom.last,'\176\1\72\139\92\36.\15\40\116\36.\72\131\196.\95\195')
 assert(customReturn&lt;customSite,'Custom resource success path is not before XMM7 spill')
 local storageSite=unique(storage.first,storage.last,'\69\132\201\117.')
 local displacement=assert(readBytes(storageSite+4,1));if displacement&gt;=128 then displacement=displacement-256 end
 local storageNormal=storageSite+5+displacement
 assert(storageNormal&gt;storageSite+5 and storageNormal&lt;storage.last,'Storage modifier branch escapes function')
 -- This point is BEFORE the multiplier CALL: R9 is volatile and the actual
 -- multiplier's map lookup overwrites it. Reading R9 after that CALL is invalid.
 local storageReturn=unique(storage.first,storage.last,'\72\139\92\36.\72\139\116\36.\15\40\116\36.\72\131\196.\95\195')
 local prefix=bytesAt(custom.first,customSite-custom.first)
 assert(prefix:find('\72\139\249',1,true)and prefix:find('\15\40\242',1,true),'Custom module register contract changed')
 prefix=bytesAt(storage.first,storageSite-storage.first)
 assert(prefix:find('\72\139\241',1,true)and prefix:find('\15\40\242',1,true),'Storage module register contract changed')
 for _,row in ipairs({{'FuelDebit061',customSite,5},{'FuelStorage062',storageSite,5}})do
  local name,a,len=row[1],row[2],row[3];local spec=TLC.SIGS[name]
  local code=bytesAt(a,len);local data={};for i=1,#code do data[i]=code:byte(i)end
  -- Interior sites have complete instruction boundaries (5-byte XMM spill or
  -- TEST + short JNE); the storage branch is explicitly relocated in ENABLE.
  spec.len=len;spec.bytes=data;local tokens={};for i,v in ipairs(data)do tokens[i]=('%02X'):format(v)end
  spec.p=table.concat(tokens,' ');TLC.codePatterns074[name]=nil
  TLC.A[name]=a;TLC.resolution[name]='verified typed RemoveResource and unwind scope';TLC.failures[name]=nil
  registerSymbol('tlcA_'..name,a,true)
 end
 local slotBytes={0xff,0x90,sites.slot&amp;255,(sites.slot&gt;&gt;8)&amp;255,(sites.slot&gt;&gt;16)&amp;255,(sites.slot&gt;&gt;24)&amp;255}
 local slotText={};for i,v in ipairs(slotBytes)do slotText[i]=('%02X'):format(v)end
 for _,name in ipairs({'FuelGridSupply071','FuelCableSupply071'})do
  local spec=TLC.SIGS[name];spec.originalPattern074=spec.originalPattern074 or spec.p
  spec.p=spec.originalPattern074:gsub('FF 90 20 05 00 00',table.concat(slotText,' '));spec.bytes=slotBytes
  TLC.codePatterns074[name]=nil
  if TLC.resolution[name]=='failed'then TLC.resolution[name]=nil;TLC.failures[name]=nil end
 end
 TLC.fuelSites074={slot=sites.slot,custom=customSite,storage=storageSite,customReturn=customReturn,storageReturn=storageReturn,storageNormal=storageNormal}
 return TLC.fuelSites074
end
local prepare=TLC.prepareFuelDebit074
function TLC.prepareFuelDebit074()
 local sites=TLC.prepareFuelSites074();local semantics=prepare()
 local custom=TLC.HOOKS.fuelDebit061.aa
 custom=custom:gsub('jmp tlcA_FuelDebit061%-12',('jmp %X'):format(sites.customReturn),1)
 local storage=TLC.HOOKS.fuelStorage062.aa
 storage=storage:gsub('jmp tlcA_FuelStorage062%+BA',('jmp %X'):format(sites.storageReturn),1)
 local at=assert(storage:find('$ORIG',1,true));local after=at+#'$ORIG'
 storage=storage:sub(1,at-1)..('test r9b,r9b\njne %X'):format(sites.storageNormal)..storage:sub(after)
 TLC.HOOKS.fuelDebit061.aa=custom;TLC.HOOKS.fuelStorage062.aa=storage
 return semantics
end
end)(TLC)

-- Only features with complete typed contracts may bypass a build-wide layout gate.
;(function(TLC)
local check=TLC.checkFeature074
function TLC.checkFeature074(key)
 if key=='fuel'or key=='weather'then
  if not TLC.reflectionReady074 then return false,'Unresolved dependency for '..key..': UObject metadata / '..tostring(TLC.metadataReason074)end
  return true
 end
 return check(key)
end
TLC.compat038.portable.fuel=true;TLC.compat038.portable.weather=true
local feature=TLC.feature
function TLC.feature(key,on)
 if key=='fuel'and on then
  -- Complete read-only preparation precedes the generic dependency checks and
  -- every hook write. Failed contracts never leave partially prepared hooks.
  local okay,why=TLC.checkFeature074(key);if not okay then error(why,0)end
  TLC.prepareFuelDebit074();TLC.requireSigs({'FuelGridSupply071','FuelCableSupply071'})
 end
 return feature(key,on)
end
end)(TLC)

;(function(TLC)
TLC.cvarNames074={CV_damage='Voyage.Character.PreventDamage',CV_cold='Voyage.Character.ColdImmunity',CV_consume='Voyage.ModuleSubsystem.Consume',CV_impact='Voyage.ImpactDamageMultiplier',CV_moduleSpeed='Voyage.ModuleSubsystem.SpeedMultiplier'}
for name in pairs(TLC.cvarNames074)do
 local p=TLC.codePatterns074[name];p.pattern='4C 8D 05 ?? ?? ?? ?? 33 D2 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ??'
 local seen={};for _,i in ipairs(p.mask)do seen[i]=true end
 -- Original seed ended inside a RIP displacement. Its last byte is a
 -- relocation too; it must not accidentally constrain another executable.
 if not seen[32]then p.mask[#p.mask+1]=32 end
end
end)(TLC)

-- Console variables are identified by their literal registered names, then by
-- the current constructor's data-store instruction, across constructor ABIs.
;(function(TLC)
local function rip(a,displacement,size)
 local d=assert(readInteger(a+displacement),'Console instruction unreadable');if d&gt;=0x80000000 then d=d-0x100000000 end;return a+size+d
end
local function nameAt(address,name)
 local b=readBytes(address,#name*2+2,true);if not b or #b~=#name*2+2 then return false end
 for i=1,#name do if b[i*2-1]~=name:byte(i)or b[i*2]~=0 then return false end end
 return b[#b-1]==0 and b[#b]==0
end
local previous=TLC.resolveSig
function TLC.resolveSig(name)
 local found=previous(name);if found or not TLC.cvarNames074[name]then return found end
 local pattern='48 8D 15 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ??'
 local rows,reason=TLC.scanFile074(pattern,function(a)
  if nameAt(rip(a,3,7),TLC.cvarNames074[name])then return a end
 end)
 if not rows or #rows~=1 then
  TLC.reason(name,'Console registration unavailable: '..TLC.cvarNames074[name]..' / '..tostring(reason or rows and(#rows..' verified candidates')));return nil
 end
 local a=rows[1];local spec=TLC.SIGS[name]
 spec.bytes=assert(readBytes(a,19,true));spec.p=pattern
 TLC.codePatterns074[name]={pattern=pattern,mask={4,5,6,7,11,12,13,14,16,17,18,19}}
 TLC.A[name]=a;TLC.resolution[name]='verified named console registration';TLC.failures[name]=nil;TLC.pend[name]=nil
 registerSymbol('tlcA_'..name,a,true);return a
end
function TLC.cvar(name)
 TLC.requireSigs({'CV_'..name});local spec=assert(TLC.CV[name]);local site=assert(TLC.resolveSig(spec.sig))
 local ip=site;local object,constructor;local returned=false
 for step=1,16 do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15)
  local b=assert(readBytes(ip,n,true))
  if n==7 and b[1]==0x48 and b[2]==0x8d and b[3]==0x0d then object=rip(ip,3,7)end
  if n==5 and b[1]==0xe8 then constructor=rip(ip,1,5);break end
  assert(b[1]~=0xc3 and b[1]~=0xe9,'Console constructor contract changed');ip=ip+n
 end
 assert(object and constructor,'Console constructor not identified')
 local first,last=TLC.runtimeFunction074(constructor);assert(first==constructor and last-first&lt;2048,'Console constructor unwind mismatch')
 local dataOffset;ip=first;local savedThis=false
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15);local b=assert(readBytes(ip,n,true))
  if n==3 and b[1]==0x4c and b[2]==0x8b and b[3]==0xf1 then savedThis=true end
  if n==4 and b[1]==0x49 and b[2]==0x89 and b[3]==0x46 then
   assert(not dataOffset,'Ambiguous console data-store contract');dataOffset=b[4]
  end
  if b[1]==0xc3 then returned=true;break end;ip=ip+n
 end
 assert(savedThis and returned and dataOffset and dataOffset&gt;=8 and dataOffset&lt;=0x80,'Console data-store layout unavailable')
 local data=readQword(object+dataOffset);assert(data and readBytes(data,spec.typ=='byte'and 2 or 8,true),'Console data storage unavailable: '..name)
 return data,spec.typ
end
end)(TLC)

-- Read back the actual weather and audio consumers before reporting success.
;(function(TLC)
local function member(object,name,size,kind)
 local off,actual=TLC.refFieldLayout(object,name,kind or false)
 assert(off and actual==size,'Weather consumer metadata unavailable: '..name);return off
end
local function number(object,name)
 local off,size=TLC.refFieldLayout(object,name,false)
 assert(off and(size==4 or size==8),'Weather scalar metadata unavailable: '..name)
 local v=size==8 and readDouble(object+off)or readFloat(object+off)
 assert(v and v==v and math.abs(v)&lt;1000000,'Invalid weather consumer scalar: '..name);return v
end
local function close(a,b)return math.abs(a-b)&lt;=math.max(.0001,math.abs(b)*.0001)end
function TLC.prepareWeatherConsumers074(s)
 local state=assert(TLC.readObjectField074(s.udw,'Local Weather State'),'Local weather state unavailable')
 local audio=assert(TLC.readObjectField074(s.audio,'WeatherMetaSound'),'Weather audio component unavailable')
 for _,n in ipairs({'Rain','Snow','Thunder/Lightning','Cloud Coverage'})do number(s.udw,n);number(state,n)end
 local ap=assert(TLC.findMetadata074('AudioParameter','ScriptStruct'),'Audio parameter metadata unavailable')
 local stride=readInteger(ap+0x58);assert(stride and stride&gt;0 and stride&lt;=512,'Audio parameter struct size unavailable')
 local name=member(ap,'ParamName',8,'struct');local array=member(ap,'ArrayFloatParam',16,'struct')
 assert(name+8&lt;=stride and array+16&lt;=stride,'Audio parameter fields exceed struct bounds')
 local container=assert(TLC.findMetadata074('GameplayTagContainer','ScriptStruct'))
 local tag=assert(TLC.findMetadata074('GameplayTag','ScriptStruct'))
 local tagStride=readInteger(tag+0x58);assert(tagStride and tagStride&gt;=8 and tagStride&lt;=64,'Gameplay tag size unavailable')
 local tagName=member(tag,'TagName',8,'struct');assert(tagName+8&lt;=tagStride)
 s.consumerLayout={audio=audio,parameters=member(audio,'InstanceParameters',16),stride=stride,name=name,array=array,
  tags=member(s.audio,'CurrentWeatherTags',32),tagArray=member(container,'GameplayTags',16,'struct'),tagStride=tagStride,tagName=tagName,
  thunder=member(s.audio,'WeatherTagThunder',8),rainLight=member(s.audio,'WeatherTagRainLight',8),rainMedium=member(s.audio,'WeatherTagRainMedium',8),rainHard=member(s.audio,'WeatherTagRainHard',8)}
 return s.consumerLayout
end
function TLC.weatherConsumersMatch074(s)
 local state=TLC.readObjectField074(s.udw,'Local Weather State')
 if not state then return false,'Local weather state is unavailable'end
 local target=s.target;local precip=target.Precipitation
 local expected={Rain=math.max(precip*.1,0),Snow=math.max(0,math.min(1,1-target.Temperature/10))*precip,
  ['Thunder/Lightning']=target.CloudCoverage*precip*.1,['Cloud Coverage']=target.CloudCoverage*10}
 for _,n in ipairs({'Rain','Snow','Thunder/Lightning','Cloud Coverage'})do
  if not close(number(s.udw,n),expected[n])then return false,'Manual weather input did not update: '..n end
  if not close(number(state,n),expected[n])then return false,'Local weather state did not update: '..n end
 end
 local layout=assert(s.consumerLayout)
 if TLC.readObjectField074(s.audio,'WeatherMetaSound')~=layout.audio then return false,'Weather audio component changed'end
 local header=layout.audio+layout.parameters;local data,count,capacity=readQword(header),readInteger(header+8),readInteger(header+12)
 if not count or not capacity or count&lt;0 or count&gt;capacity or capacity&gt;256 or count&gt;0 and not data then return false,'Weather audio parameters are unavailable'end
 local values
 for i=0,count-1 do
  local p=data+i*layout.stride;local word=readQword(p+layout.name)
  if word and TLC.U.name(word&amp;0xffffffff)=='WeatherValues'then
   if values then return false,'Weather audio parameter is ambiguous'end
   local a,n,cap=readQword(p+layout.array),readInteger(p+layout.array+8),readInteger(p+layout.array+12)
   if not a or n~=3 or not cap or cap&lt;3 or cap&gt;256 then return false,'Weather audio array contract changed'end
   values={readFloat(a),readFloat(a+4),readFloat(a+8)}
  end
 end
 if readQword(header)~=data or readInteger(header+8)~=count then return false,'Weather audio parameters are updating'end
 if not values then return false,'Weather audio state has not been notified'end
 if not values[2]or not values[3]or not close(values[2],expected.Rain)or not close(values[3],expected['Thunder/Lightning'])then return false,'Weather audio rain/lightning inputs did not update'end
 local p=s.audio+layout.tags+layout.tagArray
 local tags,n,cap=readQword(p),readInteger(p+8),readInteger(p+12)
 if not n or not cap or n&lt;0 or n&gt;cap or cap&gt;256 or n&gt;0 and not tags then return false,'Weather audio tags unavailable'end
 local found={};for i=0,n-1 do local word=readQword(tags+i*layout.tagStride+layout.tagName);if word then found[word]=true end end
 if readQword(p)~=tags or readInteger(p+8)~=n then return false,'Weather audio tags are updating'end
 for key,active in pairs({thunder=expected['Thunder/Lightning']&gt;0,rainLight=expected.Rain&gt;0,rainMedium=expected.Rain&gt;3,rainHard=expected.Rain&gt;7})do
  local word=readQword(s.audio+layout[key]);if not word or not not found[word]~=active then return false,'Weather audio tag did not update: '..key end
 end
 return true
end
end)(TLC)

-- Timestamp/SizeOfImage alone do not prove identical private layouts. A known
-- profile additionally requires the exact installed executable file identity.
;(function(TLC)
TLC.BUILD.fileMD5='9566ed95baa497960c7f370613ffa6e9'
local check=TLC.checkBuild
function TLC.checkBuild(...)
 local result=check(...);local image=assert(TLC.image038)
 if not image.known then image.profile='no exact private-layout profile';return result end
 local path
 local okay,modules=pcall(enumModules)
 if okay then for _,m in ipairs(modules)do if m.Address==image.base then path=m.PathToFile;break end end end
 local cached=TLC.profileHash074;local hash,reason
 if cached and cached.pid==getOpenedProcessID()and cached.base==image.base and cached.path==path and cached.ts==image.ts and cached.size==image.size then hash=cached.hash;reason=cached.reason
 elseif type(path)=='string'and path~=''and type(md5file)=='function'then
  local success,value=pcall(md5file,path)
  if success and type(value)=='string'and #value==32 and not value:find('[^%x]')then hash=value:lower()
  else reason='executable file identity could not be read'end
 else reason='executable file identity API/path unavailable'end
 TLC.profileHash074={pid=getOpenedProcessID(),base=image.base,path=path,ts=image.ts,size=image.size,hash=hash,reason=reason}
 image.fileMD5=hash;image.known=hash==TLC.BUILD.fileMD5
 image.profile=image.known and'exact installed executable file'or(reason or'executable differs despite matching PE timestamp/size')
 return result
end
local forget=TLC.forgetProcess
function TLC.forgetProcess(...)TLC.profileHash074=nil;return forget(...)end
end)(TLC)

-- Typed movement/time consumers do not require a historical private-layout profile.
;(function(TLC)
function TLC.movementContract074(required)
 local player=TLC.player(required);local movement=player and TLC.readObjectField074(player,'CharacterMovement')
 if not movement then if required then error('CharacterMovement unavailable')end;return end
 assert(TLC.U.isA(movement,'CharacterMovementComponent'),'CharacterMovement class mismatch')
 local off,size=TLC.refFieldLayout(movement,'Velocity',false)
 local vector=assert(TLC.findMetadata074('Vector','ScriptStruct'),'Vector metadata unavailable')
 local z,zSize=TLC.refFieldLayout(vector,'Z','struct')
 assert(off and size and z and zSize==8 and z+8&lt;=size,'Movement velocity metadata unavailable')
 return {player=player,movement=movement,velocity=off,z=z}
end
TLC.F.float={on=function()TLC.require();TLC.movementContract074(true)end,task=function()
 local state=TLC.movementContract074(false)
 if state and isKeyPressed(VK_SPACE)then
  local value=readFloat(TLC.var(0x28));assert(value and value==value and math.abs(value)&lt;1000000,'Invalid ascent speed')
  assert(writeDouble(state.movement+state.velocity+state.z,value),'Ascent velocity write failed')
 end
end}
function TLC.worldTimeContract074()
 local world=assert(TLC.world(),'Playable world unavailable')
 local level=assert(TLC.readObjectField074(world,'PersistentLevel'),'PersistentLevel unavailable')
 local settings=assert(TLC.readObjectField074(level,'WorldSettings'),'WorldSettings unavailable')
 assert(TLC.U.isA(settings,'WorldSettings'),'WorldSettings class mismatch')
 local offset,size=TLC.refFieldLayout(settings,'TimeDilation',false)
 assert(offset and size==4,'TimeDilation metadata unavailable')
 return settings,offset
end
TLC.F.gametime={on=function()TLC.require();TLC.need();TLC.worldTimeContract074()end,task=function()
 local settings,offset=TLC.worldTimeContract074();local value=readFloat(TLC.var(0x30))
 assert(value and value==value and value&gt;=0 and value&lt;1000000,'Invalid game time multiplier')
 TLC.changed(settings+offset,'float',value,settings,'gametime')
end}
local check=TLC.checkFeature074
function TLC.checkFeature074(key)
 if key=='speed'or key=='float'or key=='gametime'then
  if not TLC.reflectionReady074 then return false,'Unresolved dependency for '..key..': UObject metadata / '..tostring(TLC.metadataReason074)end
  return true
 end
 return check(key)
end
TLC.compat038.portable.speed=true;TLC.compat038.portable.float=true;TLC.compat038.portable.gametime=true
local tick=TLC.portableTick074
function TLC.portableTick074()
 tick()
 if not TLC.attached()then return end
 local player=TLC.player(false);local movement=player and TLC.readObjectField074(player,'CharacterMovement')
 assert(writeQword(TLC.base()+0x238,movement or 0))
 for _,key in ipairs({'float','gametime'})do
  if TLC.featOn[key]then
   local okay,why=pcall(TLC.F[key].task)
   if not okay then pcall(TLC.feature,key,false);TLC.reason(key,tostring(why))end
  end
 end
end
end)(TLC)

-- Historical cave recognition remains exact-build-only, but even its entry
-- position comes from the current executable file, never a historical RVA.
;(function(TLC)
function TLC.legacySite074(name)
 if not TLC.image038 or not TLC.image038.known then return end
 local spec=TLC.SIGS[name];if not spec then return end
 local pattern=spec.originalPattern074 or spec.p
 local cache=TLC.legacySites074 or{};TLC.legacySites074=cache
 local key=name..'\n'..pattern;local old=cache[key]
 if old and old.pid==getOpenedProcessID()and old.base==TLC.image038.base then return old.address end
 local rows=TLC.scanFile074(pattern,function(a)return a end,true)
 if rows and #rows==1 then cache[key]={pid=getOpenedProcessID(),base=TLC.image038.base,address=rows[1]};return rows[1]end
end
local forget=TLC.forgetProcess
function TLC.forgetProcess(...)TLC.fileScanCache074=nil;TLC.legacySites074=nil;return forget(...)end
end)(TLC)

-- Validate historical cave returns against current code/metadata, not old RVAs.
;(function(TLC)
function TLC.legacyReturn074(site,spec,rel,target)
 if rel.kind=='siteReturn'then return target==site+spec.len end
 if rel.kind~='scopedTarget'or not TLC.executable038(target,1)then return false end
 local okay,first,last=pcall(TLC.runtimeFunction074,site)
 if not okay or last-first&gt;0x10000 then return false end
 local bytes=readBytes(first,last-first,true);if not bytes then return false end
 -- The very entry under examination can itself be patched; restore its
 -- already file-verified instruction bytes in the read-only comparison view.
 for i,v in ipairs(spec.bytes)do local at=site+i-first;if at&gt;=1 and at&lt;=#bytes then bytes[at]=v end end
 local found
 for at=1,#bytes-#rel.pattern+1 do
  local matches=true
  for j,v in ipairs(rel.pattern)do if bytes[at+j-1]~=v then matches=false;break end end
  if matches then if found then return false end;found=first+at-1+rel.targetOffset end
 end
 return found==target
end
function TLC.legacyConstraint074(symbol,target,proof)
 if proof.kind=='classPointer'then
  if not TLC.reflectionReady074 then TLC.refreshMetadata074()end
  local cls=TLC.reflectionReady074 and TLC.refClass('VoyageWeapon')
  return cls and readQword(target)==cls or false
 end
 if proof.kind~='globalIdentity'then return false end
 if symbol=='tlcGameThreadId'then
  local a=TLC.resolveSig('GameThread');return a and getAddressSafe('tlcGameThreadId')==target or false
 elseif symbol=='tlcObjects'then
  local a=TLC.resolveSig('Objects');return a and TLC.objectBootstrap072 and TLC.objectBootstrap072.objects==target or false
 elseif symbol=='tlcEngine'then
  local a=TLC.resolveSig('Engine');local d=a and readInteger(a+3)
  if not d then return false end;if d&gt;=0x80000000 then d=d-0x100000000 end
  return a+7+d==target
 end
 return false
end
function TLC.resolveModuleExport074(name)
 local spec=assert(TLC.SIGS[name]);local export=spec.export
 if not export then TLC.A[name]=nil;TLC.resolution[name]='failed';TLC.reason(name,'Explicit named export identity is required for module '..tostring(spec.mod));return end
 local okay,ex,base,size=pcall(TLC.steamAchievementExports,spec.mod)
 local address=okay and ex and ex[export]
 if not address or address&lt;base or address+#spec.bytes&gt;base+size or not TLC.originalView043(address,spec.bytes)then
  TLC.A[name]=nil;TLC.resolution[name]='failed';TLC.reason(name,'Named module export is unavailable or changed: '..spec.mod..'! '..export);return
 end
 TLC.A[name]=address;TLC.resolution[name]='verified named module export';TLC.failures[name]=nil;TLC.pend[name]=nil
 registerSymbol('tlcA_'..name,address,true);return address
end
end)(TLC)

-- Standard named asset APIs; no Voyage GetSignalObject or soft-path constructor address.
;(function(TLC)
 function TLC.apiContract075(owner,method)
  assert(TLC.reflectionReady074,'UObject metadata unavailable')
  local fn=assert(TLC.reflectedFunction069(owner,method));local cls=assert(TLC.refClass(owner))
  assert((assert(readInteger(fn+0xb0))&amp;0x2000)~=0,'Expected static API: '..owner..'.'..method)
  local size=assert(readSmallInteger(fn+0xb6));assert(size&gt;=0 and size&lt;=1024,'API parameter block exceeds limit')
  local cdo=assert(TLC.defaultObject074(cls));TLC.processEvent074(cdo,true)
  return {owner=owner,method=method,fn=fn,cdo=cdo,size=size}
 end
 function TLC.apiMember075(contract,name,size)
  local off,actual=TLC.refFieldLayout(contract.fn,name,'function')
  assert(off and actual==size and off+size&lt;=contract.size,'API parameter contract changed: '..contract.owner..'.'..contract.method..'.'..name)
  return off
 end
 function TLC.apiFrame075(contract)
  TLC.apiFrames075=TLC.apiFrames075 or{};local frame=TLC.apiFrames075[contract.fn]
  if not frame then
   local address=assert(allocateMemory(0x1000),'API parameter allocation failed');assert(address&gt;0)
   assert(writeBytes(address,{0}));frame={address=address,size=contract.size,world=assert(TLC.identity029(TLC.world()))};TLC.apiFrames075[contract.fn]=frame
  end
  assert(TLC.sameIdentity029(frame.world),'API parameter world changed; reopen the operation')
  return frame.address
 end
 function TLC.apiInvoke075(contract,inputs,done)
  assert(not TLC.pendingJob,'Native action already pending')
  local p=TLC.apiFrame075(contract);local world=assert(TLC.identity029(TLC.world()));local identity=assert(TLC.identity029(contract.fn))
  for name,value in pairs(inputs or{})do
   local off=TLC.apiMember075(contract,name,#value);assert(writeBytes(p+off,value))
  end
  local target=TLC.processEvent074(contract.cdo,true)
  TLC.job(target,{contract.cdo,contract.fn,p},{world.object,contract.fn},function()
   assert(TLC.sameIdentity029(world)and TLC.sameIdentity029(identity),'API world/function expired')
   if done then done(p)end
  end)
 end
 function TLC.copyApiMember075(contract,p,name,size)
  return assert(readBytes(p+TLC.apiMember075(contract,name,size),size,true),'API output unreadable')
 end
 function TLC.readApiString075(p)
  local data,count,capacity=readQword(p),readInteger(p+8),readInteger(p+12)
  assert(count and capacity and count&gt;=0 and count&lt;=capacity and capacity&lt;=16384,'Invalid API FString')
  if count&lt;=1 then return ''end
  assert(data and data&gt;0 and readSmallInteger(data+(count-1)*2)==0,'Unterminated API FString')
  return assert(readString(data,(count-1)*2,true),'API FString unreadable')
 end
 function TLC.assetLoadContract075()
  local make=TLC.apiContract075('KismetSystemLibrary','MakeSoftObjectPath')
  local convert=TLC.apiContract075('KismetSystemLibrary','Conv_SoftObjPathToSoftObjRef')
  local load=TLC.apiContract075('KismetSystemLibrary','LoadAsset_Blocking')
  local structure=assert(TLC.findMetadata074('SoftObjectPath','ScriptStruct'));local pathSize=assert(readInteger(structure+0x58))
  assert(pathSize&gt;0 and pathSize&lt;=128,'SoftObjectPath size unavailable')
  TLC.apiMember075(make,'PathString',16);TLC.apiMember075(make,'ReturnValue',pathSize)
  TLC.apiMember075(convert,'SoftObjectPath',pathSize)
  local _,softSize=TLC.refFieldLayout(convert.fn,'ReturnValue','function');assert(softSize and softSize&lt;=256)
  TLC.apiMember075(load,'Asset',softSize);TLC.apiMember075(load,'ReturnValue',8)
  return {make=make,convert=convert,load=load,pathSize=pathSize,softSize=softSize}
 end
 function TLC.loadAsset(path,done)
  local prior=TLC.scope038;TLC.scope038='typed asset API'
  local okay,why=pcall(function()
   TLC.require();assert(type(path)=='string'and path:sub(1,1)=='/','Invalid asset path')
   local contract=TLC.assetLoadContract075();local p=TLC.apiFrame075(contract.make);local units=0
   for _,code in utf8.codes(path)do units=units+(code&gt;0xffff and 2 or 1)end
   assert(units&gt;0 and units&lt;1400,'Asset path too long')
   local text=p+0x400;assert(writeString(text,path,true));assert(writeSmallInteger(text+units*2,0))
   local off=TLC.apiMember075(contract.make,'PathString',16)
   assert(writeQword(p+off,text)and writeInteger(p+off+8,units+1)and writeInteger(p+off+12,units+1))
   TLC.apiInvoke075(contract.make,nil,function(first)
    local value=TLC.copyApiMember075(contract.make,first,'ReturnValue',contract.pathSize)
    TLC.apiInvoke075(contract.convert,{SoftObjectPath=value},function(second)
     local soft=TLC.copyApiMember075(contract.convert,second,'ReturnValue',contract.softSize)
     TLC.apiInvoke075(contract.load,{Asset=soft},function(third)
      local object=readQword(third+TLC.apiMember075(contract.load,'ReturnValue',8))
      assert(TLC.valid(object),'Asset is unavailable in this game: '..path)
      if done then done(object)end
     end)
    end)
   end)
  end)
  TLC.scope038=prior;if not okay then error(why,0)end
 end
end)(TLC)

-- Query the current game's Asset Registry and FText fields, including unloaded item assets.
;(function(TLC)
 local function copy(a,n)return assert(readBytes(a,n,true),'Registry data unreadable')end
 local function member(o,n,size,kind)
  local off,actual=TLC.refFieldLayout(o,n,kind or false);assert(off and actual==size,'Registry metadata changed: '..n);return off
 end
 local function fname(address)
  local index,number=readInteger(address),readInteger(address+4)
  assert(index and number and number&gt;=0 and number&lt;1000000,'Invalid registry FName')
  local name=TLC.U.name(index);assert(name and name~='?'and name~='None','Registry name unavailable')
  return name..(number&gt;0 and'_'..(number-1)or'')
 end
 function TLC.registryClassContract075()
  local helpers=TLC.apiContract075('AssetRegistryHelpers','GetAssetRegistry');TLC.apiMember075(helpers,'ReturnValue',16)
  local fn=assert(TLC.reflectedFunction069('AssetRegistry','GetAssetsByClass'))
  member(fn,'ClassPathName',16,'function');member(fn,'OutAssetData',16,'function');member(fn,'bSearchSubClasses',1,'function');member(fn,'ReturnValue',1,'function')
  local first=assert(readQword(fn+0xd8));assert(TLC.executable038(first,16),'Registry exec wrapper unavailable')
  local ip,slots,returned=first,{},false
  for i=1,512 do
   local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15 and ip-first&lt;4096,'Registry exec wrapper exceeds bounds')
   local b=copy(ip,n)
   if b[1]==0xff and b[2]==0x50 and n==3 then slots[#slots+1]=b[3]
   elseif b[1]==0xff and b[2]==0x90 and n==6 then slots[#slots+1]=assert(readInteger(ip+2))end
   if b[1]==0xc3 then returned=true;break end;ip=ip+n
  end
  assert(returned and #slots==1 and slots[1]&gt;=0 and slots[1]%8==0 and slots[1]&lt;0x1000,'Registry virtual method is missing or ambiguous')
  local data=assert(TLC.findMetadata074('AssetData','ScriptStruct'));local stride=assert(readInteger(data+0x58))
  assert(stride&gt;=48 and stride&lt;=512,'AssetData size unavailable')
  local package=member(data,'PackageName',8,'struct');local asset=member(data,'AssetName',8,'struct')
  local cls=assert(TLC.refClass('VoyageItem'));local owner=assert(readQword(cls+0x20));assert(TLC.valid(owner)and TLC.U.c(owner)=='Package','Item class package identity unavailable')
  local top=assert(TLC.findMetadata074('TopLevelAssetPath','ScriptStruct'))
  assert(readInteger(top+0x58)==16,'TopLevelAssetPath size changed')
  return {helpers=helpers,fn=fn,slot=slots[1],stride=stride,package=package,asset=asset,class=cls,classPackage=owner,
   topPackage=member(top,'PackageName',8,'struct'),topAsset=member(top,'AssetName',8,'struct')}
 end
 -- The engine returns its AssetRegistryImpl default object as the registry service.
 -- Accept that role only after matching the class default reference and object slot.
 function TLC.registryIdentity076(object)
  assert(object and readQword(object+0x10)==TLC.refClass('AssetRegistryImpl'),'Asset Registry service class mismatch')
  local good,entry=TLC.valid(object)
  if good then return assert(TLC.identity029(object))end
  local cls=assert(readQword(object+0x10));assert(TLC.valid(cls)and TLC.defaultObject074(cls)==object,'Registry default service identity mismatch')
  local flags=assert(readInteger(object+8));assert((flags&amp;0x18010)==0x10 and entry and(readInteger(entry+4)&amp;0x10200000)==0,'Registry service is dying or invalid')
  return {object=object,class=cls,index=readInteger(object+0xc),serial=readInteger(entry+0x10),name=readQword(object+0x18),defaultObject=true}
 end
 function TLC.sameRegistryIdentity076(identity)
  local ok,current=pcall(TLC.registryIdentity076,identity.object)
  return ok and current.class==identity.class and current.index==identity.index and current.serial==identity.serial and current.name==identity.name and current.number==identity.number and current.defaultObject==identity.defaultObject
 end
 function TLC.queryItemAssets075(done)
  local c=TLC.registryClassContract075()
  TLC.apiInvoke075(c.helpers,nil,function(p)
   local out=p+TLC.apiMember075(c.helpers,'ReturnValue',16);local object,interface=readQword(out),readQword(out+8)
   local identity=TLC.registryIdentity076(object)
   assert(interface and interface&gt;=object and interface-object&lt;=0x1000,'Asset Registry interface unavailable')
   local vt=assert(readQword(interface));local target=assert(readQword(vt+c.slot));assert(TLC.executable038(target,16),'Registry virtual target is not executable')
   local buffer=assert(allocateMemory(0x1000));assert(buffer&gt;0)
   assert(writeQword(buffer+c.topPackage,readQword(c.classPackage+0x18)))
   assert(writeQword(buffer+c.topAsset,readQword(c.class+0x18)))
   local functionIdentity=assert(TLC.identity029(c.fn))
   TLC.job(target,{interface,buffer,buffer+0x100,1},{identity.defaultObject and identity.class or object,c.fn},function(result)
    assert((result&amp;0xff)~=0,'Asset Registry rejected item query')
    assert(TLC.sameRegistryIdentity076(identity)and TLC.sameIdentity029(functionIdentity),'Registry identity changed')
    local array,count,capacity=readQword(buffer+0x100),readInteger(buffer+0x108),readInteger(buffer+0x10c)
    assert(count and capacity and count&gt;=0 and count&lt;=capacity and capacity&lt;=20000 and(count==0 or array),'Invalid item asset array')
    local rows,seen={},{}
    for i=0,count-1 do
     local a=array+i*c.stride;local package,asset=fname(a+c.package),fname(a+c.asset);local path=package..'.'..asset
     if not seen[path]then rows[#rows+1]={path=path,label=path,assetData=copy(a,c.stride)};seen[path]=true end
    end
    assert(readQword(buffer+0x100)==array and readInteger(buffer+0x108)==count,'Registry array changed while reading')
    -- Keep the native array alive: each FAssetData row contains shared registry data.
    TLC.catalogNative075={buffer=buffer,registry=identity,world=assert(TLC.identity029(TLC.world()))}
    done(rows)
   end)
   if TLC.pendingJob then TLC.pendingJob.catalogOwner075=TLC.catalogBusy075 end
  end)
 end
 function TLC.objectName075(object,done)
  local offset=member(object,'Name',16);local text=copy(object+offset,16)
  local source=TLC.apiContract075('KismetTextLibrary','GetTextSourceString')
  local localized=TLC.apiContract075('KismetTextLibrary','Conv_TextToString')
  TLC.apiMember075(source,'Text',16);TLC.apiMember075(source,'ReturnValue',16)
  TLC.apiMember075(localized,'InText',16);TLC.apiMember075(localized,'ReturnValue',16)
  TLC.apiInvoke075(source,{Text=text},function(first)
   local en=TLC.readApiString075(first+TLC.apiMember075(source,'ReturnValue',16))
   TLC.apiInvoke075(localized,{InText=text},function(second)
    local localName=TLC.readApiString075(second+TLC.apiMember075(localized,'ReturnValue',16))
    if en==''then en=localName end;if localName==''then localName=en end
    assert(en~='','Item display name is empty');done(en,localName)
   end)
  end)
 end
 local invoke=TLC.apiInvoke075
 function TLC.apiInvoke075(...)
  local result=invoke(...);if TLC.pendingJob then TLC.pendingJob.catalogOwner075=TLC.catalogBusy075 end;return result
 end
 local originalPicker=TLC.addItemPick
 local function scoped(fn,...)
  local prior=TLC.scope038;TLC.scope038='typed dynamic item catalogue'
  local result=table.pack(pcall(fn,...));TLC.scope038=prior
  if not result[1]then error(result[2],0)end;return table.unpack(result,2,result.n)
 end
 local function oldPicker()return scoped(originalPicker)end
 local function openPicker()
  TLC.need()
  local prior=TLC.catalogState075
  if prior and prior.ready and TLC.sameIdentity029(prior.world)then return oldPicker()end
  if prior and prior.busy then if prior.form then prior.form.show()end;return end
  local getAsset=TLC.apiContract075('AssetRegistryHelpers','GetAsset')
  local _,assetSize=TLC.refFieldLayout(getAsset.fn,'InAssetData','function');assert(assetSize and assetSize&lt;=512)
  TLC.apiMember075(getAsset,'ReturnValue',8)
  local s={busy=true,world=assert(TLC.identity029(TLC.world())),index=0,rows={},categories={},skipped=0,lastProgress=getTickCount()};TLC.catalogState075=s;TLC.catalogBusy075=s
  local form=TLC.uiCreate157('Form',false);s.form=form;form.Caption=TLC.T('Reading game item registry','ゲームからアイテム一覧を取得');form.ClientWidth=560;form.ClientHeight=150;form.Position='poScreenCenter'
  local status=TLC.uiCreate157('Label',form);status.Left=16;status.Top=20;status.Width=528;status.Height=48;status.AutoSize=false;status.WordWrap=true;status.Caption=TLC.T('Reading registered assets...','登録アセットを取得中…')
  s.progress079=function(current,total)status.Caption=TLC.T('Reading item names: ','アイテム名を取得中: ')..current..' / '..total;s.lastProgress=getTickCount()end
  local cancel=createButton(form);cancel.Left=394;cancel.Top=84;cancel.Width=150;cancel.Height=34;cancel.Caption=TLC.T('Cancel','中止')
  local textHeight=math.max(16,math.abs(status.Font.Height or 16));status.Height=math.max(48,textHeight*2+12);cancel.Top=status.Top+status.Height+12;cancel.Height=math.max(34,textHeight+16);form.ClientHeight=cancel.Top+cancel.Height+16
  local function finish(why)
   s.busy=false;s.error=why;TLC.catalogBusy075=nil;s.fail=nil
   if s.timer then s.timer.Enabled=false end
   if why then status.Caption=TLC.T('Stopped: ','停止: ')..tostring(why);TLC.reason('items',why)
   else s.ready=true;form.close();if s.skipped&gt;0 then TLC.msg(('Item names unavailable: %d; available items remain usable.'):format(s.skipped),('表示名を取得できない項目: %d件。取得できた項目は利用できます。'):format(s.skipped))end;oldPicker()end
  end
  local function alive()return not s.cancelled and TLC.catalogState075==s and TLC.attached()and TLC.sameIdentity029(s.world)end
  local function guarded(fn)return function(...)if not alive()then return end;s.lastProgress=getTickCount();local ok,e=pcall(fn,...);if not ok then if s.itemFailure then s.itemFailure(e)else finish(e)end end end end
  s.fail=finish
  local function stop()
   s.cancelled=true;if s.nativeAbort079 then s.nativeAbort079()end;s.busy=false;TLC.catalogBusy075=nil;if s.timer then s.timer.Enabled=false end
   local job=TLC.pendingJob
   if job and job.catalogOwner075==s and readInteger(TLC.base()+0x500)==1 then writeInteger(TLC.base()+0x500,0);TLC.pendingJob=nil end
  end
  cancel.OnClick=function()stop();form.close()end
  form.OnClose=function()if not s.ready then stop()end;s.form=nil;return caFree end
  s.timer=createTimer(form,false);s.timer.Interval=10
  s.timer.OnTimer=function()
   if not s.busy then return end
   if not alive()then finish(TLC.T('Game world changed; reopen the item list.','ワールドが変わりました。一覧を開き直してください。'));return end
   for i=1,16 do if not s.advance or TLC.pendingJob or not s.busy then break end;s.advance=false;local okay,why=pcall(s.nextItem);if not okay then finish(why);return end end
   local job=TLC.pendingJob;if not job or job.catalogOwner075~=s then if getTickCount()-s.lastProgress&gt;16000 then finish(TLC.T('Item lookup stopped before completion. Reopen the list.','アイテム取得が完了前に停止しました。一覧を開き直してください。'))end;return end
   local p=TLC.base()+0x500;local state=readInteger(p)
   if state==3 or state==4 then
    TLC.pendingJob=nil;local result=readQword(p+0x80)or 0;assert(writeInteger(p,0))
    if state==4 then finish('Native item call cancelled after identity change')
    elseif job.done then local ok,e=pcall(job.done,result);if not ok then finish(e)end end
   elseif state==1 and getTickCount()-job.start&gt;15000 then writeInteger(p,0);TLC.pendingJob=nil;finish('Item registry call timed out')end
  end;s.timer.Enabled=true;form.show()
  local function nextItem()
   if not alive()then return end;s.lastProgress=getTickCount();s.index=s.index+1
   local row=s.rows[s.index]
   if not row then
    assert(#s.output&gt;0,'No usable item display names were obtained');s.itemFailure=nil;TLC.CATALOG=s.output;TLC.ITEM_LABELS=s.labels;TLC.ITEM_CATEGORIES=s.categoryNames;finish();return
   end
   s.itemFailure=function(reason)s.itemFailure=nil;s.skipped=s.skipped+1;TLC.reason('items',TLC.T('Skipped unreadable item: ','取得できない項目を除外: ')..row.path..' / '..tostring(reason));s.advance=true end
   status.Caption=TLC.T('Reading item names: ','アイテム名を取得中: ')..s.index..' / '..#s.rows
   assert(#row.assetData==assetSize,'AssetData metadata size mismatch')
   TLC.apiInvoke075(getAsset,{InAssetData=row.assetData},guarded(function(p)
    local object=readQword(p+TLC.apiMember075(getAsset,'ReturnValue',8));assert(TLC.valid(object)and TLC.U.isA(object,'VoyageItem'),'Registered item could not be loaded: '..row.path)
    TLC.objectName075(object,guarded(function(en,localName)
     s.labels[row.label]={en,localName}
     local category=TLC.readObjectField074(object,'CategoryAsset')
     local function include(key)
      row.cat=key;row.assetData=nil;s.output[#s.output+1]=row;s.itemFailure=nil;s.advance=true
     end
     if not category then local key='other';s.categoryNames[key]={TLC.T('Other','その他'),TLC.T('Other','その他')};include(key);return end
     local identity=assert(TLC.identity029(category));local key=tostring(identity.object)..':'..tostring(identity.serial)
     if s.categoryNames[key]then include(key)
     else TLC.objectName075(category,guarded(function(ce,cl)s.categoryNames[key]={ce,cl};include(key)end))end
    end))
   end))
  end
  s.nextItem=nextItem
  local ok,e=pcall(TLC.queryItemAssets075,guarded(function(rows)
   s.rows=rows
   local ready=s.preparedCatalogue098
   if ready then
    s.index=#rows+1;s.output=ready.output;s.labels=ready.labels;s.categoryNames=ready.categoryNames;s.skipped=ready.skipped
    TLC.CATALOG=ready.output;TLC.ITEM_LABELS=ready.labels;TLC.ITEM_CATEGORIES=ready.categoryNames;finish();return
   end
   s.output={};s.labels={};s.categoryNames={};nextItem()
  end))
  if not ok then finish(e)end
 end
 function TLC.addItemPick()return scoped(openPicker)end
 local off=TLC.disableAll
 function TLC.disableAll(...)
  local state=TLC.catalogState075;if state and state.busy and state.form then state.form.close()end
  return off(...)
 end
end)(TLC)

-- Inventory mutations use named public functions and a constructed game struct template.
;(function(TLC)
 function TLC.property076(object,name,kind)
  local cls=kind and object or assert(readQword(object+0x10))
  for depth=1,64 do
   assert(TLC.valid(cls),'Property owner expired');local p=readQword(cls+0x50);local seen={}
   for i=1,2048 do
    if not p or p==0 or seen[p]then break end;seen[p]=true
    if TLC.U.name(readInteger(p+0x20)):lower()==name:lower() then return p end;p=readQword(p+0x18)
   end
   cls=readQword(cls+0x40);if not cls or cls==0 then break end
  end
  error('Reflected property unavailable: '..name)
 end
 function TLC.enumProperty076(property)
  local values={}
  for _,offset in ipairs({0x70,0x78})do local object=readQword(property+offset);if TLC.valid(object)and TLC.U.c(object)=='Enum'then values[object]=true end end
  local enum,count;count=0;for value in pairs(values)do enum=value;count=count+1 end
  assert(count==1,'Property enum missing or ambiguous');return enum,TLC.enumValues074(TLC.U.n(enum))
 end
 function TLC.objectApiContract076(object,owner,method)
  assert(TLC.valid(object)and TLC.U.isA(object,owner),'Native API object type mismatch: '..owner)
  local fn=assert(TLC.reflectedFunction069(owner,method));local size=assert(readSmallInteger(fn+0xb6));assert(size&lt;=1024,'Native API parameter block too large')
  TLC.processEvent074(object,false)
  return {owner=owner,method=method,fn=fn,cdo=object,size=size,isDefault=false,identity=assert(TLC.identity029(object))}
 end
 -- Invoke instance methods with their actual object as a game-thread lifetime guard.
 function TLC.apiInvoke075(contract,inputs,done)
  assert(not TLC.pendingJob,'Native action already pending')
  local p=TLC.apiFrame075(contract);local world=assert(TLC.identity029(TLC.world()));local fn=assert(TLC.identity029(contract.fn))
  if contract.identity then assert(TLC.sameIdentity029(contract.identity),'Native API object expired')end
  for name,value in pairs(inputs or{})do local off=TLC.apiMember075(contract,name,#value);assert(writeBytes(p+off,value))end
  local target=TLC.processEvent074(contract.cdo,contract.isDefault~=false)
  TLC.job(target,{contract.cdo,contract.fn,p},{contract.identity and contract.cdo or world.object,contract.fn},function()
   local okay,why=pcall(function()
    assert(TLC.sameIdentity029(world)and TLC.sameIdentity029(fn)and(not contract.identity or TLC.sameIdentity029(contract.identity)),'Native API object/world expired')
    if done then done(p)end
   end)
   if not okay then
    local state=TLC.catalogBusy075
    if state and state.itemFailure then state.itemFailure(why)
    elseif state and state.fail then state.fail(why)
    else error(why,0)end
   end
  end)
  if TLC.pendingJob then TLC.pendingJob.catalogOwner075=TLC.catalogBusy075 end
 end
 local function bytes(a,n)return assert(readBytes(a,n,true),'Native input unreadable')end
 local function integer(value,n)local data={};for i=0,n-1 do data[i+1]=(value&gt;&gt;(i*8))&amp;255 end;return data end
 function TLC.itemAddContract076(player)
  local inventory=TLC.objectApiContract076(player,'VoyageBaseCharacter','GetInventoryComponent')
  TLC.apiMember075(inventory,'Type',1);TLC.apiMember075(inventory,'ReturnValue',8)
  local enum,values=TLC.enumProperty076(TLC.property076(inventory.fn,'Type','function'))
  assert(values.Undefined~=nil and values.PlayerInventory~=nil,'Player inventory enum entries unavailable')
  local cls=assert(TLC.refClass('VoyageInventoryItem'));local cdo=assert(TLC.defaultObject074(cls));local p=TLC.property076(cls,'Data',true)
  local dataType=assert(readQword(p+0x70));assert(TLC.valid(dataType)and TLC.U.c(dataType)=='ScriptStruct','Default item data type unavailable')
  local size=assert(readInteger(dataType+0x58));assert(size&gt;0 and size&lt;=512,'Default item data size unavailable')
  local dataOffset,actual=TLC.refFieldLayout(cls,'Data',true);assert(dataOffset and actual==size,'Default item data property changed')
  local count,countSize=TLC.refFieldLayout(dataType,'ItemCount','struct');assert(count and countSize==4,'ItemCount field unavailable')
  for _,name in ipairs({'ItemData','ItemDataMap'})do local off=TLC.refFieldLayout(dataType,name,'struct');assert(off and readInteger(cdo+dataOffset+off+8)==0,'Default item data contains nonempty custom state')end
  return {inventory=inventory,enum=enum,values=values,dataType=dataType,size=size,count=count,default=bytes(cdo+dataOffset,size)}
 end
 function TLC.resolveItemInventory076(item,contract)
  local offset,size=TLC.refFieldLayout(item,'DesiredInventory',false);assert(offset and size==1,'Item inventory preference unavailable')
  local enum,values=TLC.enumProperty076(TLC.property076(item,'DesiredInventory'))
  local value=assert(readBytes(item+offset,1));local desired
  if enum==contract.enum then
   desired=value==contract.values.Undefined and contract.values.PlayerInventory or value
  elseif values.Inventory~=nil and value==values.Inventory then desired=contract.values.PlayerInventory
  elseif values.Vault~=nil and value==values.Vault then desired=contract.values.PlayerVault
  else error('Unsupported item inventory preference: '..tostring(TLC.U.n(enum))..' value '..tostring(value),0)end
  assert(desired~=nil,'Required destination inventory enum entry unavailable')
  local valid=false;for name,entry in pairs(contract.values)do if entry==desired and name~='Undefined'and not name:find('_MAX',1,true)then valid=true end end
  assert(valid,'Destination inventory enum value unavailable');return desired
 end
 function TLC.addItemPath(path,amount,done)
  local prior=TLC.scope038;TLC.scope038='typed inventory API'
  local okay,why=pcall(function()
   TLC.need();assert(type(amount)=='number'and amount==math.floor(amount)and amount&gt;=1 and amount&lt;=99999,'Invalid item count')
   local player=assert(TLC.player(true));local identity=assert(TLC.identity029(player));local c=TLC.itemAddContract076(player)
   TLC.loadAsset(path,function(item)
    assert(TLC.sameIdentity029(identity)and TLC.player(false)==player,'Player changed during item load')
    assert(TLC.U.isA(item,'VoyageItem'),'Asset is not an inventory item')
    local desired=TLC.resolveItemInventory076(item,c)
    TLC.apiInvoke075(c.inventory,{Type=integer(desired,1)},function(p)
     local inv=readQword(p+TLC.apiMember075(c.inventory,'ReturnValue',8));assert(TLC.valid(inv)and TLC.U.isA(inv,'VoyageBaseInventoryComponent'),'Game-selected inventory unavailable')
     local owner=inv;local belongs=false
     for depth=1,16 do owner=readQword(owner+0x20);if owner==player then belongs=true;break end;if not TLC.valid(owner)then break end end
     assert(belongs,'Resolved inventory does not belong to the local player')
     local add=TLC.objectApiContract076(inv,'VoyageBaseInventoryComponent','AddItem')
     local count=TLC.objectApiContract076(inv,'VoyageBaseInventoryComponent','GetNumItems')
     TLC.apiMember075(add,'NewItem',8);TLC.apiMember075(add,'InItemData',c.size);TLC.apiMember075(add,'bAllowStacking',1);TLC.apiMember075(add,'bNotifyChanged',1);TLC.apiMember075(add,'ReturnValue',4)
     TLC.apiMember075(count,'Item',8);TLC.apiMember075(count,'ReturnValue',4)
     local property=TLC.property076(add.fn,'InItemData','function');assert(readQword(property+0x70)==c.dataType,'AddItem struct type differs from native default template')
     local expected=readQword(TLC.property076(add.fn,'NewItem','function')+0x70);assert(TLC.valid(expected)and TLC.U.c(expected)=='Class'and TLC.U.isA(item,TLC.U.n(expected)),'AddItem object parameter type mismatch')
     local expectedCount=readQword(TLC.property076(count.fn,'Item','function')+0x70);assert(TLC.valid(expectedCount)and TLC.U.c(expectedCount)=='Class'and TLC.U.isA(item,TLC.U.n(expectedCount)),'Item count parameter type mismatch')
     local itemBytes=integer(item,8)
     TLC.apiInvoke075(count,{Item=itemBytes},function(before)
      local old=assert(readInteger(before+TLC.apiMember075(count,'ReturnValue',4)));assert(old&gt;=0,'Negative initial item count')
      local data={};for i,v in ipairs(c.default)do data[i]=v end;local n=integer(amount,4);for i=1,4 do data[c.count+i]=n[i]end
      TLC.apiInvoke075(add,{NewItem=itemBytes,InItemData=data,bAllowStacking={1},bNotifyChanged={1}},function(addedBlock)
       local added=assert(readInteger(addedBlock+TLC.apiMember075(add,'ReturnValue',4)));assert(added&gt;=0 and added&lt;=amount,'Native AddItem returned an invalid count')
       TLC.apiInvoke075(count,{Item=itemBytes},function(after)
        local current=assert(readInteger(after+TLC.apiMember075(count,'ReturnValue',4)));assert(current&gt;=0,'Negative resulting item count')
        local location=desired==c.values.PlayerInventory and TLC.T('Backpack','通常の所持品')or desired==c.values.PlayerVault and TLC.T('Vault','保管庫')or TLC.T('Game-selected inventory','ゲーム指定の所持品')
        TLC.lastAdded={item=item,inventory=inv,amount=added,requested=amount,before=old,after=current,location=location}
        TLC.msg(('Native addition: %d/%d; count %d -&gt; %d (%s)'):format(added,amount,old,current,location),('追加受付: %d/%d・所持数 %d → %d（%s）'):format(added,amount,old,current,location))
        if added&gt;0 and current&lt;=old then TLC.reason('items',TLC.T('Addition was accepted but an inventory increase was not confirmed; no automatic retry.','追加は受け付けられましたが所持数の増加を確認できません。自動再追加はしません。'));if done then done(0)end
        elseif done then done(added)end
       end)
      end)
     end)
    end)
   end)
  end)
  TLC.scope038=prior;if not okay then error(why,0)end
 end
end)(TLC)


-- Separate fixed discovery rules from all per-attachment observations.

-- Keep exact-owned legacy attribute restoration on both public entry paths.
;(function(TLC)
 local resolve=TLC.resolveSig
 function TLC.resolveSig(name)
  if name=='AttributeChange'or name=='AttributeSet'then
   if TLC.recoverOldAttribute064(name)then
    TLC.A[name]=nil;TLC.resolution[name]=nil;TLC.failures[name]=nil;TLC.pend[name]=nil
   end
  end
  return resolve(name)
 end
 local restore=TLC.restoreLegacyOwnedHooks065
 function TLC.restoreLegacyOwnedHooks065(...)
  local count=restore(...)
  for _,name in ipairs({'AttributeChange','AttributeSet'})do
   if TLC.recoverOldAttribute064(name)then count=count+1 end
  end
  TLC.lastLegacyRestore065=count
  return count
 end
end)(TLC)

-- Derive the ActorComponent owner member from its named reflected getter.
;(function(TLC)
 local prefix={0x48,0x8b,0x42,0x20,0x45,0x33,0xc9,0x48,0x85,0xc0,0x41,0x0f,0x95,0xc1,0x4c,0x03,0xc8,0x4c,0x89,0x4a,0x20}
 function TLC.componentOwnerOffset083()
  local fn=TLC.reflectedFunction069('ActorComponent','GetOwner')
  local offset,size=TLC.refFieldLayout(fn,'ReturnValue','function')
  assert(offset==0 and size==8 and readSmallInteger(fn+0xb6)==8,'Component owner getter signature changed')
  local entry=assert(readQword(fn+0xd8));assert(TLC.executable038(entry,40),'Component owner getter is not executable')
  local bytes=assert(readBytes(entry,40,true));for i,v in ipairs(prefix)do assert(bytes[i]==v,'Component owner getter frame prelude changed')end
  local at=#prefix+1;local disp,finish
  if bytes[at]==0x48 and bytes[at+1]==0x8b and bytes[at+2]==0x81 then
   disp=bytes[at+3]|(bytes[at+4]&lt;&lt;8)|(bytes[at+5]&lt;&lt;16)|(bytes[at+6]&lt;&lt;24);finish=at+7
  elseif bytes[at]==0x48 and bytes[at+1]==0x8b and bytes[at+2]==0x41 then disp=bytes[at+3];assert(disp&lt;128,'Negative component owner offset');finish=at+4
  else error('Component owner getter load ABI changed')end
  assert(disp and disp&gt;=0x28 and disp&lt;=0x2000 and disp%8==0,'Component owner member is outside verified bounds')
  assert(bytes[finish]==0x49 and bytes[finish+1]==0x89 and bytes[finish+2]==0 and bytes[finish+3]==0xc3,'Component owner getter return data flow changed')
  return disp
 end
 local prepare=TLC.prepareFuelDebit074
 function TLC.prepareFuelDebit074()
  local owner=TLC.componentOwnerOffset083();local result=prepare();result.owner=owner
  for _,name in ipairs({'fuelDebit061','fuelStorage062'})do
   local aa=TLC.HOOKS[name].aa
   aa=aa:gsub('%[rdi%+20%]',('[rdi+%X]'):format(owner)):gsub('%[rsi%+20%]',('[rsi+%X]'):format(owner))
   TLC.HOOKS[name].aa=aa
  end
  return result
 end
 local hook=TLC.hookOn
 local fuel={fuelDebit061=true,fuelStorage062=true,fuelGrid071=true,fuelCable071=true}
 TLC.supplyOwnerOffsets083={}
 function TLC.hookOn(name)
  if fuel[name]and not TLC.hookState[name]then
   local owner=TLC.componentOwnerOffset083()
   if name=='fuelGrid071'or name=='fuelCable071'then
    local aa=TLC.HOOKS[name].aa
    local prior=TLC.supplyOwnerOffsets083[name]or 0x20
    local pattern=('mov rax,%%[rcx%%+%X%%]'):format(prior)
    local changed,count=aa:gsub(pattern,('mov rax,[rcx+%X]'):format(owner))
    -- The shared preparation can regenerate the original template on re-enable.
    if count==0 and prior~=0x20 then
     changed,count=aa:gsub('mov rax,%[rcx%+20%]',('mov rax,[rcx+%X]'):format(owner))
    end
    assert(count==1,'Supply owner load ABI changed: '..name)
    TLC.supplyOwnerOffsets083[name]=owner;TLC.HOOKS[name].aa=changed
   end
  end
  return hook(name)
 end
end)(TLC)

-- Read capacity/current, add, and read back in one game-thread action.
;(function(t)
local template=[==[
[ENABLE]
alloc(tlc_aimTankBatch092,$1000,%X)
registersymbol(tlc_aimTankBatch092)
registersymbol(tlc_aimTankBatch092_end)
label(tlc_aimTankBatch092_end)
label(tlc_aimTankBatch092_invalid)
label(tlc_aimTankBatch092_done)
label(tlc_aimTankBatch092_read)
tlc_aimTankBatch092:
push rbx
push rsi
sub rsp,28
mov rbx,rcx
mov rsi,[rbx]
mov rcx,rsi
mov rdx,[rbx+10]
mov r8,[rbx+18]
call qword ptr [rbx+08]
mov rcx,rsi
mov rdx,[rbx+20]
mov r8,[rbx+28]
call qword ptr [rbx+08]
mov rax,[rbx+58]
movsd xmm0,[rax]
xorpd xmm1,xmm1
ucomisd xmm0,xmm0
jp tlc_aimTankBatch092_invalid
comisd xmm0,xmm1
jbe tlc_aimTankBatch092_invalid
comisd xmm0,[rbx+88]
jae tlc_aimTankBatch092_invalid
mov rax,[rbx+60]
movsd xmm2,[rax]
ucomisd xmm2,xmm2
jp tlc_aimTankBatch092_invalid
comisd xmm2,xmm1
jb tlc_aimTankBatch092_invalid
comisd xmm2,[rbx+88]
jae tlc_aimTankBatch092_invalid
subsd xmm0,xmm2
maxsd xmm0,xmm1
mov rax,[rbx+68]
movsd [rax],xmm0
comisd xmm0,xmm1
jbe tlc_aimTankBatch092_read
mov rcx,rsi
mov rdx,[rbx+30]
mov r8,[rbx+38]
call qword ptr [rbx+08]
tlc_aimTankBatch092_read:
mov rcx,rsi
mov rdx,[rbx+40]
mov r8,[rbx+48]
call qword ptr [rbx+08]
mov dword ptr [rbx+50],1
jmp tlc_aimTankBatch092_done
tlc_aimTankBatch092_invalid:
mov dword ptr [rbx+50],2
tlc_aimTankBatch092_done:
xor eax,eax
add rsp,28
pop rsi
pop rbx
ret
tlc_aimTankBatch092_end:
[DISABLE]
]==]
local function same(s)
 if not s or s.pid~=getOpenedProcessID()or t.pid~=s.pid or getAddressSafe('tlc_aimTankBatch092')~=s.code then return false end
 local b=readBytes(s.code,#s.bytes,true);if not b then return false end
 for i,x in ipairs(s.bytes)do if b[i]~=x then return false end end;return true
end
function t.ensureAimTankBatch092()
 local s=t.aimTankBatch092;if same(s)then return s end
 assert(not getAddressSafe('tlc_aimTankBatch092'),'Unowned aimed-tank batch symbol; no changes made')
 local okay,why=autoAssemble(template:format(t.moduleRequired()));assert(okay,tostring(why))
 local code=getAddressSafe('tlc_aimTankBatch092');local last=getAddressSafe('tlc_aimTankBatch092_end')
 assert(code and last and last&gt;code and last-code&lt;0x100,'Tank batch assembly bounds unavailable')
 s={pid=getOpenedProcessID(),code=code,bytes=assert(readBytes(code,last-code,true)),header=code+0x100}
 t.aimTankBatch092=s;return s
end
local executable=t.executable038
function t.executable038(address,length)
 local s=t.aimTankBatch092
 if s and address==s.code and (length or 1)&lt;=#s.bytes and same(s)then return true end
 return executable(address,length)
end
function t.aimTankAtomicAdd092(module,resource,maximum,current,add,done,cancelled)
 assert(not t.pendingJob,'Native action busy')
 local id=assert(t.identity029(module));local addId=assert(t.identity029(add.fn));local readId=assert(t.identity029(current.fn))
 assert(add.size&lt;=0x80 and current.size&lt;=0x80 and maximum.size&lt;=0x80,'Tank batch parameters exceed owned buffer')
 local s=t.ensureAimTankBatch092();local p=s.header;local pm=p+0x100;local pb=p+0x180;local pa=p+0x200;local pr=p+0x280
 local zero={};for i=1,0x300 do zero[i]=0 end;assert(writeBytes(p,zero))
 assert(writeQword(p,module));assert(writeQword(p+8,t.processEvent074(module)))
 for _,row in ipairs({{0x10,maximum,pm},{0x20,current,pb},{0x30,add,pa},{0x40,current,pr}})do
  assert(writeQword(p+row[1],row[2].fn));assert(writeQword(p+row[1]+8,row[3]));assert(writeBytes(row[3]+row[2].Type,resource))
 end
 assert(writeQword(p+0x58,pm+maximum.ReturnValue));assert(writeQword(p+0x60,pb+current.ReturnValue));assert(writeQword(p+0x68,pa+add.AddAmount));assert(writeDouble(p+0x88,1e15))
 t.job(s.code,{p},{module,add.fn},function()
  local okay,why=pcall(function()
   assert(t.sameIdentity029(id)and t.sameIdentity029(addId)and t.sameIdentity029(readId),'Tank API identity changed')
   local status=readInteger(p+0x50)
   if status==2 then done(nil,nil,nil,nil,nil,'not_storage');return end
   assert(status==1,'Storage batch did not complete')
   done(readDouble(pb+current.ReturnValue),readDouble(pm+maximum.ReturnValue),readDouble(pa+add.AddAmount),readDouble(pa+add.ReturnValue),readDouble(pr+current.ReturnValue))
  end)
  if not okay then cancelled(why)end
 end)
 if t.pendingJob then t.pendingJob.cancelled074=cancelled end
end
local forget=t.forgetProcess
function t.forgetProcess(...)
 -- Keep code/data allocated for any native call still returning through it.
 pcall(unregisterSymbol,'tlc_aimTankBatch092');pcall(unregisterSymbol,'tlc_aimTankBatch092_end')
 t.aimTankBatch092=nil;t.aimFillBusy088=nil;return forget(...)
end
end)(TLC)

;(function(t)
local function requireValue(ok,en,ja)if not ok then error(t.T(en,ja),0)end end
local function finite(x)return type(x)=='number'and x==x and math.abs(x)&lt;1e15 end
local function getterMember()
 local fn=t.reflectedFunction069('InteractiveDetectorPointerComponent','GetHoverReference')
 local off,size=t.refFieldLayout(fn,'ReturnValue','function')
 requireValue(off==0 and size==8 and readSmallInteger(fn+0xb6)==8,'Hover getter parameters changed','照準対象の取得関数が変更されています。')
 local entry=assert(readQword(fn+0xd8));requireValue(t.executable038(entry,64),'Hover getter is not executable','照準対象の取得関数を検証できません。')
 local b=assert(readBytes(entry,64,true));local raw={};for i,v in ipairs(b)do raw[i]=string.char(v)end;raw=table.concat(raw)
 if raw:byte(1)==0x40 then raw=raw:sub(2)end -- Optional REX prefix on PUSH RBX.
 local prefix='\83\72\131\236\32\72\139\66\32\69\51\201\72\133\192\73\139\216\65\15\149\193\72\129\193'
 requireValue(raw:sub(1,#prefix)==prefix,'Hover getter ABI changed','照準対象の取得処理を検証できません。')
 local member=string.unpack('&lt;I4',raw,#prefix+1)
 requireValue(member&gt;=0x28 and member&lt;=0x4000 and member%8==0,'Hover reference member is invalid','照準対象の保存位置を検証できません。')
 local tail=raw:sub(#prefix+5)
 requireValue(tail:sub(1,8)=='\76\3\200\76\137\74\32\232'and tail:sub(13,21)=='\72\137\3\72\131\196\32\91\195','Hover getter return path changed','照準対象の戻り値を検証できません。')
 return member
end
function t.aimedTank088()
 t.need();local player=t.player(true)
 local detector=assert(t.readObjectField074(player,'InteractiveDetectorPointerComponent'))
 local target=t.weak(detector+getterMember())
 if not t.valid(target)then return nil,nil end
 local actor=target
 if t.U.isA(target,'ActorComponent')then actor=readQword(target+t.componentOwnerOffset083())end
 if not t.valid(actor)then return nil,nil end
 local module=t.readObjectField074(actor,'ModuleComponent')
 if not(t.valid(module)and t.U.isA(module,'VoyageModuleComponent'))then return nil,nil end
 return actor,module
end
local function api(name,fields)
 local fn=t.reflectedFunction069('VoyageModuleComponent',name);local size=readSmallInteger(fn+0xb6)
 requireValue(size and size&gt;0 and size&lt;=128,'Tank API parameter block changed: '..name,'タンク操作関数の引数が変更されています: '..name)
 local result={fn=fn,size=size}
 for key,bytes in pairs(fields)do
  local off,n=t.refFieldLayout(fn,key,'function')
  requireValue(off and n==bytes and off+bytes&lt;=size,'Tank API field changed: '..name..'.'..key,'タンク操作の引数を検証できません: '..name..'.'..key)
  result[key]=off
 end
 local field=readQword(fn+0x50);local seen={};local count=0
 for i=1,128 do
  if not field or field==0 then break end
  requireValue(not seen[field],'Repeated API property','操作関数の引数一覧を検証できません。');seen[field]=true
  local flags=readQword(field+0x38)
  if flags and (flags&amp;0x80)~=0 then
   local label=t.U.name(readInteger(field+0x20))
   requireValue(fields[label]~=nil,'Unexpected tank API parameter: '..label,'設備の操作関数に未対応の引数があります: '..label)
   count=count+1
  end
  field=readQword(field+0x18)
 end
 local expected=0;for _ in pairs(fields)do expected=expected+1 end
 requireValue(count==expected,'Tank API parameter count changed','設備の操作関数の引数が変更されています。')
 return result
end
function t.fillAimedTank088()
 local prior=t.scope038;t.scope038='aimed storage / verified reflected APIs'
 local okay,why=pcall(function()
  requireValue(not t.aimFillBusy088 and not t.aimEmptyBusy156 and not t.pendingJob,'Another action is running.','別の処理を実行中です。完了後に再実行してください。')
  local actor,module=t.aimedTank088()
  if not actor or not module then t.msg('Target not eligible for refill.','補充対象外です。');return end
  local primary=api('GetPrimaryResourceType',{ReturnValue=1})
  local current=api('GetResourceAmount',{Type=1,ReturnValue=8})
  local maximum=api('GetMaxResourceAmount',{Type=1,ReturnValue=8})
  local add=api('AddResource',{Type=1,AddAmount=8,ReturnValue=8})
  local s={actor=actor,module=module,world=t.identity029(t.world()),actorId=t.identity029(actor),moduleId=t.identity029(module)}
  t.aimFillBusy088=s
  local function finish(success,reason)
   if t.aimFillBusy088==s then t.aimFillBusy088=nil end
   if success=='excluded'then
    t.msg('Target not eligible for refill.','補充対象外です。')
   elseif success then
    t.msg(('Aimed storage filled: %.6g / %.6g'):format(s.after,s.maximum),('照準先への補充完了: %.6g / %.6g'):format(s.after,s.maximum))
   else t.reason('aimTank',tostring(reason))end
  end
  local function alive()
   requireValue(t.aimFillBusy088==s and t.sameIdentity029(s.world)and t.world()==s.world.object and t.sameIdentity029(s.actorId)and t.sameIdentity029(s.moduleId),'Storage or world changed; cancelled.','設備またはワールドが変わったため中止しました。')
  end
  local p=t.base()+0xe80;for i=0,primary.size-1 do assert(writeBytes(p+i,0))end
  t.job(t.processEvent074(module),{module,primary.fn,p},{module,primary.fn},function()
   local worked,errorText=pcall(function()
    alive();s.resource=readBytes(p+primary.ReturnValue,1)
    requireValue(s.resource~=nil,'Storage resource type unavailable','設備の資源種類を取得できません。')
    t.aimTankAtomicAdd092(module,s.resource,maximum,current,add,function(before,capacity,requested,added,after,excluded)
     alive();if excluded=='not_storage'then s.excluded=true;t.lastAimedTankFill088=s;finish('excluded');return end
     s.before=before;s.maximum=capacity;s.requested=requested;s.added=added;s.after=after
     t.lastAimedTankFill088=s
     requireValue(finite(after)and finite(added)and added&gt;=0,'Invalid storage API result','設備の補充結果を取得できません。')
     local tolerance=math.max(.0001,capacity*.000001)
     requireValue(after&gt;=capacity-tolerance or (requested&gt;tolerance and added&gt;=requested-tolerance),
      ('Storage only accepted %.6g; amount %.6g / %.6g'):format(added,after,capacity),
      ('設備が受け付けた補充量: %.6g、残量: %.6g / %.6g'):format(added,after,capacity))
     finish(true)
    end,function(reason)finish(false,reason)end)
   end)
   if not worked then finish(false,errorText)end
  end)
  if t.pendingJob then t.pendingJob.cancelled074=function(reason)finish(false,reason)end end
 end)
 t.scope038=prior
 if not okay then t.aimFillBusy088=nil;error(why,0)end
end
t.NAMES[407]={'Fill aimed tank / battery','照準先のタンク・バッテリーを満タン'}
end)(TLC)

-- Named resource multiplier, with explicit argument and return-value data flow.
;(function(t)
local function bytes(a,n)local b=assert(readBytes(a,n,true));local s={};for i,v in ipairs(b)do s[i]=string.char(v)end;return table.concat(s)end
local function rip(a)local d=assert(readInteger(a+1));if d&gt;=0x80000000 then d=d-0x100000000 end;return a+5+d end
function t.consumptionWrapper090(entry)
 assert(t.executable038(entry,32),'Resource multiplier wrapper unavailable')
 local ip=entry;local list={};local done=false
 for i=1,180 do
  local n=getInstructionSize(ip);assert(n and n&gt;=1 and n&lt;=15 and ip-entry&lt;2048,'Resource multiplier wrapper exceeds bound')
  local b=bytes(ip,n);list[#list+1]={a=ip,b=b}
  if b:byte(1)==0xc3 then done=true;break end
  ip=ip+n
 end
 assert(done,'Resource multiplier wrapper has no bounded return')
 local resultSaved=false
 for i=1,math.min(#list,20)do if list[i].b=='\73\139\232'then resultSaved=true end end -- VM result pointer R8 -&gt; RBP.
 assert(resultSaved,'Resource multiplier VM result register changed')
 local candidates={}
 for i,row in ipairs(list)do
  if row.b:byte(1)==0xe8 and #row.b==5 then
   local j=i+1
   -- A compiler may prepare destruction of the temporary before storing XMM0.
   if list[j]and(list[j].b:sub(1,4)=='\72\141\76\36'or list[j].b:sub(1,4)=='\72\141\140\36')then j=j+1 end
   if list[j]and list[j].b=='\243\15\17\69\0'then
    local argument=false
    for k=math.max(1,i-10),i-1 do
     local b=list[k].b
     if b:sub(1,4)=='\15\182\84\36'or b:sub(1,4)=='\15\182\148\36'then argument=true
     elseif b:byte(1)==0xe8 then argument=false end
    end
    assert(argument,'Resource multiplier enum is not passed in EDX')
    local target=rip(row.a);assert(t.executable038(target,32),'Resource multiplier call target is not executable')
    candidates[target]=true
   end
  end
 end
 local target,count=nil,0;for a in pairs(candidates)do target=a;count=count+1 end
 assert(count==1,'Resource multiplier return-producing call is missing or ambiguous')
 return target
end
local template=[==[
[ENABLE]
alloc(tlc_consumption,$2000,$SITE)
label(tlc_consumption_normal)
label(tlc_consumption_zero)
label(tlc_consumption_tank)
label(tlc_consumption_power)
label(tlc_consumption_return)
tlc_consumption:
pushfq
cmp byte ptr [tlcFlags+08],0
je tlc_consumption_power
cmp dl,@Petrol@
je tlc_consumption_zero
cmp dl,@Diesel@
je tlc_consumption_zero
tlc_consumption_power:
cmp byte ptr [tlcFlags+09],0
je tlc_consumption_tank
cmp dl,@Electricity@
je tlc_consumption_zero
tlc_consumption_tank:
cmp byte ptr [tlcFlags+0A],0
je tlc_consumption_normal
@TANK@
jmp tlc_consumption_normal
tlc_consumption_zero:
popfq
xorps xmm0,xmm0
ret
tlc_consumption_normal:
popfq
$ORIG
jmp tlc_consumption_return
$SITE:
jmp tlc_consumption
$NOP
tlc_consumption_return:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_consumption)
]==]
function t.prepareConsumption090()
 local fn=t.reflectedFunction069('VoyageMiscBlueprintFunctionLibrary','GetConsumptionMultiplierByResource')
 local data,ds=t.refFieldLayout(fn,'Data','function');local kind,ks=t.refFieldLayout(fn,'ResourceType','function');local result,rs=t.refFieldLayout(fn,'ReturnValue','function');local size=readSmallInteger(fn+0xb6)
 assert(data==0 and ds and ds&gt;0 and ds&lt;=2048 and ks==1 and kind==ds and rs==4 and result&gt;=kind+1 and result+4==size,'Resource multiplier parameter contract changed')
 local target=t.consumptionWrapper090(assert(readQword(fn+0xd8)))
 local owned=t.hookState.consumption;local length,original
 if owned then assert(owned.addr==target and t.originalView043(target,owned.orig),'Resource multiplier ownership changed');length=#owned.orig;original=owned.orig
 else length,original=t.safeEntry072(target)end
 local values=t.enumValues074('EModuleResourceType');local tests={}
 for _,name in ipairs({'Petrol','Oil','SaltWater','FreshWater','Methane','Oxygen','Steam','Diesel','CarbonDioxide'})do
  tests[#tests+1]=('cmp dl,%X\nje tlc_consumption_zero'):format(assert(values[name],'Resource enum missing: '..name))
 end
 local aa=template:gsub('@Electricity@',('%X'):format(assert(values.Electricity))):gsub('@Petrol@',('%X'):format(assert(values.Petrol))):gsub('@Diesel@',('%X'):format(assert(values.Diesel))):gsub('@TANK@',table.concat(tests,'\n'))
 local spec=t.SIGS.ConsumptionMultiplier;spec.len=length;spec.bytes=original
 local parts={};for i,v in ipairs(original)do parts[i]=('%02X'):format(v)end;spec.p=table.concat(parts,' ')
 t.HOOKS.consumption.aa=aa;t.A.ConsumptionMultiplier=target;t.resolution.ConsumptionMultiplier='named resource multiplier / enum register / float return verified';t.failures.ConsumptionMultiplier=nil
 registerSymbol('tlcA_ConsumptionMultiplier',target,true)
 t.consumptionLayout090={fn=fn,target=target,values=values};return t.consumptionLayout090
end
local resolve=t.resolveSig
function t.resolveSig(name)
 if name~='ConsumptionMultiplier'then return resolve(name)end
 local okay,value=pcall(t.prepareConsumption090)
 if okay then return value.target end
 t.A[name]=nil;t.resolution[name]='failed';t.failures[name]=tostring(value);return nil
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='power'or key=='tank'or key=='powerTank'then
  if not t.reflectionReady074 then return false,'Resource multiplier needs UObject metadata: '..tostring(t.metadataReason074)end
  local okay,why=pcall(t.prepareConsumption090);if okay then return true end;return false,tostring(why)
 end
 return check(key)
end
end)(TLC)

-- CE-owned batch worker: named engine APIs, current reflected fields, no game offsets.
;(function(TLC)
 local template=[==[
[ENABLE]
alloc(tlc_itemNames079,$2000,$NEAR)
label(tlc_itemNames079_loop)
label(tlc_itemNames079_preloaded)
label(tlc_itemNames079_validate)
label(tlc_itemNames079_noCategory)
label(tlc_itemNames079_next)
label(tlc_itemNames079_class)
label(tlc_itemNames079_valid)
label(tlc_itemNames079_done)
label(tlc_itemNames079_end)
registersymbol(tlc_itemNames079)
registersymbol(tlc_itemNames079_end)
tlc_itemNames079:
push rbx
push rsi
push rdi
push r12
push r13
sub rsp,20
mov rbx,rcx
mov esi,[rbx+60]
xor r13d,r13d
cmp esi,80
ja tlc_itemNames079_done
mov rdi,[rbx+68]
tlc_itemNames079_loop:
test esi,esi
je tlc_itemNames079_done
cmp dword ptr [rbx+A0],0
jne tlc_itemNames079_done
mov dword ptr [rdi+D0],2
test dword ptr [rbx+A8],1
jne tlc_itemNames079_preloaded
mov rax,[rbx+78]
mov qword ptr [rdi+rax],0
mov rcx,[rbx+08]
mov rdx,[rbx+10]
mov r8,rdi
call qword ptr [rbx]
mov rax,[rbx+78]
mov r12,[rdi+rax]
jmp tlc_itemNames079_validate
tlc_itemNames079_preloaded:
mov r12,[rdi+C8]
tlc_itemNames079_validate:
cmp r12,10000
jb tlc_itemNames079_next
test r12,7
jne tlc_itemNames079_next
test dword ptr [r12+08],18010
jne tlc_itemNames079_next
mov eax,[r12+0C]
test eax,eax
js tlc_itemNames079_next
mov r9,[rbx+48]
cmp eax,[r9]
jae tlc_itemNames079_next
mov r8d,eax
shr r8d,10
mov r9,[rbx+40]
mov r9,[r9]
test r9,r9
je tlc_itemNames079_next
mov r9,[r9+r8*8]
test r9,r9
je tlc_itemNames079_next
and eax,FFFF
lea rax,[rax+rax*2]
lea r9,[r9+rax*8]
cmp [r9+08],r12
jne tlc_itemNames079_next
test dword ptr [r9+04],10200000
jne tlc_itemNames079_next
mov rax,[r12+10]
mov r10d,40
tlc_itemNames079_class:
test rax,rax
je tlc_itemNames079_next
cmp rax,[rbx+38]
je tlc_itemNames079_valid
mov rax,[rax+40]
dec r10d
jne tlc_itemNames079_class
jmp tlc_itemNames079_next
tlc_itemNames079_valid:
mov rax,[rbx+50]
movups xmm0,[r12+rax]
mov rax,[rbx+80]
movups [rdi+rax+80],xmm0
mov rax,[rbx+90]
movups [rdi+rax+A0],xmm0
mov [rdi+C8],r12
test dword ptr [rbx+A8],2
jne tlc_itemNames079_noCategory
mov rax,[rbx+58]
mov rax,[r12+rax]
mov [rdi+C0],rax
tlc_itemNames079_noCategory:
mov rcx,[rbx+18]
mov rdx,[rbx+20]
lea r8,[rdi+80]
call qword ptr [rbx]
mov rcx,[rbx+28]
mov rdx,[rbx+30]
lea r8,[rdi+A0]
call qword ptr [rbx]
mov dword ptr [rdi+D0],1
tlc_itemNames079_next:
add rdi,100
inc r13d
dec esi
jmp tlc_itemNames079_loop
tlc_itemNames079_done:
mov eax,r13d
add rsp,20
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
tlc_itemNames079_end:
[DISABLE]
unregistersymbol(tlc_itemNames079)
unregistersymbol(tlc_itemNames079_end)
]==]
 TLC.itemBatchTemplate079=template
 local function key(bytes)local a={};for i,v in ipairs(bytes)do a[i]=string.char(v)end;return table.concat(a)end
 local function same(bytes,address)local current=readBytes(address,#bytes,true);if not current then return false end;for i,b in ipairs(bytes)do if current[i]~=b then return false end end;return true end
 local executable=TLC.executable038
 function TLC.executable038(address,length)
  if executable(address,length)then return true end
  local state=TLC.itemBatch079
  return state and state.pid==getOpenedProcessID()and address==state.code and(not length or length&lt;=#state.bytes)and same(state.bytes,address)or false
 end
 function TLC.prepareItemBatch079()
  local old=TLC.itemBatch079;if old and old.pid==getOpenedProcessID()and TLC.sameIdentity029(old.world)and same(old.bytes,old.code)then return old end
  if old then if old.pid==getOpenedProcessID()and same(old.bytes,old.code)then pcall(writeInteger,old.header+0xa0,1)end;pcall(unregisterSymbol,'tlc_itemNames079');pcall(unregisterSymbol,'tlc_itemNames079_end');TLC.itemBatch079=nil end
  local get=TLC.apiContract075('AssetRegistryHelpers','GetAsset')
  local source=TLC.apiContract075('KismetTextLibrary','GetTextSourceString')
  local display=TLC.apiContract075('KismetTextLibrary','Conv_TextToString')
  local cls=assert(TLC.refClass('VoyageItem'));local name,ns=TLC.refFieldLayout(cls,'Name',true);local category,cs=TLC.refFieldLayout(cls,'CategoryAsset',true)
  assert(name and ns==16 and category and cs==8,'Item text/category metadata unavailable')
  local assetOffset,assetSize=TLC.refFieldLayout(get.fn,'InAssetData','function');assert(assetOffset==0 and get.size&lt;=0x80 and assetSize and assetSize&lt;=0x78,'AssetData batch ABI changed')
  assert(source.size&lt;=0x20 and display.size&lt;=0x20,'Text result frame exceeds batch layout')
  local proc=TLC.processEvent074(get.cdo,true);assert(TLC.processEvent074(source.cdo,true)==proc and TLC.processEvent074(display.cdo,true)==proc,'Static API dispatchers differ')
  local categoryClass=assert(readQword(TLC.property076(cls,'CategoryAsset',true)+0x70));assert(TLC.valid(categoryClass)and TLC.U.c(categoryClass)=='Class','Item category class unavailable')
  local categoryName,categoryNameSize=TLC.refFieldLayout(categoryClass,'Name',true);assert(categoryName and categoryNameSize==16,'Category name metadata unavailable')
  local values={[0]=proc,[8]=get.cdo,[0x10]=get.fn,[0x18]=source.cdo,[0x20]=source.fn,[0x28]=display.cdo,[0x30]=display.fn,[0x38]=cls,[0x40]=TLC.U.go,[0x48]=TLC.U.gc,[0x50]=name,[0x58]=category,[0x78]=TLC.apiMember075(get,'ReturnValue',8),[0x80]=TLC.apiMember075(source,'Text',16),[0x88]=TLC.apiMember075(source,'ReturnValue',16),[0x90]=TLC.apiMember075(display,'InText',16),[0x98]=TLC.apiMember075(display,'ReturnValue',16)}
  assert(autoAssemble(template:gsub('%$NEAR',('%X'):format(TLC.mod()))),'Item name batch allocation/assembly failed')
  local code=assert(getAddressSafe('tlc_itemNames079'));local finish=assert(getAddressSafe('tlc_itemNames079_end'));assert(finish&gt;code and finish-code&lt;0x2000)
  local header=assert(allocateMemory(0x1000));local rows=assert(allocateMemory(0x8000));assert(writeQword(header+0x68,rows))
  for offset,value in pairs(values)do assert(value and writeQword(header+offset,value))end
  old={pid=getOpenedProcessID(),world=assert(TLC.identity029(TLC.world())),code=code,bytes=assert(readBytes(code,finish-code,true)),header=header,rows=rows,assetSize=assetSize,itemClass=cls,nameOffset=name,categoryOffset=category,categoryClass=categoryClass,categoryName=categoryName,get=get,source=source,display=display,sourceOut=values[0x88],displayOut=values[0x98],functions={assert(TLC.identity029(get.fn)),assert(TLC.identity029(source.fn)),assert(TLC.identity029(display.fn))}}
  TLC.itemBatch079=old;return old
 end
 function TLC.prefetchItemNames079(rows,owner,done,preparedState)
  local state=preparedState or TLC.prepareItemBatch079();local index=1;local cache,names={},{};local categories,seen={},{}
  owner.lastProgress=getTickCount();owner.nativeAbort079=function()writeInteger(state.header+0xa0,1)end
  local function alive()return owner==TLC.catalogBusy075 and not owner.cancelled and TLC.sameIdentity029(state.world)end
  local function readName(p,isCategory)
   if readInteger(p+0xd0)~=1 then return end
   local okay,value=pcall(function()
    local object=readQword(p+0xc8);local identity=assert(TLC.identity029(object));local en=TLC.readApiString075(p+0x80+state.sourceOut);local localName=TLC.readApiString075(p+0xa0+state.displayOut)
    if en==''then en=localName end;if localName==''then localName=en end
    assert(en~='','Display name is empty');return {object=object,identity=identity,en=en,localName=localName,category=not isCategory and readQword(p+0xc0)or nil,isCategory079=isCategory}
   end)
   if okay then names[value.object]=value;return value else TLC.reason('items',tostring(value))end
  end
  local function publish()
   local prepared={output={},labels={},categoryNames={},skipped=0}
   for _,row in ipairs(rows)do
    local value=cache[key(row.assetData)]
    local category=value and value.category and names[value.category]
    if value and value.object~=0 and (not value.category or value.category==0 or category)then
     local group=category and(tostring(category.identity.object)..':'..tostring(category.identity.serial))or 'other'
     prepared.labels[row.label]={value.en,value.localName}
     prepared.categoryNames[group]=category and{category.en,category.localName}or{'Other','その他'}
     prepared.output[#prepared.output+1]={path=row.path,label=row.label,cat=group}
    else prepared.skipped=prepared.skipped+1 end
   end
   assert(#prepared.output&gt;0,'No usable item display names were obtained')
   owner.preparedCatalogue098=prepared
   TLC.itemNameCache079=names;TLC.itemAssetCache079=cache;done(rows)
  end
  local function reserve(count,mode,callback)
   owner.lastProgress=getTickCount()
   for _,id in ipairs(state.functions)do assert(TLC.sameIdentity029(id),'Text API identity changed')end
   assert(writeInteger(state.header+0x60,count)and writeInteger(state.header+0xa0,0)and writeInteger(state.header+0xa8,mode))
   assert(writeQword(state.header+0x38,mode==0 and state.itemClass or state.categoryClass))
   assert(writeQword(state.header+0x50,mode==0 and state.nameOffset or state.categoryName))
   owner.batchReservations079=(owner.batchReservations079 or 0)+1
   TLC.job(state.code,{state.header},{state.get.fn,state.source.fn},function(processed)
    if not alive()then return end
    local okay,why=pcall(function()assert(processed==count,'Name batch did not complete');callback()end)
    if not okay and owner.fail then owner.fail(why)end
   end)
   if TLC.pendingJob then TLC.pendingJob.catalogOwner075=owner;TLC.pendingJob.cancelled074=function(why)if alive()and owner.fail then owner.fail(why)end end end
  end
  local categoryIndex=1
  local function categoryStep()
   if not alive()then return end
   if categoryIndex&gt;#categories then publish();return end
   local count=math.min(128,#categories-categoryIndex+1)
   for j=0,count-1 do assert(writeQword(state.rows+j*0x100+0xc8,categories[categoryIndex+j]))end
   reserve(count,3,function()
    for j=0,count-1 do readName(state.rows+j*0x100,true)end
    categoryIndex=categoryIndex+count;owner.lastProgress=getTickCount();categoryStep()
   end)
  end
  local function step()
   if not alive()then return end
   if index&gt;#rows then categoryStep();return end
   local count=math.min(128,#rows-index+1)
   for j=0,count-1 do local row=rows[index+j];assert(#row.assetData==state.assetSize);assert(writeBytes(state.rows+j*0x100,row.assetData))end
   reserve(count,0,function()
    for j=0,count-1 do
     local row=rows[index+j];local result=readName(state.rows+j*0x100,false)or{object=0};cache[key(row.assetData)]=result
     local category=result.category
     if category and category~=0 and not seen[category]and TLC.valid(category)then seen[category]=true;categories[#categories+1]=category end
    end
    index=index+count;owner.lastProgress=getTickCount();if owner.progress079 then owner.progress079(index-1,#rows)end;step()
   end)
  end
  step()
 end
 local query=TLC.queryItemAssets075
 function TLC.queryItemAssets075(done)
  query(function(rows)
   local owner=TLC.catalogBusy075
   if not owner then done(rows);return end
   local okay,state=pcall(TLC.prepareItemBatch079)
   if not okay then
    owner.batchUnavailable098=tostring(state)
    TLC.msg('Batched name lookup unavailable; using the standard item API.','名前の一括取得を利用できないため、通常の取得処理を使用します。')
    done(rows);return
   end
   TLC.prefetchItemNames079(rows,owner,done,state)
  end)
 end
 local invoke=TLC.apiInvoke075
 function TLC.apiInvoke075(contract,inputs,done)
  if TLC.catalogBusy075 and contract.owner=='AssetRegistryHelpers'and contract.method=='GetAsset'and inputs and inputs.InAssetData and TLC.itemAssetCache079 then
   local result=TLC.itemAssetCache079[key(inputs.InAssetData)]
   if result then local p=TLC.apiFrame075(contract);local object=result.object;if object~=0 and not TLC.sameIdentity029(result.identity)then object=0 end;assert(writeQword(p+TLC.apiMember075(contract,'ReturnValue',8),object));if done then done(p)end;return end
  end
  return invoke(contract,inputs,done)
 end
 local name=TLC.objectName075
 function TLC.objectName075(object,done)
  local value=TLC.itemNameCache079 and TLC.itemNameCache079[object]
  if value and TLC.sameIdentity029(value.identity)then done(value.en,value.localName);return end
  return name(object,done)
 end
 local readField=TLC.readObjectField074
 function TLC.readObjectField074(object,field)
  if TLC.catalogBusy075 and field=='CategoryAsset'then
   local value=TLC.itemNameCache079 and TLC.itemNameCache079[object]
   if value and not value.isCategory079 and TLC.sameIdentity029(value.identity)then local category=value.category;if category and TLC.valid(category)then return category end;return nil end
  end
  return readField(object,field)
 end
 local forget=TLC.forgetProcess
 function TLC.forgetProcess(...)
  local s=TLC.itemBatch079;if s and s.pid==getOpenedProcessID()and same(s.bytes,s.code)then pcall(writeInteger,s.header+0xa0,1)end
  pcall(unregisterSymbol,'tlc_itemNames079');pcall(unregisterSymbol,'tlc_itemNames079_end')
  return forget(...)
 end
end)(TLC)




-- Attribute hooks are located from the named native call and reflected value type.
;(function(TLC)
 local function field(object,name,kind)
  local start=kind and object or assert(readQword(object+0x10))
  for depth=1,64 do
   if not TLC.valid(start)then break end
   local p=readQword(start+0x50);local seen={}
   for i=1,2048 do
    if not p or p==0 or seen[p]then break end;seen[p]=true
    if TLC.U.name(readInteger(p+0x20))==name then return p end;p=readQword(p+0x18)
   end
   start=readQword(start+0x40)
  end
  error('Named property unavailable: '..name)
 end
 local function off(object,name,size,kind)
  local value,actual=TLC.refFieldLayout(object,name,kind);assert(value and actual==size,'Property type changed: '..name);return value
 end
 local function aligned(n,a)return ((n+a-1)//a)*a end
 local function floats(op,offset)
  local prefix=string.char(0xf3,0x0f,op)
  if offset==0 then return prefix..string.char(0x01)
  elseif offset&lt;128 then return prefix..string.char(0x41,offset)
  else return prefix..string.char(0x81)..string.pack('&lt;I4',offset)end
 end
 local function bytes(a,n)local b=assert(readBytes(a,n,true));local r={};for i=1,#b do r[i]=string.char(b[i])end;return table.concat(r)end
 local function publish(name,address,leafLength)
  if leafLength then assert(leafLength&gt;5 and leafLength&lt;=64 and readBytes(address+leafLength-1,1)==0xc3,'Unverified leaf target')
  else local first,last=TLC.runtimeFunction074(address);assert(first==address,'Typed native target is not an unwind entry: '..name);TLC.safeEntry072(address)end
  local length,assembly,lengths=0,{},{}
  while length&lt;5 do local n=assert(getInstructionSize(address+length));assert(n&gt;0 and n&lt;=15 and length+n&lt;=32);assembly[#assembly+1]=('reassemble(%X)'):format(address+length);lengths[address+length]=n;length=length+n end
  local spec=TLC.SIGS[name];spec.len=length;spec.bytes=assert(readBytes(address,length,true));local pattern={}
  for i,v in ipairs(spec.bytes)do pattern[i]=('%02X'):format(v)end;spec.p=table.concat(pattern,' ');TLC.codePatterns074[name]=nil
  TLC.typedCodeProof076=TLC.typedCodeProof076 or{};TLC.typedCodeProof076[name]={address=address,length=length,lengths=lengths,bytes=spec.bytes}
  TLC.A[name]=address;TLC.resolution[name]='verified named attribute API / reflected value / native call relationship';TLC.failures[name]=nil;registerSymbol('tlcA_'..name,address,true)
  return table.concat(assembly,'\n')
 end
 TLC.publishNative076=publish

 function TLC.attributeWrapper096(entry)
  local list={};local ip=entry;local finished=false
  for i=1,180 do
   local n=assert(getInstructionSize(ip));assert(n&gt;=1 and n&lt;=15 and ip-entry&lt;2048)
   local b=bytes(ip,n);list[#list+1]={a=ip,b=b}
   if b:byte(1)==0xc3 then finished=true;break end;ip=ip+n
  end
  assert(finished,'Attribute wrapper return unavailable')
  local this,result=false,false
  for i=1,math.min(16,#list)do
   this=this or list[i].b=='\72\139\241';result=result or list[i].b=='\73\139\248'
  end
  assert(this and result,'Attribute wrapper this/result register contract changed')
  local found={}
  for i,row in ipairs(list)do if row.b:byte(1)==0xe8 and #row.b==5 then
   local returned=false
   for j=i+1,math.min(i+4,#list)do if list[j].b=='\136\7'then returned=true end end
   if returned then
    local enum,amount,owner=false,false,false
    for j=math.max(1,i-10),i-1 do
     local b=list[j].b
     if b:sub(1,4)=='\15\182\84\36'or b:sub(1,4)=='\15\182\148\36'then enum=true end
     if b:sub(1,5)=='\243\15\16\84\36'or b:sub(1,5)=='\243\15\16\148\36'then amount=true end
     if b=='\72\139\206'then owner=true end
    end
    assert(enum and amount and owner,'Attribute enum/float/this ABI changed')
    local d=assert(readInteger(row.a+1));if d&gt;=0x80000000 then d=d-0x100000000 end
    local target=row.a+5+d;assert(TLC.executable038(target,16));found[target]=true
   end
  end end
  local target,count=nil,0;for a in pairs(found)do target=a;count=count+1 end
  assert(count==1,'Attribute return-producing call missing or ambiguous');return target
 end
 function TLC.attributeDeltaContract076()
  local cached=TLC.attributeDelta076
  if cached and cached.pid==getOpenedProcessID()and TLC.sameIdentity029(cached.identity)then return cached end
  local cls=assert(TLC.refClass('VoyageSurvivalComponent'));local fn=assert(TLC.reflectedFunction069('VoyageSurvivalComponent','ChangeAttributeValue'))
  off(fn,'InType',1,'function');off(fn,'Amount',4,'function');off(fn,'ReturnValue',1,'function')
  local parameter=field(fn,'InType','function');local enums={}
  for _,offset in ipairs({0x70,0x78})do local object=readQword(parameter+offset);if TLC.valid(object)and TLC.U.c(object)=='Enum'then enums[object]=true end end
  local enum,count;count=0;for object in pairs(enums)do enum=object;count=count+1 end;assert(count==1,'Attribute enum metadata is ambiguous')
  local values=TLC.enumValues074(TLC.U.n(enum));assert(values.Health and values.Charge,'Health/charge enum values unavailable')
  local body=TLC.attributeWrapper096(assert(readQword(fn+0xd8)));local first,last=TLC.runtimeFunction074(body);assert(first==body and last-first&lt;65536,'Attribute function scope unavailable')
  local c={pid=getOpenedProcessID(),identity=assert(TLC.identity029(fn)),fn=fn,class=cls,health=values.Health,charge=values.Charge,body=body,original=publish('AttributeChange',body)}
  local component=assert(TLC.refClass('ActorComponent'));local base=cls;local derives=false
  for i=1,64 do if base==component then derives=true;break end;if not TLC.valid(base)then break end;base=readQword(base+0x40)end
  assert(derives,'Survival component owner type changed');c.owner=TLC.componentOwnerOffset083()
  TLC.attributeDelta076=c;return c
 end
 function TLC.survivalContract076()
  local cached=TLC.survivalTyped076;if cached and TLC.sameIdentity029(cached.identity)then return cached end
  local delta=TLC.attributeDeltaContract076();local cls,fn=delta.class,delta.fn
  local property=field(cls,'SurvivalAttributes',true);local mapOffset=off(cls,'SurvivalAttributes',80,true)
  local valueProperty=assert(readQword(property+0x78));local valueType=assert(readQword(valueProperty+0x70))
  assert(TLC.valid(valueType)and TLC.U.c(valueType)=='ScriptStruct','Attribute map value type unavailable')
  local size=assert(readInteger(valueType+0x58));local alignment=assert(readSmallInteger(valueType+0x5c))
  assert(size&gt;0 and size&lt;=1024 and alignment&gt;=1 and alignment&lt;=16 and(alignment&amp;(alignment-1))==0,'Attribute value size/alignment unavailable')
  local vo=off(valueType,'Value',4,'struct');local mi=off(valueType,'MinValue',4,'struct');local ma=off(valueType,'MaxValue',4,'struct')
  local valueOffset=aligned(1,alignment);local minimum=aligned(valueOffset+size,alignment)
  local body=delta.body;local first,last=TLC.runtimeFunction074(body);assert(first==body and last-first&lt;65536,'Attribute function scope unavailable')
  local strideCandidates,clamps={},{};local clampPattern=floats(0x10,ma)..string.char(0xf3,0x0f,0x5d,0xc1)..floats(0x5f,mi)..floats(0x11,vo)..string.char(0xc3)
  local ip=first
  while ip&lt;last do
   local proof=TLC.typedCodeProof076 and TLC.typedCodeProof076.AttributeChange
   local n,b;if proof and ip&gt;=proof.address and ip&lt;proof.address+proof.length then n=assert(proof.lengths[ip]);b={};for i=1,n do b[i]=proof.bytes[ip-proof.address+i]end else n=assert(getInstructionSize(ip));b=assert(readBytes(ip,n,true))end
   assert(n&gt;0 and n&lt;=15);local k=b[1]==0x48 and 2 or 1
   if b[k]==0x69 and n&gt;=k+5 then
    local amount=b[n-3]|(b[n-2]&lt;&lt;8)|(b[n-1]&lt;&lt;16)|(b[n]&lt;&lt;24);if amount and amount&gt;=minimum and amount&lt;=minimum+32 and amount%alignment==0 then strideCandidates[amount]=true end
   elseif b[k]==0x6b and n&gt;=k+2 then
    local amount=b[n];if amount&gt;=minimum and amount&lt;=minimum+32 and amount%alignment==0 then strideCandidates[amount]=true end
   end
   if b[1]==0xe8 and n==5 then local d=b[2]|(b[3]&lt;&lt;8)|(b[4]&lt;&lt;16)|(b[5]&lt;&lt;24);if d&gt;=0x80000000 then d=d-0x100000000 end;local target=ip+5+d
    if TLC.executable038(target,#clampPattern)and bytes(target,#clampPattern)==clampPattern then clamps[target]=true end
   end;ip=ip+n
  end
  local stride;count=0;for value in pairs(strideCandidates)do stride=value;count=count+1 end;assert(count==1,'Attribute map stride could not be derived unambiguously')
  local clamp;count=0;for value in pairs(clamps)do clamp=value;count=count+1 end;assert(count==1,'Attribute clamp native callee could not be verified')
  local original=delta.original;local clampOriginal=publish('AttributeSet',clamp,#clampPattern)
  local c=delta;c.map=mapOffset;c.stride=stride;c.valueOffset=valueOffset;c.value=vo;c.min=mi;c.max=ma;c.size=size;c.clamp=clamp;c.clampOriginal=clampOriginal
  TLC.survivalTyped076=c;return c
 end
 function TLC.survival()
  local player=TLC.player(false);return player and TLC.readObjectField074(player,'SurvivalComponent')or nil
 end
 function TLC.stats()
  local component=TLC.survival();local result={};if not component then return result end
  local c=TLC.survivalContract076();local identity=assert(TLC.identity029(component));local header=assert(readBytes(component+c.map,80,true));local mapData=readQword(component+c.map)
  for _,row in ipairs(TLC.map(component+c.map,c.stride))do
   local kind=readBytes(row,1);local base=row+c.valueOffset
   local value,minimum,maximum=readFloat(base+c.value),readFloat(base+c.min),readFloat(base+c.max)
   assert(value and minimum and maximum and value==value and minimum&lt;=maximum,'Invalid reflected survival value')
   result[kind]=base+c.value
  end
  assert(TLC.sameIdentity029(identity),'Survival owner changed during read');local after=assert(readBytes(component+c.map,80,true));for i,v in ipairs(header)do assert(after[i]==v,'Survival map changed during read')end
  return result,{identity=identity,mapData=mapData}
 end
 -- Preflight contracts are separate from any allocation or native hook write.
 local resolve=TLC.resolveSig
 function TLC.resolveSig(name)
  if name=='AttributeChange'then return TLC.attributeDeltaContract076().body elseif name=='AttributeSet'then return TLC.survivalContract076().clamp end
  return resolve(name)
 end
end)(TLC)

-- Shared attribute hook data uses reader-counted snapshots, never a half-published owner.
;(function(TLC)
 local save='pushfq\npush rax\npush rcx\npush rdx\npush r8\npush r9\npush r10\npush r11'
 local restore='pop r11\npop r10\npop r9\npop r8\npop rdx\npop rcx\npop rax\npopfq'
 local function identity(done)
  return ([=[test rcx,rcx
je %s
mov eax,[rcx+0C]
cmp eax,[r11+20]
jne %s
cmp eax,[tlcObjectCount072]
jae %s
test dword ptr [rcx+08],18010
jne %s
mov r8,[rcx+10]
cmp r8,[r11+28]
jne %s
mov r8,[rcx+18]
cmp r8,[r11+30]
jne %s
mov edx,eax
shr eax,10
and edx,FFFF
mov r8,[tlcObjects]
mov r8,[r8+rax*8]
imul rdx,rdx,18
cmp [r8+rdx+08],rcx
jne %s
mov eax,[r8+rdx+10]
cmp eax,[r11+24]
jne %s
test dword ptr [r8+rdx+04],10200000
jne %s]=]):format(done,done,done,done,done,done,done,done,done)
 end
 local function aa(name,code,original)
  local extra='';for _,suffix in ipairs({'npc','loop','hit'})do if code:find('tlc_'..name..'_'..suffix..':',1,true)then extra=extra..'label(tlc_'..name..'_'..suffix..')\n'end end
  return '[ENABLE]\nalloc(tlc_'..name..',$2000,$SITE)\nlabel(tlc_'..name..'_return)\nlabel(tlc_'..name..'_release)\nlabel(tlc_'..name..'_done)\n'..extra..'tlc_'..name..':\n'..save..'\nmov r10,rdx\nmov r11,[tlcSurvival076Data]\ntest r11,r11\nje tlc_'..name..'_done\nlock inc dword ptr [r11+F0]\ncmp r11,[tlcSurvival076Data]\njne tlc_'..name..'_release\n'..code..'\ntlc_'..name..'_release:\nlock dec dword ptr [r11+F0]\ntlc_'..name..'_done:\n'..restore..'\n'..original..'\njmp tlc_'..name..'_return\n$SITE:\njmp tlc_'..name..'\n$NOP\ntlc_'..name..'_return:\n[DISABLE]\n$SITE:\n$ORIG\n'
 end
 local prepareFull,prepareDelta=TLC.survivalContract076,TLC.attributeDeltaContract076
 local function prepare(c,needClamp)
  if c.deltaHookPrepared and(not needClamp or c.clampHookPrepared)then return c end
  local prefix='tlc_survivalDelta076';local release=prefix..'_release'
  local body=('cmp rcx,[r11]\njne %s_npc\n'):format(prefix)..identity(release)..('\ncmp r10b,%02X\njne %s\ncmp byte ptr [tlcFlags+01],0\nje %s\nmovd eax,xmm2\ntest eax,80000000\nje %s\nxorps xmm2,xmm2\njmp %s\n'):format(c.health,release,release,release,release)
  body=body..prefix..'_npc:\ncmp byte ptr [tlcFlags+07],0\nje '..release..('\ncmp r10b,%02X\njne %s\n'):format(c.health,release)..'movd eax,xmm2\ntest eax,80000000\nje '..release..'\nmov r8,[r11+18]\ntest r8,r8\nje '..release..'\nmov rax,[rcx+@OWNER096@]\ntest rax,rax\nje '..release..'\nmov rax,[rax+10]\nmov r9d,40\n'..prefix..'_loop:\ntest rax,rax\nje '..release..'\ncmp rax,r8\nje '..prefix..'_hit\nmov rax,[rax+40]\ndec r9d\njne '..prefix..'_loop\njmp '..release..'\n'..prefix..'_hit:\nmovss xmm2,[tlcVars+3C]'
  body=body:gsub('@OWNER096@',('%X'):format(assert(c.owner)))
  TLC.HOOKS.survivalDelta076={sig='AttributeChange',aa=aa('survivalDelta076',body,c.original)}
  c.deltaHookPrepared=true
  if not needClamp then return c end
  prefix='tlc_survivalClamp076';release=prefix..'_release'
  body='cmp byte ptr [tlcFlags+01],0\nje '..release..'\nmov rcx,[r11]\n'..identity(release)..('\nmov rax,[rcx+%02X]\ncmp rax,[r11+40]\njne %s\nmov rcx,[rsp+28]\ncmp rcx,[r11+08]\njne %s\ncmp byte ptr [rcx-%02X],%02X\njne %s\nmovss xmm1,[rcx+%02X]'):format(c.map,release,release,c.valueOffset,c.health,release,c.max)
  TLC.HOOKS.survivalClamp076={sig='AttributeSet',aa=aa('survivalClamp076',body,c.clampOriginal)}
  c.hooksPrepared=true;c.clampHookPrepared=true;return c
 end
 function TLC.attributeDeltaContract076()return prepare(prepareDelta(),false)end
 function TLC.survivalContract076()return prepare(prepareFull(),true)end
 function TLC.publishSurvival076(requireHealth,requireNPC)
  local c=requireHealth and TLC.survivalContract076()or TLC.attributeDeltaContract076();local owner=TLC.survival();local stats,context={},nil;if requireHealth and owner then stats,context=TLC.stats()end
  if requireHealth and not(owner and stats[c.health])then local data=TLC.survivalData076;if data then assert(writeQword(data.address,0))end;return end
  local npc=requireNPC and TLC.refClass('VoyageNPCBaseCharacter')or nil
  -- No loaded NPC class is a temporary absence, not an instruction to disable one-hit kill.
  TLC.npcPending157=requireNPC and not npc or nil
  local state=TLC.survivalData076
  if not state then
   local script=('alloc(tlcSurvival076Data,$1000,%02X)\nregistersymbol(tlcSurvival076Data)'):format(TLC.mod())
   assert(autoAssemble(script),'Attribute snapshot allocation failed');state={address=assert(getAddressSafe('tlcSurvival076Data')),next=0};TLC.survivalData076=state
  end
  local bank=state.address+0x100+state.next*0x100
  if readInteger(bank+0xf0)~=0 then return end
  local id=owner and assert(TLC.identity029(owner))
  assert(writeQword(bank,owner or 0));assert(writeQword(bank+8,stats[c.health]and stats[c.health]-c.value or 0))
  assert(writeQword(bank+0x10,stats[c.charge]and stats[c.charge]-c.value or 0));assert(writeQword(bank+0x18,npc or 0))
  assert(writeInteger(bank+0x20,id and id.index or 0));assert(writeInteger(bank+0x24,id and id.serial or 0))
  assert(writeQword(bank+0x28,id and id.class or 0));assert(writeQword(bank+0x30,owner and readQword(owner+0x18)or 0))
  assert(writeQword(bank+0x40,context and context.mapData or 0));assert(writeQword(state.address,bank));state.next=1-state.next
  return stats,c,owner
 end
 local function update()
  local stats,c,owner=TLC.publishSurvival076(TLC.featOn.health,TLC.featOn.oneshot)
  if stats and TLC.featOn.health and not TLC.pendingJob then
   local a=stats[c.health];local value=assert(readFloat(a));local maximum=assert(readFloat(a+c.max-c.value))
   assert(value==value and maximum==maximum and maximum&gt;=0,'Invalid health value')
   if value&lt;maximum then
    local fn=c.fn;local size=assert(readSmallInteger(fn+0xb6));assert(size&lt;=64,'Attribute parameter block too large')
    local kind,ks=TLC.refFieldLayout(fn,'InType','function');local amount,as=TLC.refFieldLayout(fn,'Amount','function')
    assert(kind and ks==1 and amount and as==4 and amount+4&lt;=size,'Attribute parameters changed')
    local p=TLC.base()+0xe80;for i=0,size-1 do assert(writeBytes(p+i,0))end
    assert(writeBytes(p+kind,c.health)and writeFloat(p+amount,maximum-value))
    TLC.job(TLC.processEvent074(owner),{owner,fn,p},{owner,fn},function()end)
   end
  end
 end
 TLC.F.health={flag=1,hooks={'survivalDelta076','survivalClamp076'},on=function()TLC.need();TLC.publishSurvival076(true,TLC.featOn.oneshot)end,task=update}
 TLC.F.oneshot={flag=7,hooks={'survivalDelta076'},on=function()TLC.need();TLC.publishSurvival076(TLC.featOn.health,true)end,task=function()if not TLC.featOn.health then update()end end}
 -- Metadata class identity replaces the old NPC class-constructor code dependency.
 local requireSigs=TLC.requireSigs
 function TLC.requireSigs(names)
  local remaining={}
  for _,name in ipairs(names)do if name=='NPCClass'then assert(TLC.refClass('VoyageNPCBaseCharacter'),'NPC class metadata unavailable')else remaining[#remaining+1]=name end end
  return requireSigs(remaining)
 end
 local check=TLC.checkFeature074
 function TLC.checkFeature074(key)
  if key=='health'or key=='oneshot'then
   local ok,e=pcall(function()assert(TLC.reflectionReady074,'Metadata unavailable');if key=='health'then TLC.survivalContract076()else TLC.attributeDeltaContract076()end;if key=='oneshot'then assert(TLC.refClass('VoyageNPCBaseCharacter'),'NPC class unavailable')end end)
   if ok then return true end;return false,tostring(e)
  end
  return check(key)
 end
 TLC.compat038.portable.health=true;TLC.compat038.portable.oneshot=true
 local tick=TLC.portableTick074
 function TLC.portableTick074(...)
  local result=tick(...)
  if TLC.attached()then for _,key in ipairs({'health','oneshot'})do if TLC.featOn[key]then local ok,e=pcall(TLC.F[key].task);if not ok then TLC.reason(key,tostring(e));TLC.feature(key,false)end end end end
  return result
 end
end)(TLC)

-- Rotor ownership and interface layout come from the current metadata/code pair.
;(function(t)
local function field(object,name,size,kind)
 local offset,actual=t.refFieldLayout(object,name,kind)
 assert(offset and actual==size,'Rotor field contract changed: '..name)
 return offset
end
local function raw(address,count)
 local values=assert(readBytes(address,count,true));local out={}
 for i,v in ipairs(values)do out[i]=string.char(v)end
 return table.concat(out)
end
function t.rotorCodeContract102(site)
 local cls=assert(t.refClass('VoyageModuleRotorActor'),'Rotor class unavailable')
 local names={'ResourceToRotationSpeed','RotationSpeedToLinearSpeed','SpeedDamping','RotationSpeed'}
 local sizes={4,4,8,8};local offsets={}
 for i,name in ipairs(names)do offsets[i]=field(cls,name,sizes[i],true)end
 local first,last=t.runtimeFunction074(site)
 assert(first and last and first&lt;=site and last-first&lt;=0x4000,'Rotor native function scope unavailable')
 local code=raw(first,last-first)
 -- This verified ABI keeps the rotor interface in RBX and the propulsion scalar in XMM7.
 assert(code:find('\72\139\217',1,true),'Rotor this-register contract changed')
 local instruction=raw(site,5)
 assert(instruction:sub(1,4)=='\242\15\89\123','Rotor scalar instruction changed')
 local rotationDisp=instruction:byte(5)
 assert(rotationDisp&lt;128,'Unsupported rotor scalar displacement encoding')
 local interface=offsets[4]-rotationDisp
 assert(interface&gt;=0x28 and interface%8==0,'Rotor interface position is invalid')
 local wanted={
  '\243\15\16\75'..string.char(offsets[1]-interface),
  '\243\15\16\123'..string.char(offsets[2]-interface),
  '\242\15\16\67'..string.char(offsets[3]-interface)}
 for _,pattern in ipairs(wanted)do assert(code:find(pattern,1,true),'Rotor metadata/native member correspondence changed')end
 local cdo=assert(t.defaultObject074(cls));local vtable=assert(readQword(cdo+interface));local matches=0
 for i=0,15 do if readQword(vtable+i*8)==first then matches=matches+1 end end
 assert(matches==1,'Rotor interface does not reference the verified native function')
 return {pid=getOpenedProcessID(),site=site,first=first,last=last,interface=interface,class=cls,rotationDisp=rotationDisp}
end
local oldResolve=t.resolveSig
function t.resolveSig(name)
 if name~='BoatPropulsionTarget'then return oldResolve(name)end
 local old=t.rotorContract102
 if old and old.pid==getOpenedProcessID()and old.site==t.A[name]then return old.site end
 -- File search accepts only candidates whose native fields agree with the named rotor class.
 local pattern='F2 0F 59 7B ?? 0F 5A C0 F2 0F 58 D1 0F 10 89 ?? ?? ?? ?? F2 0F 11 4D ?? F2 0F 59 C9 F2 0F 5C FA F2 0F 59 F8'
 local proofs={}
 local rows,why=t.scanFile074(pattern,function(address)
  local okay,proof=pcall(t.rotorCodeContract102,address)
  if okay then proofs[address]=proof;return address end
 end,true)
 if not rows or #rows~=1 then
  t.resolution[name]='failed';t.reason(name,'Rotor metadata/native contract: '..tostring(why or('verified candidates '..tostring(rows and #rows or 0))))
  return nil
 end
 local site=rows[1];local spec=t.SIGS[name];local bytes=assert(readBytes(site,5,true))
 -- Never adopt another table's entry patch as the original instruction.
 assert(bytes[1]==0xf2 and bytes[2]==0x0f and bytes[3]==0x59 and bytes[4]==0x7b,'Rotor entry is already modified')
 spec.bytes=bytes;spec.len=5;t.A[name]=site;t.rotorContract102=proofs[site]
 t.resolution[name]='rotor metadata / native ABI';t.failures[name]=nil
 registerSymbol('tlcA_'..name,site,true);return site
end
local function same(address,expected)
 local actual=readBytes(address,#expected,true);if not actual then return false end
 for i,v in ipairs(expected)do if actual[i]~=v then return false end end;return true
end
function t.installRotor102()
 local proof=assert(t.rotorContract102);local site=proof.site
 local cache=rawget(_G,'TLCBoatPropulsion102')
 if cache and cache.pid==getOpenedProcessID()and cache.module==t.moduleRequired()then
  assert(cache.site==site and cache.interface==proof.interface,'Rotor allocation contract changed')
  assert(cache.codeBytes and same(cache.code,cache.codeBytes)and readInteger(cache.data+0x60)==0x20504c54,'Rotor retained code/data identity changed')
  assert(same(site,cache.original)or same(site,cache.patch),'Rotor instruction ownership conflict')
  if same(site,cache.original)then assert(writeBytes(site,cache.patch))end
  t.boatPropulsion=cache;return cache
 end
 local original=assert(readBytes(site,5,true));assert(original[1]==0xf2,'Rotor entry already modified')
 local script=([=[alloc(tlcBoatPropulsion102,1000,%X)
registersymbol(tlcBoatPropulsion102)
label(tlcBoatPropulsion102Data)
registersymbol(tlcBoatPropulsion102Data)
label(rotor102_loop)
label(rotor102_match)
label(rotor102_done)
tlcBoatPropulsion102:
reassemble(%X)
pushfq
push rax
push rcx
push rdx
cmp byte ptr [tlcBoatPropulsion102Data],0
je rotor102_done
mov ecx,[tlcBoatPropulsion102Data+4]
lea rax,[tlcBoatPropulsion102Data+100]
rotor102_loop:
test ecx,ecx
jz rotor102_done
cmp [rax],rbx
je rotor102_match
add rax,20
dec ecx
jmp rotor102_loop
rotor102_match:
mov ecx,[rax+8]
cmp [rbx-%X],ecx
jne rotor102_done
mov rdx,[rax+10]
mov ecx,[rax+C]
cmp [rdx+10],ecx
jne rotor102_done
lea rcx,[rbx-%X]
cmp [rdx+8],rcx
jne rotor102_done
inc dword ptr [tlcBoatPropulsion102Data+10]
mov [tlcBoatPropulsion102Data+18],rbx
movsd [tlcBoatPropulsion102Data+20],xmm7
mulsd xmm7,[tlcBoatPropulsion102Data+8]
movsd [tlcBoatPropulsion102Data+28],xmm7
rotor102_done:
pop rdx
pop rcx
pop rax
popfq
jmp %X
align 10
tlcBoatPropulsion102Data:
resb 600
%X:
jmp tlcBoatPropulsion102
]=]):format(site,site,proof.interface-0x0c,proof.interface,site+5,site)
 assert(autoAssemble(script),'Rotor allocation failed')
 cache={pid=getOpenedProcessID(),module=t.moduleRequired(),site=site,original=original,patch=assert(readBytes(site,5,true)),code=assert(getAddressSafe('tlcBoatPropulsion102')),data=assert(getAddressSafe('tlcBoatPropulsion102Data')),interface=proof.interface,script=script}
 assert(cache.patch[1]==0xe9,'Rotor jump encoding changed')
 assert(cache.data&gt;cache.code and cache.data-cache.code&lt;0x1000,'Rotor allocation bounds changed');cache.codeBytes=assert(readBytes(cache.code,cache.data-cache.code,true))
 assert(writeDouble(cache.data+8,1)and writeInteger(cache.data+0x60,0x20504c54))
 _G.TLCBoatPropulsion102=cache;t.boatPropulsion=cache;return cache
end
function t.updateBoatPropulsion()
 local c=assert(t.boatPropulsion,'Boat propulsion hook unavailable');local proof=assert(t.rotorContract102)
 assert(c.site==proof.site and proof.pid==getOpenedProcessID(),'Rotor code identity changed')
 local ratio=readFloat(t.var(0xa0));assert(ratio and ratio==ratio and ratio&gt;0 and ratio&lt;math.huge,t.T('Boat speed multiplier must be a finite number greater than 0.','船の速度倍率は0より大きい有限の数値を指定してください。'))
 assert(writeDouble(c.data+8,ratio))
 local pc=t.playerController(false);local boat=pc and t.readObjectField074(pc,'AcknowledgedPawn');local rows,keys={},{}
 if t.valid(boat)and t.U.isA(boat,'VoyageBoatPawn')then
  local root=t.readObjectField074(boat,'RootComponent');local level=t.readObjectField074(boat,'LevelInstanceComponent')
  if not(t.valid(root)and t.valid(level))then assert(writeInteger(c.data+4,0));c.targets=nil;return end
  local owned=field(level,'OwnedActors',16,false);local array=readQword(level+owned);local count=readInteger(level+owned+8)
  assert(count and count&gt;=0 and count&lt;=4096 and(count==0 or array and array&gt;0x10000),'Invalid boat actor-list count')
  for i=0,count-1 do
   local actor=t.weak(array+i*8)
   if t.valid(actor)and t.U.isA(actor,'VoyageModuleRotorActor')then
    local parent=t.readObjectField074(actor,'RootComponent');local belongs=false;local seen={}
    for depth=1,64 do
     if parent==root then belongs=true;break end
     if not t.valid(parent)or seen[parent]then break end;seen[parent]=true;parent=t.readObjectField074(parent,'AttachParent')
    end
    if belongs then
     local vt=assert(readQword(actor+proof.interface));local matches=0
     for slot=0,15 do if readQword(vt+slot*8)==proof.first then matches=matches+1 end end
     assert(matches==1,'Rotor propulsion interface identity mismatch')
     local good,entry=t.valid(actor);assert(good);local id=assert(t.identity029(actor))
     rows[#rows+1]={actor+proof.interface,id.index,id.serial,entry};keys[#keys+1]=('%X:%d:%d'):format(actor,id.index,id.serial)
    end
   end
  end
 end
 assert(#rows&lt;=32,'Too many boat propellers');local key=table.concat(keys,';')
 if c.targets~=key then
  assert(writeInteger(c.data+4,0))
  for i,row in ipairs(rows)do local p=c.data+0x100+(i-1)*0x20;assert(writeQword(p,row[1])and writeInteger(p+8,row[2])and writeInteger(p+0x0c,row[3])and writeQword(p+0x10,row[4]))end
  c.targets=key;assert(writeInteger(c.data+4,#rows))
 end
 assert(writeBytes(c.data,1))
end
t.F.boatSpeed.task=t.updateBoatPropulsion
t.F.boatSpeed.on=function()
 t.require();t.requireSigs({'BoatPropulsionTarget'});local proof=assert(t.rotorContract102)
 t.installRotor102()
 local okay,why=pcall(t.updateBoatPropulsion)
 if not okay then t.stopBoatPropulsion();error(why,0)end
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key~='boatSpeed'then return check(key)end
 if not t.reflectionReady074 then return false,'Rotor metadata unavailable'end
 return true
end
t.compat038.portable.boatSpeed=true
end)(TLC)

-- Gameplay members are resolved by name; native getters prove container/value ABI.
;(function(t)
local function field(object,name,size,kind)
 local offset,actual=t.refFieldLayout(object,name,kind)
 assert(offset and actual==size,'Named field contract changed: '..name)
 return offset
end
local function bytes(address,count)
 local b=assert(readBytes(address,count,true));local out={};for i,v in ipairs(b)do out[i]=string.char(v)end;return table.concat(out)
end
local function relative(address)
 local d=assert(readInteger(address+1));if d&gt;=0x80000000 then d=d-0x100000000 end;return address+5+d
end
function t.resourceReadContract102()
 local cached=t.resourceRead102
 if cached and cached.pid==getOpenedProcessID()and t.sameIdentity029(cached.identity)then return cached end
 local cls=assert(t.refClass('VoyageModuleComponent'));local cdo=assert(t.defaultObject074(cls))
 local fn=assert(t.reflectedFunction069('VoyageModuleComponent','GetResourceAmount'))
 field(fn,'Type',1,'function');field(fn,'ReturnValue',8,'function')
 local entry=assert(readQword(fn+0xd8));local first,last=t.runtimeFunction074(entry)
 assert(first==entry and last-entry&lt;=512,'Resource getter wrapper scope unavailable')
 local ip=entry;local slot;local count=0
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;=1 and n&lt;=15)
  if n==6 and bytes(ip,2)=='\255\144'and bytes(ip-6,6)=='\72\139\207\72\139\7'then slot=readInteger(ip+2);count=count+1 end
  ip=ip+n
 end
 assert(count==1 and slot and slot%8==0,'Resource getter virtual dispatch is missing or ambiguous')
 local body=assert(readQword(assert(readQword(cdo))+slot));first,last=t.runtimeFunction074(body)
 assert(first==body and last-body&lt;=1024,'Resource getter implementation scope unavailable')
 local map=field(cls,'Resources',80,true);local helper;count=0;ip=first;local matchedMember=false
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;=1 and n&lt;=15)
  if n==7 and bytes(ip,3)=='\72\141\139'and readInteger(ip+3)==map then matchedMember=true end
  if n==5 and readBytes(ip,1)==0xe9 then helper=relative(ip);count=count+1 end
  ip=ip+n
 end
 assert(matchedMember and count==1 and helper and t.executable038(helper,128),'Resource getter map correspondence changed')
 local code=bytes(helper,128)
 -- The supported UE sparse-map reader must agree with the map header used by map().
 assert(code:sub(1,9)=='\139\65\8\76\139\201\59\65\52','Resource map header ABI changed')
 local scale=code:find('\72\141\12\64\65\56\20\200\73\141\4\200',1,true)
 assert(scale,'Resource map element addressing ABI changed')
 local value;count=0
 for i=1,#code-5 do if code:sub(i,i+3)=='\242\15\16\64'and code:byte(i+5)==0xc3 then value=code:byte(i+4);count=count+1 end end
 assert(count==1 and value and value+8&lt;=24,'Resource value return ABI changed')
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(fn)),fn=fn,map=map,stride=3*8,value=value,slot=slot,helper=helper}
 t.resourceRead102=c;return c
end
function t.batteryAddress()
 local player=t.player(false);local module=player and t.readObjectField074(player,'PlayerModuleComponent')
 if not module then return end
 assert(t.U.isA(module,'VoyageModuleComponent'),'Player battery module type changed')
 local c=t.resourceReadContract102();local enums=t.enumValues074('EModuleResourceType');local electricity=assert(enums.Electricity)
 for _,entry in ipairs(t.map(module+c.map,c.stride))do if readBytes(entry,1)==electricity then return entry+c.value,module end end
 return nil,module
end
function t.moduleResourceAPI102(name,fields)
 local fn=assert(t.reflectedFunction069('VoyageModuleComponent',name));local size=assert(readSmallInteger(fn+0xb6))
 assert(size&gt;0 and size&lt;=128,'Resource API parameter block changed: '..name)
 local result={fn=fn,size=size};for name,n in pairs(fields)do result[name]=field(fn,name,n,'function');assert(result[name]+n&lt;=size,'Resource API field exceeds parameter block')end
 local p=readQword(fn+0x50);local seen={};local count=0
 for i=1,128 do
  if not p or p==0 then break end;assert(not seen[p],'Resource API property cycle');seen[p]=true
  local flags=assert(readQword(p+0x38));if(flags&amp;0x80)~=0 then local name=t.U.name(readInteger(p+0x20));assert(fields[name],'Unexpected resource API parameter: '..name);count=count+1 end
  p=readQword(p+0x18)
 end
 local expected=0;for _ in pairs(fields)do expected=expected+1 end;assert(count==expected,'Resource API parameter list changed')
 return result
end
local function resourceAPIs()
 return t.moduleResourceAPI102('GetMaxResourceAmount',{Type=1,ReturnValue=8}),t.moduleResourceAPI102('GetResourceAmount',{Type=1,ReturnValue=8}),t.moduleResourceAPI102('AddResource',{Type=1,AddAmount=8,ReturnValue=8})
end
t.F.battery={on=function()
 t.need();local _,module=t.batteryAddress();assert(module,'Player battery unavailable');resourceAPIs()
end,task=function()
 if t.pendingJob then return end
 local _,module=t.batteryAddress();if not module then return end
 local maximum,current,add=resourceAPIs();local typ=assert(t.enumValues074('EModuleResourceType').Electricity)
 t.aimTankAtomicAdd092(module,typ,maximum,current,add,function()end,function(why)t.reason('battery',tostring(why));if t.featOn.battery then t.feature('battery',false)end end)
end}
function t.playerEditor(mr)
 t.require();t.clearChildren(mr);local player=t.player(true)
 local okay,reason=pcall(function()
  local c=t.survivalContract076();local stats=t.stats();local enum
  -- Enum identity is taken from the verified ChangeAttributeValue property, never a numeric label table.
  local property=t.property076(c.fn,'InType','function');local _,actual=t.enumProperty076(property);enum=actual
  for _,row in ipairs({{'Temperature','Temperature','温度'},{'Health','Health','体力'},{'Stamina','Stamina','スタミナ'},{'Charge','Battery','バッテリー'},{'Level','Level attribute','レベル属性'}})do
   local key=enum[row[1]];local address=key and stats[key]
   if address then t.addRec(mr,row[2],row[3],('%X'):format(address),vtSingle);t.addRec(mr,row[2]..' maximum',row[3]..'上限',('%X'):format(address+c.max-c.value),vtSingle)end
  end
 end)
 if not okay then t.reason('playerEditor',tostring(reason))end
 local movement=t.readObjectField074(player,'CharacterMovement')
 if movement then
  for _,row in ipairs({{'MaxWalkSpeed','Walk speed','歩行速度'},{'MaxWalkSpeedCrouched','Crouch speed','しゃがみ速度'},{'MaxSwimSpeed','Swim speed','水泳速度'},{'MaxFlySpeed','Fly speed','飛行速度'},{'JumpZVelocity','Jump velocity','ジャンプ初速'},{'GravityScale','Gravity scale','重力倍率'},{'MaxWalkSprintSpeedMultiplier','Sprint multiplier','走行倍率'}})do
   local off,size=t.refFieldLayout(movement,row[1],false)
   if off and size==4 then t.addRec(mr,row[2],row[3],('%X'):format(movement+off),vtSingle)else t.reason('playerEditor','Movement field unavailable: '..row[1])end
  end
 end
 local success,errorText=pcall(function()
  local address,module=t.batteryAddress();if address then t.addRec(mr,'Battery charge (game units)','バッテリー残量（ゲーム内部単位）',('%X'):format(address),vtDouble)end
  if module then
   local config=t.property076(readQword(module+0x10),'ConfigData',true);local struct=assert(readQword(config+0x70))
   local size=assert(readInteger(struct+0x58));local off=field(module,'ConfigData',size,false);local cap=field(struct,'MaxResourceAmount',8,'struct')
   t.addRec(mr,'Battery base capacity','バッテリー基本容量',('%X'):format(module+off+cap),vtDouble)
  end
 end)
 if not success then t.reason('playerEditor',tostring(errorText))end
 t.refreshPoints()
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='battery'then
  if not t.reflectionReady074 then return false,'Player battery metadata unavailable'end
  local okay,why=pcall(t.resourceReadContract102);if okay then return true end;return false,tostring(why)
 end
 return check(key)
end
local editor=t.playerEditor
function t.playerEditor(...)
 assert(t.reflectionReady074,'Player editor metadata unavailable')
 local prior=t.scope038;t.scope038='reflected player editor';local args=table.pack(...)
 local okay,result=pcall(function()return editor(table.unpack(args,1,args.n))end)
 t.scope038=prior;if not okay then error(result,0)end;return result
end
t.compat038.portable.battery=true
end)(TLC)

-- Replace the historical fixed-member timer core while preserving its higher-level consumers.
;(function(t)
local function report(key,why)
 t.reason(key,tostring(why))
end
local function attempt(key,fn)
 local okay,why=pcall(fn)
 if not okay then report(key,why)end
 return okay
end
function t.coreTick102()
 if not t.pid then return end
 if getOpenedProcessID()~=t.pid or getProcessIDFromProcessName(t.EXE)~=t.pid then t.forgetProcess();return end
 local b=t.base();if not b then return end
 local pending=t.pendingJob
 if pending then
  attempt('action',function()
   local block=b+0x500;local state=readInteger(block)
   if state==3 or state==4 then
    t.pendingJob=nil;local result=readQword(block+0x80)or 0;assert(writeInteger(block,0))
    if state==4 then if pending.cancelled074 then pending.cancelled074('target/world identity changed')end
    elseif pending.done then pending.done(result)end
   elseif state==1 and getTickCount()-pending.start&gt;15000 then
    assert(writeInteger(block,0));t.pendingJob=nil
    if pending.cancelled074 then pending.cancelled074('native dispatch timed out')end
    report('action',t.T('Native dispatch timed out.','ゲーム処理の実行が時間切れになりました。'))
   end
  end)
 end
 if t.drainActions025 then attempt('action',t.drainActions025)end
 -- Failed optional pointer reads are cleared in table-owned storage; they cannot abort peer tasks.
 local player,inventory,vault,movement
 attempt('player',function()player=t.player(false)end)
 local function object(name)
  local target
  attempt(name,function()target=player and t.readObjectField074(player,name)end)
  return target
 end
 if player then inventory=object('WeightInventory');vault=object('VaultInventory');movement=object('CharacterMovement')end
 for _,row in ipairs({{0x200,player},{0x220,inventory},{0x228,vault},{0x238,movement}})do assert(writeQword(b+row[1],row[2]or 0))end
 local marker={tostring(player)}
 for _,owner in ipairs({inventory or 0,vault or 0})do
  local data=0
  if owner~=0 then attempt('inventory',function()
   local off,size=t.refFieldLayout(owner,'Items',false);assert(off and size==80,'Inventory Items metadata unavailable');data=readQword(owner+off)or 0
  end)end
  marker[#marker+1]=tostring(owner)..'/'..tostring(data)
 end
 marker=table.concat(marker,';')
 if t.editorMarker and t.editorMarker~=marker then for _,id in ipairs({201,301})do local row=getAddressList().getMemoryRecordByID(id);if row then t.clearChildren(row)end end end
 t.editorMarker=marker
 -- Snapshot the key list: disabling one failed task must not skip another task.
 local keys={};for key in pairs(t.featOn)do keys[#keys+1]=key end;table.sort(keys)
 for _,key in ipairs(keys)do
  local feature=t.F[key]
  if t.featOn[key]and feature and feature.task then
   local okay,why=pcall(feature.task)
   if not okay then
    report(key,why)
    local restored,errorText=pcall(t.feature,key,false)
    if not restored then report(key,errorText)end
   end
  end
 end
end
local seen={};local replacements=0
local function replace(fn)
 if type(fn)~='function'or seen[fn]then return end;seen[fn]=true
 for i=1,100 do
  local name,value=debug.getupvalue(fn,i);if not name then break end
  if name=='tickBeforeGP'then debug.setupvalue(fn,i,t.coreTick102);replacements=replacements+1
  elseif type(value)=='function'then replace(value)end
 end
end
replace(t.tick);assert(replacements==1,'Historical timer core missing or ambiguous')
local portable=t.portableTick074
function t.portableTick074(...)
 local result=portable(...)
 if not t.attached()then return result end
 for _,key in ipairs({'boatSpeed','battery'})do
  if t.featOn[key]then
   local okay,why=pcall(t.F[key].task)
   if not okay then report(key,why);local restored,errorText=pcall(t.feature,key,false);if not restored then report(key,errorText)end end
  end
 end
 return result
end
end)(TLC)

-- Loaded-module enumeration and refill use reflected members and named resource APIs.
;(function(t)
local function field(object,name,size,kind)
 local off,actual=t.refFieldLayout(object,name,kind);assert(off and actual==size,'Storage field contract changed: '..name);return off
end
function t.modules()
 local player=t.player(false);local module=player and t.readObjectField074(player,'PlayerModuleComponent')
 local system=module and t.readObjectField074(module,'ModuleSubsystem');local out={}
 if not system then return out end
 assert(t.U.isA(system,'VoyageModuleSubsystem'),'Loaded module registry class changed')
 local property=t.property076(readQword(system+0x10),'LoadedModules',true)
 local key=assert(readQword(property+0x70));local value=assert(readQword(property+0x78))
 assert(readInteger(key+0x34)==8 and readInteger(value+0x34)==8,'Loaded module key/value types changed')
 local off=field(system,'LoadedModules',80,false);local layout=t.resourceReadContract102();local seen={}
 for _,row in ipairs(t.map(system+off,layout.stride))do
  local target=t.weak(row+layout.value)
  if target and not seen[target]then assert(t.U.isA(target,'VoyageModuleComponent'),'Loaded module value type mismatch');seen[target]=true;out[#out+1]=target end
 end
 return out
end
local function apis()
 return t.moduleResourceAPI102('GetMaxResourceAmount',{Type=1,ReturnValue=8}),t.moduleResourceAPI102('GetResourceAmount',{Type=1,ReturnValue=8}),t.moduleResourceAPI102('AddResource',{Type=1,AddAmount=8,ReturnValue=8})
end
local function config(module)
 local cls=readQword(module+0x10);local p=t.property076(cls,'ConfigData',true);local kind=assert(readQword(p+0x70))
 assert(t.valid(kind)and t.U.c(kind)=='ScriptStruct','Module config type unavailable')
 local size=assert(readInteger(kind+0x58));local off=field(module,'ConfigData',size,false)
 return module+off,kind
end
function t.storageTypes102(module)
 local enum=t.enumValues074('EModuleResourceType');local allowed={}
 for _,name in ipairs({'Electricity','Petrol','Oil','SaltWater','FreshWater','Methane','Oxygen','Steam','Diesel','CarbonDioxide'})do local v=assert(enum[name],'Storage resource enum missing: '..name);allowed[v]=true end
 local data,kind=config(module);local primary=readBytes(data+field(kind,'ModuleResourceType',1,'struct'),1)
 local candidates={};if allowed[primary]then candidates[primary]=true end
 local layout=t.resourceReadContract102()
 for _,row in ipairs(t.map(module+layout.map,layout.stride))do local typ=readBytes(row,1);if allowed[typ]then candidates[typ]=true end end
 local out={};for typ in pairs(candidates)do out[#out+1]=typ end;table.sort(out);return out
end
function t.cancelFeatureJob102(key)
 local pending=t.pendingJob
 if pending and pending.featureOwner102==key and readInteger(t.base()+0x500)==1 then
  assert(writeInteger(t.base()+0x500,0));t.pendingJob=nil
  if pending.cancelled074 then pending.cancelled074('feature disabled before dispatch')end
 end
end
t.F.fullTank={on=function()
 t.need();t.resourceReadContract102();apis();t.storageSweep102={index=1,resource=1,next=0}
end,off=function()t.storageSweep102=nil;t.cancelFeatureJob102('fullTank')end,task=function()
 local sweep=t.storageSweep102;if not sweep or t.pendingJob or t.pointTimer or(t.userActionDepth025 or 0)&gt;0 or #(t.actions025 or{})&gt;0 or getTickCount()&lt;sweep.next then return end
 local modules=t.modules();if #modules==0 then return end
 sweep.index=(sweep.index-1)%#modules+1;local module=modules[sweep.index];local types=t.storageTypes102(module)
 if #types==0 then sweep.index=sweep.index%#modules+1;sweep.resource=1;sweep.next=getTickCount()+50;return end
 sweep.resource=(sweep.resource-1)%#types+1;local typ=types[sweep.resource]
 if sweep.resource==#types then sweep.index=sweep.index%#modules+1;sweep.resource=1 else sweep.resource=sweep.resource+1 end
 local maximum,current,add=apis();sweep.next=getTickCount()+50
 t.aimTankAtomicAdd092(module,typ,maximum,current,add,function(before,capacity,requested,added,after,excluded)
  if excluded~='not_storage'then t.lastFilledTank={module=module,type=typ,maximum=capacity};t.tankFillHistory=t.tankFillHistory or{};t.tankFillHistory[module]=true end
 end,function(why)
  if t.featOn.fullTank then if t.isTransient157 and t.isTransient157(why)then sweep.next=getTickCount()+250;return end;t.reason('fullTank',tostring(why));t.feature('fullTank',false)end
 end)
 if t.pendingJob then t.pendingJob.featureOwner102='fullTank'end
end}
local battery=t.F.battery.task
t.F.battery.task=function()
 if t.pendingJob or(t.batteryCheck102 or 0)&gt;getTickCount()or(t.userActionDepth025 or 0)&gt;0 or #(t.actions025 or{})&gt;0 then return end
 t.batteryCheck102=getTickCount()+250;local result=battery();if t.pendingJob then t.pendingJob.featureOwner102='battery'end;return result
end
t.F.battery.off=function()t.cancelFeatureJob102('battery')end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='fullTank'then
  if not t.reflectionReady074 then return false,'Storage metadata unavailable'end
  local okay,why=pcall(t.resourceReadContract102);if okay then return true end;return false,tostring(why)
 end
 return check(key)
end
t.compat038.portable.fullTank=true
local portable=t.portableTick074
function t.portableTick074(...)
 local result=portable(...)
 if t.attached()and t.featOn.fullTank then local okay,why=pcall(t.F.fullTank.task);if not okay then t.reason('fullTank',tostring(why));local restored,errorText=pcall(t.feature,'fullTank',false);if not restored then t.reason('fullTank',tostring(errorText))end end end
 return result
end
end)(TLC)

;(function(t)
local template=t.HOOKS.noclip040.aa
local function field(object,name,size)
 local off,actual=t.refFieldLayout(object,name,false);assert(off and actual==size,'Free movement field contract changed: '..name);return off
end
local function code(a,n)local b=assert(readBytes(a,n,true));local s={};for i,v in ipairs(b)do s[i]=string.char(v)end;return table.concat(s)end
function t.ladderContract102()
 local old=t.ladder102;if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local getter=assert(t.reflectedFunction069('VoyageCharacter','IsUsingLadder'));local off,size=t.refFieldLayout(getter,'ReturnValue','function')
 assert(off==0 and size==1 and readSmallInteger(getter+0xb6)==1,'Ladder predicate return ABI changed')
 local a=assert(readQword(getter+0xd8));local b=code(a,32)
 local prefix='\72\139\66\32\69\51\201\72\133\192\65\15\149\193\76\3\200\76\137\74\32\15\182\129'
 assert(b:sub(1,#prefix)==prefix and b:sub(29,32)=='\65\136\0\195','Ladder predicate implementation changed')
 local member=string.unpack('&lt;I4',b,#prefix+1);assert(member&gt;=0x28 and member&lt;0x10000,'Ladder predicate member invalid')
 local exit=assert(t.reflectedFunction069('VoyageCharacter','ExitLadderIfUsing'));assert(readSmallInteger(exit+0xb6)==0,'Ladder exit parameters changed')
 a=assert(readQword(exit+0xd8));b=code(a,48)
 local lead='\72\139\66\32\69\51\192\72\133\192\65\15\149\192\76\3\192\76\137\66\32\128\185'
 assert(b:sub(1,#lead)==lead and string.unpack('&lt;I4',b,#lead+1)==member,'Ladder getter/exit member correspondence changed')
 assert(b:sub(28,35)=='\0\116\10\69\51\192\51\210'and b:byte(36)==0xe9 and b:byte(41)==0xc3,'Ladder exit argument/branch ABI changed')
 local d=assert(readInteger(a+36));if d&gt;=0x80000000 then d=d-0x100000000 end;local target=a+40+d
 local original=t.publishNative076('NoClipLadder040',target)
 local state={pid=getOpenedProcessID(),identity=assert(t.identity029(getter)),exitIdentity=assert(t.identity029(exit)),member=member,target=target,original=original}
 t.ladder102=state;return state
end
local resolve=t.resolveSig
function t.resolveSig(name)if name=='NoClipLadder040'then return t.ladderContract102().target end;return resolve(name)end
function t.freeMovementState102()
 local player=t.need();assert(t.controlledPawn(false)==player,t.T('Exit the vehicle before enabling free movement.','乗り物の操縦を解除してから自由移動を有効にしてください。'))
 local movement=t.readObjectField074(player,'CharacterMovement');local root=t.readObjectField074(player,'RootComponent')
 assert(movement and root and t.U.isA(movement,'VoyageCharacterMovementComponent'),'Free movement objects unavailable')
 local owner=t.componentOwnerOffset083();assert(readQword(movement+owner)==player,'Movement owner mismatch')
 local c={root=field(player,'RootComponent',8),movement=field(player,'CharacterMovement',8),input=field(player,'ControlInputVector',24),lastInput=field(player,'LastControlInputVector',24),velocity=field(movement,'Velocity',24),owner=owner,ladder=t.ladderContract102().member}
 return {player=player,movement=movement,root=root,world=t.world(),p=assert(t.identity029(player)),m=assert(t.identity029(movement)),r=assert(t.identity029(root)),layout=c}
end
function t.publishNoClip040()
 local state=assert(t.noclip040,'Free movement state unavailable');local d=assert(getAddressSafe('tlc_nc_data040'));local c=state.layout
 if not(t.world()==state.world and t.player(false)==state.player and t.controlledPawn(false)==state.player and t.sameIdentity029(state.p)and t.sameIdentity029(state.m)and t.sameIdentity029(state.r)and readQword(state.player+c.root)==state.root and readQword(state.player+c.movement)==state.movement)then
   assert(writeQword(d,0));local player=t.player(false)
   if player and t.controlledPawn(false)==player then t.F.noclip040.on()end
   return
  end
 local speed=readFloat(t.var(0xc8));assert(speed and speed==speed and speed&gt;0 and speed&lt;=10000,t.T('Free movement speed must be above 0 and at most 10000 cm/s.','自由移動速度は0より大きく10000cm/秒以下にしてください。'))
 local focus=getForegroundProcess()==t.pid
 assert(writeFloat(d+0x4c,speed)and writeFloat(d+0x50,focus and((isKeyPressed(0x20)and 1 or 0)-(isKeyPressed(0x11)and 1 or 0))or 0))
 assert(writeInteger(d+0x54,focus and 1 or 0)and writeFloat(d+0x48,0.6))
end
t.F.noclip040.on=function()
 t.requireSigs({'NoClipOffset040','NoClipLadder040'});local state=t.freeMovementState102();local c=state.layout
 local replacements={rcx={A8=c.owner},r10={['1B8']=c.root,E10=c.ladder,['2F0']=c.input,['300']=c.input+16,['308']=c.lastInput,['318']=c.lastInput+16},r11={D8=c.velocity,E8=c.velocity+16}}
 t.HOOKS.noclip040.aa=template:gsub('%[(%w+)%+([%x]+)%]',function(reg,old)local value=replacements[reg]and replacements[reg][old];if value then return('[%s+%X]'):format(reg,value)end;return('['..reg..'+'..old..']')end)
 t.noclip040=state
end
t.F.noclip040.task=t.publishNoClip040
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='noclip040'then
  if not t.reflectionReady074 then return false,'Free movement metadata unavailable'end
  return true
 end
 return check(key)
end
t.compat038.portable.noclip040=true
local portable=t.portableTick074
function t.portableTick074(...)
 local result=portable(...)
 if t.attached()and t.featOn.noclip040 then local okay,why=pcall(t.F.noclip040.task);if not okay then t.reason('noclip040',tostring(why));local restored,errorText=pcall(t.feature,'noclip040',false);if not restored then t.reason('noclip040',tostring(errorText))end end end
 return result
end
end)(TLC)

-- Object metadata and the engine/world path are separate capabilities.
;(function(t)
local function global(name)
 local okay,address=pcall(t.resolveSig,name)
 if not okay or not address then return nil,tostring(okay and t.missing(name)or address)end
 if name=='Objects'then
  local proof=t.objectBootstrap072
  if proof and proof.objects then return proof.objects end
 end
 local d=readInteger(address+3);if not d then return nil,'global displacement unreadable'end
 if d&gt;=0x80000000 then d=d-0x100000000 end
 local target=address+7+d;local image=assert(t.image038)
 if target&lt;image.base or target+8&gt;image.base+image.size then return nil,'global reference is outside the executable'end
 return target
end
function t.bootstrapValid038()
 local u=t.U;assert(u.go and u.gn,'Object/name metadata unavailable');u.names={}
 assert(u.name(0)=='None','Unreal name-pool layout not verified')
 local count=t.objectCount072();local chunks=readQword(u.go)
 assert(count and count&gt;=16 and count&lt;=4000000 and chunks and chunks&gt;0x10000,'Unreal object-array layout not verified')
 local verified=0
 for index=0,math.min(count-1,255)do
  local chunk=readQword(chunks+(index//65536)*8);local object=chunk and readQword(chunk+(index%65536)*24+8)
  if object and object&gt;0x10000 and readInteger(object+0x0c)==index and t.valid(object)and u.n(object)~='?'then verified=verified+1 end
 end
 assert(verified&gt;=8,'Unreal object identity checks failed')
 return true
end
function t.refreshMetadata074()
 local objects,objectReason=global('Objects');local names,nameReason=global('Names');local engine,engineReason=global('Engine')
 local u=t.U;u.go=objects;u.gc=t.objectBootstrap072 and t.objectBootstrap072.countAddress;u.gn=names;u.ge=nil;u.names={}
 local okay,why=false,nil
 if objects and names then okay,why=pcall(t.bootstrapValid038)end
 local capabilities={objects=okay==true,names=okay==true,engine=false,objectReason=objectReason,nameReason=nameReason,engineReason=engineReason}
 t.reflectionReady074=okay==true
 if not okay then
  local reasons={};if not objects then reasons[#reasons+1]='Objects: '..tostring(objectReason)end;if not names then reasons[#reasons+1]='Names: '..tostring(nameReason)end
  t.metadataReason074=#reasons&gt;0 and table.concat(reasons,'; ')or tostring(why)
  u.go=nil;u.gc=nil;u.gn=nil;u.names={}
 else
  t.metadataReason074=nil
  if engine then
   local object=readQword(engine)
   if t.valid(object)and u.isA(object,'Engine')then u.ge=engine;capabilities.engine=true
   else capabilities.engineReason='Engine object class/identity unavailable'end
  end
 end
 t.metadataCapabilities102=capabilities
 return t.reflectionReady074,t.metadataReason074
end
local worldFeatures={ammo=true,battery=true,boat=true,boatSpeed=true,clearWater=true,float=true,fullTank=true,gametime=true,health=true,instant=true,materials=true,noclip040=true,noon=true,speed=true,time=true,waves051=true,weather=true,weight=true,wind=true,fuel=true}
local check=t.checkFeature074
function t.checkFeature074(key)
 local capabilities=t.metadataCapabilities102
 if worldFeatures[key]and capabilities and not capabilities.engine then
  return false,t.T('Unavailable dependency: Engine / world path: ','依存先を取得できません: Engine／ワールドの参照経路: ')..tostring(capabilities.engineReason)
 end
 return check(key)
end
end)(TLC)

-- Human result/info layout comes from named script structs and parameter properties.
;(function(t)
local function field(object,name,size,kind)
 local off,actual=t.refFieldLayout(object,name,kind);assert(off and actual==size,'Human field contract changed: '..name);return off
end
local function structure(name)
 local object=assert(t.findMetadata074(name,'ScriptStruct'),'Human struct unavailable: '..name)
 local size=assert(readInteger(object+0x58));assert(size&gt;0 and size&lt;4096,'Human struct size invalid: '..name);return object,size
end
function t.humanLayout103()
 local cached=t.humanLayoutCache103;if cached and cached.pid==getOpenedProcessID()and t.sameIdentity029(cached.identity)then return cached end
 local result,resultSize=structure('VoyageHumanGrowResult');assert(resultSize&lt;=0x180,'Human result exceeds the owned work-buffer region')
 local info,infoSize=structure('VoyageHumanInfo');local progress,progressSize=structure('GameProgress')
 local cls=assert(t.refClass('VoyagePlayerState'));local trait=assert(t.refClass('VoyageItemMemoryTrait'));local traitClass=assert(t.refClass('VoyageItemMemoryTraitClass'))
 local requirement=structure('VoyageHumanPropertyRequirement')
 local property=t.property076(result,'Type','struct');local _,status=t.enumProperty076(property)
 local compare=t.property076(requirement,'Type','struct');local _,comparisons=t.enumProperty076(compare)
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(result)),result=result,resultSize=resultSize,info=info,infoSize=infoSize,progress=progress,progressSize=progressSize,
  progressOffset=field(cls,'PlayerGameProgress',progressSize,true),results=field(progress,'HumanGrow',16,'struct'),type=field(result,'Type',1,'struct'),id=field(result,'UniqueID',16,'struct'),timestamp=field(result,'Timestamp',8,'struct'),deliveryTimestamp=field(result,'DeliveryTimestamp',8,'struct'),
  traits=field(result,'Traits',80,'struct'),properties=field(result,'properties',80,'struct'),launched=assert(status.Delivered),grown=assert(status.Success),metadata=field(cls,'HumanGrowMetadata',8,true),
  traitClass=field(trait,'Class',8,true),profession=field(traitClass,'bShowAsTargetProfession',1,true),requires=field(trait,'Requires',80,true),requiresProperties=field(trait,'RequiresProperties',80,true),traitLevel=field(trait,'Level',4,true),
  propertyKey=field(assert(t.refClass('VoyageHumanProperty')),'Key',8,true),requirementValue=field(requirement,'Value',4,'struct'),requirementType=field(requirement,'Type',1,'struct'),greater=assert(comparisons.Greater),
  minimumHours=field(assert(t.refClass('VoyageHumanGrowMetadataAsset')),'MinHoursInSpaceForCommittee',4,true),infoLevel=field(info,'Level',4,'struct'),infoProfession=field(info,'Profession',16,'struct'),nameFields={}}
 for _,name in ipairs({'Title','FirstName','MiddleName','LastName'})do c.nameFields[#c.nameFields+1]=field(info,name,16,'struct')end
 local boolean=t.property076(traitClass,'bShowAsTargetProfession',true)
 local bits=assert(readBytes(boolean+0x70,4,true));local fieldSize,byteOffset,byteMask,fieldMask=bits[1],bits[2],bits[3],bits[4]
 assert(fieldSize==1 and byteOffset and byteOffset&lt;8 and byteMask and byteMask~=0 and fieldMask and fieldMask~=0,'Profession Boolean metadata changed')
 assert(fieldMask==0xff or(fieldMask&amp;(fieldMask-1))==0,'Profession Boolean mask is unsupported')
 c.profession=c.profession+byteOffset;c.professionMask=fieldMask
 local layout=t.resourceReadContract102();c.propertyStride=layout.stride;c.propertyValue=layout.value;c.traitStride=layout.stride-8
 t.humanLayoutCache103=c;return c
end
function t.humanContext103()
 assert(t.reflectionReady074,'Human metadata unavailable');local c=t.humanLayout103()
 local prior=t.scope038;t.scope038='verified human metadata';local okay,why=pcall(t.need);t.scope038=prior;if not okay then error(why,0)end
 local pc=t.playerController(true);local ps=t.readObjectField074(pc,'PlayerState')
 assert(ps and t.U.isA(ps,'VoyagePlayerState'),'Human player state unavailable')
 local array=ps+c.progressOffset+c.results;local data,count,capacity=readQword(array),readInteger(array+8),readInteger(array+12)
 assert(count and capacity and count&gt;=0 and count&lt;=capacity and capacity&lt;=10000 and(count==0 or data and data&gt;0x10000),'Invalid human result array')
 return ps,data,count
end
local function text(address)
 local p,n,capacity=readQword(address),readInteger(address+8),readInteger(address+12)
 assert(n and capacity and n&gt;=0 and n&lt;=capacity and capacity&lt;=1024,'Human FString is invalid')
 if n&lt;=1 then return ''end
 assert(p and p&gt;0x10000 and readSmallInteger(p+(n-1)*2)==0,'Human FString is not terminated')
 return assert(readString(p,(n-1)*2,true))
end
function t.humanResult103(id)
 local ps,data,count=t.humanContext103();local c=t.humanLayout103();local found
 for index=0,count-1 do local result=data+index*c.resultSize;if text(result+c.id)==id then assert(not found,'Duplicate human ID');found=result end end
 assert(found,t.T('This human no longer exists. Refresh the list.','対象の人間を取得できません。一覧を再取得してください。'))
 return found,ps
end
function t.humanProperties103(result,labels)
 local c=t.humanLayout103();local out={}
 for _,row in ipairs(t.map(result+c.properties,c.propertyStride))do
  local asset=readQword(row);assert(t.valid(asset)and t.U.isA(asset,'VoyageHumanProperty'),'Human property asset unavailable')
  local key=t.U.name(readInteger(asset+c.propertyKey));local label=labels[key]
  if label then out[#out+1]={asset=asset,key=key,label=label,value=assert(readDouble(row+c.propertyValue)),address=row+c.propertyValue}end
 end
 return out
end
function t.humanList103()
 local ps,data,count=t.humanContext103();local c=t.humanLayout103();local out={}
 for index=0,count-1 do
  local result=data+index*c.resultSize
  if readBytes(result+c.type,1)==c.launched then
   local id=text(result+c.id);assert(#id==32 and id:match('^[A-Fa-f0-9]+$'),'Invalid human social ID')
   out[#out+1]={id=id}
  end
 end
 return out
end
local function raw(a,n)local b=assert(readBytes(a,n,true));local out={};for i,v in ipairs(b)do out[i]=string.char(v)end;return table.concat(out)end
local function instructions(first,last)
 assert(first and last and last&gt;first and last-first&lt;=8192,'Human native function scope unavailable')
 local out={};local ip=first
 while ip&lt;last do local size=assert(getInstructionSize(ip));assert(size&gt;=1 and size&lt;=15 and ip+size&lt;=last);out[#out+1]={a=ip,b=raw(ip,size)};ip=ip+size end
 return out
end
local function target(ins)local d=string.unpack('&lt;i4',ins.b,2);return ins.a+5+d end
local function member(ins,prefix)
 if #ins.b==#prefix+4 and ins.b:sub(1,#prefix)==prefix then return string.unpack('&lt;I4',ins.b,#prefix+1)end
end
local function stack(ins,prefix8,prefix32)
 if #ins.b==#prefix8+1 and ins.b:sub(1,#prefix8)==prefix8 then return string.unpack('&lt;i1',ins.b,#prefix8+1)end
 if #ins.b==#prefix32+4 and ins.b:sub(1,#prefix32)==prefix32 then return string.unpack('&lt;i4',ins.b,#prefix32+1)end
end
function t.humanStructOps103(kind)
 local cached=t.humanStructOperations103 and t.humanStructOperations103[kind]
 if cached and cached.pid==getOpenedProcessID()and t.sameIdentity029(cached.identity)then return cached end
 local c=t.humanLayout103();local object=kind=='result'and c.result or c.info
 local size=kind=='result'and c.resultSize or c.infoSize;local alignment=assert(readSmallInteger(object+0x5c))
 local image=assert(t.image038);local candidates={};local seen={}
 local class=assert(readQword(object+0x10));local objectSize=assert(readInteger(class+0x58))
 assert(objectSize&gt;=0x80 and objectSize&lt;=0x1000,'Script-struct metadata object size unavailable')
 for offset=0x60,objectSize-8,8 do
  local pointer=readQword(object+offset)
  if pointer and pointer&gt;0x10000 and pointer%8==0 and readInteger(pointer+8)==size and readInteger(pointer+12)==alignment then
   local descriptor=readQword(pointer)
   if descriptor and descriptor&gt;=image.base and descriptor+0x40&lt;=image.base+image.size and not t.executable038(descriptor,1)and not seen[descriptor]then
    seen[descriptor]=true
    for position=0,0x28,8 do
     local ctor,dtor,copy=readQword(descriptor+position),readQword(descriptor+position+8),readQword(descriptor+position+16)
     if t.executable038(ctor,8)and t.executable038(dtor,5)and t.executable038(copy,16)and readBytes(dtor,1)==0xe9 then
      local okay,a,z=pcall(t.runtimeFunction074,copy)
      if okay and a==copy and z-a&lt;=4096 then
       local body=instructions(a,z);local countABI,returnsTrue=false,false
       for i,row in ipairs(body)do
        local b=row.b
        if i&lt;=24 and #b==3 then local rex,op,mod=b:byte(1,3);if(rex&amp;0xf9)==0x41 and op==0x8b and(mod&amp;0xc7)==0xc0 then countABI=true end end
        returnsTrue=returnsTrue or b=='\176\1'
       end
       if countABI and returnsTrue then
        local displacement=assert(readInteger(dtor+1));if displacement&gt;=0x80000000 then displacement=displacement-0x100000000 end
        local destroy=dtor+5+displacement
        if t.executable038(destroy,16)then candidates[#candidates+1]={ctor=ctor,copy=copy,destroy=destroy,descriptor=descriptor,size=size,kind=kind}end
       end
      end
     end
    end
   end
  end
 end
 assert(#candidates==1,'Human '..kind..' struct operations are missing or ambiguous')
 local operations=candidates[1]
 if kind=='result'then
  local first,last=t.runtimeFunction074(operations.copy);local body=instructions(first,last)
  local fields={id=c.id,traits=c.traits,properties=c.properties};local bindings={}
  for i,row in ipairs(body)do
   local source=member(row,'\72\141\147')or stack(row,'\72\141\83','\72\141\147')
   if source then
    for name,off in pairs(fields)do if source==off then
     for j=i+1,math.min(i+6,#body)do
      local dest=member(body[j],'\72\141\143')or stack(body[j],'\72\141\79','\72\141\143')
      if dest==off then
       for k=j+1,math.min(j+3,#body)do
        local b=body[k].b
        if #b==5 and b:byte(1)==0xe8 then assert(not bindings[name],'Human struct member copy is ambiguous: '..name);bindings[name]=target(body[k]);break end
        local op=b:sub(1,3)
        if op~='\72\139\67'and op~='\72\139\131'and op~='\72\137\71'and op~='\72\137\135'then break end
       end
      end
     end
    end end
   end
  end
  assert(bindings.id and bindings.traits and bindings.properties,('Human struct copy/member correspondence changed: id=%s traits=%s properties=%s copy=%X'):format(tostring(bindings.id),tostring(bindings.traits),tostring(bindings.properties),operations.copy))
  for _,offset in ipairs({c.timestamp,c.deliveryTimestamp})do
   local matched=false
   for i,row in ipairs(body)do
    local source=member(row,'\72\139\131')or stack(row,'\72\139\67','\72\139\131')
    if source==offset then
     for j=i+1,math.min(i+3,#body)do local dest=member(body[j],'\72\137\135')or stack(body[j],'\72\137\71','\72\137\135');if dest==offset then matched=true;break end end
    end
   end
   assert(matched,'Human timestamp metadata/native copy correspondence changed')
  end
  operations.stringCopy=bindings.id;operations.traitCopy=bindings.traits;operations.propertyCopy=bindings.properties
  t.publishNative076('HumanCopy033',operations.copy);t.publishNative076('HumanDestroy033',operations.destroy)
  t.publishNative076('HumanStringCopy033',operations.stringCopy);t.publishNative076('HumanTraitCopy034',operations.traitCopy);t.publishNative076('HumanPropertyCopy034',operations.propertyCopy)
 end
 operations.pid=getOpenedProcessID();operations.identity=assert(t.identity029(object));t.humanStructOperations103=t.humanStructOperations103 or{};t.humanStructOperations103[kind]=operations
 return operations
end
function t.copyHumanResult103(destination,source,guard,done)
 local operations=t.humanStructOps103('result')
 t.job(operations.ctor,{destination},guard,function()
  t.job(operations.copy,{destination,source,1},guard,done)
 end)
end
local resolveHuman=t.resolveSig
function t.resolveSig(name)
 if name=='HumanCopy033'or name=='HumanDestroy033'or name=='HumanStringCopy033'or name=='HumanTraitCopy034'or name=='HumanPropertyCopy034'then
  t.humanStructOps103('result');return t.A[name]
 end
 return resolveHuman(name)
end
function t.humanNativeInfoContract103()
 local old=t.humanNativeInfo103;if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local c=t.humanLayout103();local fn=assert(t.reflectedFunction069('VoyagePlayerState','GetSimulatedHumanInfo'))
 local entry=assert(readQword(fn+0xd8));local first,last=t.runtimeFunction074(entry);local wrapper=instructions(first,last)
 local getter,count=nil,0;local savesThis,savesReturn=false,false
 for i,row in ipairs(wrapper)do
  if i&lt;=24 then savesThis=savesThis or row.b=='\72\139\241';savesReturn=savesReturn or row.b=='\77\139\240'end
  if row.b:byte(1)==0xe8 and #row.b==5 then
   for j=i+1,math.min(i+4,#wrapper)do if wrapper[j].b=='\65\136\6'then getter=target(row);count=count+1 end end
  end
 end
 assert(savesThis and savesReturn and count==1,'Human info return-producing call ABI changed')
 first,last=t.runtimeFunction074(getter);local native=instructions(first,last);local candidates={}
 for _,row in ipairs(native)do if #row.b==5 and row.b:byte(1)==0xe8 then
  local callee=target(row);local okay,a,z=pcall(t.runtimeFunction074,callee)
  if okay and a==callee and z-a&lt;=4096 then
   local body=instructions(a,z)
   for i,ins in ipairs(body)do
    if member(ins,'\76\139\137')==c.metadata then
     local counter,simulation,info,infoIndex,temp
     for j=i+1,math.min(i+12,#body)do
      counter=counter or member(body[j],'\76\141\129')
      simulation=simulation or member(body[j],'\72\141\185')
      temp=temp or stack(body[j],'\72\141\76\36','\72\141\140\36')
      if body[j].b:byte(1)==0xe8 and #body[j].b==5 then info=target(body[j]);infoIndex=j;break end
     end
     if counter and simulation and info and temp then
      local validOffset,destructor;local destructorCount=0
      for j=infoIndex+1,#body do
       local b=body[j].b
       if #b==8 and b:sub(1,3)=='\128\188\36'and b:byte(8)==0 then local v=string.unpack('&lt;i4',b,4)-temp;if v&gt;=0 and v&lt;c.infoSize then validOffset=v end end
       if stack(body[j],'\72\141\76\36','\72\141\140\36')==temp and body[j+1]and body[j+1].b:byte(1)==0xe8 and #body[j+1].b==5 then destructor=target(body[j+1]);destructorCount=destructorCount+1 end
      end
      if validOffset and destructorCount==1 then candidates[#candidates+1]={counter=counter,simulation=simulation,info=info,valid=validOffset,destructor=destructor}end
     end
    end
   end
  end
 end end
 assert(#candidates==1,'Human info calculation/destruction relationship missing or ambiguous');local result=candidates[1]
 -- Independently bind the private simulation member to its named getter and reflected Humans field.
 local sim,simSize=structure('VoyageHumanSimulation');local humans=field(sim,'Humans',80,'struct')
 local simFn=assert(t.reflectedFunction069('VoyagePlayerState','GetHumanSimulation'));field(simFn,'ReturnValue',simSize,'function')
 entry=assert(readQword(simFn+0xd8));first,last=t.runtimeFunction074(entry);count=0
 for _,row in ipairs(instructions(first,last))do if member(row,'\72\141\145')==result.simulation+humans then count=count+1 end end
 assert(count==1,'Human simulation getter/member correspondence changed')
 assert(result.counter&gt;=0x28 and result.counter&lt;0x10000 and result.simulation&gt;=0x28 and result.simulation&lt;0x10000,'Human private member displacement invalid')
 local operations=t.humanStructOps103('info');assert(operations.destroy==result.destructor,'Human info API/struct destructor correspondence changed')
 t.publishNative076('HumanInfo034',result.info);t.publishNative076('HumanInfoDestroy034',result.destructor)
 result.pid=getOpenedProcessID();result.identity=assert(t.identity029(fn));t.humanNativeInfo103=result;return result
end
function t.humanInfo103(id,values,profession,done)
 local result,ps=t.humanResult103(id);local c=t.humanLayout103();local fn=assert(t.reflectedFunction069('VoyagePlayerState','GetSimulatedHumanInfo'))
 local size=assert(readSmallInteger(fn+0xb6));assert(size&gt;0 and size&lt;=0x1000,'Human information parameter block too large')
 local input=field(fn,'InResult',c.resultSize,'function');local output=field(fn,'OutInfo',c.infoSize,'function');local success=field(fn,'ReturnValue',1,'function')
 assert(input+c.resultSize&lt;=size and output+c.infoSize&lt;=size and success&lt;size,'Human information parameter bounds changed')
 local native=t.humanNativeInfoContract103()
 local buffer=assert(allocateMemory(size+0x400),'Human information allocation failed');local zero={};for i=1,size do zero[i]=0 end;assert(writeBytes(buffer,zero))
 assert(writeBytes(buffer+input,assert(readBytes(result,c.resultSize,true))));assert(writeBytes(buffer+input+c.type,c.grown))
 local world=assert(t.identity029(t.world()));local owner=assert(t.identity029(ps));local identity=assert(t.identity029(fn))
 local function alive()assert(t.sameIdentity029(world)and t.sameIdentity029(owner)and t.sameIdentity029(identity),'Human information world/object changed')end
 local function query()
  local function completed()
   alive();local good=values and readBytes(buffer+output+native.valid,1)~=0 or not values and readBytes(buffer+success,1)~=0
   assert(good,'Game did not produce human information')
   local info=buffer+output;local parts={};for _,offset in ipairs(c.nameFields)do local s=text(info+offset);if s~=''then parts[#parts+1]=s end end
   local name=table.concat(parts,' ');local level=readInteger(info+c.infoLevel)
   local convert=t.apiContract075('KismetTextLibrary','Conv_TextToString')
   t.apiInvoke075(convert,{InText=assert(readBytes(info+c.infoProfession,16,true))},function(frame)
    alive();local professionName=t.readApiString075(frame+t.apiMember075(convert,'ReturnValue',16))
    t.job(t.A.HumanInfoDestroy034,{info},ps,function()
     alive()
     local function finish()deAlloc(buffer);if done then done(name,professionName,level)end end
     -- A preview with changed traits owns its copy; a normal read borrows only input data.
     if values then t.job(t.A.HumanDestroy033,{buffer+input},ps,finish)else finish()end
    end)
   end)
  end
  if values then
   local metadata=t.readObjectField074(ps,'HumanGrowMetadata');assert(metadata and t.U.isA(metadata,'VoyageHumanGrowMetadataAsset'),'Human metadata unavailable')
   t.job(native.info,{buffer+output,buffer+input,ps+native.counter,metadata,ps+native.simulation,0},{ps,metadata},completed)
  else t.job(t.processEvent074(ps),{ps,fn,buffer},{ps,fn},completed)end
 end
 if values then
  t.requireSigs({'HumanCopy033','HumanDestroy033'});local empty={};for i=1,c.resultSize do empty[i]=0 end;assert(writeBytes(buffer+input,empty))
  t.copyHumanResult103(buffer+input,result,ps,function()
   alive();assert(writeBytes(buffer+input+c.type,c.grown))
   for _,row in ipairs(t.map(buffer+input+c.properties,c.propertyStride))do local asset=readQword(row);assert(t.valid(asset));local key=t.U.name(readInteger(asset+c.propertyKey));local value=values[key];if value~=nil then assert(type(value)=='number'and value==value and math.abs(value)&lt;=1000000,'Invalid human preview value');assert(writeDouble(row+c.propertyValue,value))end end
   t.prepareHumanValues034(buffer+input,values,ps,function()t.prepareHumanProfession034(buffer+input,profession,ps,query)end)
  end)
 else query()end
end
-- Keep the existing user interface; replace its native-cache readers with named APIs.
function t.readHumanName042(id,done)
 t.humanInfo103(id,nil,nil,function(name)
  assert(name~=''and name~=id,'Game did not produce a human name');local ps=t.humanContext103()
  local cache=t.humanNames042
  if not cache or cache.ps~=ps or cache.pid~=t.pid or cache.world~=t.world()or not t.sameIdentity029(cache.identity)then cache={pid=t.pid,ps=ps,identity=assert(t.identity029(ps)),world=t.world(),names={}};t.humanNames042=cache end
  cache.names[id:upper()]=name;if done then done(name)end
 end)
end
function t.humanPredict034(id,values,done,profession)
 t.humanInfo103(id,values,profession,function(_,professionName,level)if done then done(t.professionText103 and t.professionText103(professionName)or professionName,level,professionName)end end)
end
local editor=t.humanEditor033
function t.humanEditor033(...)
 assert(t.reflectionReady074,'Human metadata unavailable');t.humanLayout103()
 local prior=t.scope038;t.scope038='verified human editor';local args=table.pack(...)
 local okay,result=pcall(function()return editor(table.unpack(args,1,args.n))end);t.scope038=prior
 if not okay then error(result,0)end;return result
end
for _,name in ipairs({'humanApply033','humanAdd033','humanApplyProfession034','setHumanSpace035','humanApplySpace035'})do
 local action=t[name]
 t[name]=function(...)t.humanStructOps103('result');return action(...)end
end
end)(TLC)

-- Inventory enumeration uses named properties and a verified native map getter.
;(function(t)
local function field(object,name,size,kind)
 local offset,actual=t.refFieldLayout(object,name,kind)
 assert(offset and actual==size,'Inventory field contract changed: '..name)
 return offset
end
local function bytes(address,count)
 local data=assert(readBytes(address,count,true));local result={}
 for i,v in ipairs(data)do result[i]=string.char(v)end;return table.concat(result)
end
function t.inventoryLayout104()
 local cached=t.inventoryLayoutCache104
 if cached and cached.pid==getOpenedProcessID()and t.sameIdentity029(cached.identity)then return cached end
 local cls=assert(t.refClass('VoyageBaseInventoryComponent'))
 local serial=assert(t.findMetadata074('VoyageItemSerialize','ScriptStruct'))
 local data=assert(t.findMetadata074('VoyageItemData','ScriptStruct'))
 local serialSize=assert(readInteger(serial+0x58));local dataSize=assert(readInteger(data+0x58))
 local serialAlign=assert(readSmallInteger(serial+0x5c));assert(serialAlign==8 and serialSize&gt;0 and serialSize&lt;=4096)
 local items=field(cls,'Items',80,true)
 local fn=assert(t.reflectedFunction069('VoyageBaseInventoryComponent','GetItemsMap'))
 field(fn,'ReturnValue',80,'function')
 local entry=assert(readQword(fn+0xd8));local first,last=t.runtimeFunction074(entry)
 assert(first==entry and last-entry&lt;=512,'Inventory getter wrapper scope changed')
 local ip=first;local slot;local count=0
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15)
  if n==6 and bytes(ip,2)=='\255\144'then slot=readInteger(ip+2);count=count+1 end
  ip=ip+n
 end
 assert(count==1 and slot and slot%8==0,'Inventory getter dispatch is missing or ambiguous')
 local cdo=assert(t.defaultObject074(cls));local body=assert(readQword(assert(readQword(cdo))+slot))
 assert(t.executable038(body,8),'Inventory getter is not executable')
 assert(bytes(body,3)=='\72\141\129'and readInteger(body+3)==items and bytes(body+7,1)=='\195','Inventory getter/member correspondence changed')
 -- Integer key + aligned reflected value + UE sparse-map hash links.
 local resource=t.resourceReadContract102();assert(resource.stride==24 and resource.value==8,'Sparse-map ABI is not verified')
 local value=serialAlign;local stride=((value+serialSize+7)//8)*8+8
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(serial)),items=items,value=value,stride=stride,assetType=field(serial,'AssetType',8,'struct'),
  name=field(serial,'AssetName',8,'struct'),data=field(serial,'Data',dataSize,'struct'),count=field(data,'ItemCount',4,'struct'),serialSize=serialSize,dataSize=dataSize}
 assert(c.data+dataSize&lt;=serialSize and c.name+8&lt;=serialSize and c.count+4&lt;=dataSize,'Inventory fields exceed structure bounds')
 t.inventoryLayoutCache104=c;return c
end
function t.inventoryRows104(inv)
 assert(t.valid(inv)and t.U.isA(inv,'VoyageBaseInventoryComponent'),'Inventory object type changed')
 local c=t.inventoryLayout104();local result={}
 for _,row in ipairs(t.map(inv+c.items,c.stride))do
  local value=row+c.value;local name=t.U.name(readInteger(value+c.name));local number=readInteger(value+c.name+4)or 0
  if number&gt;0 then name=name..'_'..(number-1)end
  local slot=assert(readInteger(row));local count=assert(readInteger(value+c.data+c.count))
  assert(slot&gt;=0 and count&gt;=0,'Inventory slot/count is invalid')
  result[#result+1]={slot=slot,name=name,count=count,data=value+c.data,row=row}
 end
 return result
end
local function functionCode(address)
 local first,last=t.runtimeFunction074(address);assert(first==address and last-first&lt;=4096,'Inventory native function scope changed')
 local result={};local ip=first
 while ip&lt;last do local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15);result[#result+1]={a=ip,b=bytes(ip,n)};ip=ip+n end
 return result
end
local function relative(row)
 local d=string.unpack('&lt;i4',row.b,2);return row.a+5+d
end
function t.inventoryMutationContract104()
 local old=t.inventoryMutationCache104
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local c=t.inventoryLayout104();local serial=assert(t.findMetadata074('VoyageItemSerialize','ScriptStruct'))
 local cls=assert(t.refClass('VoyageBaseInventoryComponent'));local cdo=assert(t.defaultObject074(cls));local vt=assert(readQword(cdo))
 local function dispatch(name,parameters)
  local fn=assert(t.reflectedFunction069('VoyageBaseInventoryComponent',name))
  for name,size in pairs(parameters)do field(fn,name,size,'function')end
  local slots={}
  for _,row in ipairs(functionCode(assert(readQword(fn+0xd8))))do
   if #row.b==6 and row.b:sub(1,2)=='\255\144'then slots[#slots+1]=string.unpack('&lt;I4',row.b,3)end
  end
  assert(#slots==1 and slots[1]%8==0,'Inventory API dispatch changed: '..name)
  return assert(readQword(vt+slots[1])),slots[1],fn
 end
 local get,getSlot,getFn=dispatch('GetSlot',{SlotIndex=4,OutItemData=c.serialSize,ReturnValue=1})
 local set,setSlot,setFn=dispatch('SetSlotData',{SlotIndex=4,InItemData=c.dataSize,Notify=1,ReturnValue=1})
 local dataCopy;local notify;local matches=0
 for _,row in ipairs(functionCode(set))do
  if #row.b==5 and row.b:byte(1)==0xe8 then dataCopy=relative(row);matches=matches+1 end
  if #row.b==6 and row.b:sub(1,2)=='\255\144'then assert(not notify,'Inventory notification dispatch is ambiguous');notify=string.unpack('&lt;I4',row.b,3)end
 end
 assert(matches==1 and dataCopy and notify and notify%8==0,'Inventory update/callback contract changed')
 -- Struct ops are selected by metadata size/alignment and the same data-copy callee.
 local metadataSize=assert(readInteger(assert(readQword(serial+0x10))+0x58));assert(metadataSize&gt;=0x80 and metadataSize&lt;=4096)
 local alignment=assert(readSmallInteger(serial+0x5c));local candidates={};local seen={}
 for off=0x60,metadataSize-8,8 do
  local p=readQword(serial+off)
  if p and p&gt;0x10000 and p%8==0 and readInteger(p+8)==c.serialSize and readInteger(p+12)==alignment then
   local descriptor=readQword(p)
   if descriptor and t.image038 and descriptor&gt;=t.image038.base and descriptor+0x40&lt;t.image038.base+t.image038.size and not seen[descriptor]then
    seen[descriptor]=true
    for pos=0,0x28,8 do
     local ctor,dtor,copy=readQword(descriptor+pos),readQword(descriptor+pos+8),readQword(descriptor+pos+16)
     if t.executable038(ctor,8)and t.executable038(dtor,8)and t.executable038(copy,8)then
      local okay,code=pcall(functionCode,copy)
      if okay then
       local calls=0;local stride=false;local countABI=false
       for _,row in ipairs(code)do
        if #row.b==5 and row.b:byte(1)==0xe8 and relative(row)==dataCopy then calls=calls+1 end
        if #row.b==7 and row.b:sub(1,3)=='\72\129\195'and string.unpack('&lt;I4',row.b,4)==c.serialSize then stride=true end
        if row.b=='\65\139\248'and countABI==false then countABI=true end
       end
       if calls==1 and stride and countABI then candidates[#candidates+1]={ctor=ctor,destroy=dtor,copy=copy}end
      end
     end
    end
   end
  end
 end
 assert(#candidates==1,'Inventory struct lifecycle is missing or ambiguous')
 local result=candidates[1];result.get=get;result.set=set;result.getSlot=getSlot;result.setSlot=setSlot;result.notify=notify;result.layout=c
 result.pid=getOpenedProcessID();result.identity=assert(t.identity029(serial));result.getIdentity=assert(t.identity029(getFn));result.setIdentity=assert(t.identity029(setFn))
 t.inventoryMutationCache104=result;return result
end
local function sameWorker(s)
 if not s or s.pid~=getOpenedProcessID()or getAddressSafe('tlcInventoryWorker104')~=s.code then return false end
 local current=readBytes(s.code,#s.bytes,true);if not current then return false end
 for i,b in ipairs(s.bytes)do if current[i]~=b then return false end end;return true
end
function t.inventoryWorker104(c)
 local state=t.inventoryWorkerState104
 if sameWorker(state)and state.layoutIdentity==c.identity.object then return state end
 assert(not getAddressSafe('tlcInventoryWorker104'),'Unowned inventory worker symbol; no changes made')
 local l=c.layout
 local script=([==[
[ENABLE]
alloc(tlcInventoryWorker104,$1000,%X)
registersymbol(tlcInventoryWorker104)
registersymbol(tlcInventoryWorker104End)
label(tlcInventoryWorker104End)
label(tlcInventoryWorker104Missing)
label(tlcInventoryWorker104Stale)
label(tlcInventoryWorker104Destroy)
tlcInventoryWorker104:
push rbx
push rsi
sub rsp,28
mov rbx,rcx
mov rsi,[rbx+28]
mov rcx,rsi
call qword ptr [rbx+08]
mov rcx,[rbx]
mov edx,[rbx+30]
mov r8,rsi
call qword ptr [rbx+10]
test al,al
jz tlcInventoryWorker104Missing
mov rax,[rsi+%X]
cmp rax,[rbx+40]
jne tlcInventoryWorker104Stale
mov rax,[rsi+%X]
cmp rax,[rbx+48]
jne tlcInventoryWorker104Stale
mov eax,[rsi+%X]
mov [rbx+50],eax
cmp eax,[rbx+34]
jne tlcInventoryWorker104Stale
mov eax,[rbx+38]
mov [rsi+%X],eax
mov rcx,[rbx]
mov edx,[rbx+30]
lea r8,[rsi+%X]
mov r9d,1
call qword ptr [rbx+18]
mov [rbx+54],al
mov dword ptr [rbx+3C],1
jmp tlcInventoryWorker104Destroy
tlcInventoryWorker104Missing:
mov dword ptr [rbx+3C],2
jmp tlcInventoryWorker104Destroy
tlcInventoryWorker104Stale:
mov dword ptr [rbx+3C],3
tlcInventoryWorker104Destroy:
mov rcx,rsi
call qword ptr [rbx+20]
mov eax,[rbx+3C]
add rsp,28
pop rsi
pop rbx
ret
tlcInventoryWorker104End:
[DISABLE]
]==]):format(t.moduleRequired(),l.name,l.assetType,l.data+l.count,l.data+l.count,l.data)
 local okay,why=autoAssemble(script);assert(okay,tostring(why))
 local code=assert(getAddressSafe('tlcInventoryWorker104'));local finish=assert(getAddressSafe('tlcInventoryWorker104End'))
 assert(finish&gt;code and finish-code&lt;0x400,'Inventory worker assembly bounds changed')
 state={code=code,bytes=assert(readBytes(code,finish-code,true)),pid=getOpenedProcessID(),layoutIdentity=c.identity.object,buffer=assert(allocateMemory(math.max(4096,l.serialSize+0x100)))}
 t.inventoryWorkerState104=state;return state
end
local executable=t.executable038
function t.executable038(address,length)
 local state=t.inventoryWorkerState104
 if state and address==state.code and(length or 1)&lt;=#state.bytes and sameWorker(state)then return true end
 return executable(address,length)
end
function t.setQuantity(inv,slot,name,old,new,done)
 t.require();assert(type(new)=='number'and new==new and new%1==0 and new&gt;=0 and new&lt;=999999,'Quantity must be an integer from 0 to 999999')
 if new==old then if done then done()end;return end
 assert(not t.pendingJob,'Native action already pending')
 local id=assert(t.identity029(inv));local c=t.inventoryMutationContract104();local vtable=assert(readQword(inv))
 assert(readQword(vtable+c.getSlot)==c.get and readQword(vtable+c.setSlot)==c.set,'Inventory overrides are not verified; no changes made')
 local selected
 for _,row in ipairs(t.inventoryRows104(inv))do if row.slot==slot and row.name==name and row.count==old then selected=row;break end end
 assert(selected,'Inventory contents changed; refresh the editor')
 local state=t.inventoryWorker104(c);local p=state.buffer;local zero={};for i=1,0x100 do zero[i]=0 end;assert(writeBytes(p,zero))
 for _,entry in ipairs({{0,inv},{8,c.ctor},{0x10,c.get},{0x18,c.set},{0x20,c.destroy},{0x28,p+0x100},{0x40,readQword(selected.row+c.layout.value+c.layout.name)},{0x48,readQword(selected.row+c.layout.value+c.layout.assetType)}})do assert(writeQword(p+entry[1],entry[2]))end
 assert(writeInteger(p+0x30,slot));assert(writeInteger(p+0x34,old));assert(writeInteger(p+0x38,new))
 t.job(state.code,{p},{inv,c.getIdentity.object,c.setIdentity.object},function()
  assert(t.sameIdentity029(id)and t.sameIdentity029(c.getIdentity)and t.sameIdentity029(c.setIdentity),'Inventory or API expired')
  local status=readInteger(p+0x3c)
  if status~=1 then t.msg('Inventory contents changed; refresh the editor.','所持品が変わったため変更を中止しました。一覧を再取得してください。');if done then done()end;return end
  assert(readBytes(p+0x54,1)==1,'Inventory rejected the quantity change')
  t.msg('Quantity change accepted: '..new,'個数変更の受付: '..new);if done then done()end
 end)
end
local forget=t.forgetProcess
function t.forgetProcess(...)
 -- Retain allocations if a queued native call could still be returning through them.
 pcall(unregisterSymbol,'tlcInventoryWorker104');pcall(unregisterSymbol,'tlcInventoryWorker104End')
 t.inventoryWorkerState104=nil;return forget(...)
end
function t.refreshItems(mr)
 t.require();local player=t.player(true);local groups={};local total=0
 for _,cfg in ipairs({{'WeightInventory','Weight-limited inventory','重量制限インベントリ'},{'VaultInventory','Vault inventory','保管庫インベントリ'},{'OutputInventory','Output inventory','出力インベントリ'},{'WeaponHolsterComponent','Holstered weapons / throwables','装備中の武器・投擲物'},{'EquipmentComponent','Equipment inventory','装備品インベントリ'}})do
  local inv=t.readObjectField074(player,cfg[1])
  if inv then local rows=t.inventoryRows104(inv);groups[#groups+1]={inv=inv,rows=rows,en=cfg[2],ja=cfg[3]};total=total+#rows end
 end
 assert(total&lt;=65536,'Inventory editor item count is unreasonable')
 local mirror=assert(allocateMemory(math.max(4,total*4)));t.mirrorPages=t.mirrorPages or{};t.mirrorPages[#t.mirrorPages+1]=mirror
 t.clearChildren(mr);local index=0
 for _,group in ipairs(groups)do
  local header=t.addHdr(mr,group.en,group.ja);local inv=group.inv
  for _,row in ipairs(group.rows)do
   local slot,name=row.slot,row.name;local en,ja=t.itemLabels(name)
   local item=t.addHdr(header,en..' [slot '..slot..']',ja..'［スロット '..slot..'］')
   local address=mirror+index*4;index=index+1;writeInteger(address,row.count)
   local rec=t.addRec(item,'Quantity (native edit)','個数（ゲーム処理で変更）',string.format('%X',address),vtDword)
   rec.OnActivate=function(_,before)if before then return false end end
   rec.OnValueChangedByUser=function(_,old,new)
    if t.player()~=player or not t.valid(inv)then return end
    local amount=tonumber(new);if not amount then return end
    local current
    for _,entry in ipairs(t.inventoryRows104(inv))do if entry.slot==slot and entry.name==name then current=entry.count;break end end
    if current==nil then t.msg('Refresh the inventory editor.','一覧を再取得してください。');return end
    writeInteger(address,current);t.setQuantity(inv,slot,name,current,amount,function()t.refreshItems(mr)end)
   end
  end
 end
end
end)(TLC)

-- Weapon ownership/category members are taken from current reflected metadata.
;(function(t)
local templates={}
for _,name in ipairs({'ammoDelta2','weaponResource2','weaponItemConsume2','ammoReserve2','ammoShot027'})do templates[name]=assert(t.HOOKS[name]).aa end
local function field(cls,name,size)
 local off,actual=t.refFieldLayout(assert(t.refClass(cls)),name,true)
 assert(off and actual==size,'Weapon field contract changed: '..cls..'.'..name);return off
end
function t.ammoContract105()
 local old=t.ammoContractCache105
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local cls=assert(t.refClass('VoyageWeaponBallistic'));local fn=assert(t.reflectedFunction069('VoyageWeaponBallistic','SetAmmoAmount'))
 local entry=assert(readQword(fn+0xd8));local first,last=t.runtimeFunction074(entry)
 assert(first==entry and last-first&lt;=512,'Ammo setter wrapper scope changed')
 local slot;local count=0;local ip=first
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15);local b=readBytes(ip,n,true)
  if n==6 and b[1]==255 and b[2]==144 then slot=readInteger(ip+2);count=count+1 end
  ip=ip+n
 end
 assert(count==1 and slot and slot%8==0,'Ammo setter dispatch is missing or ambiguous')
 local property=t.property076(assert(t.refClass('VoyageItem')),'Category',true);local _,values=t.enumProperty076(property)
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(cls)),owner=field('Actor','Owner',8),componentOwner=t.componentOwnerOffset083(),category=field('VoyageItem','Category',1),ammo=assert(values.Ammo),grenade=assert(values.Grenade),setterSlot=slot}
 assert(c.ammo&gt;=0 and c.ammo&lt;=255 and c.grenade&gt;=0 and c.grenade&lt;=255 and c.ammo~=c.grenade,'Ammo category enum changed')
 t.ammoContractCache105=c;return c
end
function t.prepareAmmo105()
 local c=t.ammoContract105()
 for name,template in pairs(templates)do
  local script=template:gsub('%[rcx%+158%]',('[rcx+%X]'):format(c.owner)):gsub('%[rbx%+158%]',('[rbx+%X]'):format(c.owner)):gsub('%[rax%+158%]',('[rax+%X]'):format(c.owner))
  script=script:gsub('%[rcx%+A8%]',('[rcx+%X]'):format(c.componentOwner))
  script=script:gsub('cmp byte ptr %[rdx%+B0%],09',('cmp byte ptr [rdx+%X],%02X'):format(c.category,c.ammo)):gsub('cmp byte ptr %[rdx%+B0%],0B',('cmp byte ptr [rdx+%X],%02X'):format(c.category,c.grenade))
  t.HOOKS[name].aa=script
 end
 local signature=assert(t.SIGS.AmmoShot027);local raw=string.pack('&lt;I4',c.setterSlot)
 for n=1,4 do signature.bytes[7+n]=raw:byte(n)end
 -- Recreate the signature from its bytes, rather than assuming a prior slot value.
 local pattern={};for _,b in ipairs(signature.bytes)do pattern[#pattern+1]=('%02X'):format(b)end
 signature.p=table.concat(pattern,' ')
 return c
end
local resolve=t.resolveSig
function t.resolveSig(name)
 if name=='AmmoShot027'then t.prepareAmmo105()end
 local address=resolve(name)
 if name=='AmmoReserve'and address then
  local first=t.runtimeFunction074(address);local raw=readBytes(first,address-first,true);local pushes={}
  for _,b in ipairs(raw or{})do pushes[#pushes+1]=string.char(b)end
  assert(table.concat(pushes)=='\64\85\83\86\87\65\86','Reserve-ammo stack contract changed; no hook installed')
 end
 return address
end
local hook=t.hookOn
function t.hookOn(name)
 if templates[name]then t.prepareAmmo105()end
 return hook(name)
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='ammo'then local okay,why=pcall(t.prepareAmmo105);if not okay then return false,tostring(why)end end
 return check(key)
end
end)(TLC)

-- Hierarchy members used by boat protection are resolved by reflected names.
;(function(t)
function t.boatProtectionLayout106()
 local function field(cls,name)
  local off,size=t.refFieldLayout(assert(t.refClass(cls)),name,true)
  assert(off and size==8,'Boat protection field contract changed: '..cls..'.'..name);return off
 end
 return {componentOwner=t.componentOwnerOffset083(),root=field('Actor','RootComponent'),parent=field('SceneComponent','AttachParent'),boatClass=assert(t.refClass('VoyageBoatPawn'))}
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='boat'then local okay,why=pcall(t.boatProtectionLayout106);if not okay then return false,tostring(why)end end
 return check(key)
end
end)(TLC)

-- Resolve the world subsystem collection through the named engine getter.
;(function(t)
local function bytes(a,n)
 local data=assert(readBytes(a,n,true));local b={};for i,v in ipairs(data)do b[i]=string.char(v)end;return table.concat(b)
end
local function instructions(a)
 local first,last=t.runtimeFunction074(a);assert(first==a and last-first&lt;=4096,'Subsystem getter function scope changed')
 local rows={};while a&lt;last do local n=assert(getInstructionSize(a));assert(n&gt;0 and n&lt;=15);rows[#rows+1]={a=a,b=bytes(a,n)};a=a+n end;return rows
end
local function call(row)return row.a+5+string.unpack('&lt;i4',row.b,2)end
function t.worldRegistryContract107()
 local old=t.worldRegistryCache107
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local fn=assert(t.reflectedFunction069('SubsystemBlueprintLibrary','GetWorldSubsystem'));local rows=instructions(assert(readQword(fn+0xd8)));local found={}
 for i,row in ipairs(rows)do
  if #row.b==7 and row.b:sub(1,3)=='\72\141\143'and rows[i+1]and rows[i+1].b=='\72\139\211'and rows[i+2]and #rows[i+2].b==5 and rows[i+2].b:byte(1)==0xe8 then
   found[#found+1]={collection=string.unpack('&lt;I4',row.b,4),getter=call(rows[i+2])}
  end
 end
 assert(#found==1,'World subsystem collection access is missing or ambiguous')
 local c=found[1];rows=instructions(c.getter);found={}
 for i,row in ipairs(rows)do
  if #row.b==4 and row.b:sub(1,3)=='\72\141\79'and rows[i+1]and rows[i+2]and rows[i+3]and #rows[i+3].b==5 and rows[i+3].b:byte(1)==0xe8 then
   found[#found+1]={map=string.unpack('&lt;I1',row.b,4),reader=call(rows[i+3])}
  end
 end
 assert(#found==1,'Subsystem map access is missing or ambiguous')
 local map=found[1];local code=instructions(map.reader);local value;local count=0
 for i,row in ipairs(code)do
  if #row.b==4 and row.b:sub(1,3)=='\72\139\72'and code[i+1]and code[i+1].b=='\72\137\15'then value=row.b:byte(4);count=count+1 end
 end
 assert(count==1 and value==8,'Subsystem map result ABI changed')
 local resource=t.resourceReadContract102();assert(resource.stride==24 and resource.value==8,'Sparse map ABI is not verified')
 c.map=c.collection+map.map;c.stride=resource.stride;c.value=value;c.pid=getOpenedProcessID();c.identity=assert(t.identity029(fn))
 t.worldRegistryCache107=c;return c
end
function t.worldSubsystem107(name)
 local world=assert(t.world(),'Playable world unavailable');local cls=assert(t.refClass(name));local c=t.worldRegistryContract107();local matches={}
 for _,row in ipairs(t.map(world+c.map,c.stride))do
  local key=readQword(row);local value=readQword(row+c.value)
  if key==cls and t.valid(value)and t.U.isA(value,name)then
   assert(readQword(value+0x20)==world,'Subsystem world identity changed');matches[#matches+1]=value
  end
 end
 assert(#matches==1,'World subsystem is missing or ambiguous: '..name);return matches[1],world
end
function t.questLayout107()
 local old=t.questLayoutCache107
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local function field(object,name,size,kind)
  local off,actual=t.refFieldLayout(object,name,kind);assert(off and actual==size,'Quest field contract changed: '..name);return off
 end
 local subsystem=assert(t.refClass('VoyageQuestSubsystem'));local quest=assert(t.refClass('VoyageQuest'));local object=assert(t.refClass('VoyageQuestObject'))
 local data=assert(t.findMetadata074('VoyageQuestData','ScriptStruct'));local task=assert(t.findMetadata074('VoyageQuestTask','ScriptStruct'))
 local size=assert(readInteger(data+0x58));local taskSize=assert(readInteger(task+0x58));assert(size&gt;0 and size&lt;=4096 and taskSize&gt;0 and taskSize&lt;=4096)
 local getter=assert(t.reflectedFunction069('VoyageQuestObject','GetQuestData'));field(getter,'ReturnValue',size,'function')
 local entry=assert(readQword(getter+0xd8));assert(t.executable038(entry,48),'Quest data getter unavailable')
 local offset;local ip=entry
 for i=1,24 do
  local n=assert(getInstructionSize(ip));local b=bytes(ip,n)
  if n==4 and b:sub(1,3)=='\72\141\81'and bytes(ip+n,3)=='\73\139\200'and bytes(ip+n+3,1)=='\233'then
   assert(not offset,'Quest data getter is ambiguous');offset=b:byte(4)
  end
  if b:byte(1)==0xe9 or b=='\195'then break end;ip=ip+n;assert(ip-entry&lt;=128,'Quest data getter bounds changed')
 end
 assert(offset,'Quest data getter/member correspondence unavailable')
 local taskProperty=t.property076(quest,'TasksArray',true);local inner=assert(readQword(taskProperty+0x78))
 assert(readQword(inner+0x70)==task and readInteger(inner+0x34)==taskSize,'Quest task array type changed')
 local map=t.property076(subsystem,'QuestObjects',true)
 assert(readInteger(assert(readQword(map+0x70))+0x34)==16 and readInteger(assert(readQword(map+0x78))+0x34)==8,'Quest registry key/value types changed')
 local progress=t.property076(data,'TaskProgress','struct')
 assert(readInteger(assert(readQword(progress+0x70))+0x34)==1 and readInteger(assert(readQword(progress+0x78))+0x34)==4,'Quest task-state key/value types changed')
 local _,types=t.enumProperty076(t.property076(task,'Type','struct'))
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(data)),objects=field(subsystem,'QuestObjects',80,true),registryStride=32,registryValue=16,
  quest=field(object,'Quest',8,true),progress=offset+field(data,'TaskProgress',80,'struct'),progressStride=16,progressValue=4,
  tasks=field(quest,'TasksArray',16,true),logics=field(quest,'QuestLogics',16,true),taskSize=taskSize,taskType=field(task,'Type',1,'struct'),taskLogic=field(task,'CustomTaskLogic',8,'struct'),blueprint=assert(types.BlueprintLogic)}
 t.questLayoutCache107=c;return c
end
function t.questObserver107(subsystem)
 t.requireSigs({'QuestTick045','QuestBegin045','QuestEnd045'})
 local tick=assert(t.A.QuestTick045);local first,last=t.runtimeFunction074(tick)
 assert(first==tick and t.A.QuestBegin045&gt;=first and t.A.QuestBegin045&lt;last and t.A.QuestEnd045&gt;=first and t.A.QuestEnd045&lt;last,'Quest observer sites are not in the same verified native function')
 local delegate=t.refFieldLayout(assert(t.refClass('VoyageQuestSubsystem')),'QuestStateChanged',true);assert(delegate and delegate&lt;=0x1000)
 local found={}
 for off=0x28,delegate-8,8 do
  local vt=readQword(subsystem+off)
  if vt and t.image038 and vt&gt;=t.image038.base and vt+8&lt;=t.image038.base+t.image038.size and readQword(vt)==tick then found[#found+1]=off end
 end
 assert(#found==1,'Quest observer interface is missing or ambiguous');return found[1]
end
function t.verifyLegacyFabricator107()
 -- Until the retained native templates are migrated, reject a changed layout.
 -- This guard is not counted as removal of their remaining fixed-layout dependency.
 local cls=assert(t.refClass('VoyageFabricatorComponent'))
 for name,expected in pairs({CurrentFabricationId=0x22c,ProgressTimerRemaining=0x234,ProgressTimerMax=0x238,ItemQueue=0x2a0})do
  local off=t.refFieldLayout(cls,name,true);assert(off==expected,'Unmigrated fabricator native layout changed: '..name)
 end
 local off=t.refFieldLayout(assert(t.refClass('VoyageItem')),'CategoryAsset',true)
 assert(off==0xb8,'Unmigrated craft-category native layout changed')
end
end)(TLC)

-- Bind native fabricator interfaces to reflected members before generating hooks.
;(function(t)
local names={'fabricationProgress2','fabricationFree049','instantDuration049','fabricatorGate2'}
local templates={};for _,name in ipairs(names)do templates[name]=assert(t.HOOKS[name]).aa end
local function field(object,name,size,kind)
 local offset,actual=t.refFieldLayout(object,name,kind);assert(offset and actual==size,'Fabricator field contract changed: '..name);return offset
end
local function bytes(a,n)local b=assert(readBytes(a,n,true));local s={};for i,x in ipairs(b)do s[i]=string.char(x)end;return table.concat(s)end
function t.fabricatorLayout108()
 local old=t.fabricatorLayoutCache108
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local cls=assert(t.refClass('VoyageFabricatorComponent'));local cdo=assert(t.defaultObject074(cls))
 local current=field(cls,'CurrentFabricationId',4,true);local remaining=field(cls,'ProgressTimerRemaining',4,true);local maximum=field(cls,'ProgressTimerMax',4,true)
 local queue=field(cls,'ItemQueue',16,true);local ignore=field(cls,'bIgnoreModuleRequirements',1,true)
 local queueProperty=t.property076(cls,'ItemQueue',true);local inner=assert(readQword(queueProperty+0x78));local itemType=assert(readQword(inner+0x70))
 assert(t.valid(itemType)and t.U.c(itemType)=='ScriptStruct','Fabricator queue type unavailable')
 local itemSize=assert(readInteger(itemType+0x58));assert(itemSize&gt;0 and itemSize&lt;=4096 and readInteger(inner+0x34)==itemSize,'Fabricator queue element size changed')
 local site=assert(t.resolveSig('FabricationProgress'),'Fabricator progress code unavailable')
 local first,last=t.runtimeFunction074(site);assert(last-first&lt;=65536,'Fabricator progress function exceeds verification bound')
 local code=bytes(first,last-first);local boundary=field(cls,'FabricateSignalKey',8,true);assert(boundary&lt;=4096)
 local candidates={}
 for off=0x28,boundary-8,8 do
  local vt=readQword(cdo+off)
  if vt and t.image038 and vt&gt;=t.image038.base and vt+128&lt;=t.image038.base+t.image038.size and remaining&gt;off and maximum&gt;off then
   local found=false;for slot=0,15 do if readQword(vt+slot*8)==first then found=true end end
   if found and code:find('\243\65\15\16\134'..string.pack('&lt;I4',remaining-off),1,true)and code:find('\243\65\15\16\142'..string.pack('&lt;I4',maximum-off),1,true)then candidates[#candidates+1]=off end
  end
 end
 assert(#candidates==1,'Fabricator interface/member correspondence is missing or ambiguous')
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(cls)),interface=candidates[1],current=current,remaining=remaining,maximum=maximum,queue=queue,ignore=ignore,
  item=field(itemType,'Item',8,'struct'),count=field(itemType,'Count',4,'struct'),category=field(assert(t.refClass('VoyageItem')),'CategoryAsset',8,true)}
 t.fabricatorLayoutCache108=c;return c
end
function t.prepareFabricator108(scope)
 local c=t.fabricatorLayout108();local gateOnly=scope=='fabricatorGate2'or scope=='noCraftPower'
 local replacements={['[r14+16C]']=('[r14+%X]'):format(c.current-c.interface),['[r14+174]']=('[r14+%X]'):format(c.remaining-c.interface),['[r14+178]']=('[r14+%X]'):format(c.maximum-c.interface),
  ['[r14+1E0]']=('[r14+%X]'):format(c.queue-c.interface),['[r14+1E8]']=('[r14+%X]'):format(c.queue+8-c.interface),['[r14+16A]']=('[r14+%X]'):format(c.ignore-c.interface),
  ['[r14-B4]']=('[r14-%X]'):format(c.interface-0xc),['[rbx+2A0]']=('[rbx+%X]'):format(c.queue),['[rbx+2A8]']=('[rbx+%X]'):format(c.queue+8),
  ['[r8+B8]']=('[r8+%X]'):format(c.category)}
 assert(c.interface&gt;0xc,'Native interface/member range changed')
 if not gateOnly then
  local quest=t.questLayout107();local sys=t.worldSubsystem107('VoyageQuestSubsystem');local observer=t.questObserver107(sys)
  assert(quest.objects&gt;observer,'Quest interface/member range changed')
  replacements['[rdx+D8]']=('[rdx+%X]'):format(quest.objects-observer);replacements['[rdx+E0]']=('[rdx+%X]'):format(quest.objects+8-observer)
 end
 for name,template in pairs(templates)do
  if not gateOnly or name=='fabricatorGate2'then
  local script=template
  script=script:gsub('mov r11d,%[r8%+10%]\nmov r8,%[r8%]',('mov r11d,[r8+%X]\nmov r8,[r8+%X]'):format(c.count,c.item))
  script=script:gsub('mov r8,%[r8%]\n',('mov r8,[r8+%X]\n'):format(c.item))
  script=script:gsub('%[[^%]\n]+%]',function(part)return replacements[part]or part end)
  t.HOOKS[name].aa=script
  end
 end
 return c
end
function t.verifyLegacyFabricator107()return t.prepareFabricator108()end
local hook=t.hookOn
function t.hookOn(name)
 if templates[name]then t.prepareFabricator108(name)end
 return hook(name)
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='instant'or key=='materials'or key=='noCraftPower'then local okay,why=pcall(t.prepareFabricator108,key);if not okay then return false,tostring(why)end end
 return check(key)
end
end)(TLC)

-- Scene translation and async-action completion are derived from named getters.
;(function(t)
local function bytes(a,n)local b=assert(readBytes(a,n,true));local s={};for i,v in ipairs(b)do s[i]=string.char(v)end;return table.concat(s)end
local function relative(a)return a+5+string.unpack('&lt;i4',bytes(a+1,4))end
local function field(o,name,size,kind)
 local off,actual=t.refFieldLayout(o,name,kind);assert(off and actual==size,'Location field contract changed: '..name);return off
end
function t.sceneLocationLayout109()
 local old=t.sceneLocationCache109
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 local fn=assert(t.reflectedFunction069('SceneComponent','K2_GetComponentLocation'));local vector=assert(t.findMetadata074('Vector','ScriptStruct'));local size=assert(readInteger(vector+0x58));assert(size==24,'Location vector scalar ABI changed')
 field(fn,'ReturnValue',size,'function');local entry=assert(readQword(fn+0xd8));assert(t.executable038(entry,64))
 local loads={};local ip=entry;local returned=false
 for i=1,32 do
  local n=assert(getInstructionSize(ip));local b=bytes(ip,n)
  if n==7 and b:sub(1,3)=='\15\16\137'then loads.xy=string.unpack('&lt;I4',b,4)end
  if n==8 and b:sub(1,4)=='\242\15\16\129'then loads.z=string.unpack('&lt;I4',b,5)end
  if b=='\195'then returned=true;break end;ip=ip+n;assert(ip-entry&lt;128,'Location getter exceeds verification bound')
 end
 assert(returned and loads.xy and loads.z==loads.xy+16,'Location getter return correspondence changed')
 local body=bytes(entry,ip-entry)
 assert(body:find('\65\15\17\8',1,true)and body:find('\242\65\15\17\64\16',1,true),'Location getter output mapping changed')
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(fn)),translation=loads.xy,axes={field(vector,'X',8,'struct'),field(vector,'Y',8,'struct'),field(vector,'Z',8,'struct')}}
 t.sceneLocationCache109=c;return c
end
function t.actorLocation109(actor)
 local root=assert(t.readObjectField074(actor,'RootComponent'),'Actor root unavailable');assert(t.U.isA(root,'SceneComponent'),'Actor root type changed')
 local c=t.sceneLocationLayout109();local p={}
 for index,axis in ipairs(c.axes)do local value=readDouble(root+c.translation+axis);assert(value and value==value and math.abs(value)&lt;1e12,'Invalid actor location');p[index]=value end
 return p
end
function t.warpCompletionOffset109()
 local old=t.warpCompletionCache109
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old.offset end
 local fn=assert(t.reflectedFunction069('VoyageTeleportAsyncAction','Cancel'));local entry=assert(readQword(fn+0xd8));local ip=entry;local target
 for i=1,24 do
  local n=assert(getInstructionSize(ip));local b=bytes(ip,n)
  if n==5 and b:byte(1)==0xe9 then target=relative(ip);break end
  if b=='\195'then break end;ip=ip+n;assert(ip-entry&lt;=128,'Teleport cancel wrapper changed')
 end
 assert(target and t.executable038(target,32),'Teleport cancel implementation unavailable')
 local b=bytes(target,32);assert(b:sub(1,2)=='\128\185'and b:byte(7)==0,'Teleport completion guard changed')
 local off=string.unpack('&lt;I4',b,3);local finish
 ip=target
 for i=1,24 do
  local n=assert(getInstructionSize(ip));local row=bytes(ip,n)
  if n==5 and row:byte(1)==0xe9 then finish=relative(ip);break end
  if row=='\195'then break end;ip=ip+n;assert(ip-target&lt;=128)
 end
 assert(finish,'Teleport completion path unavailable')
 local first,last=t.runtimeFunction074(finish);assert(first==finish and last-first&lt;=4096,'Teleport completion scope changed')
 local body=bytes(first,last-first)
 assert(body:find('\128\185'..string.pack('&lt;I4',off)..'\0',1,true)and body:find('\198\129'..string.pack('&lt;I4',off)..'\1',1,true),'Teleport completion read/write correspondence changed')
 local size=assert(readInteger(assert(t.refClass('VoyageTeleportAsyncAction'))+0x58));assert(off&gt;=0x28 and off&lt;size,'Teleport completion member exceeds object bounds')
 t.warpCompletionCache109={pid=getOpenedProcessID(),identity=assert(t.identity029(fn)),offset=off};return off
end
function t.virtualMethod109(object,method)
 assert(t.valid(object)and t.executable038(method,1),'Virtual method identity unavailable');local vt=assert(readQword(object));local matches=0
 for slot=0,511 do
  local target=readQword(vt+slot*8);if not target or not t.executable038(target,1)then break end
  if target==method then matches=matches+1 end
 end
 assert(matches==1,'Virtual method is missing or ambiguous');return method
end
end)(TLC)

-- Equipped ability lookup and charge writes use current named members.
;(function(t)
local template=assert(t.HOOKS.DismantleDispatch023).aa
local function field(object,name,size)
 local offset,actual=t.refFieldLayout(object,name,false);assert(offset and actual==size,'Equipment member contract changed: '..name);return offset
end
local function mapOffset(object,name)
 local off=field(object,name,80);local property=t.property076(readQword(object+0x10),name,true)
 local key,value=assert(readQword(property+0x70)),assert(readQword(property+0x78))
 assert(readInteger(key+0x34)==4 and readInteger(value+0x34)==8,'Equipment map key/value types changed: '..name)
 local abi=t.resourceReadContract102();assert(abi.stride==24 and abi.value==8,'Equipment map ABI unverified');return off,abi
end
function t.prepareDismantle110()
 local cls=assert(t.refClass('EquipmentAbilityComponent'));local off,size=t.refFieldLayout(cls,'AbilityCharge',true)
 assert(off and size==4,'AbilityCharge member contract changed')
 t.HOOKS.DismantleDispatch023.aa=template:gsub('%[rdi%+D4%]',('[rdi+%X]'):format(off))
 return off
end
function t.updateDismantleClass023()
 local result=0;local player=t.player(false);local holster=player and t.readObjectField074(player,'WeaponHolsterComponent')
 if holster then
  local off,abi=mapOffset(holster,'SlotActors')
  for _,row in ipairs(t.map(holster+off,abi.stride))do
   local tool=readQword(row+abi.value)
   if t.valid(tool)and t.U.isA(tool,'VoyageEquipmentActor')then
    local offset,layout=mapOffset(tool,'AbilityComponents')
    for _,entry in ipairs(t.map(tool+offset,layout.stride))do
     local ability=readQword(entry+layout.value)
     if t.valid(ability)and t.U.isA(ability,'BP_ToolAbility_Maintenance_Dismantle_C')then result=assert(readQword(ability+0x10));break end
    end
   end
   if result~=0 then break end
  end
 end
 assert(writeQword(t.base()+0xdf0,result))
end
local hook=t.hookOn
function t.hookOn(name)
 if name=='DismantleDispatch023'then t.prepareDismantle110()end
 return hook(name)
end
end)(TLC)

-- Countdown member displacement is derived from the same verified update block.
;(function(t)
local template=assert(t.HOOKS.seedCountdown).aa
t.SIGS.SeedCountdown.bootstrapPattern='F3 0F 5C CE F3 0F 11 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 0F 57 C0 0F 2F 83 ?? ?? ?? ?? 72 ?? 48 8B CB E8 ?? ?? ?? ?? 48 8B 03'
function t.seedCountdownContract111()
 local address=assert(t.resolveSig('SeedCountdown'),'Seed countdown update code unavailable');local b=assert(t.SIGS.SeedCountdown.bytes);local raw={}
 for i,v in ipairs(b)do raw[i]=string.char(v)end;raw=table.concat(raw)
 assert(#raw&gt;=39 and raw:sub(1,8)=='\243\15\92\206\243\15\17\139'and raw:sub(18,23)=='\15\87\192\15\47\131','Seed countdown update ABI changed')
 local store=string.unpack('&lt;I4',raw,9);local compare=string.unpack('&lt;I4',raw,24)
 assert(store==compare and store&gt;=0x28 and store&lt;=0x10000 and store%4==0,'Seed countdown read/write correspondence changed')
 local first,last=t.runtimeFunction074(address);assert(address&gt;=first and address+#raw&lt;=last,'Seed countdown block exceeds native function scope')
 return store,address
end
function t.prepareSeed111()
 local offset=t.seedCountdownContract111();t.HOOKS.seedCountdown.aa=template:gsub('%[rbx%+318%]',('[rbx+%X]'):format(offset));return offset
end
local hook=t.hookOn
function t.hookOn(name)if name=='seedCountdown'then t.prepareSeed111()end;return hook(name)end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='seedCountdown'then local okay,why=pcall(t.prepareSeed111);if not okay then return false,tostring(why)end end
 return check(key)
end
end)(TLC)

-- Recovery target enumeration uses the standard actor-query API.
;(function(t)
function t.actorVisible112(actor)
 if not t.valid(actor)or not t.U.isA(actor,'Actor')then return false end
 local p=t.property076(assert(t.refClass('Actor')),'bHidden',true);local off,size=t.refFieldLayout(t.refClass('Actor'),'bHidden',true)
 local mask=readBytes(p+0x72,1);local byte=readBytes(p+0x71,1)
 assert(off and size==1 and mask and mask&gt;0 and byte==0,'Actor visibility bool contract changed')
 return(readBytes(actor+off,1)&amp;mask)==0
end
function t.queryActors112(className,done)
 t.require();assert(not t.pendingJob,'Native action already pending')
 local cls=assert(t.refClass(className),'Recovery actor class is not loaded: '..className)
 local c=t.apiContract075('GameplayStatics','GetAllActorsOfClass')
 t.apiMember075(c,'WorldContextObject',8);t.apiMember075(c,'ActorClass',8);local output=t.apiMember075(c,'OutActors',16)
 local property=t.property076(c.fn,'OutActors','function');local inner=assert(readQword(property+0x78))
 assert(readInteger(inner+0x34)==8,'Actor-query array element type changed')
 local world=assert(t.world());local identity=assert(t.identity029(world))
 -- The API owns/reuses its output array in its persistent parameter frame.
 t.apiInvoke075(c,{WorldContextObject={string.byte(string.pack('&lt;I8',world),1,8)},ActorClass={string.byte(string.pack('&lt;I8',cls),1,8)}},function(p)
  assert(t.sameIdentity029(identity)and t.world()==world,'Actor-query world changed')
  local array=p+output;local data,count,capacity=readQword(array),readInteger(array+8),readInteger(array+12)
  assert(count and capacity and count&gt;=0 and count&lt;=capacity and capacity&lt;=100000 and(count==0 or data and data&gt;0x10000),'Actor-query output array invalid')
  local rows={};local seen={}
  for i=0,count-1 do local actor=readQword(data+i*8)
   if t.valid(actor)and not seen[actor]and t.U.isA(actor,className)and t.actorVisible112(actor)then seen[actor]=true;rows[#rows+1]=actor end
  end
  done(rows,world)
 end)
end
function t.recoveryActors112(className)
 local cache=t.recoveryActorCache112
 assert(cache and cache.name==className and cache.world==t.world(),'Recovery actor query must complete first')
 return cache.rows
end
local function wrap(name,className)
 local original=assert(t[name])
 t[name]=function(...)
  local args=table.pack(...)
  t.queryActors112(className,function(rows,world)
   t.recoveryActorCache112={name=className,rows=rows,world=world}
   local okay,why=pcall(original,table.unpack(args,1,args.n));t.recoveryActorCache112=nil
   if not okay then error(why,0)end
  end)
 end
end
wrap('restoreRocketTop036','BP_Rocket_Functional_C');wrap('recoverFirstRoots031','BP_Eden_Frame_Small_C')
function t.nextQuestTask112(object,done)
 local c=t.objectApiContract076(object,'VoyageQuestObject','GetNextTaskIndex');local off=t.apiMember075(c,'ReturnValue',4)
 t.apiInvoke075(c,{},function(p)done(readInteger(p+off))end)
end
function t.levelScript()
 local world=t.world();if not world then return end
 local off,size=t.refFieldLayout(world,'Levels',false);assert(off and size==16,'World level-list metadata changed')
 local data,count=readQword(world+off),readInteger(world+off+8);assert(count and count&gt;=0 and count&lt;=10000,'World level-list count invalid')
 for i=0,count-1 do local level=readQword(data+i*8)
  if t.valid(level)then local script=t.readObjectField074(level,'LevelScriptActor');if script and t.U.isA(script,'VoyageLevelScriptActor')then return script end end
 end
end
end)(TLC)

-- A verified feature contract supersedes the historical build-wide layout gate.
;(function(t)
local validators={ammo=t.prepareAmmo105,boat=t.boatProtectionLayout106,instant=function()t.prepareFabricator108();t.prepareDismantle110()end,materials=t.prepareFabricator108}
local check=t.checkFeature074
function t.checkFeature074(key)
 local validate=validators[key]
 if not validate then return check(key)end
 if not t.reflectionReady074 then return false,'Object/name metadata unavailable for '..key end
 local capabilities=t.metadataCapabilities102
 if capabilities and not capabilities.engine then return false,'Engine/world dependency unavailable for '..key..': '..tostring(capabilities.engineReason)end
 local okay,why=pcall(validate);if okay then return true end;return false,tostring(why)
end
for key in pairs(validators)do t.compat038.portable[key]=true end
function t.publishPlayerPointers113()
 local player=t.player(false);local fields={{0x200,player},{0x220},{0x228},{0x238}}
 if player then
  fields[2][2]=t.readObjectField074(player,'WeightInventory');fields[3][2]=t.readObjectField074(player,'VaultInventory');fields[4][2]=t.readObjectField074(player,'CharacterMovement')
 end
 local base=assert(t.base());for _,row in ipairs(fields)do assert(writeQword(base+row[1],row[2]or 0))end
end
local portable=t.portableTick074
function t.portableTick074(...)
 if not t.attached()then return end
 if getOpenedProcessID()~=t.pid or getProcessIDFromProcessName(t.EXE)~=t.pid then t.forgetProcess();return end
 local okay,why=pcall(t.publishPlayerPointers113)
 if not okay then
  local base=t.base();if base then for _,offset in ipairs({0x200,0x220,0x228,0x238})do writeQword(base+offset,0)end end
  t.reason('playerPointers',tostring(why))
 end
 local worked,errorText=pcall(portable,...)
 if not worked then t.reason('update',tostring(errorText))end
 if not t.attached()then return end
 -- Earlier consumers already ran their tasks on success. On failure, keep every
 -- still-enabled peer task running; never globally disable working features.
 local keys={}
 if worked then keys={'instant'}else for key in pairs(t.featOn)do keys[#keys+1]=key end;table.sort(keys)end
 for _,key in ipairs(keys)do
  local feature=t.F[key]
  if t.featOn[key]and feature and feature.task then
   local passed,problem=pcall(feature.task)
   if not passed then
    t.reason(key,tostring(problem));local restored,restoreError=pcall(t.feature,key,false)
    if not restored then t.reason(key,tostring(restoreError))end
   end
  end
 end
end
end)(TLC)

-- Rocket recovery state and Blueprint event frames use named typed metadata.
;(function(t)
local function field(object,name,size,kind)
 local off,actual=t.refFieldLayout(object,name,kind);assert(off and actual==size,'Rocket member contract changed: '..name);return off
end
function t.rocketLayout114()
 local cls=assert(t.refClass('VoyageRocketStateComponent'));local prop=t.property076(cls,'StateResults',true)
 local key,value=assert(readQword(prop+0x70)),assert(readQword(prop+0x78));local _,states=t.enumProperty076(key)
 assert(readInteger(key+0x34)==1,'Rocket state key type changed');local result=assert(readQword(value+0x70))
 assert(t.valid(result)and t.U.c(result)=='ScriptStruct','Rocket state result type unavailable')
 local size=assert(readInteger(result+0x58));local alignment=assert(readSmallInteger(result+0x5c));assert(alignment==8 and size&gt;0 and size&lt;=4096 and readInteger(value+0x34)==size)
 return {countdown=field(cls,'CountdownRemaining',4,true),flight=field(cls,'FlightRemaining',4,true),states=field(cls,'StateResults',80,true),stride=((8+size+7)//8)*8+8,value=8,
  progress=field(result,'Progress',4,'struct'),launched=assert(states.Launched),landing=assert(states.Landing),landed=assert(states.Landed)}
end
function t.rocketGrounded114(state)
 assert(t.valid(state)and t.U.isA(state,'VoyageRocketStateComponent'),'Rocket state unavailable');local c=t.rocketLayout114()
 local countdown,flight=readFloat(state+c.countdown),readFloat(state+c.flight);assert(countdown and countdown==countdown and flight and flight==flight,'Rocket timer unreadable')
 local states={}
 for _,row in ipairs(t.map(state+c.states,c.stride))do local key=readBytes(row,1);local progress=readFloat(row+c.value+c.progress);assert(progress and progress==progress,'Rocket state progress unreadable');states[key]=progress end
 if countdown&gt;0 or flight&gt;0 or(((states[c.launched]or 0)&gt;0 or(states[c.landing]or 0)&gt;0)and(states[c.landed]or 0)&lt;0.9999)then
  error(t.T('The rocket is counting down or in flight; nose recovery is unavailable.','カウントダウン中または飛行中のため、先端の復旧を中止しました。'),0)
 end
end
function t.rocketEvent114(actor,name,inputCount)
 local owner=t.U.c(actor);local c=t.objectApiContract076(actor,owner,name);assert(c.size&lt;=128,'Rocket event frame exceeds bound')
 local boolean=t.property076(assert(t.refClass('Actor')),'bHidden',true);local boolClass=assert(readQword(boolean+8));local p=readQword(c.fn+0x50);local count=0
 for i=1,64 do
  if not p or p==0 then break end
  if(readQword(p+0x38)&amp;0x80)~=0 then
   assert((readQword(p+0x38)&amp;0x400)==0,'Unexpected rocket event return parameter');count=count+1
   assert(inputCount==1 and readQword(p+8)==boolClass and readInteger(p+0x34)==1,'Rocket visibility event parameter type changed')
   c.offset=assert(readInteger(p+0x44));local byte=readBytes(p+0x71,1);c.mask=readBytes(p+0x72,1)
   assert(byte==0 and c.mask and c.mask&gt;0 and c.offset+1&lt;=c.size,'Rocket event boolean layout changed')
  end
  p=readQword(p+0x18)
 end
 assert(count==inputCount,'Rocket event parameter count changed: '..name);return c
end
end)(TLC)

-- Resource-category identities are named enums, not historical ordinal ranges.
;(function(t)
function t.resourceFilter115()
 local values=t.enumValues074('EModuleResourceType');local seen={}
 local function value(name)
  local number=assert(values[name],'Resource enum missing: '..name)
  assert(number&gt;=0 and number&lt;=255 and number%1==0 and not seen[number],'Resource enum is invalid or aliased: '..name);seen[number]=true;return number
 end
 local c={electricity=value('Electricity'),petrol=value('Petrol'),diesel=value('Diesel'),tank={}}
 for _,name in ipairs({'Oil','SaltWater','FreshWater','Methane','Oxygen','Steam','CarbonDioxide'})do c.tank[#c.tank+1]=value(name)end
 c.tank[#c.tank+1]=c.petrol;c.tank[#c.tank+1]=c.diesel
 return c
end
function t.prepareResourceFilter115()
 local c=t.resourceFilter115();local comparisons={}
 for _,number in ipairs(c.tank)do comparisons[#comparisons+1]=('cmp dl,%02X\nje tlc_consumption_zero'):format(number)end
 local script=([==[
[ENABLE]
alloc(tlc_consumption,$2000,$SITE)
label(tlc_consumption_ret)
label(tlc_consumption_normal)
label(tlc_consumption_zero)
label(tlc_consumption_fuel)
label(tlc_consumption_tank)
label(tlc_consumption_liquid)
tlc_consumption:
pushfq
cmp dl,%02X
jne tlc_consumption_liquid
cmp byte ptr [tlcFlags+09],0
jne tlc_consumption_zero
jmp tlc_consumption_normal
tlc_consumption_liquid:
cmp dl,%02X
je tlc_consumption_fuel
cmp dl,%02X
jne tlc_consumption_tank
tlc_consumption_fuel:
cmp byte ptr [tlcFlags+08],0
jne tlc_consumption_zero
tlc_consumption_tank:
cmp byte ptr [tlcFlags+0A],0
je tlc_consumption_normal
%s
jmp tlc_consumption_normal
tlc_consumption_zero:
popfq
xorps xmm0,xmm0
ret
tlc_consumption_normal:
popfq
$ORIG
jmp tlc_consumption_ret
$SITE:
jmp tlc_consumption
$NOP
tlc_consumption_ret:
[DISABLE]
$SITE:
$ORIG
dealloc(tlc_consumption)
]==]):format(c.electricity,c.petrol,c.diesel,table.concat(comparisons,'\n'))
 t.HOOKS.consumption.aa=script;return c
end
local hook=t.hookOn
function t.hookOn(name)if name=='consumption'then t.prepareResourceFilter115()end;return hook(name)end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='power'or key=='tank'or key=='powerTank'then
  local okay,why=pcall(t.prepareResourceFilter115);if okay then return true end;return false,tostring(why)
 end
 return check(key)
end
t.compat038.portable.power=true;t.compat038.portable.tank=true;t.compat038.portable.powerTank=true
end)(TLC)

-- Resolve Fog by registration name and decode its actual native flag accessor.
;(function(t)
local function raw(a,n)local b=assert(readBytes(a,n,true));local s={};for i,v in ipairs(b)do s[i]=string.char(v)end;return table.concat(s)end
local function signed(a)return string.unpack('&lt;i4',raw(a,4))end
t.SIGS.FogDispatch116={len=0,bytes={},bootstrapPattern='40 53 48 83 EC 20 81 FA ?? ?? ?? ?? 0F 87 ?? ?? ?? ?? 8B C2 4C 8D 05 ?? ?? ?? ?? 41 0F B6 84 00 ?? ?? ?? ?? 41 8B 94 80 ?? ?? ?? ?? 49 03 D0 FF E2'}
function t.fogBitContract116()
 local old=t.fogBitCache116;if old and old.pid==getOpenedProcessID()and old.module==t.moduleRequired()then return old end
 local pattern='48 8D 15 ?? ?? ?? ?? 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 4C 8D 85 ?? ?? ?? ?? BA ?? ?? ?? ?? 48 8B CB E8 ?? ?? ?? ??'
 local rows,why=t.scanFile074(pattern,function(site)
  local name=site+7+signed(site+3)
  if raw(name,8)=='F\0o\0g\0\0\0'then return site end
 end,true)
 assert(rows and #rows&gt;0,'Fog named registration unavailable: '..tostring(why))
 local index=assert(readInteger(rows[1]+27))
 for _,site in ipairs(rows)do assert(readInteger(site+27)==index,'Fog named registrations disagree')end
 local dispatch=assert(t.resolveSig('FogDispatch116'),'Fog native accessor switch unavailable')
 local code=raw(dispatch,49);local maximum=string.unpack('&lt;I4',code,9)
 assert(index&lt;=maximum and maximum&lt;=4096,'Fog index exceeds native switch range')
 local base=dispatch+27+string.unpack('&lt;i4',code,24)
 local mapping=base+string.unpack('&lt;i4',code,33);local jumps=base+string.unpack('&lt;i4',code,41)
 local selector=assert(readBytes(mapping+index,1));local target=base+signed(jumps+selector*4)
 local first,last=t.runtimeFunction074(dispatch);assert(first==dispatch and target&gt;=first and target&lt;last,'Fog switch target exceeds native scope')
 local b=raw(target,24);local offset,used,shift
 if b:sub(1,2)=='\139\65'then offset=b:byte(3);used=3
 elseif b:sub(1,2)=='\139\129'then offset=string.unpack('&lt;I4',b,3);used=6
 elseif b:sub(1,3)=='\15\182\65'then offset=b:byte(4);used=4
 elseif b:sub(1,3)=='\15\182\1'then offset=0;used=3
 else error('Fog native bit load ABI changed')end
 if b:sub(used+1,used+2)=='\193\232'then shift=b:byte(used+3);used=used+3
 elseif b:sub(used+1,used+2)=='\209\232'then shift=1;used=used+2
 else shift=0 end
 assert(shift&lt;32 and b:sub(used+1,used+2)=='\36\1','Fog native bit normalization changed')
 assert(b:sub(used+3,used+8)=='\72\131\196\32\91\195','Fog native accessor return ABI changed')
 local c={pid=getOpenedProcessID(),module=t.moduleRequired(),index=index,offset=offset+shift//8,mask=1&lt;&lt;(shift%8),dispatch=dispatch,target=target,registrations=#rows}
 assert(c.offset&lt;4096);t.fogBitCache116=c;return c
end
t.SIGS.FogViewCopy039.bootstrapPattern='4C 8D 8F ?? ?? ?? ?? 49 8B D5 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ??'
function t.fogTarget116()
 local engine=t.U.ge and readQword(t.U.ge);assert(engine and t.valid(engine),'Engine unavailable')
 local viewport=assert(t.readObjectField074(engine,'GameViewport'),'Game viewport unavailable');assert(t.U.isA(viewport,'GameViewportClient'),'Game viewport class mismatch')
 local bit=t.fogBitContract116();local old=t.fogViewportCache116
 if old and old.pid==getOpenedProcessID()and old.identity.object==viewport and t.sameIdentity029(old.identity)and old.mask==bit.mask and old.bitOffset==bit.offset then
  assert(readQword(viewport+old.interface)==old.vtable and readQword(old.vtable+old.slot*8)==old.getter and raw(old.getter,8)==old.getterBytes,'Viewport accessor identity changed')
  return {identity=old.identity,address=viewport+old.interface+old.member+bit.offset,pid=t.pid,mask=bit.mask}
 end
 local copy=assert(t.resolveSig('FogViewCopy039'),'Viewport show-flag copy unavailable');local first=t.runtimeFunction074(copy)
 assert(raw(first,128):find('\72\139\249',1,true),'Viewport draw receiver correspondence changed')
 local b=raw(copy,7);assert(b:sub(1,3)=='\76\141\143','Viewport show-flag copy ABI changed');local member=string.unpack('&lt;I4',b,4)
 local cls=assert(t.refClass('GameViewportClient'));local p=readQword(cls+0x50);local boundary
 for i=1,512 do
  if not p or p==0 then break end;local off=readInteger(p+0x44)
  if off and off&gt;=0x28 then boundary=math.min(boundary or off,off)end;p=readQword(p+0x18)
 end
 assert(boundary and boundary&lt;=4096,'Viewport base-interface bounds unavailable')
 local candidates={};local seen={}
 for off=0x28,boundary-8,8 do
  local vt=readQword(viewport+off)
  if vt and t.image038 and vt&gt;=t.image038.base and vt+8&lt;=t.image038.base+t.image038.size then
   local draw=false;local getter,slot
   for index=0,511 do
    local a=readQword(vt+index*8);if not a or not t.executable038(a,1)then break end
    if a==first then draw=true end
    local code=raw(a,8)
    if code:sub(1,3)=='\72\141\129'and code:byte(8)==0xc3 and string.unpack('&lt;I4',code,4)==member then getter=a;slot=index end
   end
   if draw and getter then
    local key=tostring(off)..'/'..member
    if not seen[key]then seen[key]=true;candidates[#candidates+1]={interface=off,member=member,vtable=vt,getter=getter,slot=slot}end
   end
  end
 end
 assert(#candidates==1,'Viewport show-flag interface is missing or ambiguous')
 local c=candidates[1];c.pid=getOpenedProcessID();c.identity=assert(t.identity029(viewport));c.mask=bit.mask;c.bitOffset=bit.offset;c.getterBytes=raw(c.getter,8);t.fogViewportCache116=c
 return {identity=c.identity,address=viewport+c.interface+c.member+bit.offset,pid=t.pid,mask=bit.mask}
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='clearWater'then local okay,why=pcall(t.fogTarget116);if okay then return true end;return false,tostring(why)end
 return check(key)
end
t.compat038.portable.clearWater=true
end)(TLC)

-- Non-reflected pending-attachment members are derived from checked native readers.
;(function(t)
local function raw(a,n)local b=assert(readBytes(a,n,true));local s={};for i,v in ipairs(b)do s[i]=string.char(v)end;return table.concat(s)end
local function rel(a)return a+5+string.unpack('&lt;i4',raw(a+1,4))end
local function body(a,allowLeaf)
 local okay,first,last=pcall(t.runtimeFunction074,a)
 if not okay then
  assert(allowLeaf,'Area native function scope unavailable')
  first=a;local ip=a;local previous;local branches={}
  for i=1,128 do
   local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15);local b=raw(ip,n)
   if b=='\204'then assert(previous=='\195','Leaf map reader has no bounded return');last=ip;break end
   assert(b:byte(1)~=0xe8 and b:byte(1)~=0x50 and b:byte(1)~=0x55,'Leaf map reader call/frame ABI changed')
   if n==2 and b:byte(1)&gt;=0x70 and b:byte(1)&lt;=0x7f then branches[#branches+1]=ip+2+string.unpack('&lt;i1',b,2)
   elseif n==6 and b:byte(1)==0x0f and b:byte(2)&gt;=0x80 and b:byte(2)&lt;=0x8f then branches[#branches+1]=ip+6+string.unpack('&lt;i4',b,3)end
   previous=b;ip=ip+n;assert(ip-a&lt;=512,'Leaf map reader exceeds instruction bound')
  end
  assert(last,'Leaf map reader padding boundary unavailable')
  for _,target in ipairs(branches)do assert(target&gt;=first and target&lt;last,'Leaf map reader branch escapes scope')end
 end
 assert(first==a and last-first&lt;=65536,'Area native function scope changed');return raw(a,last-first),first,last
end
local function instructions(first,last)
 local rows={};while first&lt;last do local n=assert(getInstructionSize(first));assert(n&gt;0 and n&lt;=15);rows[#rows+1]={a=first,b=raw(first,n)};first=first+n end;return rows
end
t.SIGS.AreaPendingReader117={len=0,bytes={},bootstrapPattern='48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 4C 89 74 24 20 55 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8D 99 ?? ?? ?? ?? 4C 8B F2'}
t.SIGS.AreaReferenceEntry117={len=0,bytes={},bootstrapPattern='48 8D 79 ?? E8 ?? ?? ?? ?? 4C 8B F0 48 85 C0 0F 84 ?? ?? ?? ?? 48 83 3F 00 0F 84 ?? ?? ?? ?? 48 63 5F ?? 33 C0 48 8B 77 ??'}
function t.areaLayout117()
 local old=t.areaLayoutCache117
 if old and old.pid==getOpenedProcessID()and t.sameIdentity029(old.identity)then return old end
 t.requireSigs({'AreaPendingReader117','AreaReferenceEntry117','AreaDetachable037','AreaResolve037'})
 local reader=assert(t.A.AreaPendingReader117);local code,first,last=body(reader)
 local pending=assert(code:find('\72\141\153',1,true));local map=string.unpack('&lt;I4',code,pending+3)
 local a,b=t.runtimeFunction074(assert(t.A.AreaDetachable037));local calls=0
 for _,row in ipairs(instructions(a,b))do if #row.b==5 and row.b:byte(1)==0xe8 and rel(row.a)==reader then calls=calls+1 end end
 assert(calls==1,'Pending-attachment reader is not the verified detachability dependency')
 -- Verify both nested-set element strides and the value start used by this reader.
 local outer=code:find('\72\141\20\64',1,true);local inner=code:find('\72\141\12\64',1,true)
 assert(outer and inner,'Pending-attachment iterator scale changed')
 local outerShift=code:sub(outer,outer+24):match('\72\193\226(.)');local innerShift=code:sub(inner,inner+12):match('\72\193\225(.)')
 assert(outerShift and innerShift,'Pending-attachment iterator shift unavailable')
 local valueOffset=code:sub(outer,outer+24):match('\72\131\195(.)')
 assert(valueOffset,'Pending-attachment value offset unavailable');valueOffset=valueOffset:byte()
 local outerStride=3*(1&lt;&lt;outerShift:byte());local innerStride=3*(1&lt;&lt;innerShift:byte())
 assert(outerStride&gt;=valueOffset+80 and outerStride&lt;=4096 and innerStride&gt;=48 and innerStride&lt;=4096,'Pending attachment element bounds invalid')
 local entry=assert(t.A.AreaReferenceEntry117);local data=raw(entry,41);local pathInEntry=data:byte(4)
 local stringCount=data:byte(35);local stringData=data:byte(41)
 local updateFirst,updateLast=t.runtimeFunction074(entry);local updateCode=raw(updateFirst,updateLast-updateFirst);local resolverCalls=0
 for _,row in ipairs(instructions(updateFirst,updateLast))do if #row.b==5 and row.b:byte(1)==0xe8 and rel(row.a)==t.A.AreaResolve037 then resolverCalls=resolverCalls+1 end end
 assert(resolverCalls==1,'Pending reference processing does not call the verified resolver')
 local path=assert(t.findMetadata074('SoftObjectPath','ScriptStruct'));local pathSize=assert(readInteger(path+0x58))
 local sub,subSize=t.refFieldLayout(path,'SubPathString','struct');local asset,assetSize=t.refFieldLayout(path,'AssetPath','struct')
 assert(sub and subSize==16 and asset==0 and assetSize and sub==assetSize and sub+16==pathSize,'Soft path metadata contract changed')
 assert(stringData==sub and stringCount==sub+8,'Pending UTF8 path fields disagree with named soft-path metadata')
 assert(updateCode:find('\184\1\0\0\0\139\208\139\200',1,true),'Pending path byte-element allocation ABI changed')
 -- The normal conversion API establishes the soft-pointer prefix size.
 local convert=assert(t.reflectedFunction069('KismetSystemLibrary','Conv_SoftObjPathToSoftObjRef'))
 local _,softSize=t.refFieldLayout(convert,'ReturnValue','function');assert(softSize and softSize&gt;pathSize and softSize&lt;=128)
 local prefix=softSize-pathSize;assert(prefix==8 and pathInEntry&gt;=prefix,'Soft pointer weak-prefix ABI changed')
 local reference=pathInEntry-prefix;local header=prefix+sub;assert(reference+softSize&lt;=innerStride,'Pending reference exceeds element bounds')
 local cls=assert(t.refClass('VoyageLocatorSubsystem'));local getter=assert(t.reflectedFunction069('VoyageLocatorSubsystem','GetMainStreamingGridName'))
 local offset,size=t.refFieldLayout(getter,'ReturnValue','function');assert(offset==0 and size==8,'Main-grid getter return ABI changed')
 local native=assert(readQword(getter+0xd8));local main;local ip=native
 for i=1,24 do local n=getInstructionSize(ip);local row=raw(ip,n)
  if n==7 and row:sub(1,3)=='\72\139\129'and raw(ip+n,3)=='\73\137\0'then assert(not main,'Main-grid getter ambiguous');main=string.unpack('&lt;I4',row,4)end
  if row=='\195'then break end;ip=ip+n;assert(ip-native&lt;128)
 end
 assert(main,'Main-grid member unavailable')
 local cell=assert(t.reflectedFunction069('VoyageLocatorSubsystem','GetStreamingCellSize'));local cellNative=assert(readQword(cell+0xd8));local ca,cz=t.runtimeFunction074(cellNative);local cellCalls={}
 for _,row in ipairs(instructions(ca,cz))do if #row.b==5 and row.b:byte(1)==0xe8 then cellCalls[#cellCalls+1]=rel(row.a)end end
 local gridBody=assert(cellCalls[#cellCalls]);local gridCode,ga,gz=body(gridBody,true)
 local countAt=gridCode:find('\139\129',1,true);local gridAt=gridCode:find('\73\139\146',1,true)
 assert(countAt and gridAt,'Streaming-grid map reader changed')
 local grid=string.unpack('&lt;I4',gridCode,gridAt+3);assert(string.unpack('&lt;I4',gridCode,countAt+2)==grid+8,'Streaming-grid map header correspondence changed')
 local valueAt=gridCode:find('\72\141\72',1,true)
 assert(valueAt and gridCode:find('\72\141\12\64',1,true)and gridCode:sub(valueAt,valueAt+24):find('\242\15\16\1',1,true),'Streaming-grid key/value ABI changed')
 local gridValue=gridCode:byte(valueAt+3);assert(gridValue==8,'Streaming-grid value alignment changed')
 local c={pid=getOpenedProcessID(),identity=assert(t.identity029(getter)),pending=map,outerStride=outerStride,innerStride=innerStride,set=valueOffset,
  reference=reference,prefix=prefix,header=header,stringPointer=reference+prefix+sub,stringCount=reference+prefix+sub+8,stringCapacity=reference+prefix+sub+12,softSize=softSize,
  main=main,grids=grid,gridStride=24,gridValue=gridValue}
 t.areaLayoutCache117=c;return c
end
function t.areaContext117()
 t.need();local player=t.player(true);local locator,world=t.worldSubsystem107('VoyageLocatorSubsystem');local c=t.areaLayout117()
 local persistent=assert(t.readObjectField074(locator,'PersistentSubsystem'),'Persistent subsystem unavailable');assert(t.U.isA(persistent,'VoyagePersistentSubsystem'))
 local abi=t.resourceReadContract102();assert(abi.stride==c.gridStride and abi.value==c.gridValue,'Streaming-grid container ABI unverified')
 local main=readQword(locator+c.main);local size
 for _,row in ipairs(t.map(locator+c.grids,c.gridStride))do if readQword(row)==main then size=readDouble(row+c.gridValue)end end
 assert(size and size==size and size&gt;0 and size&lt;1e10,'Streaming grid size unavailable')
 local position=t.actorLocation109(player);local x,y=math.floor(position[1]/size),math.floor(position[2]/size)
 assert(math.abs(x)&lt;32768 and math.abs(y)&lt;32768,'Streaming coordinates outside supported range')
 return {world=world,player=player,locator=locator,persistent=persistent,pos=position,cell=x..':'..y,pid=t.pid,layout=c}
end
function t.areaReference117(entry)
 local c=t.areaLayout117();local pointer,count,capacity=readQword(entry+c.stringPointer),readInteger(entry+c.stringCount),readInteger(entry+c.stringCapacity)
 if not pointer or pointer==0 or not count or count&lt;=1 or count&gt;4096 or not capacity or capacity&lt;count then return end
 local bytes=readBytes(pointer,count,true);if not bytes or bytes[count]~=0 then return end
 local text=string.char(table.unpack(bytes,1,count-1));if text:find('\0',1,true)then return end
 local header=readBytes(entry+c.reference,c.header,true);if not header then return end
 return {path=text,bytes=bytes,header=header,n=count,prefix=c.prefix,size=c.softSize,stringPointer=c.stringPointer-c.reference,stringCount=c.stringCount-c.reference,stringCapacity=c.stringCapacity-c.reference}
end
function t.copyAreaReference117(ref)
 assert(ref.size&lt;=256 and ref.n&lt;=4096,'Area reference exceeds owned buffer bound')
 local buffer=assert(allocateMemory(256+ref.n))
 for i=0,ref.size-1 do assert(writeBytes(buffer+i,0))end
 assert(writeBytes(buffer,ref.header)and writeBytes(buffer+256,ref.bytes))
 assert(writeQword(buffer+ref.stringPointer,buffer+256)and writeInteger(buffer+ref.stringCount,ref.n)and writeInteger(buffer+ref.stringCapacity,ref.n))
 return buffer
end
end)(TLC)

-- Derive relocated branch destinations from verified native instructions.
;(function(t)
local previous=t.prepareFabricator108
function t.fabricatorBranch118(name)
 local site=assert(t.resolveSig(name),'Fabricator branch unavailable: '..name)
 local b=t.branchSource127(name,site,5)
 assert(#b==5 and b[1]==0x45 and b[2]==0x84 and b[3]==0xE4 and b[4]==0x74,'Fabricator conditional branch contract changed')
 local displacement=b[5];if displacement&gt;=128 then displacement=displacement-256 end
 local first,last=t.runtimeFunction074(site)
 local destination=site+5+displacement
 assert(destination&gt;=first and destination&lt;last,'Fabricator branch leaves verified function')
 return destination
end
function t.prepareFabricator108(scope)
 local result=previous(scope)
 if scope~='fabricatorGate2'and scope~='noCraftPower'then
  for _,row in ipairs({{'fabricationProgress2','FabricationProgress'},{'fabricationFree049','FabricationFree049'}})do
   local destination=t.fabricatorBranch118(row[2])
   local script,count=t.HOOKS[row[1]].aa:gsub('%$SITE%+%x+',('%X'):format(destination))
   assert(count==1,'Fabricator branch substitution is missing or ambiguous')
   t.HOOKS[row[1]].aa=script
  end
 end
 return result
end
end)(TLC)

-- Remaining public helpers resolve game members by identity and property name.
;(function(t)
function t.inventory()
 local player=t.player(true)
 local inventory=t.readObjectField074(player,'WeightInventory')
 assert(inventory and t.U.isA(inventory,'VoyageBaseInventoryComponent'),'Player inventory unavailable')
 return inventory
end
function t.timeActors119()
 local world=assert(t.world(),'World unavailable')
 local level=assert(t.readObjectField074(world,'PersistentLevel'),'Persistent level unavailable')
 local array=t.levelActors074(level);local result={}
 for index=0,array.count-1 do
  local actor=readQword(array.data+index*8)
  if t.valid(actor)then
   local name=t.U.c(actor)
   local key=name=='BP_PersistentWorldTime_C'and'clock'or name=='Ultra_Dynamic_Sky_Voyage_C'and'sky'
   if key then assert(not result[key],'Ambiguous environment actor: '..key);result[key]=actor end
   if name=='WeatherVolumeActor_C'then
    local volume=t.readObjectField074(actor,'Volume')
    if volume and t.U.isA(volume,'VoyageWeatherVolume')then
     local offset,size=t.refFieldLayout(volume,'Radius',false)
     assert(offset and size==4,'Weather radius metadata unavailable')
     local radius=readFloat(volume+offset)
     if radius and radius&gt;=1e9 then assert(not result.volume,'Ambiguous global weather volume');result.volume=volume end
    end
   end
  end
 end
 return result
end
function t.timeFields119(clock,sky)
 local clockOffset,clockSize=t.refFieldLayout(clock,'WorldTime',false)
 local skyOffset,skySize=t.refFieldLayout(sky,'Time of Day',false)
 assert(clockOffset and clockSize==8 and skyOffset and skySize==8,'Day-clock property contract changed')
 return clockOffset,skyOffset
end
end)(TLC)

-- Material success branch follows the verified native comparison.
;(function(t)
t.SIGS.MaterialCheck.bootstrapPattern='41 3B C1 7D ?? 45 84 FF 74 ?? 48 8B 13 44 2B C8 4D 8B C4 C6 44 24 20 01 49 8B CE E8 ?? ?? ?? ?? 84 C0 74 ?? 8B 45 ?? 48'
t.SIGS.FabricationProgress.bootstrapPattern='45 84 E4 74 ?? F3 41 0F 10 86 ?? ?? ?? ?? F3 41 0F 5C C7 F3 41 0F 5F C6 F3 41 0F 11 86 ?? ?? ?? ?? F3 41 0F 10 8E ?? ??'
t.SIGS.FabricationFree049.bootstrapPattern='45 84 E4 74 ?? F3 41 0F 10 96 ?? ?? ?? ?? F3 41 0F 5C D7 F3 41 0F 5F D6 F3 41 0F 11 96 ?? ?? ?? ?? 41 83 BE ?? ?? ?? ??'
local template=assert(t.HOOKS.materialCheck2.aa)
function t.prepareMaterialBranch120()
 local site=assert(t.resolveSig('MaterialCheck'),'Material comparison unavailable')
 local b=t.branchSource127('MaterialCheck',site,5)
 assert(#b==5 and b[1]==0x41 and b[2]==0x3B and b[3]==0xC1 and b[4]==0x7D,'Material comparison/branch contract changed')
 local displacement=b[5];if displacement&gt;=128 then displacement=displacement-256 end
 local first,last=t.runtimeFunction074(site);local destination=site+5+displacement
 assert(destination&gt;=first and destination&lt;last,'Material success branch leaves verified function')
 local script,count=template:gsub('%$SITE%+24',('%X'):format(destination))
 assert(count==2,'Material branch substitution is missing or ambiguous')
 t.HOOKS.materialCheck2.aa=script;return destination
end
local hook=t.hookOn
function t.hookOn(name)
 if name=='materialCheck2'then t.prepareMaterialBranch120()end
 return hook(name)
end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='materials'then
  local okay,why=pcall(t.prepareMaterialBranch120)
  if not okay then return false,tostring(why)end
 end
 if key=='materials'or key=='instant'then
  local okay,why=pcall(t.prepareFabricator108,key)
  if not okay then return false,tostring(why)end
 end
 return check(key)
end
end)(TLC)

-- Output layout migration only: preserve wind/wave behavior and safety policy.
;(function(t)
local template=assert(t.HOOKS.weatherOutput2.aa)
local function raw(a,n)local b=assert(readBytes(a,n,true));local s={};for i,v in ipairs(b)do s[i]=string.char(v)end;return table.concat(s)end
local function field(o,name,size,kind)
 local offset,actual=t.refFieldLayout(o,name,kind)
 assert(offset and actual==size,'Weather output field contract changed: '..name);return offset
end
local function calls(entry,limit)
 local first,last=t.runtimeFunction074(entry);assert(first==entry and last-first&lt;=limit,'Weather dispatch function exceeds verification bound')
 local rows={};local ip=first
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15)
  if n==5 and readBytes(ip,1)==0xe8 then local d=string.unpack('&lt;i4',raw(ip+1,4));rows[#rows+1]={site=ip,target=ip+5+d}end
  ip=ip+n
 end
 return rows,first,last
end
function t.weatherOutputLayout121()
 local cls=assert(t.refClass('VoyageWeatherSubsystem'))
 local fn=assert(t.reflectedFunction069('VoyageWeatherSubsystem','GetWeather'))
 local wind=assert(t.findMetadata074('VoyageWorldWind','ScriptStruct'))
 local waves=assert(t.findMetadata074('WaveProperties','ScriptStruct'))
 local waveSize=assert(readInteger(waves+0x58));local windSize=assert(readInteger(wind+0x58))
 assert(waveSize&gt;0 and waveSize&lt;=4096 and windSize&gt;0 and windSize&lt;=256,'Weather output structure exceeds verification bound')
 local order={field(fn,'Location',24,'function'),field(fn,'Climate',40,'function'),field(fn,'Wind',windSize,'function'),field(fn,'WaveProps',16,'function'),field(fn,'ReturnValue',1,'function')}
 for i=2,#order do assert(order[i]&gt;order[i-1],'Weather API argument order changed')end
 local windProperty=t.property076(fn,'Wind','function')
 assert(readQword(windProperty+0x70)==wind,'Weather wind structure identity changed')
 local waveProperty=t.property076(fn,'WaveProps','function');local inner=assert(readQword(waveProperty+0x78))
 assert(readQword(inner+0x70)==waves and readInteger(inner+0x34)==waveSize,'Weather wave array element identity changed')
 local native=assert(t.resolveSig('WeatherNative'),'Native weather output unavailable')
 local wrapperCalls=calls(assert(readQword(fn+0xd8)),4096)
 local matches={}
 for _,row in ipairs(wrapperCalls)do
  if t.executable038(row.target,32)and raw(row.target,3)=='\72\131\236'then
   local okay,bodyCalls=pcall(calls,row.target,256)
   if okay then
    for _,child in ipairs(bodyCalls)do
     if child.target==native then
      local frame=readBytes(row.target+3,1)
      -- Win64 stack argument forwarding and the additional resource mask must
      -- agree with the six-argument output wrapper used by this hook.
      local prefix='\72\131\236'..string.char(frame)..'\72\139\68\36'..string.char(frame+0x28)..'\198\68\36\40\255\72\137\68\36\32'
      assert(frame&lt;=0x70 and raw(row.target,#prefix)==prefix,'Weather native argument forwarding changed')
      assert(child.site==row.target+#prefix and raw(child.site+5,5)=='\72\131\196'..string.char(frame)..'\195','Weather native forwarding epilogue changed')
      matches[#matches+1]=row.target
     end
    end
   end
  end
 end
 assert(#matches==1,'Named GetWeather/native output correspondence is missing or ambiguous')
 local c={waveSize=waveSize,windSize=windSize,direction=field(wind,'Direction',4,'struct'),speed=field(wind,'SpeedInKm',4,'struct'),native=native,bridge=matches[1]}
 for _,name in ipairs({'MinWavelength','MaxWavelength','MinAmplitude','MaxAmplitude','SmallWaveSteepness','LargeWaveSteepness'})do c[name]=field(waves,name,4,'struct');assert(c[name]+4&lt;=waveSize,'Wave property exceeds reflected structure')end
 assert(c.direction+4&lt;=windSize and c.speed+4&lt;=windSize,'Wind property exceeds reflected structure')
 return c
end
function t.prepareWeatherOutput121()
 local c=t.weatherOutputLayout121()
 local replacements={['[r11+08]']=('[r11+%X]'):format(c.direction),['[r11+0C]']=('[r11+%X]'):format(c.speed),
  ['[rdx+14]']=('[rdx+%X]'):format(c.MinWavelength),['[rdx+18]']=('[rdx+%X]'):format(c.MaxWavelength),
  ['[rdx+20]']=('[rdx+%X]'):format(c.MinAmplitude),['[rdx+24]']=('[rdx+%X]'):format(c.MaxAmplitude),
  ['[rdx+30]']=('[rdx+%X]'):format(c.SmallWaveSteepness),['[rdx+34]']=('[rdx+%X]'):format(c.LargeWaveSteepness)}
 local script=template:gsub('%[[^%]\n]+%]',function(part)return replacements[part]or part end)
 local count;script,count=script:gsub('add rdx,40\n',('add rdx,%X\n'):format(c.waveSize));assert(count==1,'Wave stride substitution is missing or ambiguous')
 t.HOOKS.weatherOutput2.aa=script;return c
end
local hook=t.hookOn
function t.hookOn(name)if name=='weatherOutput2'then t.prepareWeatherOutput121()end;return hook(name)end
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='wind'or key=='waves051'then
  local okay,why=pcall(t.prepareWeatherOutput121);if okay then return true end;return false,tostring(why)
 end
 return check(key)
end
t.compat038.portable.wind=true;t.compat038.portable.waves051=true
end)(TLC)

-- Named API frames for the existing time-control sequence; no weather behavior change.
;(function(t)
local function property(owner,name,size,kind)
 local p=t.property076(owner,name,kind);local offset,actual=t.refFieldLayout(owner,name,kind)
 assert(offset and actual==size,'Time property contract changed: '..name)
 return {property=p,offset=offset,size=size,class=assert(readQword(p+8))}
end
function t.timeFunction123(object,name,spec)
 local c=t.objectApiContract076(object,t.U.c(object),name);assert(c.size&lt;=512,'Time API frame exceeds bound')
 local fields={};local count=0;local p=readQword(c.fn+0x50);local seen={}
 for i=1,256 do
  if not p or p==0 then break end;assert(not seen[p],'Time API property cycle');seen[p]=true
  local flags=assert(readQword(p+0x38))
  if(flags&amp;0x80)~=0 then
   local label=t.U.name(readInteger(p+0x20));local size=assert(spec[label],'Unexpected time API parameter: '..label)
   local f=property(c.fn,label,size,'function');assert(f.offset+size&lt;=c.size,'Time API parameter exceeds frame')
   assert(((flags&amp;0x400)~=0)==(label=='ReturnValue'),'Time API return direction changed: '..label)
   fields[label]=f;count=count+1
  end
  p=readQword(p+0x18)
 end
 local expected=0;for name in pairs(spec)do assert(fields[name],'Missing time API parameter: '..name);expected=expected+1 end
 assert(count==expected,'Time API parameter count changed');c.fields=fields;return c
end
local function boolean(field)
 local reference=t.property076(assert(t.refClass('Actor')),'bHidden',true)
 assert(field.class==readQword(reference+8),'Time API Boolean type changed')
 local b=assert(readBytes(field.property+0x70,4,true))
 assert(b[1]==1 and b[2]==0 and b[3]&gt;0 and b[4]&gt;0,'Time API Boolean storage changed')
 field.trueValue=b[3];field.mask=b[4];return field
end
function t.timeTransitionContract123(sky)
 local c=t.timeFunction123(sky,'Transition Time of Day',{['New Time of Day']=8,['Transition Duration (Seconds)']=8,['Easing Function']=1,['Easing Exponent']=8,['Allow Time Going Backwards']=1})
 local reference=property(sky,'Time of Day',8,false)
 for _,name in ipairs({'New Time of Day','Transition Duration (Seconds)','Easing Exponent'})do assert(c.fields[name].class==reference.class,'Time transition scalar type changed: '..name)end
 boolean(c.fields['Allow Time Going Backwards'])
 local _,values=t.enumProperty076(c.fields['Easing Function'].property);c.linear=assert(values.Linear,'Linear easing enum unavailable')
 return c
end
function t.timeWorldContract123(level)
 local state=assert(t.findMetadata074('VoyageWorldState','ScriptStruct'));local size=assert(readInteger(state+0x58))
 local get=t.timeFunction123(level,'GetWorldState',{ReturnValue=size})
 local set=t.timeFunction123(level,'SetWorldState',{NewState=size,InterSpeed=4})
 assert(readQword(get.fields.ReturnValue.property+0x70)==state and readQword(set.fields.NewState.property+0x70)==state,'World-state API structure identity changed')
 local timeProperty=t.property076(state,'Time','struct');local timeType=assert(readQword(timeProperty+0x70));local timeSize=assert(readInteger(timeType+0x58))
 local time=property(state,'Time',timeSize,'struct');local hour=property(timeType,'TimeOfDay',4,'struct')
 assert(time.offset+timeSize&lt;=size and hour.offset+4&lt;=timeSize,'World-state time exceeds structure')
 assert(set.fields.InterSpeed.class==hour.class,'World-state interpolation scalar type changed')
 return {get=get,set=set,size=size,hour=time.offset+hour.offset}
end
function t.timePreflight123(s,level)
 local is=t.timeFunction123(s.clock,'IsActorTickEnabled',{ReturnValue=1});boolean(is.fields.ReturnValue)
 local set=t.timeFunction123(s.clock,'SetActorTickEnabled',{bEnabled=1});boolean(set.fields.bEnabled)
 local result={is=is,set=set,transition=t.timeTransitionContract123(s.sky)}
 if level then result.world=t.timeWorldContract123(level)end
 return result
end
function t.timeReadBoolean123(contract,name,frame)
 local field=boolean(assert(contract.fields[name]));return(readBytes(frame+field.offset,1)&amp;field.mask)~=0
end
function t.changeHour123(s,hour,done,call)
 local level=t.levelScript();if not level then if done then done()end;return end
 local c=t.timeWorldContract123(level)
 call(s,level,'GetWorldState',c.get.size,nil,function(p)
  local bytes=assert(readBytes(p+c.get.fields.ReturnValue.offset,c.size,true))
  if s.originalHour==nil then s.originalHour=assert(readFloat(p+c.get.fields.ReturnValue.offset+c.hour))end
  call(s,level,'SetWorldState',c.set.size,function(frame)
   assert(writeBytes(frame+c.set.fields.NewState.offset,bytes))
   assert(writeFloat(frame+c.set.fields.NewState.offset+c.hour,hour))
   assert(writeFloat(frame+c.set.fields.InterSpeed.offset,0))
  end,done)
 end)
end
function t.tickTime123(s,enabled,done,call)
 local c=t.timeFunction123(s.clock,'SetActorTickEnabled',{bEnabled=1});local field=boolean(c.fields.bEnabled)
 call(s,s.clock,'SetActorTickEnabled',c.size,function(p)assert(writeBytes(p+field.offset,enabled and field.trueValue or 0))end,done)
end
function t.transitionTime123(s,hour,done,call)
 local c=t.timeTransitionContract123(s.sky);local f=c.fields
 call(s,s.sky,'Transition Time of Day',c.size,function(p)
  assert(writeDouble(p+f['New Time of Day'].offset,hour*100))
  assert(writeDouble(p+f['Transition Duration (Seconds)'].offset,0))
  assert(writeBytes(p+f['Easing Function'].offset,c.linear))
  assert(writeDouble(p+f['Easing Exponent'].offset,2))
  assert(writeBytes(p+f['Allow Time Going Backwards'].offset,f['Allow Time Going Backwards'].trueValue))
 end,done)
end
end)(TLC)

-- Explicit enable retries only dependencies actually requested by that feature.
-- This scope starts before typed preflight, not after preflight has already failed.
;(function(t)
local resolve=t.resolveSig
function t.resolveSig(name)
 local scope=t.featureRetryScope124
 if scope and not scope.seen[name]then
  scope.seen[name]=true
  if t.resolution[name]=='failed'then
   t.A[name]=nil;t.resolution[name]=nil;t.failures[name]=nil;t.pend[name]=nil
  end
 end
 return resolve(name)
end
local feature=t.feature
function t.feature(key,on)
 if not on then return feature(key,on)end
 local previous=t.featureRetryScope124
 t.featureRetryScope124={key=key,seen={}}
 local result=table.pack(pcall(feature,key,on))
 t.featureRetryScope124=previous
 if not result[1]then error(result[2],0)end
 return table.unpack(result,2,result.n)
end
end)(TLC)

-- Instance calls resolve on the verified object's actual class hierarchy.
-- Static APIs keep their separate, explicitly validated default-object route.
;(function(t)
function t.instanceFunction125(object,owner,method)
 assert(t.valid(object)and t.U.isA(object,owner),'Native API object type mismatch: '..owner)
 local cls=assert(readQword(object+0x10));local classes={}
 for depth=1,64 do
  assert(t.valid(cls)and not classes[cls],'Instance class hierarchy is invalid');classes[cls]=true
  local fn=readQword(cls+0x48);local visited={};local result
  for i=1,4096 do
   if not fn or fn==0 then break end
   assert(not visited[fn],'Instance function list cycle');visited[fn]=true
   assert(t.valid(fn),'Instance function metadata expired')
   if t.U.n(fn)==method and t.U.isA(fn,'Function')then assert(not result,'Ambiguous instance function: '..method);result=fn end
   fn=readQword(fn+0x28)
  end
  if result then return result end
  cls=readQword(cls+0x40);if not cls or cls==0 then break end
 end
 error('Instance function unavailable: '..owner..'.'..method)
end
function t.objectApiContract076(object,owner,method)
 local fn=t.instanceFunction125(object,owner,method)
 local size=assert(readSmallInteger(fn+0xb6));assert(size&lt;=1024,'Native API parameter block too large')
 t.processEvent074(object,false)
 return {owner=owner,method=method,fn=fn,cdo=object,size=size,isDefault=false,identity=assert(t.identity029(object))}
end
end)(TLC)

-- Named time contracts replace the historical build-wide layout gate.
;(function(t)
local check=t.checkFeature074
function t.checkFeature074(key)
 if key=='noon'or key=='time'then
  if not t.reflectionReady074 then return false,'Time metadata unavailable: '..tostring(t.metadataReason074)end
  local okay,why=pcall(function()
   local actors=t.timeActors119();assert(actors.clock and actors.sky,'Day clock/sky instance unavailable')
   t.timeFields119(actors.clock,actors.sky);t.timePreflight123(actors,t.levelScript())
  end)
  if okay then return true end
  return false,tostring(why)
 end
 return check(key)
end
t.compat038.portable.noon=true;t.compat038.portable.time=true
end)(TLC)

-- Inspect verified original instructions while this table owns an active hook.
-- Unknown jumps and ownership mismatches are never interpreted as originals.
;(function(t)
function t.branchSource127(signature,site,width)
 assert(t.pid==getOpenedProcessID(),'Branch inspection target process changed')
 local spec=assert(t.SIGS[signature]);assert(type(spec.bytes)=='table'and #spec.bytes&gt;=width,'Verified branch bytes unavailable')
 local owner
 for name,state in pairs(t.hookState or{})do
  if state.addr==site then
   assert(not owner,'Ambiguous branch hook ownership')
   assert(t.HOOKS[name]and t.HOOKS[name].sig==signature,'Branch hook signature ownership mismatch')
   owner=state
  end
 end
 local bytes
 if owner then
  assert(type(owner.orig)=='table'and type(owner.patch)=='table'and #owner.orig==#owner.patch and #owner.orig&gt;=width,'Managed branch original/patch data unavailable')
  local actual=assert(readBytes(site,#owner.patch,true),'Managed branch site unreadable')
  assert(#actual==#owner.patch,'Managed branch patch truncated')
  for i,value in ipairs(owner.patch)do assert(actual[i]==value,'Managed branch hook ownership conflict')end
  bytes={};for i=1,width do bytes[i]=owner.orig[i]end
 else
  bytes=assert(readBytes(site,width,true),'Branch site unreadable')
 end
 assert(#bytes==width,'Branch instruction truncated')
 for i=1,width do assert(bytes[i]==spec.bytes[i],'Branch instructions differ from the verified signature')end
 return bytes
end
end)(TLC)

-- Serialize native API requests before touching their shared argument frames.
;(function(t)
local invoke=t.apiInvoke075
local loadAsset=t.loadAsset
local job=t.job
function t.wrapNativeCompletion128(done)
 if not done then return nil end
 return function(...)
  local depth=t.apiCompletionDepth128 or 0;t.apiCompletionDepth128=depth+1
  local result=table.pack(pcall(done,...));t.apiCompletionDepth128=depth
  if not result[1]then error(result[2],0)end
  return table.unpack(result,2,result.n)
 end
end
function t.job(fn,args,guard,done)
 local previous=t.pendingJob
 local result=table.pack(job(fn,args,guard,t.wrapNativeCompletion128(done)))
 if t.pendingJob and t.pendingJob~=previous then t.pendingJob.completionWrapped128=true end
 return table.unpack(result,1,result.n)
end
-- A task-local application can occur while an older call is in flight.
if t.pendingJob and t.pendingJob.done and not t.pendingJob.completionWrapped128 then
 t.pendingJob.done=t.wrapNativeCompletion128(t.pendingJob.done);t.pendingJob.completionWrapped128=true
end
local function capture(label,contract)
 local c={pid=getOpenedProcessID(),world=assert(t.identity029(t.world()),'Native API world unavailable'),scope=t.scope038,catalog=t.catalogBusy075,label=label,continuation=(t.apiCompletionDepth128 or 0)&gt;0}
 if contract then
  c.fn=assert(t.identity029(contract.fn),'Native API function expired')
  c.object=contract.identity
 end
 return c
end
local function alive(c)
 if c.catalog and(c.catalog.cancelled or c.catalog.busy==false)then return false,'cancelled' end
 if c.pid~=getOpenedProcessID()or not t.attached()or not t.sameIdentity029(c.world)or t.world()~=c.world.object then return false,'world/process changed' end
 if c.fn and not t.sameIdentity029(c.fn)then return false,'function expired'end
 if c.object and not t.sameIdentity029(c.object)then return false,'object expired'end
 return true
end
local function failure(c,why)
 if c.catalog and(c.catalog.cancelled or c.catalog.busy==false)then return end
 local message=c.label..': '..tostring(why)
 if c.catalog and c.catalog.itemFailure then c.catalog.itemFailure(message)
 elseif c.catalog and c.catalog.fail then c.catalog.fail(message)
 else t.reason('action',message)end
end
local function within(c,fn,...)
 local scope,owner,depth=t.scope038,t.catalogBusy075,t.userActionDepth025 or 0
 t.scope038=c.scope;t.catalogBusy075=c.catalog;t.userActionDepth025=depth+1
 local result=table.pack(pcall(fn,...))
 t.userActionDepth025=depth;t.scope038=scope
 if t.catalogBusy075==c.catalog then t.catalogBusy075=owner end
 if not result[1]then error(result[2],0)end
 return table.unpack(result,2,result.n)
end
local function schedule(c,run)
 local active,why=alive(c);assert(active,c.label..': '..tostring(why))
 local occupied=t.pendingJob or t.actionBusy025()
 local priorRequests=#(t.actions025 or{})&gt;0 and(t.userActionDepth025 or 0)==0 and(t.apiCompletionDepth128 or 0)==0
 if not occupied and not priorRequests then return within(c,run)end
 local accepted=t.enqueueAction025(function()
  local valid,reason=alive(c)
  if not valid then if reason~='cancelled'then failure(c,reason)end;return end
  local okay,errorText=pcall(within,c,run)
  if not okay then failure(c,errorText)end
 end,nil,function()
  local valid,reason=alive(c)
  if not valid and reason~='cancelled'then failure(c,reason)end
  return valid
 end)
 assert(accepted,t.T('Native API queue is full.','ゲーム内APIの待機数が上限です。'))
 -- Preserve FIFO within continuations, ahead of unrelated new requests. This
 -- keeps native output strings/structs alive through their dependent call chain.
 local queue=t.actions025;local request=queue[#queue];request.apiContinuation128=c.continuation
 if c.continuation then
  table.remove(queue)
  local index=1;while queue[index]and queue[index].apiContinuation128 do index=index+1 end
  table.insert(queue,index,request)
 end
 return true
end
function t.apiInvoke075(contract,inputs,done)
 local copy={};for k,v in pairs(contract)do copy[k]=v end
 local values
 if inputs then
  values={}
  for name,bytes in pairs(inputs)do
   assert(type(bytes)=='table','Native API input bytes must be a table')
   local value={};for i=1,#bytes do assert(type(bytes[i])=='number'and bytes[i]&gt;=0 and bytes[i]&lt;=255 and bytes[i]%1==0,'Invalid native API input byte');value[i]=bytes[i]end
   values[name]=value
  end
 end
 local c=capture(tostring(contract.owner)..'.'..tostring(contract.method),copy)
 return schedule(c,function()
  local previous=t.pendingJob
  local result=invoke(copy,values,function(frame)
   local valid,reason=alive(c);if not valid then if reason~='cancelled'then failure(c,reason)end;return end
   local depth=t.apiCompletionDepth128 or 0;t.apiCompletionDepth128=depth+1
   local okay,why=pcall(function()if done then within(c,done,frame)end end)
   t.apiCompletionDepth128=depth
   if not okay then failure(c,why)end
  end)
  local job=t.pendingJob
  if job and job~=previous and not job.apiRequest128 then job.apiRequest128=c;job.catalogOwner075=c.catalog end
  return result
 end)
end
function t.loadAsset(path,done)
 -- loadAsset prepares a path inside the MakeSoftObjectPath frame before its
 -- first apiInvoke. Defer that entire preparation, not just the later call.
 assert(type(path)=='string','Asset path must be a string')
 local c=capture('loadAsset')
 return schedule(c,function()return loadAsset(path,done)end)
end
end)(TLC)

-- Local-analysis candidate: complete growth through named engine/Blueprint APIs.
-- Own-buffer offsets below are not game member offsets. Game fields and calls
-- are resolved and type-checked from reflection before dispatch.
;(function(t)
local key='plantGrowth129'
t.NAMES[408]={'Instant plant growth (trees / saplings / seeds)','植物を即成長（木・苗木・種）'}
local function finite(v)return type(v)=='number'and v==v and math.abs(v)&lt;1e100 end
local function field(object,name,size,kind)
 local p=t.property076(object,name,kind or false)
 local offset=assert(readInteger(p+0x44));assert(offset&gt;=0 and offset&lt;0x10000 and readInteger(p+0x34)==size,'Plant field contract changed: '..name)
 return {property=p,offset=offset,class=assert(readQword(p+8))}
end
function t.plantContract132(object)
 assert(t.valid(object)and t.U.isA(object,'VoyageFarmingSeedActor'),'Plant actor unavailable')
 local seed=field(object,'SeedInfo',8);local info=readQword(object+seed.offset)
 assert(t.valid(info)and t.U.isA(info,'VoyageItemSeed'),'Plant seed data unavailable')
 local value=field(object,'GrowValue',8);local override=field(object,'FruitGrowthOverride',8)
 local vector=assert(t.findMetadata074('Vector','ScriptStruct'));local scalar=field(vector,'X',8,'struct')
 assert(value.class==scalar.class and override.class==scalar.class,'Plant growth scalar type changed')
 local bed=field(object,'SeedBedModule',40);local soft=t.apiContract075('KismetSystemLibrary','Conv_SoftObjectReferenceToObject')
 t.apiMember075(soft,'SoftObject',40);local softReturn=t.apiMember075(soft,'ReturnValue',8)
 local softProperty=t.property076(soft.fn,'SoftObject','function')
 assert(bed.class==readQword(softProperty+8),'Plant bed reference type changed')
 local setter=t.apiContract075('KismetSystemLibrary','SetDoublePropertyByName')
 local input={object=t.apiMember075(setter,'Object',8),name=t.apiMember075(setter,'PropertyName',8),value=t.apiMember075(setter,'Value',8)}
 assert(readQword(t.property076(setter.fn,'Value','function')+8)==scalar.class,'Plant setter scalar type changed')
 local mesh=t.objectApiContract076(object,'VoyageFarmingSeedActor','UpdateMesh')
 assert(mesh.size==0,'Plant mesh update parameters changed')
 local spawn=t.objectApiContract076(object,'VoyageFarmingSeedActor','SpawnFruits');local delta=t.apiMember075(spawn,'Delta',8)
 assert(readQword(t.property076(spawn.fn,'Delta','function')+8)==scalar.class,'Plant fruit delta type changed')
 local rooted=t.objectApiContract076(object,'VoyageFarmingSeedActor','IsRooted');local rootOut=t.apiMember075(rooted,'Output_Rooted',1)
 local rootProperty=t.property076(rooted.fn,'Output_Rooted','function')
 local boolean=t.property076(assert(t.refClass('Actor')),'bHidden',true)
 assert(readQword(rootProperty+8)==readQword(boolean+8),'Plant rooted-result Boolean type changed')
 local bits=assert(readBytes(rootProperty+0x70,4,true));assert(bits[1]==1 and bits[2]==0 and bits[4]&gt;0,'Plant rooted-result storage changed')
 assert(setter.size&lt;=0x80 and spawn.size&lt;=0x80 and rooted.size&lt;=0x80,'Plant API frame exceeds owned buffer')
 return {value=value,override=override,bed=bed,soft=soft,softReturn=softReturn,setter=setter,input=input,mesh=mesh,spawn=spawn,delta=delta,rooted=rooted,rootOut=rootOut,rootMask=bits[4]}
end
-- One game-thread call: engine setter -&gt; stage/model event -&gt; fruit event.
-- The temporary fruit override is restored before this call returns, including
-- when the feature is unchecked while CE is waiting for the completion callback.
local assembly=[==[
[ENABLE]
alloc(tlc_plantBatch132,1000,%s)
registersymbol(tlc_plantBatch132)
registersymbol(tlc_plantBatch132_end)
label(tlc_plantBatch132_end)
label(tlc_plantBatch132_fruit)
label(tlc_plantBatch132_cancel)
label(tlc_plantBatch132_done)
tlc_plantBatch132:
push rbx
push rsi
sub rsp,28
mov rbx,rcx
mov rax,[rbx+90]
mov rdx,[rbx+98]
mov rcx,[rax]
cmp rcx,[rdx]
jne tlc_plantBatch132_cancel
mov rcx,[rax+08]
cmp rcx,[rdx+08]
jne tlc_plantBatch132_cancel
mov rcx,[rax+10]
cmp rcx,[rdx+10]
jne tlc_plantBatch132_cancel
mov rcx,[rax+18]
cmp rcx,[rdx+18]
jne tlc_plantBatch132_cancel
mov rcx,[rax+20]
cmp rcx,[rdx+20]
jne tlc_plantBatch132_cancel
mov rax,[rbx+20]
mov rsi,[rax]
cmp dword ptr [rbx+80],0
je tlc_plantBatch132_fruit
mov rcx,[rbx+30]
mov rdx,[rbx+40]
mov r8,[rbx+48]
call qword ptr [rbx+38]
mov rcx,[rbx]
mov rdx,[rbx+10]
xor r8d,r8d
call qword ptr [rbx+08]
tlc_plantBatch132_fruit:
mov rax,[rbx+20]
movsd xmm0,[rax]
maxsd xmm0,[rbx+88]
movsd [rax],xmm0
mov rcx,[rbx]
mov rdx,[rbx+18]
mov r8,[rbx+50]
call qword ptr [rbx+08]
mov rax,[rbx+20]
mov [rax],rsi
mov rcx,[rbx]
mov rdx,[rbx+70]
mov r8,[rbx+78]
call qword ptr [rbx+08]
mov rax,[rbx+60]
mov rax,[rax]
mov [rbx+68],rax
mov dword ptr [rbx+58],1
jmp tlc_plantBatch132_done
tlc_plantBatch132_cancel:
mov dword ptr [rbx+58],2
tlc_plantBatch132_done:
xor eax,eax
add rsp,28
pop rsi
pop rbx
ret
tlc_plantBatch132_end:
[DISABLE]
]==]
local function owned(s)
 if not s or s.pid~=getOpenedProcessID()or t.pid~=s.pid or getAddressSafe('tlc_plantBatch132')~=s.code then return false end
 local actual=readBytes(s.code,#s.bytes,true);if not actual or #actual~=#s.bytes then return false end
 for i,v in ipairs(s.bytes)do if actual[i]~=v then return false end end;return true
end
function t.ensurePlantBatch132()
 local s=t.plantBatch132;if owned(s)then return s end
 assert(not getAddressSafe('tlc_plantBatch132'),'Unowned plant batch symbol; no changes made')
 local okay,why=autoAssemble(assembly:format(t.moduleRequired()));assert(okay,tostring(why))
 local code=getAddressSafe('tlc_plantBatch132');local last=getAddressSafe('tlc_plantBatch132_end')
 assert(code and last and last&gt;code and last-code&lt;0x200,'Plant batch assembly bounds changed')
 s={pid=getOpenedProcessID(),code=code,bytes=assert(readBytes(code,last-code,true)),header=code+0x200};t.plantBatch132=s;return s
end
local executable=t.executable038
function t.executable038(address,length)
 local s=t.plantBatch132;if s and address==s.code and(length or 1)&lt;=#s.bytes and owned(s)then return true end
 return executable(address,length)
end
function t.runPlantBatch132(object,c,update,done,failed,bedBytes)
 assert(not t.pendingJob,'Plant batch must be dispatched from the native queue')
 local identity=assert(t.identity029(object));local identities={identity}
 -- identity029 intentionally excludes CDOs. Validate the static receiver with
 -- the dedicated class/default-object contract, never as a regular live actor.
 local setterClass=assert(t.refClass('KismetSystemLibrary'))
 assert(t.defaultObject074(setterClass)==c.setter.cdo,'Plant setter default-object identity changed')
 for _,fn in ipairs({c.setter.fn,setterClass,c.mesh.fn,c.spawn.fn,c.rooted.fn})do identities[#identities+1]=assert(t.identity029(fn))end
 local original=readDouble(object+c.override.offset);local growth=readDouble(object+c.value.offset)
 assert(finite(original)and original&gt;=0 and finite(growth)and growth&gt;=0,'Plant scalar is invalid')
 local s=t.ensurePlantBatch132();local p=s.header;local set=p+0x100;local spawn=p+0x180
 local zero={};for i=1,0x300 do zero[i]=0 end;assert(writeBytes(p,zero))
 for offset,value in pairs({[0]=object,[8]=t.processEvent074(object,false),[0x10]=c.mesh.fn,[0x18]=c.spawn.fn,[0x20]=object+c.override.offset,[0x30]=c.setter.cdo,[0x38]=t.processEvent074(c.setter.cdo,true),[0x40]=c.setter.fn,[0x48]=set,[0x50]=spawn,[0x60]=object+c.value.offset})do assert(writeQword(p+offset,value))end
 assert(writeQword(set+c.input.object,object));assert(writeBytes(set+c.input.name,assert(readBytes(c.value.property+0x20,8,true))))
 assert(writeDouble(set+c.input.value,1));assert(writeDouble(spawn+c.delta,0));assert(writeInteger(p+0x80,update and 1 or 0));assert(writeDouble(p+0x88,1))
 assert(type(bedBytes)=='table'and #bedBytes==40,'Verified planted-bed reference unavailable')
 assert(writeQword(p+0x90,object+c.bed.offset));assert(writeQword(p+0x98,p+0x200));assert(writeBytes(p+0x200,bedBytes))
 assert(writeQword(p+0x70,c.rooted.fn));assert(writeQword(p+0x78,p+0x280))
 t.job(s.code,{p},{object,c.spawn.fn},function()
  local okay,why=pcall(function()
   for _,id in ipairs(identities)do assert(t.sameIdentity029(id),'Plant completion identity changed')end
   assert(t.defaultObject074(setterClass)==c.setter.cdo,'Plant setter default-object identity changed')
   local status=readInteger(p+0x58)
   if status==2 then done({actor=object,cancelled=true,reason='plant bed reference changed before dispatch'});return end
   assert(status==1,'Plant game-thread batch did not complete')
   local after=readDouble(p+0x68);assert(finite(after)and after&gt;=1,'Plant growth did not reach the normal completion value')
   local rootByte=assert(readBytes(p+0x280+c.rootOut,1,true))[1]
   done({actor=object,before=growth,after=after,rooted=(rootByte&amp;c.rootMask)~=0,stageRequested=update,fruitRequested=true})
  end)
  if not okay then if failed then failed(why)else error(why,0)end end
 end)
 if t.pendingJob then t.pendingJob.featureOwner102=key end
end
local function alive(s,id)
 return t.plantGrowthState129==s and t.attached()and t.world()==s.world and t.sameIdentity029(s.identity)and(not id or t.sameIdentity029(id))
end
local function fail(s,why)
 s.busy=false
 if t.plantGrowthState129==s then t.reason(key,tostring(why));t.feature(key,false)end
end
local function protect(s,fn)
 return function(...)local okay,why=pcall(fn,...);if not okay then fail(s,why)end end
end
local function unplanted(s,actor)
 local row=s.unplanted and s.unplanted[actor];if not row then return false end
 if getTickCount()&gt;=row.untilTick or not t.sameIdentity029(row.identity)then s.unplanted[actor]=nil;return false end
 local off,size=t.refFieldLayout(actor,'SeedBedModule',false)
 if not off or size~=40 then s.unplanted[actor]=nil;return false end
 local current=readBytes(actor+off,40,true)
 if not current then s.unplanted[actor]=nil;return false end
 for i=1,40 do if current[i]~=row.reference[i]then s.unplanted[actor]=nil;return false end end
 return true
end
function t.queuePlant132(s,object)
 local id=t.identity029(object);if not id then return end;s.busy=true
 local accepted=t.enqueueAction025(function()
  if not alive(s,id)then s.busy=false;return end
  local okay,why=pcall(function()
   local c=t.plantContract132(object)
   local softBytes=assert(readBytes(object+c.bed.offset,40,true))
   t.apiInvoke075(c.soft,{SoftObject=softBytes},protect(s,function(frame)
    if not alive(s,id)then s.busy=false;return end
    local bed=readQword(frame+c.softReturn)
    -- A dropped or unplanted seed must not be silently converted to a tree.
    if not t.valid(bed)or not t.U.isA(bed,'VoyageModuleActor')then
     s.unplanted=s.unplanted or{};s.unplanted[object]={identity=id,reference=softBytes,untilTick=getTickCount()+1000}
     s.busy=false;return
    end
    if s.unplanted then s.unplanted[object]=nil end
    local bedId=assert(t.identity029(bed))
    local queued=t.enqueueAction025(function()
     if not alive(s,id)or not t.sameIdentity029(bedId)then s.busy=false;return end
     local success,errorText=pcall(function()
      local fresh=t.plantContract132(object)
      local value=readDouble(object+fresh.value.offset)
      local row=s.processed[object];local update=not row or not t.sameIdentity029(row)or not finite(value)or value&lt;1
      t.runPlantBatch132(object,fresh,update,function(result)
       if not alive(s,id)then s.busy=false;return end
       if not result.cancelled then
        s.processed[object]=id;s.pendingModels=s.pendingModels or{}
        local off,size=t.refFieldLayout(object,'FruitSockets',false);assert(off and size==16,'Plant socket array contract changed')
        local count=assert(readInteger(object+off+8));assert(count&gt;=0 and count&lt;=4096,'Plant socket count invalid')
        if count&gt;0 then s.pendingModels[object]=nil elseif result.stageRequested then s.pendingModels[object]=true end
       end
       s.results=s.results or{};s.results[object]=result;s.last=result;s.busy=false
       -- A model may still be loading; no visible/harvestable success is claimed.
       -- Retry SpawnFruits on subsequent sweeps after socket generation.
      end,function(errorText)fail(s,errorText)end,softBytes)
      if t.pendingJob then t.pendingJob.cancelled074=function()s.busy=false end end
     end)
     if not success then fail(s,errorText)end
    end,nil,function()local valid=alive(s,id)and t.sameIdentity029(bedId);if not valid then s.busy=false end;return valid end)
    if not queued then s.busy=false end
   end))
   if t.pendingJob and t.pendingJob.apiRequest128 and t.pendingJob.apiRequest128.fn and t.pendingJob.apiRequest128.fn.object==c.soft.fn then
    t.pendingJob.featureOwner102=key;t.pendingJob.cancelled074=function()s.busy=false end
   end
  end)
  if not okay then fail(s,why)end
 end,nil,function()local valid=alive(s,id);if not valid then s.busy=false end;return valid end)
 if not accepted then s.busy=false end
end
function t.stopPlantGrowth129()
 t.plantGrowthState129=nil;t.cancelFeatureJob102(key)
 -- No persistent GrowSpeed or fruit-override edit exists in this implementation.
end
t.F[key]={on=function()
 t.need();local world=assert(t.world(),'Plant world unavailable')
 t.plantGrowthState129={world=world,identity=assert(t.identity029(world)),rows={},processed={},results={},pendingModels={},unplanted={},index=1,next=0,nextQuery=0,query=false,busy=false}
end,off=t.stopPlantGrowth129,task=function()
 local s=t.plantGrowthState129;if not s then return end
 if not alive(s)then t.feature(key,false);return end
 if s.busy or s.query or t.pendingJob or t.pointTimer or(t.userActionDepth025 or 0)&gt;0 or #(t.actions025 or{})&gt;0 or getTickCount()&lt;s.next then return end
 s.next=getTickCount()+100
 if getTickCount()&gt;=(s.nextQuery or 0)then
  s.query=true;s.nextQuery=getTickCount()+500
  local okay,why=pcall(t.queryActors112,'VoyageFarmingSeedActor',function(rows,world)
   if not alive(s)or world~=s.world then return end
   s.rows=rows;s.query=false;s.next=getTickCount()+25
  end)
  if not okay then s.query=false;error(why,0)end
  local pending=t.pendingJob
  if pending and pending.apiRequest128 and pending.apiRequest128.fn then
   pending.featureOwner102=key;pending.cancelled074=function()s.query=false;s.next=getTickCount()+1000 end
  end
  return
 end
 if #s.rows==0 then return end
 local object
 -- New seedlings cannot wait behind an entire orchard of mature trees.
 for _,actor in ipairs(s.rows)do if t.valid(actor)then
  local off,size=t.refFieldLayout(actor,'GrowValue',false);assert(off and size==8,'Plant growth contract changed')
  local value=readDouble(actor+off)
  if finite(value)and value&gt;=0 and value&lt;1 and not unplanted(s,actor)then object=actor;break end
 end end
 -- Once the normal async model callback supplies sockets, finish its fruit
 -- pass ahead of mature-tree maintenance. No callback is invoked twice.
 if not object then for _,actor in ipairs(s.rows)do
  if s.pendingModels and s.pendingModels[actor]and t.valid(actor)then
   local off,size=t.refFieldLayout(actor,'FruitSockets',false);assert(off and size==16,'Plant socket array contract changed')
   if(readInteger(actor+off+8)or 0)&gt;0 then object=actor;break end
  end
 end end
 if not object then s.index=(s.index-1)%#s.rows+1;object=s.rows[s.index];s.index=s.index+1 end
 t.queuePlant132(s,object)
end}
local check=t.checkFeature074
function t.checkFeature074(feature)
 if feature~=key then return check(feature)end
 if not t.reflectionReady074 then return false,'Plant metadata unavailable'end
 local okay,why=pcall(function()
  assert(t.refClass('VoyageFarmingSeedActor'),'Plant actor class unavailable')
  -- Actual instance contracts are resolved on demand, not from a presumed CDO.
  local c=t.apiContract075('GameplayStatics','GetAllActorsOfClass')
  t.apiMember075(c,'WorldContextObject',8);t.apiMember075(c,'ActorClass',8);t.apiMember075(c,'OutActors',16)
 end)
 if okay then return true end;return false,tostring(why)
end
t.compat038.portable[key]=true
local portable=t.portableTick074
function t.portableTick074(...)
 local result=table.pack(pcall(portable,...))
 if not result[1]then t.reason('update',tostring(result[2]))end
 if t.attached()then
  local keys={key};if not result[1]then keys={};for k in pairs(t.featOn)do keys[#keys+1]=k end;table.sort(keys)end
  for _,k in ipairs(keys)do local f=t.F[k]
   if t.featOn[k]and f and f.task then local okay,why=pcall(f.task);if not okay then t.reason(k,tostring(why));pcall(t.feature,k,false)end end
  end
 end
 if result[1]then return table.unpack(result,2,result.n)end
end
local suspend=t.suspendWorld029
function t.suspendWorld029(...)t.stopPlantGrowth129();return suspend(...)end
local forget=t.forgetProcess
function t.forgetProcess(...)
 t.stopPlantGrowth129()
 -- A returning native call must never lose its code/data allocation.
 pcall(unregisterSymbol,'tlc_plantBatch132');pcall(unregisterSymbol,'tlc_plantBatch132_end');t.plantBatch132=nil
 return forget(...)
end
end)(TLC)

-- Reject incoming positive damage before the player damage entry executes.
;(function(t)
local key='invincibleEntry134'
local function equal(a,b) if not a or #a~=#b then return false end;for i,v in ipairs(b)do if a[i]~=v then return false end end;return true end
local function damageSlot()
 local fn=t.reflectedFunction069('GameplayStatics','ApplyDamage')
 local start=assert(readQword(fn+0xd8));assert(t.executable038(start,16),'Damage API native wrapper unavailable')
 local first,last=t.runtimeFunction074(start);assert(first==start and last-start&lt;=4096,'Damage API native function bounds changed')
 local ip=start;local slots={}
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;=1 and n&lt;=15 and ip+n&lt;=last,'Damage API instruction boundary changed')
  local b=readBytes(ip,n,true)
  if n==6 and b[1]==0xff and b[2]==0x90 then
   local slot=readInteger(ip+2);local nextop=disassemble(ip+n):lower()
   if nextop:find('movss',1,true)and nextop:find('xmm0',1,true)then
    assert(slot and slot&gt;=0 and slot%8==0 and slot&lt;0x4000,'Damage virtual slot is invalid');slots[slot]=true
   end
  end
  ip=ip+n
 end
 local slot,count=nil,0;for value in pairs(slots)do slot=value;count=count+1 end
 assert(count==1,'Damage entry virtual slot missing or ambiguous');return slot
end
function t.prepareInvincible134()
 local player=t.player(true);assert(t.U.isA(player,'VoyageCharacter'),'Damage protection requires the player character')
 local slot=damageSlot();local site=assert(readQword(assert(readQword(player))+slot))
 assert(t.executable038(site,16),'Player damage entry unavailable')
 local expected={0x48,0x89,0x5c,0x24,0x08};local state=t.hookState[key]
 if state then assert(state.addr==site,'Player damage implementation changed');assert(t.originalView043(site,expected),'Player damage hook ownership changed')
 else assert(equal(readBytes(site,5,true),expected),'Player damage entry instruction contract changed')end
 t.SIGS.PlayerDamage134={len=5,bytes=expected,p='48 89 5C 24 08'}
 t.A.PlayerDamage134=site;t.resolution.PlayerDamage134='reflection';t.pend.PlayerDamage134=nil
 if not getAddressSafe('tlcA_PlayerDamage134')then registerSymbol('tlcA_PlayerDamage134',site,true)else assert(getAddressSafe('tlcA_PlayerDamage134')==site,'Player damage symbol points to another implementation')end
 t.invincibleProof134={slot=slot,site=site,pid=getOpenedProcessID()};return player
end
local resolve=t.resolveSig
function t.resolveSig(name)
 if name~='PlayerDamage134'then return resolve(name)end
 t.prepareInvincible134();return t.A[name]
end
t.HOOKS[key]={sig='PlayerDamage134',aa=[==[
[ENABLE]
alloc(tlc_invincible134,1000,$SITE)
label(tlc_invincible134_normal)
label(tlc_invincible134_return)
label(tlc_invincible134_data)
registersymbol(tlc_invincible134_data)
tlc_invincible134:
pushfq
push rax
cmp rcx,[tlc_invincible134_data]
jne tlc_invincible134_normal
ucomiss xmm1,[tlc_invincible134_data+18]
jbe tlc_invincible134_normal
mov rax,[tlc_invincible134_data+8]
test rax,rax
je tlc_invincible134_normal
cmp [rax],rcx
jne tlc_invincible134_normal
mov rax,[tlc_invincible134_data+28]
mov eax,[rax]
cmp eax,[tlc_invincible134_data+10]
jne tlc_invincible134_normal
inc qword ptr [tlc_invincible134_data+20]
pop rax
popfq
xorps xmm0,xmm0
ret
tlc_invincible134_normal:
pop rax
popfq
$ORIG
jmp tlc_invincible134_return
align 10
tlc_invincible134_data:
dq 0 0 0 0 0 0
$SITE:
jmp tlc_invincible134
$NOP
tlc_invincible134_return:
[DISABLE]
$SITE:
$ORIG
unregistersymbol(tlc_invincible134_data)
]==]}
function t.updateInvincible134()
 local data=assert(getAddressSafe('tlc_invincible134_data'),'Damage protection data unavailable')
 local player=t.player(false)
 if not player then assert(writeQword(data,0));return end
 local proof=assert(t.invincibleProof134);assert(proof.pid==getOpenedProcessID()and readQword(assert(readQword(player))+proof.slot)==proof.site,'Player damage implementation changed')
 local id=assert(t.identity029(player));local good,entry=t.valid(player);assert(good)
 local objectField,count=nil,0;for offset=0,16,8 do if readQword(entry+offset)==player then objectField=entry+offset;count=count+1 end end
 assert(count==1,'Object-slot pointer identity is missing or ambiguous')
 if readQword(data)==player and readQword(data+8)==objectField and readQword(data+0x28)==entry+0x10 and readInteger(data+0x10)==id.serial then return end
 assert(writeQword(data,0)and writeQword(data+8,objectField)and writeQword(data+0x28,entry+0x10)and writeInteger(data+0x10,id.serial)and writeQword(data,player),'Damage protection identity publication failed')
end
t.F.invincible={hooks={key},on=function()
 t.prepareInvincible134();local okay,why=pcall(function()t.hookOn(key);t.updateInvincible134()end)
 if not okay then local data=getAddressSafe('tlc_invincible134_data');if data then writeQword(data,0)end;if t.hookState[key]then t.hookOff(key)end;error(why,0)end
end,off=function()local data=getAddressSafe('tlc_invincible134_data');if data then assert(writeQword(data,0))end;t.invincibleProof134=nil end,task=t.updateInvincible134}
local check=t.checkFeature074
function t.checkFeature074(feature)
 if feature~='invincible'then return check(feature)end
 if not t.reflectionReady074 then return false,'Player damage metadata unavailable'end
 return true
end
t.compat038.portable.invincible=true
end)(TLC)

-- Cancel only an obsolete request, then reacquire the current battery on the next tick.
;(function(t)
local original=t.F.battery.task
function t.batteryCancellation135(reason)
 if reason=='target/world identity changed' then
  t.batteryCheck102=getTickCount()+250
  t.batteryRetry135=(t.batteryRetry135 or 0)+1
  return true
 end
 return false
end
-- The atomic resource operation remains guarded; only its caller's cancellation policy changes.
local batch=t.aimTankAtomicAdd092
function t.aimTankAtomicAdd092(module,resource,maximum,current,add,done,cancelled)
 local owner=t.scopeBattery135
 return batch(module,resource,maximum,current,add,done,function(reason)
  if owner and t.batteryCancellation135(reason)then return end
  return cancelled(reason)
 end)
end
t.F.battery.task=function(...)
 local prior=t.scopeBattery135;t.scopeBattery135=true
 local result=table.pack(pcall(original,...));t.scopeBattery135=prior
 if not result[1]then error(result[2],0)end
 return table.unpack(result,2,result.n)
end
end)(TLC)

-- Named quest APIs; selection is bound to a local quest object and an explicit task.
;(function(t)
local function bounds(c,x,y,w,h)c.Left=x;c.Top=y;c.Width=w;c.Height=h end
local function bytes(format,value)local s=string.pack(format,value);return{s:byte(1,#s)}end
local function field(o,n,size,kind)local a,z=t.refFieldLayout(o,n,kind);assert(a and z==size,'Quest field contract changed: '..n);return a end
local function safe(callback,failed)
 return function(...)local okay,why=pcall(callback,...);if not okay then failed(tostring(why))end end
end
local function invoke(contract,inputs,done,failed)
 local prior=t.catalogBusy075
 t.catalogBusy075={busy=true,fail=failed}
 local okay,why=pcall(t.apiInvoke075,contract,inputs,safe(done,failed))
 t.catalogBusy075=prior
 if not okay then failed(tostring(why))end
end
local function nextIndex(row,done,failed)
 local c=t.objectApiContract076(row.object,'VoyageQuestObject','GetNextTaskIndex')
 local off=t.apiMember075(c,'ReturnValue',4)
 invoke(c,{},function(frame)done(readInteger(frame+off))end,failed)
end
local function valid(row)
 assert(t.attached()and t.world()==row.world.object and t.sameIdentity029(row.world),'Quest world changed; refresh the list')
 assert(t.sameIdentity029(row.identity)and t.sameIdentity029(row.assetIdentity),'Selected quest expired; refresh the list')
 local owner=t.weak(row.object+field(row.object,'QuestOwner',8,false))
 assert(owner==t.playerController(false)and t.weak(row.object+field(row.object,'Quest',8,false))==row.asset,'Selected quest owner or asset changed')
end
local function status(row,done,failed)
 valid(row)
 local c=t.objectApiContract076(row.object,'VoyageQuestObject','GetQuestData')
 local data=assert(t.findMetadata074('VoyageQuestData','ScriptStruct'));local size=assert(readInteger(data+0x58))
 local off=t.apiMember075(c,'ReturnValue',size)+field(data,'Status',1,'struct')
 local _,enum=t.enumProperty076(t.property076(data,'Status','struct'))
 assert(enum.InProgress,'Quest status enum unavailable')
 invoke(c,{},function(frame)valid(row);done(readBytes(frame+off,1)==enum.InProgress)end,failed)
end
local function text(address,done,failed)
 local c=t.apiContract075('KismetTextLibrary','Conv_TextToString');t.apiMember075(c,'InText',16)
 invoke(c,{InText=assert(readBytes(address,16,true))},function(frame)
  done(t.readApiString075(frame+t.apiMember075(c,'ReturnValue',16)))
 end,failed)
end
function t.questSelectionRows136(done,failed)
 local okay,why=pcall(function()
  t.need();local sys=t.worldSubsystem107('VoyageQuestSubsystem');local layout=t.questLayout107();local pc=t.playerController(true)
  local rows,seen={},{};local world=assert(t.identity029(t.world()))
  for _,p in ipairs(t.map(sys+layout.objects,layout.registryStride))do
   local o=readQword(p+layout.registryValue)
   if t.valid(o)and not seen[o]and t.U.isA(o,'VoyageQuestObject')then
    seen[o]=true;local asset=t.weak(o+field(o,'Quest',8,false));local owner=t.weak(o+field(o,'QuestOwner',8,false))
    if asset and owner==pc then rows[#rows+1]={object=o,asset=asset,identity=assert(t.identity029(o)),assetIdentity=assert(t.identity029(asset)),world=world}end
   end
  end
  local result,index={},0
  local function nextRow()
   index=index+1;local row=rows[index]
   if not row then table.sort(result,function(a,b)return a.name&lt;b.name end);done(result);return end
   status(row,function(active)
    if not active then nextRow();return end
    text(row.asset+field(row.asset,'Name',16,false),function(name)
     valid(row);row.name=name~=''and name or t.T('(Unnamed quest)','（名前のないクエスト）');result[#result+1]=row;nextRow()
    end,failed)
   end,failed)
  end
  nextRow()
 end)
 if not okay then failed(tostring(why))end
end
function t.questSelectionTask136(row,done,failed)
 local okay,why=pcall(function()
  status(row,function(active)
   assert(active,t.T('This quest is no longer in progress. Refresh the list.','このクエストは受注中ではありません。一覧を更新してください。'))
   nextIndex(row,function(index)
    valid(row);local layout=t.questLayout107();local array=row.asset+layout.tasks
    local count=readInteger(array+8);local data=readQword(array)
    assert(index and count and index&gt;=0 and index&lt;count and index&lt;=255 and data,'No unfinished task remains')
    local task=data+index*layout.taskSize
    text(task+field(assert(t.findMetadata074('VoyageQuestTask','ScriptStruct')),'Description',16,'struct'),function(description)
     valid(row);done(index,description,count)
    end,failed)
   end,failed)
  end,failed)
 end)
 if not okay then failed(tostring(why))end
end
function t.advanceSelectedQuest136(row,expected,done,failed)
 assert(not t.questAdvanceBusy136,'Quest advancement already running')
 t.questAdvanceBusy136=true
 local function finishError(why)t.questAdvanceBusy136=nil;failed(tostring(why))end
 local okay,why=pcall(function()
  t.questSelectionTask136(row,function(index)
   if index~=expected then finishError(t.T('The current objective changed. Select it again.','現在の目標が変わりました。選択し直してください。'));return end
   valid(row)
   local c=t.objectApiContract076(row.object,'VoyageQuestObject','CompleteTask')
   t.apiMember075(c,'TaskIndex',4);local result=t.apiMember075(c,'ReturnValue',1)
   invoke(c,{TaskIndex=bytes('&lt;i4',index)},function(frame)
    valid(row);assert(readBytes(frame+result,1)~=0,'The game rejected task completion')
    nextIndex(row,function(nextIndex)
     t.questAdvanceBusy136=nil;done(index,nextIndex)
    end,finishError)
   end,finishError)
  end,finishError)
 end)
 if not okay then finishError(why)end
end
function t.openQuestAdvance136()
 t.require()
 if t.questForm136 then t.questForm136.show();return end
 local form=TLC.uiCreate157('Form',false);t.questForm136=form
 form.Caption=t.T('Advance a selected quest by one objective','クエストを選択して目標を1つ進める');form.ClientWidth=960;form.ClientHeight=580
 form.Font.Size=10;form.Position='poScreenCenter';form.Constraints.MinWidth=976;form.Constraints.MinHeight=620;form.AutoScroll=true
 local list=TLC.uiCreate157('ListBox',form);bounds(list,16,54,400,430);list.Color=0x252525;list.Font.Color=0xFFFFFF;list.Style='lbOwnerDrawFixed'
 list.OnDrawItem=function(sender,index,rect,state)
  if type(index)~='number' or index&lt;0 or index&gt;=sender.Items.Count then return end
  local canvas=sender.Canvas;canvas.Brush.Color=index==sender.ItemIndex and 0x805020 or 0x252525;canvas.Font.Color=0xFFFFFF
  canvas.fillRect(rect.Left,rect.Top,rect.Right,rect.Bottom);canvas.textOut(rect.Left+3,rect.Top,sender.Items[index])
 end
 local details=TLC.uiCreate157('Memo',form);bounds(details,432,54,510,340);details.ReadOnly=true;details.WordWrap=true
 local label=TLC.uiCreate157('Label',form);bounds(label,16,498,925,58);label.AutoSize=false;label.WordWrap=true
 local refresh=createButton(form);bounds(refresh,16,12,400,30);refresh.Caption=t.T('Refresh active quests','受注中クエストを再取得')
 local advance=createButton(form);bounds(advance,432,410,510,34);advance.Caption=t.T('Complete this objective once','この目標を1つだけ完了する');advance.Enabled=false
 local close=createButton(form);bounds(close,432,454,510,30);close.Caption=t.T('Close','閉じる')
 local state={rows={},generation=0,busy=false,closed=false}
 local function errorText(why)
  if not state.closed then state.busy=false;refresh.Enabled=true;advance.Enabled=false;label.Caption=tostring(why)end
  t.reason('questAdvance',tostring(why))
 end
 local function choose()
  if state.busy or state.closed then return end
  state.generation=state.generation+1;local generation=state.generation;advance.Enabled=false;state.index=nil
  local row=state.rows[list.ItemIndex+1];state.selected=row;if not row then return end
  label.Caption=t.T('Reading current objective...','現在の目標を取得中…')
  t.questSelectionTask136(row,function(index,description,count)
   if state.closed or state.generation~=generation then return end
   state.index=index;details.Lines.Text=row.name..'\r\n\r\n'..t.T('Objective ','目標 ')..(index+1)..' / '..count..'\r\n\r\n'..description
   advance.Enabled=true;label.Caption=t.T('Only the selected quest objective will be completed.','選択したクエストの現在の目標だけを完了します。')
  end,errorText)
 end
 local function reload()
  if state.busy or state.closed then return end
  state.busy=true;state.generation=state.generation+1;advance.Enabled=false;refresh.Enabled=false;list.Items.clear();details.Lines.Text='';state.rows={}
  label.Caption=t.T('Loading active quests...','受注中クエストを取得中…')
  t.questSelectionRows136(function(rows)
   if state.closed then return end
   state.rows=rows;state.busy=false;refresh.Enabled=true
   for _,row in ipairs(rows)do list.Items.add(row.name)end
   if #rows&gt;0 then list.ItemIndex=0;choose()else label.Caption=t.T('No active quests.','受注中のクエストはありません。')end
  end,errorText)
 end
 list.OnClick=choose;refresh.OnClick=reload
 advance.OnClick=function()
  if state.busy or not state.selected or state.index==nil then return end
  local row,index=state.selected,state.index;state.busy=true;advance.Enabled=false;refresh.Enabled=false
  label.Caption=t.T('Completing the selected objective...','選択した目標を完了中…')
  local okay,why=pcall(t.advanceSelectedQuest136,row,index,function(before,after)
   if state.closed then return end
   state.busy=false;refresh.Enabled=true
   label.Caption=t.T('Completed one objective: ','目標を1つ完了しました：')..row.name
   details.Lines.Text=row.name..'\r\n\r\n'..t.T('Completed objective: ','完了した目標：')..(before+1)
   state.index=nil
  end,errorText)
  if not okay then errorText(why)end
 end
 close.OnClick=function()form.close()end
 form.OnClose=function()state.closed=true;state.generation=state.generation+1;t.questForm136=nil;return caFree end
 form.show();reload()
end
local forget=t.forgetProcess
function t.forgetProcess(...)if t.questForm136 then t.questForm136.close()end;t.questAdvanceBusy136=nil;return forget(...)end
t.NAMES[605]={'Advance a selected quest by one objective...','クエストを選択して目標を1つ進める…'}
end)(TLC)

-- Fuel debits are blocked for the reflected vehicle base, including boats and gyrocopters.
;(function(t)
local symbols={'tlc_fuelDebit061Data','tlc_fuelStorage062Data','tlc_fuelGrid071Data','tlc_fuelCable071Data'}
function t.vehicleFuelClass138()
 local vehicle=assert(t.refClass('VoyageVehiclePawn'),'Vehicle class metadata unavailable')
 assert(t.valid(vehicle)and t.U.n(vehicle)=='VoyageVehiclePawn','Vehicle class identity changed')
 local root,size=t.refFieldLayout(vehicle,'RootComponent',true)
 local boat=assert(t.refClass('VoyageBoatPawn'),'Boat class metadata unavailable')
 local boatRoot,boatSize=t.refFieldLayout(boat,'RootComponent',true)
 assert(root and size==8 and boatRoot==root and boatSize==8,'Vehicle root layout differs from prepared fuel hooks')
 local current=boat;local found=false
 for depth=1,64 do
  if current==vehicle then found=true;break end
  current=readQword(current+0x40);if not t.valid(current)then break end
 end
 assert(found,'Boat is not derived from the verified vehicle class')
 return vehicle
end
function t.publishVehicleFuelScope138()
 local vehicle=t.vehicleFuelClass138();local rows={}
 for _,name in ipairs(symbols)do
  local address=assert(getAddressSafe(name),'Fuel scope data unavailable: '..name)
  rows[#rows+1]={address=address,old=assert(readQword(address))}
 end
 local okay,why=pcall(function()
  for _,row in ipairs(rows)do assert(writeQword(row.address,vehicle),'Vehicle fuel scope write failed')end
  for _,row in ipairs(rows)do assert(readQword(row.address)==vehicle,'Vehicle fuel scope readback failed')end
 end)
 if not okay then
  local restored=true
  for _,row in ipairs(rows)do if not writeQword(row.address,row.old)then restored=false end end
  if not restored then error('Vehicle fuel scope update and rollback failed: '..tostring(why),0)end
  error(why,0)
 end
 return vehicle
end
local enable=t.F.fuel.on
t.F.fuel.on=function()
 t.vehicleFuelClass138()
 enable()
 t.publishVehicleFuelScope138()
end
end)(TLC)

-- Enemy selection is populated by the running game's NPC asset registry.
;(function(t)
local function bytes(fmt,...)local s=string.pack(fmt,...);return{s:byte(1,#s)}end
local function bounds(c,x,y,w,h)c.Left=x;c.Top=y;c.Width=w;c.Height=h end
local function field(o,n,z,kind)local a,b=t.refFieldLayout(o,n,kind);assert(a and b==z,'NPC field contract changed: '..n);return a end
local function invoke(c,input,done,failed)
 local old=t.catalogBusy075;t.catalogBusy075={busy=true,fail=failed}
 local ok,e=pcall(t.apiInvoke075,c,input,function(p)local good,why=pcall(done,p);if not good then failed(tostring(why))end end)
 t.catalogBusy075=old;if not ok then failed(tostring(e))end
end
-- Destruction invalidates its target by design: guard before dispatch, then
-- verify the world/function and successful destruction instead of target liveness.
local function destroyActor(object,world,done,failed)
 local id=assert(t.identity029(object));local c=t.objectApiContract076(object,'Actor','K2_DestroyActor');local fnid=assert(t.identity029(c.fn))
 local function run()
  local ok,e=pcall(function()
   assert(t.sameIdentity029(world)and t.sameIdentity029(id)and t.sameIdentity029(fnid),'NPC cleanup target expired')
   local frame=t.apiFrame075(c);local target=t.processEvent074(object,false)
   t.job(target,{object,c.fn,frame},{object,c.fn},function()
    local good,why=pcall(function()
     assert(t.sameIdentity029(world)and t.sameIdentity029(fnid),'NPC cleanup world/function changed')
     assert(not t.sameIdentity029(id),'Game did not destroy the temporary NPC spawner');done()
    end);if not good then failed(tostring(why))end
   end)
   if t.pendingJob then t.pendingJob.cancelled074=function(e)failed(tostring(e))end end
  end);if not ok then failed(tostring(e))end
 end
 if t.pendingJob or t.actionBusy025()then assert(t.enqueueAction025(run))else run()end
end
local function fname(p)local n=t.U.name(readInteger(p));local number=assert(readInteger(p+4));assert(n and n~='?'and number&gt;=0 and number&lt;1000000,'NPC asset name unavailable');return n..(number&gt;0 and'_'..(number-1)or'')end
function t.enemyRows139(done,failed)
 local ok,e=pcall(function()
  t.need();local c=t.registryClassContract075();local cls=assert(t.refClass('VoyageNPCData'));local outer=assert(readQword(cls+0x20));local world=assert(t.identity029(t.world()))
  invoke(c.helpers,{},function(p)
   local result=p+t.apiMember075(c.helpers,'ReturnValue',16);local object,interface=readQword(result),readQword(result+8);local id=t.registryIdentity076(object)
   assert(interface and interface&gt;=object and interface-object&lt;=0x1000,'NPC registry interface unavailable')
   local target=assert(readQword(readQword(interface)+c.slot));assert(t.executable038(target,16),'NPC registry method unavailable')
   local buffer=assert(allocateMemory(0x1000));assert(writeBytes(buffer,{0}))
   assert(writeQword(buffer+c.topPackage,readQword(outer+0x18))and writeQword(buffer+c.topAsset,readQword(cls+0x18)))
   local fnid=assert(t.identity029(c.fn))
   t.job(target,{interface,buffer,buffer+0x100,1},{id.defaultObject and id.class or object,c.fn},function(ret)
    local good,why=pcall(function()
     assert((ret&amp;255)~=0 and t.sameRegistryIdentity076(id)and t.sameIdentity029(fnid)and t.sameIdentity029(world),'NPC registry query expired')
     local data,count,capacity=readQword(buffer+0x100),readInteger(buffer+0x108),readInteger(buffer+0x10c)
     assert(count and capacity and count&gt;=0 and count&lt;=capacity and capacity&lt;=4096 and(count==0 or data),'Invalid NPC asset array')
     local rows={};for i=0,count-1 do local a=data+i*c.stride;rows[#rows+1]={path=fname(a+c.package)..'.'..fname(a+c.asset),assetData=assert(readBytes(a,c.stride,true))}end
     t.enemyRegistry139=t.enemyRegistry139 or{};t.enemyRegistry139[#t.enemyRegistry139+1]={buffer=buffer,world=world}
     local get=t.apiContract075('AssetRegistryHelpers','GetAsset');local index=0;local output={}
     local function nextRow()
      assert(t.sameIdentity029(world),'NPC world changed; reopen the list');index=index+1;local row=rows[index]
      if not row then table.sort(output,function(a,b)return a.name&lt;b.name end);done(output);return end
      invoke(get,{InAssetData=row.assetData},function(frame)
       local asset=readQword(frame+t.apiMember075(get,'ReturnValue',8))
       if not t.valid(asset)or not t.U.isA(asset,'VoyageNPCData')then nextRow();return end
       local template=t.readObjectField074(asset,'ActorTemplate')
       if not t.valid(template)or not t.U.isA(template,'VoyageNPCBaseCharacter')then nextRow();return end
       row.asset=asset;row.identity=assert(t.identity029(asset));row.world=world
       local text=assert(readBytes(asset+field(asset,'Name',16),16,true));local source=t.apiContract075('KismetTextLibrary','GetTextSourceString');local localized=t.apiContract075('KismetTextLibrary','Conv_TextToString')
       invoke(source,{Text=text},function(frame)
        local en=t.readApiString075(frame+t.apiMember075(source,'ReturnValue',16))
        invoke(localized,{InText=text},function(frame)
         local localName=t.readApiString075(frame+t.apiMember075(localized,'ReturnValue',16));if en==''then en=localName end;if localName==''then localName=en end
         if en~=''then row.en=en;row.ja=localName;row.name=t.T(en,localName);output[#output+1]=row end;nextRow()
        end,failed)
       end,failed)
      end,failed)
     end
     nextRow()
    end);if not good then failed(tostring(why))end
   end)
  end,failed)
 end);if not ok then failed(tostring(e))end
end
local function valid(row)
 assert(t.attached()and t.sameIdentity029(row.world)and t.sameIdentity029(row.identity),'Selected NPC expired; refresh the list')
 assert(t.U.isA(row.asset,'VoyageNPCData'),'Selected asset is not NPC data')
end
function t.spawnEnemy139(row,count,distance,height,done,failed)
 assert(not t.enemySpawnBusy139,'Enemy spawn is already running')
 assert(type(count)=='number'and count%1==0 and count&gt;=1 and count&lt;=20,'Spawn count must be 1-20')
 assert(distance and distance==distance and distance&gt;=1 and distance&lt;=1000 and height and height==height and math.abs(height)&lt;=1000,'Spawn distance/height is invalid')
 valid(row);local pawn=assert(t.player(true));local pawnid=assert(t.identity029(pawn));local helper;local created={};t.enemySpawnBusy139=true
 local function fail(why)
  t.enemySpawnBusy139=nil
  if helper and t.sameIdentity029(row.world)and t.sameIdentity029(helper)then
   local object=helper.object;helper=nil;destroyActor(object,row.world,function()failed(why)end,function(e)failed(tostring(why)..'; helper cleanup: '..e)end);return
  end
  failed(tostring(why))
 end
 local function check()valid(row);assert(t.sameIdentity029(pawnid),'Player changed during NPC spawn')end
 local ok,e=pcall(function()
  local begin=t.apiContract075('GameplayStatics','BeginDeferredActorSpawnFromClass');local finish=t.apiContract075('GameplayStatics','FinishSpawningActor');local make=t.apiContract075('KismetMathLibrary','MakeTransform')
  local spawnClass=assert(t.refClass('VoyageNPCSpawnerActor'));local collision=t.enumValues074('ESpawnActorCollisionHandlingMethod');assert(collision.AlwaysSpawn,'Spawn collision enum unavailable')
  local location=t.objectApiContract076(pawn,'Actor','K2_GetActorLocation');local forward=t.objectApiContract076(pawn,'Actor','GetActorForwardVector')
  invoke(location,{},function(p)
   check();local q=p+t.apiMember075(location,'ReturnValue',24);local x,y,z=readDouble(q),readDouble(q+8),readDouble(q+16)
   invoke(forward,{},function(p)
    check();local q=p+t.apiMember075(forward,'ReturnValue',24);local dx,dy=readDouble(q),readDouble(q+8);local length=math.sqrt(dx*dx+dy*dy);assert(length&gt;0.0001,'Player forward direction unavailable');dx=dx/length;dy=dy/length
    local function nextEnemy()
     check();local i=#created;local side=i==0 and 0 or ((i+1)//2)*(i%2==1 and 300 or -300)
     local at=bytes('&lt;ddd',x+dx*distance*100-dy*side,y+dy*distance*100+dx*side,z+height*100)
     invoke(make,{Location=at,Rotation=bytes('&lt;ddd',0,math.deg(math.atan(dy,dx)),0),Scale=bytes('&lt;ddd',1,1,1)},function(p)
      check();local transform=assert(readBytes(p+t.apiMember075(make,'ReturnValue',96),96,true))
      invoke(begin,{WorldContextObject=bytes('&lt;I8',row.world.object),ActorClass=bytes('&lt;I8',spawnClass),SpawnTransform=transform,CollisionHandlingOverride=bytes('&lt;I1',collision.AlwaysSpawn),Owner=bytes('&lt;I8',0),TransformScaleMethod=bytes('&lt;I1',0)},function(p)
       check();local object=readQword(p+t.apiMember075(begin,'ReturnValue',8));assert(t.valid(object)and t.U.isA(object,'VoyageNPCSpawnerActor'),'NPC spawner creation failed');helper=assert(t.identity029(object))
       assert(writeQword(object+field(object,'NPCDataRef',8),row.asset))
       for _,name in ipairs({'ToSpawn','MaxSpawn','ToSpawnRefresh'})do assert(writeInteger(object+field(object,name,4),0))end
       invoke(finish,{Actor=bytes('&lt;I8',object),SpawnTransform=transform,TransformScaleMethod=bytes('&lt;I1',0)},function(p)
        check();assert(t.sameIdentity029(helper)and readQword(p+t.apiMember075(finish,'ReturnValue',8))==object,'NPC spawner expired')
        local spawn=t.objectApiContract076(object,'VoyageSpawnerActor','SpawnActor')
        invoke(spawn,{Transform=transform},function(p)
         check();local actor=readQword(p+t.apiMember075(spawn,'ReturnValue',8));assert(t.valid(actor)and t.U.isA(actor,'VoyageNPCBaseCharacter'),'Game rejected NPC spawn')
         created[#created+1]={object=actor,identity=assert(t.identity029(actor)),asset=row.asset};t.lastEnemySpawn139=created
         destroyActor(object,row.world,function()
          helper=nil;check();if #created&lt;count then nextEnemy()else t.enemySpawnBusy139=nil;t.lastEnemySpawn139=created;done(created)end
         end,fail)
        end,fail)
       end,fail)
      end,fail)
     end,fail)
    end
    nextEnemy()
   end,fail)
  end,fail)
 end);if not ok then fail(e)end
end
function t.openEnemySpawn139()
 t.require();if t.enemyForm139 then t.enemyForm139.show();return end
 local f=TLC.uiCreate157('Form',false);t.enemyForm139=f;f.Caption=t.T('Spawn enemies','敵をスポーン');f.Font.Size=10;f.Position='poScreenCenter';f.ClientWidth=820;f.ClientHeight=550;f.Constraints.MinWidth=840;f.Constraints.MinHeight=590;f.AutoScroll=true
 local list=TLC.uiCreate157('ListBox',f);bounds(list,16,54,788,340);list.Style='lbOwnerDrawFixed';list.Color=0x252525;list.Font.Color=0xffffff
 list.MultiSelect=false
 list.OnDrawItem=function(sender,index,rect,state)if type(index)~='number' or index&lt;0 or index&gt;=sender.Items.Count then return end;local c=sender.Canvas;c.Brush.Color=index==sender.ItemIndex and 0x805020 or 0x252525;c.Font.Color=0xffffff;c.fillRect(rect.Left,rect.Top,rect.Right,rect.Bottom);c.textOut(rect.Left+4,rect.Top,sender.Items[index])end
 local refresh=createButton(f);bounds(refresh,16,12,788,30);refresh.Caption=t.T('Refresh enemies from game','ゲームから敵一覧を取得')
 local function input(caption,x,value)local l=TLC.uiCreate157('Label',f);bounds(l,x,405,220,22);l.Caption=caption;local e=TLC.uiCreate157('Edit',f);bounds(e,x,432,220,30);e.Text=value;return e end
 local count=input(t.T('Count (1-20)','数（1～20）'),16,'1');local distance=input(t.T('Distance ahead (m)','前方への距離（m）'),278,'10');local height=input(t.T('Height offset (m)','高さ補正（m）'),540,'0')
 local spawn=createButton(f);bounds(spawn,16,474,550,32);spawn.Caption=t.T('Spawn selected enemy','選択した敵をスポーン');spawn.Enabled=false
 local close=createButton(f);bounds(close,580,474,224,32);close.Caption=t.T('Close','閉じる')
 local label=TLC.uiCreate157('Label',f);bounds(label,16,514,788,30);label.AutoSize=false;label.WordWrap=true
 local s={rows={},busy=false,closed=false};t.enemyUI139={form=f,list=list,count=count,distance=distance,height=height,spawn=spawn,refresh=refresh,state=s}
 local function failure(e)if not s.closed then s.busy=false;refresh.Enabled=true;spawn.Enabled=#s.rows&gt;0;label.Caption=tostring(e)end;t.reason('enemySpawn',tostring(e))end
 local function reload()
  if s.busy then return end;s.busy=true;spawn.Enabled=false;refresh.Enabled=false;list.Items.clear();s.rows={};label.Caption=t.T('Reading enemy names...','敵の名前を取得中…')
  t.enemyRows139(function(rows)if s.closed then return end;s.rows=rows;s.busy=false;refresh.Enabled=true;for _,r in ipairs(rows)do list.Items.add(r.name)end;if #rows&gt;0 then list.ItemIndex=0;spawn.Enabled=true end;label.Caption=t.T('Enemies: ','敵の種類：')..#rows end,failure)
 end
 spawn.OnClick=function()
  if s.busy then return end;local row=s.rows[list.ItemIndex+1];if not row then return end;s.busy=true;spawn.Enabled=false;refresh.Enabled=false
  local ok,e=pcall(t.spawnEnemy139,row,tonumber(count.Text),tonumber(distance.Text),tonumber(height.Text),function(rows)if s.closed then return end;s.busy=false;spawn.Enabled=true;refresh.Enabled=true;label.Caption=row.name..t.T(' spawned: ','を生成しました：')..#rows end,failure);if not ok then failure(e)end
 end
 refresh.OnClick=reload;close.OnClick=function()f.close()end;f.OnClose=function()s.closed=true;t.enemyForm139=nil;t.enemyUI139=nil;return caFree end
 f.show();reload()
end
local forget=t.forgetProcess
function t.forgetProcess(...)if t.enemyForm139 then t.enemyForm139.close()end;t.enemySpawnBusy139=nil;t.lastEnemySpawn139=nil;t.enemyRegistry139=nil;return forget(...)end
t.NAMES[606]={'Spawn enemies...','敵をスポーン…'}
end)(TLC)

-- Quest assets and parameters come from the current game's named metadata/APIs.
;(function(t)
local function bytes(fmt,...)local s=string.pack(fmt,...);return{s:byte(1,#s)}end
local function bounds(c,x,y,w,h)c.Left=x;c.Top=y;c.Width=w;c.Height=h end
local function field(o,n,z,kind)local a,b=t.refFieldLayout(o,n,kind);assert(a and b==z,'Quest field contract changed: '..n);return a end
local function invoke(c,input,done,failed)
 local old=t.catalogBusy075;t.catalogBusy075={busy=true,fail=failed}
 local ok,e=pcall(t.apiInvoke075,c,input,function(p)local good,why=pcall(done,p);if not good then failed(tostring(why))end end)
 t.catalogBusy075=old;if not ok then failed(tostring(e))end
end
-- Read the source FText and convert it in one game-thread action. The source
-- UObject and function are dispatcher lifetime guards; no FText pointer is
-- copied on the CE thread and then left waiting in a native request queue.
function t.questTextCode141(c)
 return table.concat({'push rbx','sub rsp,20',('mov rbx,%X'):format(c.buffer),('mov rax,%X'):format(c.asset),('cmp qword ptr [rax+%X],0'):format(c.offset),'je qt_empty141',('movdqu xmm0,[rax+%X]'):format(c.offset),('movdqu [rbx+%X],xmm0'):format(0x400+c.input),('mov rcx,%X'):format(c.api.cdo),('mov rdx,%X'):format(c.api.fn),('lea r8,[rbx+400]'),('mov rax,%X'):format(c.dispatch),'call rax','mov eax,1','jmp qt_done141','qt_empty141:','xor eax,eax','qt_done141:','add rsp,20','pop rbx','ret'},'\n')
end
function t.questTextRead141(row,name,api,input,done,failed)
 local function run()
  local okay,why=pcall(function()
   assert(t.attached()and t.sameIdentity029(row.world)and t.sameIdentity029(row.identity),'Quest text source expired')
   local offset=field(row.asset,name,16);local property=t.property076(row.asset,name,false);local parameter=t.property076(api.fn,input,'function')
   local textType,inputType=readQword(property+8),readQword(parameter+8);assert(textType and inputType and textType==inputType,'Quest text native input type changed')
   local inputOffset=t.apiMember075(api,input,16);local result=t.apiMember075(api,'ReturnValue',16);assert(api.size&lt;=0x100,'Quest text native parameter block too large')
   local cache=t.questTextScratch141;if not cache or cache.pid~=getOpenedProcessID()then cache={pid=getOpenedProcessID(),frames={}};t.questTextScratch141=cache end;local allocation=cache.frames[api.fn];if not allocation then allocation={address=assert(allocateMemory(0x1000))};cache.frames[api.fn]=allocation end
   local c={buffer=allocation.address,asset=row.asset,offset=offset,input=inputOffset,api=api,dispatch=t.processEvent074(api.cdo,true)}
   local code=t.questTextCode141(c);assert(autoAssemble(('[ENABLE]\nlabel(qt_empty141)\nlabel(qt_done141)\n%X:\n%s\n[DISABLE]\n'):format(c.buffer,code)),'Quest text action assembly failed')
   local allow=t.nativeCallAllowlist141 or{};t.nativeCallAllowlist141=allow;local prior=allow[c.buffer];allow[c.buffer]=true
   local submitted,errorText=pcall(t.job,c.buffer,{}, {row.asset,api.fn},function(converted)
    local good,e=pcall(function()
     assert(t.sameIdentity029(row.world)and t.sameIdentity029(row.identity),'Quest text source/world changed')
     assert(converted==0 or converted==1,'Quest text action result invalid')
     done(converted==1 and t.readApiString075(c.buffer+0x400+result)or'')
    end);if not good then failed(tostring(e))end
   end)
   allow[c.buffer]=prior;assert(submitted,errorText);if t.pendingJob then t.pendingJob.cancelled074=failed end
  end);if not okay then failed(tostring(why))end
 end
 assert(t.enqueueAction025(run,nil,function()local alive=t.attached()and t.sameIdentity029(row.world)and t.sameIdentity029(row.identity);if not alive then failed('Quest text source expired before execution')end;return alive end))
end
-- The registry is the game's active quest registry, not unused assets in the install.
function t.registeredQuests141()
 t.need();local sys=t.worldSubsystem107('VoyageQuestSubsystem');local cls=assert(t.refClass('VoyageQuestSubsystem'));local off=field(cls,'Quests',80,true)
 local property=t.property076(cls,'Quests',true);local key,value=assert(readQword(property+0x70)),assert(readQword(property+0x78))
 assert(readInteger(key+0x34)==16 and readInteger(value+0x34)==8,'Quest registry key/value types changed')
 local fn=t.reflectedFunction069('VoyageQuestSubsystem','GetQuestByPrimaryAssetId');local body=t.reflectedNativeBody069(fn);local first,last=t.runtimeFunction074(body)
 assert(first==body and last-first&lt;=4096,'Quest registry getter function scope changed')
 local ip=first;local maps,shifts,values={},{},{}
 while ip&lt;last do
  local n=assert(getInstructionSize(ip));assert(n&gt;0 and n&lt;=15 and ip+n&lt;=last,'Quest registry instruction truncated');local b=assert(readBytes(ip,n,true))
  if n==7 and b[1]==0x48 and b[2]==0x8d and (b[3]&amp;0xc7)==0x81 then maps[#maps+1]=assert(readInteger(ip+3))end
  if n==4 and b[1]==0x48 and b[2]==0xc1 and (b[3]&amp;0xf8)==0xe0 then shifts[#shifts+1]=b[4]end
  if n==4 and b[1]==0x48 and b[2]==0x8b and (b[3]&amp;0xc7)==0x40 then values[#values+1]=b[4]end
  ip=ip+n
 end
 local mapCount=0;for _,v in ipairs(maps)do if v==off then mapCount=mapCount+1 end end
 assert(mapCount==1 and #shifts==1 and #values==1,'Quest registry getter layout is missing or ambiguous')
 local stride=1&lt;&lt;shifts[1];local at=values[1];assert(stride&gt;=24 and stride&lt;=128 and at&gt;=16 and at%8==0 and at+8&lt;=stride,'Quest registry getter ABI invalid')
 local rows,seen={},{};for _,entry in ipairs(t.map(sys+off,stride))do local asset=readQword(entry+at)
  assert(t.valid(asset)and t.U.isA(asset,'VoyageQuest'),'Quest registry contains an invalid asset')
  if not seen[asset]then rows[#rows+1]=asset;seen[asset]=true end
 end
 return rows
end
function t.questCatalog141(done,failed,progress,alive)
 local okay,why=pcall(function()
  t.need();local cached=t.questCatalogCache141
  if cached and t.sameIdentity029(cached.world)then local good=true;for _,row in ipairs(cached.rows)do if not t.sameIdentity029(row.identity)or not row.package154 then good=false;break end end;if good then for _,row in ipairs(cached.rows)do row.name=t.T(row.en,row.ja)end;table.sort(cached.rows,function(a,b)return a.name==b.name and a.key&lt;b.key or a.name&lt;b.name end);done(cached.rows);return end end
  local assets=t.registeredQuests141();local world=assert(t.identity029(t.world()));local rows={}
  for _,asset in ipairs(assets)do rows[#rows+1]={asset=asset,identity=assert(t.identity029(asset)),world=world,key=t.U.n(asset)}end
  t.questBatch152(rows,true,function(all)
   local output={};for _,row in ipairs(all)do if row.name~=''then output[#output+1]=row end end
   table.sort(output,function(a,b)return a.name==b.name and a.key&lt;b.key or a.name&lt;b.name end);t.questCatalogCache141={world=world,rows=output};done(output)
  end,failed,progress,alive)
 end);if not okay then failed(tostring(why))end
end

local function valid(row)
 assert(t.attached()and t.sameIdentity029(row.world)and t.sameIdentity029(row.identity),'Selected quest expired; refresh the list')
 assert(t.U.isA(row.asset,'VoyageQuest'),'Selected asset is not a quest')
end
local function context(row)
 valid(row);local sys=t.worldSubsystem107('VoyageQuestSubsystem');local pc=t.playerController(true)
 return sys,pc,assert(t.identity029(pc))
end
local function statuses(c)local _,values=t.enumProperty076(t.property076(c.fn,'ReturnValue','function'));for _,n in ipairs({'None','Available','Unavailable','Starting','InProgress','Ready','Completed','Failed','Aborted'})do assert(values[n]~=nil and values[n]&gt;=0 and values[n]&lt;=255,'Quest status enum changed: '..n)end;return values end
local function eligible(value,e)return value==e.None or value==e.Available or value==e.Unavailable or value==e.Failed or value==e.Aborted end
local statusLabels={None={'Not accepted','未受注'},Available={'Available','受注可能'},Unavailable={'Requirements not met','条件未達'},Starting={'Starting','開始処理中'},InProgress={'In progress','受注中'},Ready={'Ready to turn in','報告待ち'},Completed={'Completed','完了済み'},Failed={'Failed','失敗'},Aborted={'Aborted','中止済み'}}
local function statusName(value,e)for k,v in pairs(e)do if v==value and statusLabels[k]then return t.T(table.unpack(statusLabels[k]))end end;return t.T('Unknown status','状態不明')end
-- Reuse the current dispatcher's object-lifetime contract. No game field offsets
-- or store-specific locations are introduced by this batch implementation.
function t.questBatchGuard152()
 local aa=assert(t.HOOKS.gameTick.aa);local first=assert(aa:find('mov rax,[tlcFlags+518]',1,true),'Quest batch lifetime guard unavailable')
 local last=assert(aa:find('\ntlc_job_guard2:',first,true),'Quest batch lifetime guard end unavailable')
 local guard=aa:sub(first,last-1);assert(#guard&lt;2000 and guard:find('[tlcFlags+520]',1,true)and guard:find('[tlcFlags+524]',1,true)and guard:find('[tlcFlags+5C8]',1,true)and guard:find('[tlcFlags+5D0]',1,true),'Quest batch lifetime guard contract changed')
 return guard
end
function t.questBatchCode152(c)
 local out={'push rbx','push rsi','push rdi','sub rsp,20',('mov rbx,%X'):format(c.buffer),('lea rsi,[rbx+10000]'),('mov edi,%X'):format(#c.rows),'qbl_loop152:'}
 local function emit(x)out[#out+1]=x end
 local function call(object,fn,frame,dispatch)
  emit(('mov rcx,%X'):format(object));emit(('mov rdx,%X'):format(fn));emit(('lea r8,[rsi+%X]'):format(frame));emit(('mov rax,%X'):format(dispatch));emit('call rax')
 end
 local guard=c.guard:gsub('%[tlcFlags%+518%]','[rsi]'):gsub('%[tlcFlags%+520%]','[rsi+8]'):gsub('%[tlcFlags%+524%]','[rsi+C]'):gsub('%[tlcFlags%+5C8%]','[rsi+10]'):gsub('%[tlcFlags%+5D0%]','[rsi+18]')
 guard=guard:gsub('cmp ecx,%[tlcObjectCount072%]','mov r9,tlcObjectCount072\ncmp ecx,[r9]'):gsub('mov r8,%[tlcObjects%]','mov r9,tlcObjects\nmov r8,[r9]'):gsub('tlc_job_fail','qbl_next152'):gsub('tlc_job_guard2','qbl_valid152')
 assert(not guard:find('tlcFlags',1,true),'Quest batch guard substitution incomplete');emit(guard);emit('qbl_valid152:')
 if c.names then
  emit('mov rax,[rsi]');emit('mov ecx,[rsi+E0]');emit('cmp qword ptr [rax+rcx],0');emit('je qbl_empty152');emit('movdqu xmm0,[rax+rcx]');emit(('movdqu [rsi+%X],xmm0'):format(0x20+c.sourceInput))
  call(c.source.cdo,c.source.fn,0x20,c.sourceDispatch)
  emit('mov rax,[rsi]');emit('mov ecx,[rsi+E0]');emit('movdqu xmm0,[rax+rcx]');emit(('movdqu [rsi+%X],xmm0'):format(0x60+c.localizedInput))
  call(c.localized.cdo,c.localized.fn,0x60,c.localizedDispatch);emit('qbl_empty152:')
 end
 if c.paths then call(c.path.cdo,c.path.fn,0x4000,c.pathDispatch)end
 call(c.sys,c.status.fn,0xa0,c.statusDispatch);emit('mov dword ptr [rsi+F0],1');emit('qbl_next152:');emit('add rsi,100');emit('dec edi');emit('jnz qbl_loop152')
 emit(('mov eax,%X'):format(#c.rows));emit('add rsp,20');emit('pop rdi');emit('pop rsi');emit('pop rbx');emit('ret');return table.concat(out,'\n')
end
function t.questBatch152(rows,names,done,failed,progress,alive)
 local function failure(e)failed(tostring(e))end
 local okay,why=pcall(function()
  if #rows==0 then done(rows);return end
  local sys,pc,owner=context(rows[1]);local world=rows[1].world;local sysid=assert(t.identity029(sys))
  local status=t.objectApiContract076(sys,'VoyageQuestSubsystem','GetQuestStatus');local values=statuses(status);local statusReturn=t.apiMember075(status,'ReturnValue',1)
  local statusOwner=t.apiMember075(status,'InPlayerController',8);local statusQuest=t.apiMember075(status,'InQuest',8);assert(status.size&lt;=0x40,'Quest status parameter frame changed')
  local paths=names;for _,row in ipairs(rows)do if not row.package154 then paths=true;break end end
  local path,pathIdentity,pathInput,pathReturn
  if paths then path=t.apiContract075('KismetSystemLibrary','GetPathName');pathIdentity=assert(t.identity029(path.fn));pathInput=t.apiMember075(path,'Object',8);pathReturn=t.apiMember075(path,'ReturnValue',16);assert(path.size&lt;=0x100,'Quest path parameter frame changed')end
  local source,localized,sourceIdentity,localizedIdentity,sourceInput,localizedInput,sourceReturn,localizedReturn,textType
  if names then
   source=t.apiContract075('KismetTextLibrary','GetTextSourceString');localized=t.apiContract075('KismetTextLibrary','Conv_TextToString');sourceIdentity=assert(t.identity029(source.fn));localizedIdentity=assert(t.identity029(localized.fn))
   sourceInput=t.apiMember075(source,'Text',16);localizedInput=t.apiMember075(localized,'InText',16);sourceReturn=t.apiMember075(source,'ReturnValue',16);localizedReturn=t.apiMember075(localized,'ReturnValue',16)
   assert(source.size&lt;=0x40 and localized.size&lt;=0x40,'Quest text parameter frame changed')
   textType=assert(readQword(t.property076(source.fn,'Text','function')+8));assert(readQword(t.property076(localized.fn,'InText','function')+8)==textType,'Quest text parameter type changed')
  end
  local index=1;local timing={rows=#rows,names=names,dispatches=0,started=getTickCount()};t.questBatchTiming152=timing
  local function nextBatch()
   if alive and not alive()then return end
   if index&gt;#rows then timing.elapsed=getTickCount()-timing.started;timing.complete=true;done(rows);return end
   local chunk={};for n=index,math.min(index+63,#rows)do chunk[#chunk+1]=rows[n]end
   local function run()
    local ok,e=pcall(function()
     if alive and not alive()then return end
     assert(t.sameIdentity029(world)and t.sameIdentity029(owner)and t.sameIdentity029(sysid),'Quest batch world/owner changed')
     assert(t.sameIdentity029(status.identity)and t.valid(status.fn),'Quest status function changed')
     local c={rows=chunk,names=names,paths=paths,sys=sys,status=status,statusDispatch=t.processEvent074(sys,false),guard=t.questBatchGuard152(),offsets={}}
     if names then
      assert(t.sameIdentity029(sourceIdentity)and t.sameIdentity029(localizedIdentity)and t.valid(source.fn)and t.valid(localized.fn),'Quest text function changed')
      assert(t.defaultObject074(t.refClass(source.owner))==source.cdo and t.defaultObject074(t.refClass(localized.owner))==localized.cdo,'Quest text library default object changed')
      c.source=source;c.localized=localized;c.sourceInput=sourceInput;c.localizedInput=localizedInput;c.sourceDispatch=t.processEvent074(source.cdo,true);c.localizedDispatch=t.processEvent074(localized.cdo,true)
     end
     if paths then assert(t.sameIdentity029(pathIdentity)and t.valid(path.fn)and t.defaultObject074(t.refClass(path.owner))==path.cdo,'Quest path API changed');c.path=path;c.pathDispatch=t.processEvent074(path.cdo,true)end
     local allocation=t.questBatchScratch152
     if not allocation or allocation.pid~=getOpenedProcessID()or allocation.capacity~=64 then allocation={pid=getOpenedProcessID(),capacity=64,address=assert(allocateMemory(0x18000))};t.questBatchScratch152=allocation end
     c.buffer=allocation.address
     local zero={};for n=1,0x8000 do zero[n]=0 end;assert(writeBytes(c.buffer+0x10000,zero))
     for i,row in ipairs(chunk)do
      valid(row);local at=c.buffer+0x10000+(i-1)*0x100
      assert(writeQword(at,row.asset));assert(writeInteger(at+8,row.identity.index));assert(writeInteger(at+12,row.identity.serial));assert(writeQword(at+0x10,row.identity.class));assert(writeBytes(at+0x18,bytes('&lt;I4I4',row.identity.name,row.identity.number)))
      if paths then assert(writeQword(at+0x4000+pathInput,row.asset))end
      assert(writeQword(at+0xa0+statusOwner,pc));assert(writeQword(at+0xa0+statusQuest,row.asset))
      if names then
       c.offsets[i]=field(row.asset,'Name',16);assert(writeInteger(at+0xe0,c.offsets[i]));assert(readQword(t.property076(row.asset,'Name',false)+8)==textType,'Quest Name is not the verified FText type')
      end
     end
     local code=t.questBatchCode152(c);local _,lines=code:gsub('\n','');assert((lines+1)*15&lt;0x10000,'Quest batch code exceeds reserved code region');local labels={'label(qbl_loop152)','label(qbl_next152)','label(qbl_valid152)'};if names then labels[#labels+1]='label(qbl_empty152)'end
     -- Assembler code and output frames are disjoint, with a checked code bound.
     local assembled,detail=autoAssemble(('[ENABLE]\n%s\n%X:\n%s\n[DISABLE]\n'):format(table.concat(labels,'\n'),c.buffer,code))
     assert(assembled,'Quest batch assembly failed: '..tostring(detail))
     local allow=t.nativeCallAllowlist141 or{};t.nativeCallAllowlist141=allow;local previous=allow[c.buffer];allow[c.buffer]=true
     timing.dispatches=timing.dispatches+1
     local submitted,problem=pcall(t.job,c.buffer,{}, {sys,status.fn},function(count)
      local good,errorText=pcall(function()
       if alive and not alive()then return end
       assert(count==#chunk and t.sameIdentity029(world)and t.sameIdentity029(owner)and t.sameIdentity029(sysid),'Quest batch completion changed')
       for i,row in ipairs(chunk)do
        valid(row);local at=c.buffer+0x10000+(i-1)*0x100;assert(readInteger(at+0xf0)==1,'Quest asset expired before batch execution')
        if names then
         local en=t.readApiString075(at+0x20+sourceReturn);local ja=t.readApiString075(at+0x60+localizedReturn)
         if en==''then en=ja end;if ja==''then ja=en end;row.en=en;row.ja=ja;row.name=t.T(en,ja)
        end
        if paths then row.package154=t.readApiString075(at+0x4000+pathReturn);assert(row.package154~='','Quest asset path unavailable')end
        row.status149=readBytes(at+0xa0+statusReturn,1);row.statusLabel149=statusName(row.status149,values)
        row.color149=row.status149==values.Completed and 0x909090 or (row.status149==values.Starting or row.status149==values.InProgress or row.status149==values.Ready)and 0x70dfff or 0xffffff
        row.statusFresh152=names and true or nil;if progress then progress(index+i-1,#rows,row)end
       end
       index=index+#chunk;nextBatch()
      end);if not good then failure(errorText)end
     end)
     allow[c.buffer]=previous;assert(submitted,problem);if t.pendingJob then t.pendingJob.cancelled074=failure end
    end);if not ok then failure(e)end
   end
   assert(t.enqueueAction025(run,nil,function()if alive and not alive()then return false end;if not t.sameIdentity029(world)or not t.sameIdentity029(owner)then failure('Quest batch world/owner expired before execution');return false end;return true end))
  end
  nextBatch()
 end);if not okay then failure(why)end
end
function t.questAddStatus141(row,checkPrerequisites,done,failed)
 local ok,e=pcall(function()
  local sys,pc,owner=context(row);local get=t.objectApiContract076(sys,'VoyageQuestSubsystem','GetQuestStatus');local values=statuses(get)
  invoke(get,{InPlayerController=bytes('&lt;I8',pc),InQuest=bytes('&lt;I8',row.asset)},function(p)
   valid(row);assert(t.sameIdentity029(owner),'Quest owner changed');local status=readBytes(p+t.apiMember075(get,'ReturnValue',1),1)
   if not eligible(status,values)then done(status,false,statusName(status,values),values);return end
   local can=t.objectApiContract076(sys,'VoyageQuestSubsystem','CanAcceptQuest')
   invoke(can,{InPlayerController=bytes('&lt;I8',pc),InQuest=bytes('&lt;I8',row.asset),bCheckPrerequisites=bytes('&lt;I1',checkPrerequisites and 1 or 0)},function(p)
    valid(row);assert(t.sameIdentity029(owner),'Quest owner changed');done(status,readBytes(p+t.apiMember075(can,'ReturnValue',1),1)~=0,statusName(status,values),values)
   end,failed)
  end,failed)
 end);if not ok then failed(tostring(e))end
end
function t.questDescription141(row,done,failed)
 local ok,e=pcall(function()
  valid(row);local c=t.apiContract075('KismetTextLibrary','Conv_TextToString')
  t.questTextRead141(row,'Description',c,'InText',done,failed)
 end);if not ok then failed(tostring(e))end
end
-- Status, eligibility and BeginQuest execute consecutively on the game thread.
-- All numeric offsets in this buffer belong to CT-owned scratch/code storage.
function t.questStartCode141(c)
 local lines={'push rbx','sub rsp,20',('mov rbx,%X'):format(c.buffer)}
 local function call(fn,frame)
  lines[#lines+1]=('mov rcx,%X'):format(c.sys);lines[#lines+1]=('mov rdx,%X'):format(fn);lines[#lines+1]=('mov r8,%X'):format(frame);lines[#lines+1]=('mov rax,%X'):format(c.dispatch);lines[#lines+1]='call rax'
 end
 call(c.get.fn,c.buffer+0x400)
 lines[#lines+1]=('mov al,[rbx+%X]'):format(0x400+c.statusReturn);lines[#lines+1]='mov [rbx+310],al'
 for _,name in ipairs({'None','Available','Unavailable','Failed','Aborted'})do lines[#lines+1]=('cmp al,%02X'):format(c.values[name]);lines[#lines+1]='je qs_allowed141'end
 lines[#lines+1]='mov eax,2';lines[#lines+1]='jmp qs_done141';lines[#lines+1]='qs_allowed141:'
 call(c.can.fn,c.buffer+0x500)
 lines[#lines+1]=('cmp byte ptr [rbx+%X],0'):format(0x500+c.canReturn);lines[#lines+1]='je qs_denied141'
 call(c.begin.fn,c.buffer+0x600)
 lines[#lines+1]=('cmp byte ptr [rbx+%X],0'):format(0x600+c.beginReturn);lines[#lines+1]='je qs_rejected141';lines[#lines+1]='mov eax,1';lines[#lines+1]='jmp qs_done141'
 lines[#lines+1]='qs_denied141:';lines[#lines+1]='mov eax,3';lines[#lines+1]='jmp qs_done141';lines[#lines+1]='qs_rejected141:';lines[#lines+1]='mov eax,4'
 lines[#lines+1]='qs_done141:';lines[#lines+1]='mov [rbx+300],eax';lines[#lines+1]='add rsp,20';lines[#lines+1]='pop rbx';lines[#lines+1]='ret'
 return table.concat(lines,'\n')
end
function t.acceptSelectedQuest141(row,checkPrerequisites,done,failed)
 assert(not t.questStartBusy141,t.T('A quest addition is already running.','クエストの追加処理中です。'))
 valid(row);t.questStartBusy141=true
 local function failure(e)t.questStartBusy141=nil;failed(tostring(e))end
 local ok,e=pcall(function()
  local sys,pc,owner=context(row);local sysid=assert(t.identity029(sys))
  local c={sys=sys,owner=pc,ownerIdentity=owner,sysIdentity=sysid,world=row.world,asset=row.asset,assetIdentity=row.identity}
  c.get=t.objectApiContract076(sys,'VoyageQuestSubsystem','GetQuestStatus');c.can=t.objectApiContract076(sys,'VoyageQuestSubsystem','CanAcceptQuest');c.begin=t.objectApiContract076(sys,'VoyageQuestSubsystem','BeginQuest');c.values=statuses(c.get)
  c.statusReturn=t.apiMember075(c.get,'ReturnValue',1);c.canReturn=t.apiMember075(c.can,'ReturnValue',1);c.beginReturn=t.apiMember075(c.begin,'ReturnValue',1)
  for _,v in ipairs({c.get,c.can,c.begin})do assert(v.size&lt;=0x100,'Quest API parameter block too large')end
  local function run()
   local okay,why=pcall(function()
    valid(row);assert(t.sameIdentity029(owner)and t.playerController(false)==pc and t.sameIdentity029(sysid),'Quest owner/subsystem changed')
    for _,v in ipairs({c.get,c.can,c.begin})do assert(t.sameIdentity029(v.identity)and t.valid(v.fn),'Quest API identity changed')end
    local allocation=t.questStartAllocation141
    if not allocation or allocation.pid~=getOpenedProcessID()then allocation={pid=getOpenedProcessID(),address=assert(allocateMemory(0x1000))};t.questStartAllocation141=allocation end
    c.buffer=allocation.address;c.dispatch=t.processEvent074(sys,false)
    local blank={};for i=1,0x700 do blank[i]=0 end;assert(writeBytes(c.buffer,blank))
    local function input(contract,base,name,value)local off=t.apiMember075(contract,name,#value);assert(writeBytes(base+off,value))end
    for _,entry in ipairs({{c.get,0x400,'InPlayerController','InQuest'},{c.can,0x500,'InPlayerController','InQuest'},{c.begin,0x600,'InOwner','Quest'}})do
     input(entry[1],c.buffer+entry[2],entry[3],bytes('&lt;I8',pc));input(entry[1],c.buffer+entry[2],entry[4],bytes('&lt;I8',row.asset))
    end
    input(c.can,c.buffer+0x500,'bCheckPrerequisites',bytes('&lt;I1',checkPrerequisites and 1 or 0))
    local code=t.questStartCode141(c);local script=('[ENABLE]\nlabel(qs_allowed141)\nlabel(qs_denied141)\nlabel(qs_rejected141)\nlabel(qs_done141)\n%X:\n%s\n[DISABLE]\n'):format(c.buffer,code)
    local assembled,detail=autoAssemble(script);assert(assembled,'Quest action assembly failed: '..tostring(detail))
    local allow=t.nativeCallAllowlist141 or{};t.nativeCallAllowlist141=allow;local prior=allow[c.buffer];allow[c.buffer]=true
    local submitted,submitError=pcall(t.job,c.buffer,{}, {sys,row.asset},function(result)
     local good,reason=pcall(function()
      valid(row);assert(t.sameIdentity029(owner)and t.sameIdentity029(sysid),'Quest owner/subsystem expired')
      local code=readInteger(c.buffer+0x300);assert(code==result,'Quest action result mismatch');local before=readBytes(c.buffer+0x310,1)
      if code~=1 then
       t.questStartBusy141=nil;local message=code==2 and t.T('This quest is already active or completed: ','受注中・報告待ち・完了済みのため追加しません：')..statusName(before,c.values)or code==3 and t.T('The game rejected the acceptance requirements.','ゲーム側の受注条件を満たしていません。')or t.T('The game did not accept this quest.','ゲーム側がクエストを受け付けませんでした。')
       failed(message);return
      end
      invoke(c.get,{InPlayerController=bytes('&lt;I8',pc),InQuest=bytes('&lt;I8',row.asset)},function(p)
       valid(row);local after=readBytes(p+c.statusReturn,1);t.questStartBusy141=nil
       assert(after==c.values.Starting or after==c.values.InProgress or after==c.values.Ready or after==c.values.Completed,'Quest acceptance returned success but state was not updated')
       t.lastQuestAdded141={name=row.name,before=before,after=after};row.status149=after;row.statusLabel149=statusName(after,c.values);row.color149=after==c.values.Completed and 0x909090 or 0x70dfff;done(after,row.statusLabel149)
      end,failure)
     end);if not good then failure(reason)end
    end)
    allow[c.buffer]=prior;assert(submitted,submitError)
    if t.pendingJob then t.pendingJob.cancelled074=failure end
   end);if not okay then failure(why)end
  end
  assert(t.enqueueAction025(run,'quest-add141',function()local okay=pcall(valid,row);if not okay then failure('Selected quest expired before execution')end;return okay end))
 end);if not ok then failure(e)end
end
function t.questListStatuses149(rows,done,failed,progress,alive)
 local fresh=true;for _,row in ipairs(rows)do if not row.statusFresh152 then fresh=false;break end end
 if fresh then for _,row in ipairs(rows)do row.statusFresh152=nil end;done(rows);return end
 t.questBatch152(rows,false,done,failed,progress,alive)
end
function t.questVisibility154(row,includeHidden)
 if includeHidden then return true end
 local path=(row.package154 or ''):gsub('\\','/'):lower()
 if path==''then return false,'unknown path' end
 if path:find('/old/',1,true)or (row.en or ''):lower():find('(old)',1,true)then return false,'old' end
 local key=(row.key or ''):gsub('(%l)(%u)','%1_%2'):lower()
 for token in key:gmatch('[a-z0-9]+')do if token=='test'or token=='tests'or token=='unittest'then return false,'test' end end
 for token in path:gmatch('[^/]+')do if token=='test'or token=='tests'or token=='unittest'then return false,'test' end end
 if (row.en or ''):lower():match('^do%s+quest%s+[a-z]$')then return false,'placeholder' end
 return true
end
function t.openQuestAdd141()
 t.require();if t.questAddForm141 then t.questAddForm141.show();return end
 local f=TLC.uiCreate157('Form',false);t.questAddForm141=f;f.Caption=t.T('Add a selected quest','クエストを選択して追加');f.Font.Size=10;f.Position='poScreenCenter';f.ClientWidth=980;f.ClientHeight=650;f.Constraints.MinWidth=1000;f.Constraints.MinHeight=690;f.AutoScroll=true
 local search=TLC.uiCreate157('Edit',f);bounds(search,16,54,410,30);search.TextHint=t.T('Search quest names','クエスト名で検索')
 local includeHidden=createCheckBox(f);bounds(includeHidden,16,91,410,28);includeHidden.Caption=t.T('Show old / test quests','旧・テスト用クエストも表示');includeHidden.Checked=false
 local list=TLC.uiCreate157('ListBox',f);bounds(list,16,126,410,420);list.Style='lbOwnerDrawFixed';list.Color=0x252525;list.Font.Color=0xffffff
 list.MultiSelect=false
 list.OnDrawItem=function(sender,index,r,state)if type(index)~='number' or index&lt;0 or index&gt;=sender.Items.Count then return end;local c=sender.Canvas;local row=t.questAddUI141 and t.questAddUI141.state.shown[index+1];c.Brush.Color=index==sender.ItemIndex and 0x805020 or 0x252525;c.Font.Color=row and row.color149 or 0xffffff;c.fillRect(r.Left,r.Top,r.Right,r.Bottom);c.textOut(r.Left+3,r.Top,sender.Items[index])end
 local details=TLC.uiCreate157('Memo',f);bounds(details,444,54,520,430);details.ReadOnly=true;details.WordWrap=true
 local prerequisites=createCheckBox(f);bounds(prerequisites,444,498,520,30);prerequisites.Caption=t.T('Check prerequisite quests before accepting','前提クエストの条件を確認して追加');prerequisites.Checked=true
 local add=createButton(f);bounds(add,444,542,520,36);add.Caption=t.T('Add selected quest','選択したクエストを追加');add.Enabled=false
 local refresh=createButton(f);bounds(refresh,16,12,948,30);refresh.Caption=t.T('Refresh quests from game','ゲームからクエスト一覧を取得')
 local close=createButton(f);bounds(close,16,558,410,32);close.Caption=t.T('Close','閉じる')
 local label=TLC.uiCreate157('Label',f);bounds(label,16,600,948,44);label.AutoSize=false;label.WordWrap=true
 local s={rows={},shown={},busy=false,closed=false,generation=0};t.questAddUI141={form=f,list=list,search=search,includeHidden=includeHidden,prerequisites=prerequisites,add=add,refresh=refresh,details=details,state=s}
 local function failure(e)if not s.closed then s.busy=false;refresh.Enabled=true;add.Enabled=false;label.Caption=tostring(e)end;t.reason('questAdd',tostring(e))end
 local function updateRow151(row)
  if s.closed or s.updating151 or s.busy or list.Items.Count~=#s.shown then return end
  for n,r in ipairs(s.shown)do if r==row then local index=n-1;if index&gt;=0 and index&lt;list.Items.Count then list.Items[index]=row.name..'  ['..row.statusLabel149..']'end;return end end
 end
 local function choose()
  if s.closed or s.busy or s.updating151 then return end;s.generation=s.generation+1;local generation=s.generation;local row=s.shown[list.ItemIndex+1];s.selected=row;add.Enabled=false;if not row then details.Lines.Text='';return end
  label.Caption=t.T('Reading quest status...','クエストの状態を取得中…')
  t.questAddStatus141(row,prerequisites.Checked,function(status,can,name,values)
   if s.closed or generation~=s.generation then return end
   local header=row.name..'\r\n'..t.T('Status: ','状態：')..name
   t.questDescription141(row,function(description)
    if s.closed or generation~=s.generation then return end;details.Lines.Text=header..'\r\n\r\n'..(description~=''and description or t.T('(No description)','（説明なし）'));add.Enabled=can
    label.Caption=can and t.T('The selected quest will be started through the normal game API.','選択したクエストをゲーム本来の受注処理で追加します。')or eligible(status,values)and t.T('Acceptance requirements are not met. Uncheck prerequisite checking to omit that check. Other game requirements still apply.','受注条件未達です。前提クエストの確認はチェックで切替できます。他の受注条件はゲーム側で判定します。')or t.T('Active and completed quests cannot be added again.','受注中・報告待ち・完了済みのクエストは追加しません。')
   end,failure)
  end,failure)
 end
 local function filter()
  if s.busy then return end;s.updating151=true;s.generation=s.generation+1;s.shown={};list.Items.clear();local term=search.Text:lower()
  for _,row in ipairs(s.rows)do if t.questVisibility154(row,includeHidden.Checked)and (term==''or row.en:lower():find(term,1,true)or row.ja:lower():find(term,1,true))then s.shown[#s.shown+1]=row;list.Items.add(row.name..(row.statusLabel149 and '  ['..row.statusLabel149..']'or t.T('  [Checking status]','  [状態確認中]')))end end
  s.updating151=false;if #s.shown&gt;0 and list.Items.Count&gt;0 then list.ItemIndex=0;choose()else add.Enabled=false;details.Lines.Text='';label.Caption=t.T('No matching quests.','該当するクエストはありません。')end
 end
 local function reload()
  if s.busy then return end;s.statusScan150=nil;s.busy=true;s.generation=s.generation+1;refresh.Enabled=false;add.Enabled=false;s.rows={};s.shown={};list.Items.clear();details.Lines.Text=''
  t.questCatalog141(function(rows)
   if s.closed then return end;s.rows=rows;s.busy=false;refresh.Enabled=true;filter()
   local scan={};s.statusScan150=scan
   t.questListStatuses149(rows,function()if s.closed or s.statusScan150~=scan then return end;s.statusScan150=nil end,function(e)if s.closed or s.statusScan150~=scan then return end;s.statusScan150=nil;t.reason('questStatus',tostring(e))end,function(i,total,row)
    if s.closed or s.statusScan150~=scan then return end
    updateRow151(row)
   end,function()return not s.closed and s.statusScan150==scan end)
  end,failure,function(i,total)if not s.closed then label.Caption=t.T('Reading quest names: ','クエスト名を取得中：')..i..' / '..total end end,function()return not s.closed end)
 end
 add.OnClick=function()
  if s.busy or not s.selected then return end;local row=s.selected;local check=prerequisites.Checked;s.busy=true;add.Enabled=false;refresh.Enabled=false;s.generation=s.generation+1
  label.Caption=t.T('Adding selected quest...','選択したクエストを追加中…')
  local okay,e=pcall(t.acceptSelectedQuest141,row,check,function(after,name)if s.closed then return end;s.busy=false;refresh.Enabled=true;add.Enabled=false;updateRow151(row);label.Caption=t.T('Added: ','追加しました：')..row.name;details.Lines.Text=row.name..'\r\n'..t.T('Status: ','状態：')..name end,failure);if not okay then failure(e)end
 end
 list.OnClick=choose;search.OnChange=filter;includeHidden.OnChange=filter;prerequisites.OnChange=choose;refresh.OnClick=function()t.questCatalogCache141=nil;reload()end;close.OnClick=function()f.close()end
 f.OnClose=function()s.closed=true;s.generation=s.generation+1;t.questAddForm141=nil;t.questAddUI141=nil;return caFree end;f.show();reload()
end
local forget=t.forgetProcess
function t.forgetProcess(...)if t.questAddForm141 then t.questAddForm141.close()end;t.questStartBusy141=nil;t.questRegistry141=nil;t.questCatalogCache141=nil;t.lastQuestAdded141=nil;return forget(...)end
t.NAMES[607]={'Add a selected quest...','クエストを選択して追加…'}
end)(TLC)

-- Named game APIs and reflected fields only; no store-specific addresses.
;(function(t)
local function pack(fmt,...)local s=string.pack(fmt,...);return{s:byte(1,#s)}end
local function finite(x)return type(x)=='number'and x==x and math.abs(x)&lt;1e10 end
local function bounds(c,x,y,w,h)c.Left=x;c.Top=y;c.Width=w;c.Height=h end
local function tripleLayout155(kind)
 t.tripleLayouts155=t.tripleLayouts155 or{};local old=t.tripleLayouts155[kind];if old and t.sameIdentity029(old.identity)then return old.offsets end
 local meta=assert(t.findMetadata074(kind,'ScriptStruct'));local names=kind=='Vector'and{'X','Y','Z'}or{'Pitch','Yaw','Roll'};local offsets={};local seen={}
 for i,name in ipairs(names)do local off,size=t.refFieldLayout(meta,name,'struct');assert(off and size==8 and off&gt;=0 and off+8&lt;=24 and not seen[off],'Spatial parameter layout changed: '..kind..'.'..name);offsets[i]=off;seen[off]=true end
 t.tripleLayouts155[kind]={identity=assert(t.identity029(meta)),offsets=offsets};return offsets
end
function t.tripleBytes155(kind,values)
 local offsets=tripleLayout155(kind);local out={};for i=1,24 do out[i]=0 end
 for i,off in ipairs(offsets)do assert(finite(values[i]),'Invalid spatial parameter');local b=pack('&lt;d',values[i]);for n,v in ipairs(b)do out[off+n]=v end end;return out
end
function t.tripleRead155(kind,address)local out={};for i,off in ipairs(tripleLayout155(kind))do out[i]=readDouble(address+off);assert(finite(out[i]),'Spatial result invalid')end;return out end
local function invoke(c,input,done,failed,alive)
 local function failure(e)if not alive or alive()then failed(tostring(e))end end
 assert(t.enqueueAction025(function()
  if alive and not alive()then return end
  local prior=t.catalogBusy075;t.catalogBusy075={busy=true,fail=failure}
  local ok,e=pcall(t.apiInvoke075,c,input,function(p)if alive and not alive()then return end;local okay,why=pcall(done,p);if not okay then failure(why)end end)
  t.catalogBusy075=prior;if not ok then failure(e)end
 end,nil,function()return not alive or alive()end))
end
function t.recyclerContract155(actor)
 assert(t.valid(actor)and(t.U.isA(actor,'BP_Module_Recycler_C')or t.U.isA(actor,'BP_Module_Recycler_Ground_C')or t.U.isA(actor,'BP_Module_Dumpster_C')),'Target is not a recycler')
 local module=assert(t.readObjectField074(actor,'ModuleComponent'));assert(t.U.isA(module,'VoyageModuleComponent'),'Recycler module component unavailable')
 local get=t.objectApiContract076(module,'VoyageModuleComponent','GetResourceAmount');local clear=t.objectApiContract076(module,'VoyageModuleComponent','ClearResource');local power=t.objectApiContract076(module,'VoyageModuleComponent','HasPower')
 t.apiMember075(get,'Type',1);local amount=t.apiMember075(get,'ReturnValue',8);t.apiMember075(clear,'Type',1);local cleared=t.apiMember075(clear,'ReturnValue',1);local powered=t.apiMember075(power,'ReturnValue',1)
 local _,types=t.enumProperty076(t.property076(get.fn,'Type','function'));local _,clearTypes=t.enumProperty076(t.property076(clear.fn,'Type','function'));local work=assert(types.Custom2,'Recycler processing resource unavailable');assert(clearTypes.Custom2==work and work&gt;=0 and work&lt;=255,'Recycler resource enum disagreement')
 return{actor=actor,identity=assert(t.identity029(actor)),module=module,moduleIdentity=assert(t.identity029(module)),get=get,clear=clear,power=power,amount=amount,cleared=cleared,powered=powered,work=work}
end
function t.recyclerBatchCode155(c)
 return table.concat({'push rbx','push rdi','sub rsp,28',('mov rbx,%X'):format(c.buffer),('mov edi,%X'):format(c.limit),'ri_loop155:',('mov rcx,%X'):format(c.module),('mov rdx,%X'):format(c.power.fn),'lea r8,[rbx+400]',('mov rax,%X'):format(c.moduleDispatch),'call rax',('cmp byte ptr [rbx+%X],0'):format(0x400+c.powered),'je ri_done155',('mov rcx,%X'):format(c.module),('mov rdx,%X'):format(c.get.fn),'lea r8,[rbx+500]',('mov rax,%X'):format(c.moduleDispatch),'call rax','xorps xmm0,xmm0',('ucomisd xmm0,[rbx+%X]'):format(0x500+c.amount),'jae ri_update155','jp ri_done155',('mov rcx,%X'):format(c.module),('mov rdx,%X'):format(c.clear.fn),'lea r8,[rbx+600]',('mov rax,%X'):format(c.moduleDispatch),'call rax',('cmp byte ptr [rbx+%X],0'):format(0x600+c.cleared),'je ri_done155','inc dword ptr [rbx+300]','ri_update155:',('mov rcx,%X'):format(c.actor),('mov rdx,%X'):format(c.update.fn),'lea r8,[rbx+700]',('mov rax,%X'):format(c.actorDispatch),'call rax','inc dword ptr [rbx+304]','dec edi','jnz ri_loop155','ri_done155:','mov eax,[rbx+304]','add rsp,28','pop rdi','pop rbx','ret'},'\n')
end
function t.finishRecycler155(actor,done,failed,alive)
 local okay,why=pcall(function()
  local c=t.recyclerContract155(actor);local world=assert(t.identity029(t.world()));c.update=t.objectApiContract076(actor,'BP_Module_MasterRecycler_C','JoinModuleUpdate');local delta=t.apiMember075(c.update,'DeltaSeconds',4);local catchup=t.apiMember075(c.update,'bCatchupTick',1)
  c.limit=128;assert(c.power.size&lt;=0x100 and c.get.size&lt;=0x100 and c.clear.size&lt;=0x100 and c.update.size&lt;=0x100,'Recycler API frame exceeds owned storage')
  local function valid()return(not alive or alive())and t.sameIdentity029(world)and t.sameIdentity029(c.identity)and t.sameIdentity029(c.moduleIdentity)end
  assert(t.enqueueAction025(function()
   local ok,e=pcall(function()
    if not valid()then failed('target/world identity changed');return end
    c.moduleDispatch=t.processEvent074(c.module,false);c.actorDispatch=t.processEvent074(actor,false)
    local cache=t.recyclerScratch155;if not cache or cache.pid~=getOpenedProcessID()then cache={pid=getOpenedProcessID(),address=assert(allocateMemory(0x1000))};t.recyclerScratch155=cache end;c.buffer=cache.address
    local zero={};for i=1,0x500 do zero[i]=0 end;assert(writeBytes(c.buffer+0x300,zero))
    assert(writeBytes(c.buffer+0x500+t.apiMember075(c.get,'Type',1),pack('&lt;I1',c.work)));assert(writeBytes(c.buffer+0x600+t.apiMember075(c.clear,'Type',1),pack('&lt;I1',c.work)));assert(writeBytes(c.buffer+0x700+delta,pack('&lt;f',0)));assert(writeBytes(c.buffer+0x700+catchup,pack('&lt;I1',0)))
    local code=t.recyclerBatchCode155(c);assert(autoAssemble(('[ENABLE]\nlabel(ri_loop155)\nlabel(ri_update155)\nlabel(ri_done155)\n%X:\n%s\n[DISABLE]\n'):format(c.buffer,code)),'Recycler batch assembly failed')
    local allow=t.nativeCallAllowlist141 or{};t.nativeCallAllowlist141=allow;local previous=allow[c.buffer];allow[c.buffer]=true
    local submitted,why=pcall(t.job,c.buffer,{}, {actor,c.module},function(iterations)
     if not valid()then failed('target/world identity changed');return end
     local cleared=readInteger(c.buffer+0x300);t.recyclerLast155={actor=actor,cycles=iterations,cleared=cleared,world=world.object,resource=c.work};done(cleared&gt;0,'completed')
    end);allow[c.buffer]=previous;assert(submitted,why);if t.pendingJob then t.pendingJob.cancelled074=failed end
   end);if not ok then failed(tostring(e))end
  end,nil,valid,failed))
 end);if not okay then failed(tostring(why))end
end
local key='recyclerInstant155'
local function active(s)return t.recyclerState155==s and t.featOn[key]and t.sameIdentity029(s.world)end
local function stop()t.recyclerState155=nil;t.cancelFeatureJob102(key)end
local function failed(s,e)if t.recyclerState155==s then s.busy=false;s.query=false;s.next=getTickCount()+250;s.nextQuery=0;if not(t.isTransient157 and t.isTransient157(e))then t.reason(key,tostring(e));t.feature(key,false)end end end
t.F[key]={on=function()t.need();assert(t.refClass('BP_Module_MasterRecycler_C'),'Recycler metadata is not loaded');t.recyclerState155={world=assert(t.identity029(t.world())),rows={},index=1,next=0,nextQuery=0}end,off=stop,task=function()
 local s=t.recyclerState155;if not s then return end
 if not active(s)then t.feature(key,false);return end
 if s.busy or s.query or t.pendingJob or #(t.actions025 or{})&gt;0 or getTickCount()&lt;s.next then return end
 s.next=getTickCount()+50
 if getTickCount()&gt;=s.nextQuery then
  s.query=true;s.nextQuery=getTickCount()+1000
  local ok,e=pcall(t.queryActors112,'BP_Module_MasterRecycler_C',function(rows,world)
   if not active(s)then return end;s.rows={};for _,o in ipairs(rows)do if t.U.isA(o,'BP_Module_Recycler_C')or t.U.isA(o,'BP_Module_Recycler_Ground_C')or t.U.isA(o,'BP_Module_Dumpster_C')then s.rows[#s.rows+1]=o end end;s.index=1;s.query=false
  end);if not ok then failed(s,e)elseif t.pendingJob then t.pendingJob.featureOwner102=key;t.pendingJob.cancelled074=function(why)failed(s,why)end end;return
 end
 if #s.rows==0 then return end
 local actor=s.rows[s.index];s.index=s.index%#s.rows+1;if not t.valid(actor)then return end
 local progress,size=t.refFieldLayout(actor,'CurrentProgressMax',false);if not t.U.isA(actor,'BP_Module_Dumpster_C')and progress and size==8 and readDouble(actor+progress)&lt;=0 then return end;s.busy=true
 t.finishRecycler155(actor,function()if active(s)then s.busy=false end end,function(e)failed(s,e)end,function()return active(s)end)
end}
t.compat038.portable[key]=true
t.NAMES[409]={'Instant recycler / Recovery Grinder','リサイクラー・リカバリーグラインダー即完了'}

function t.boatDestination155(boat,kind,distance,done,failed)
 local id=assert(t.identity029(boat));local world=assert(t.identity029(t.world()));local initial=t.actorLocation109(boat)
 local function alive()return t.sameIdentity029(id)and t.sameIdentity029(world)end
 local locator=t.worldSubsystem107('VoyageLocatorSubsystem')
 local function water(destination,preserveHeight)
  for _,v in ipairs(destination)do assert(finite(v),'Boat destination coordinates invalid')end
  local water=t.apiContract075('VoyageMiscBlueprintFunctionLibrary','GetWaterHeightAtLocation');t.apiMember075(water,'World',8);t.apiMember075(water,'Loc',24);local height=t.apiMember075(water,'ReturnValue',4)
  invoke(water,{World=pack('&lt;I8',world.object),Loc=t.tripleBytes155('Vector',initial)},function(p)
   local oldHeight=readFloat(p+height);assert(finite(oldHeight),'Source sea level unavailable')
   invoke(water,{World=pack('&lt;I8',world.object),Loc=t.tripleBytes155('Vector',destination)},function(p)
    local targetHeight=readFloat(p+height);assert(finite(targetHeight),'Destination sea level unavailable')
    -- Preserve the ship's waterline offset instead of changing buoyancy or hull geometry.
    if not preserveHeight then destination[3]=targetHeight+(initial[3]-oldHeight)end
    local check=t.objectApiContract076(locator,'VoyageLocatorSubsystem','IsLocationInWater');t.apiMember075(check,'Location',24);local result=t.apiMember075(check,'ReturnValue',1)
    invoke(check,{Location=t.tripleBytes155('Vector',{destination[1],destination[2],targetHeight-1})},function(p)
     assert(readBytes(p+result,1)~=0,t.T('Choose a destination on open water.','移動先を海上に指定してください。'));done(destination,initial)
    end,failed,alive)
   end,failed,alive)
  end,failed,alive)
 end
 if kind=='waypoint'then
  local closest=t.objectApiContract076(locator,'VoyageLocatorSubsystem','FindClosestLocator');t.apiMember075(closest,'InLocation',24);t.apiMember075(closest,'OutDistance',4);t.apiMember075(closest,'InType',1);local result=t.apiMember075(closest,'ReturnValue',16)
  local _,types=t.enumProperty076(t.property076(closest.fn,'InType','function'));local waypoint=assert(types.Waypoint,'Waypoint locator enum unavailable')
  invoke(closest,{InLocation=t.tripleBytes155('Vector',initial),OutDistance=pack('&lt;f',0),InType=pack('&lt;I1',waypoint)},function(p)
   assert(t.readApiString075(p+result)~='',t.T('Set a waypoint on the map first.','先にマップでウェイポイントを設定してください。'))
   local identifier=assert(readBytes(p+result,16,true));local location=t.objectApiContract076(locator,'VoyageLocatorSubsystem','GetLocatorWorldLocation');t.apiMember075(location,'Identifier',16);local point=t.apiMember075(location,'ReturnValue',24)
   invoke(location,{Identifier=identifier},function(p)water(t.tripleRead155('Vector',p+point))end,failed,alive)
  end,failed,alive)
 elseif kind=='player'then water(t.actorLocation109(t.player(true)))
 elseif kind:match('^bookmark:%d+$')then
  local index=tonumber(kind:match('(%d+)$'));local mark=assert((t.boatBookmarks155 or{})[index],'Saved destination unavailable');local c=t.apiContract075('GameplayStatics','RebaseZeroOriginOntoLocal');t.apiMember075(c,'WorldContextObject',8);t.apiMember075(c,'WorldLocation',24);local output=t.apiMember075(c,'ReturnValue',24)
  invoke(c,{WorldContextObject=pack('&lt;I8',world.object),WorldLocation=t.tripleBytes155('Vector',mark.location)},function(p)water(t.tripleRead155('Vector',p+output),true)end,failed,alive)
 elseif kind=='saved'then
  local saved=t.boatSaved155;assert(saved and t.sameIdentity029(saved.world),t.T('Save a boat position first.','先に船の位置を保存してください。'));water({table.unpack(saved.location)},true)
 else
  assert(kind=='forward'or kind=='backward'or kind=='left'or kind=='right','Unknown boat destination');assert(finite(distance)and distance&gt;0 and distance&lt;=10000,t.T('Specify a distance greater than 0 and at most 10000 m.','移動距離は0より大きく10000m以下で指定してください。'))
  local rot=t.objectApiContract076(boat,'Actor','K2_GetActorRotation');local rotation=t.apiMember075(rot,'ReturnValue',24)
  invoke(rot,{},function(p)
   local yaw=t.tripleRead155('Rotator',p+rotation)[2];assert(finite(yaw),'Boat heading unavailable');local angle=math.rad(yaw+(kind=='backward'and 180 or kind=='left'and -90 or kind=='right'and 90 or 0));local d=distance*100
   water({initial[1]+math.cos(angle)*d,initial[2]+math.sin(angle)*d,initial[3]})
  end,failed,alive)
 end
end
function t.activateBoatCode155(c)
 return table.concat({'push rbx','sub rsp,20',('mov rbx,%X'):format(c.buffer),('mov rcx,%X'):format(c.action),('mov rdx,%X'):format(c.activate.fn),'lea r8,[rbx+400]',('mov rax,%X'):format(c.actionDispatch),'call rax',('mov rax,%X'):format(c.action),('movzx eax,byte ptr [rax+%X]'):format(c.completion),'mov [rbx+300],eax',('mov rcx,%X'):format(c.boat),('mov rdx,%X'):format(c.location.fn),'lea r8,[rbx+500]',('mov rax,%X'):format(c.boatDispatch),'call rax','mov eax,[rbx+300]','add rsp,20','pop rbx','ret'},'\n')
end
function t.pollBoatWarp155()
 local r=t.boatWarpRequest155;if not r or r.stage=='done'or r.stage=='failed'then return end
 local okay,why=pcall(function()
  if not r.alive()then r.failure(t.T('Boat warp cancelled: world or boat changed.','ワールドまたは船が変わったため移動を中止しました。'));return end
  if r.monitorIdentity and not t.sameIdentity029(r.monitorIdentity)then r.failure('Boat passenger identity changed');return end
  if r.stage~='active'then return end
  local destination=r.monitorDestination or r.destination;local position=t.actorLocation109(r.monitorActor or r.boat);local dx,dy,dz=position[1]-destination[1],position[2]-destination[2],position[3]-destination[3]
  local actionAlive=t.sameIdentity029(r.actionIdentity);local finished=r.nativeComplete or actionAlive and readBytes(r.action+r.completion,1)~=0
  if (finished or not actionAlive)and dx*dx+dy*dy+dz*dz&lt;10000 then r.arrivedAt=r.arrivedAt or getTickCount();if getTickCount()-r.arrivedAt&gt;=1000 then r.arrival=position;(r.arrived or r.success)(position)end;return end
  r.arrivedAt=nil;if ((finished or not actionAlive)and getTickCount()-(r.activeStarted or r.started)&gt;5000)or getTickCount()-(r.activeStarted or r.started)&gt;35000 then r.failure(t.T('The game did not complete the boat warp.','ゲーム側で船の移動を完了できませんでした。'))end
 end);if not okay then r.failure(tostring(why))end
end
function t.warpBoat155(boat,kind,distance,done,failed)
 assert(not t.boatWarpBusy155,t.T('A boat warp is already running.','船の移動処理中です。'));assert(t.valid(boat)and t.U.isA(boat,'VoyageBoatPawn'),'Selected boat unavailable')
 local id=assert(t.identity029(boat));local world=assert(t.identity029(t.world()));local request={boat=boat,identity=id,world=world,started=getTickCount(),stage='preflight',done=done};t.boatWarpRequest155=request;t.boatWarpBusy155=true
 local function worldAlive()return t.boatWarpRequest155==request and t.sameIdentity029(world)and t.sameIdentity029(id)end
 local function alive()return worldAlive()and t.boatWarpBusy155 end
 local function finalize(position,errorText)
  if t.boatWarpRequest155~=request then return end;t.boatWarpBusy155=nil;request.stage=position and 'done'or'failed';request.error=errorText
  if position then done(position)else failed(tostring(errorText))end
 end
 local function finish(position,errorText)
  if t.boatWarpRequest155~=request then return end
  if request.finishing then if not worldAlive()then finalize(nil,errorText)end;return end;request.finishing=true
  if request.anchorsWereDown and request.lifted and worldAlive()then
   request.stage='restoring-anchors';local drop=t.objectApiContract076(boat,'VoyageBoatPawn','DropAnchors');assert(drop.size==0,'Anchor drop parameters changed')
   invoke(drop,{},function()request.anchorsRestored=true;finalize(position,errorText)end,function(e)finalize(nil,tostring(errorText or'')..' / '..tostring(e))end,worldAlive)
  else finalize(position,errorText)end
 end
 local function failure(e)finish(nil,tostring(e))end
 request.failure=failure;request.alive=alive;request.success=function(position)finish(position,nil)end
 local function anchorDown()
  local off,size=t.refFieldLayout(boat,'AnchorsDropped',false);assert(off and size==1,'Boat anchor state unavailable');local prop=t.property076(boat,'AnchorsDropped',false);local byte=readBytes(prop+0x71,1);local mask=readBytes(prop+0x72,1);assert(byte and byte&lt;size and mask and mask&gt;0,'Boat anchor bool contract changed');return(readBytes(boat+off+byte,1)&amp;mask)~=0
 end
 local function activateTarget(targetActor,action,destination,arrived)
  local targetId=assert(t.identity029(targetActor));local actionId=assert(t.identity029(action));local activate=t.objectApiContract076(action,'BlueprintAsyncActionBase','Activate');assert(activate.size==0,'Async activation parameters changed')
    request.monitorActor=targetActor;request.monitorIdentity=targetId;request.monitorDestination=destination;request.arrived=arrived;request.arrivedAt=nil;request.nativeComplete=nil;request.action=action;request.actionIdentity=actionId;request.completion=t.warpCompletionOffset109();request.stage='activation-queued'
    assert(t.enqueueAction025(function()
     local ok,e=pcall(function()
      assert(alive()and t.sameIdentity029(actionId),'Boat warp action expired before activation')
      local location=t.objectApiContract076(targetActor,'Actor','K2_GetActorLocation');local locationResult=t.apiMember075(location,'ReturnValue',24)
      local cache=t.boatActivateScratch155;if not cache or cache.pid~=getOpenedProcessID()then cache={pid=getOpenedProcessID(),address=assert(allocateMemory(0x1000))};t.boatActivateScratch155=cache end
      local c={buffer=cache.address,action=action,boat=targetActor,activate=activate,location=location,completion=request.completion,actionDispatch=t.processEvent074(action,false),boatDispatch=t.processEvent074(targetActor,false)}
      local zeros={};for i=1,0x300 do zeros[i]=0 end;assert(writeBytes(c.buffer+0x300,zeros));assert(autoAssemble(('[ENABLE]\n%X:\n%s\n[DISABLE]\n'):format(c.buffer,t.activateBoatCode155(c))),'Boat activation assembly failed')
      local allow=t.nativeCallAllowlist141 or{};t.nativeCallAllowlist141=allow;local old=allow[c.buffer];allow[c.buffer]=true
      local submitted,errorText=pcall(t.job,c.buffer,{}, {action,targetActor},function(finished)
       if not alive()then return end;request.nativeComplete=finished~=0;request.activationPosition=t.tripleRead155('Vector',c.buffer+0x500+locationResult);request.activeStarted=getTickCount();request.stage='active'
      end);allow[c.buffer]=old;assert(submitted,errorText);if t.pendingJob then t.pendingJob.cancelled074=failure end
     end);if not ok then failure(e)end
    end,nil,alive))
 end
 local function shipArrived(position)
  request.boatArrival=position
  local player=request.passenger
  if not player then finish(position,nil);return end
  assert(t.sameIdentity029(request.passengerIdentity),'Boat passenger changed')
  local destination={};for i=1,3 do destination[i]=position[i]+request.passengerOffset[i]end
  request.stage='passenger-preflight';request.monitorIdentity=request.passengerIdentity
  local rot=t.objectApiContract076(player,'Actor','K2_GetActorRotation');local rotation=t.apiMember075(rot,'ReturnValue',24)
  invoke(rot,{},function(p)
   local angles=t.tripleRead155('Rotator',p+rotation);local create=t.apiContract075('VoyageTeleportAsyncAction','TeleportActorWhenLoaded');local output=t.apiMember075(create,'ReturnValue',8)
   invoke(create,{WorldContextObject=pack('&lt;I8',player),Actor=pack('&lt;I8',player),Location=t.tripleBytes155('Vector',destination),Rotation=t.tripleBytes155('Rotator',angles),Timeout=pack('&lt;f',30),bTeleportOnTimeout=pack('&lt;I1',0)},function(p)
    local action=readQword(p+output);assert(t.valid(action)and t.U.isA(action,'VoyageTeleportAsyncAction'),'Passenger teleport action unavailable')
    activateTarget(player,action,destination,function()request.passengerMoved=true;finish(t.actorLocation109(boat),nil)end)
   end,failure,alive)
  end,failure,alive)
 end
 local function beginDestination()
 local okay,why=pcall(t.boatDestination155,boat,kind,distance,function(destination,initial)
  request.destination=destination;request.initial=initial
  local rot=t.objectApiContract076(boat,'Actor','K2_GetActorRotation');local rotation=t.apiMember075(rot,'ReturnValue',24)
  invoke(rot,{},function(p)
   local yaw=t.tripleRead155('Rotator',p+rotation)[2];assert(finite(yaw),'Boat heading invalid')
   local create=t.apiContract075('VoyageTeleportAsyncAction','TeleportActorWhenLoaded');local result=t.apiMember075(create,'ReturnValue',8)
   for _,v in ipairs({{'WorldContextObject',8},{'Actor',8},{'Location',24},{'Rotation',24},{'Timeout',4},{'bTeleportOnTimeout',1}})do t.apiMember075(create,v[1],v[2])end
   invoke(create,{WorldContextObject=pack('&lt;I8',boat),Actor=pack('&lt;I8',boat),Location=t.tripleBytes155('Vector',destination),Rotation=t.tripleBytes155('Rotator',{0,yaw,0}),Timeout=pack('&lt;f',30),bTeleportOnTimeout=pack('&lt;I1',0)},function(p)
    local action=readQword(p+result);assert(t.valid(action)and t.U.isA(action,'VoyageTeleportAsyncAction'),'Boat teleport action unavailable')
    activateTarget(boat,action,destination,shipArrived)
   end,failure,alive)
  end,failure,alive)
 end,failure)
 if not okay then failure(why)end
 end
 local function beginAnchors()
  local okay,why=pcall(function()
  request.anchorsWereDown=anchorDown()
  if request.anchorsWereDown then
   local lift=t.objectApiContract076(boat,'VoyageBoatPawn','LiftAnchors');assert(lift.size==0,'Anchor lift parameters changed')
   invoke(lift,{},function()request.lifted=true;assert(not anchorDown(),'The game did not lift the boat anchors');beginDestination()end,failure,alive)
  else beginDestination()end
 end);if not okay then failure(why)end
 end
 local okay,why=pcall(function()
  local player=t.boatCarryPlayer155~=false and t.player(false)or nil
  if not t.valid(player)then beginAnchors();return end
  local attached=t.objectApiContract076(boat,'Actor','GetAttachedActors');local output=t.apiMember075(attached,'OutActors',16)
  invoke(attached,{bResetArray=pack('&lt;I1',1),bRecursivelyIncludeAttachedActors=pack('&lt;I1',1)},function(p)
   local data,count,capacity=readQword(p+output),readInteger(p+output+8),readInteger(p+output+12);assert(count and capacity and count&gt;=0 and count&lt;=capacity and capacity&lt;10000,'Boat attachment result invalid')
   local found=false;for i=0,count-1 do if readQword(data+i*8)==player then found=true;break end end
   if found and t.valid(player)then
    request.passenger=player;request.passengerIdentity=assert(t.identity029(player));local location=t.actorLocation109(player);local base=t.actorLocation109(boat);request.passengerOffset={}
    for i=1,3 do request.passengerOffset[i]=location[i]-base[i]end
   end
   beginAnchors()
  end,failure,alive)
 end);if not okay then failure(why)end

end
if not t.boatWarpTick155Installed then
 t.boatWarpTick155Installed=true;local tick=t.tick
 function t.tick(...)local result=tick(...);t.pollBoatWarp155();return result end
end
function t.openBoatWarp155()
 t.require();if t.boatWarpForm155 then t.boatWarpForm155.show();return end
 local f=TLC.uiCreate157('Form',false);t.boatWarpForm155=f;f.Caption=t.T('Warp boat','船をワープ');f.Font.Size=10;f.ClientWidth=620;f.ClientHeight=430;f.Position='poScreenCenter'
 local function label(text,x,y,w)local l=TLC.uiCreate157('Label',f);bounds(l,x,y,w,25);l.Caption=text;return l end
 label(t.T('Boat','移動する船'),16,16,580);local boats=TLC.uiCreate157('ComboBox',f);bounds(boats,16,46,588,30);boats.Style='csDropDownList'
 label(t.T('Destination','移動先'),16,88,580);local target=TLC.uiCreate157('ComboBox',f);bounds(target,16,118,588,30);target.Style='csDropDownList'
 local kinds={'waypoint','player','forward','backward','left','right','saved'}
 local labels={{'Map waypoint (sea level)','マップのウェイポイント（海面）'},{'Player position (sea level)','プレイヤーの位置（海面）'},{'Forward from boat','船の前方'},{'Backward from boat','船の後方'},{'Left of boat','船の左方'},{'Right of boat','船の右方'},{'Saved boat position','保存した船の位置'}}
 for _,v in ipairs(labels)do target.Items.add(t.T(table.unpack(v)))end
 for i,mark in ipairs(t.boatBookmarks155 or{})do kinds[#kinds+1]='bookmark:'..i;target.Items.add(t.T(mark.en,mark.ja))end;target.ItemIndex=0
 label(t.T('Distance for relative movement (m)','前後左右へ移動する距離（m）'),16,162,430);local distance=TLC.uiCreate157('Edit',f);bounds(distance,454,158,150,30);distance.Text='50'
 local carry=createCheckBox(f);bounds(carry,16,196,588,28);carry.Caption=t.T('Move the player aboard with the boat','船上のプレイヤーも一緒に移動');carry.Checked=t.boatCarryPlayer155~=false;carry.OnChange=function()t.boatCarryPlayer155=carry.Checked end
 local save=createButton(f);bounds(save,16,238,285,34);save.Caption=t.T('Save current boat position','現在の船位置を保存');save.Enabled=false
 local refresh=createButton(f);bounds(refresh,319,238,285,34);refresh.Caption=t.T('Refresh boats','船の一覧を再取得')
 local run=createButton(f);bounds(run,16,288,588,38);run.Caption=t.T('Warp selected boat','選択した船をワープ');run.Enabled=false
 local message=TLC.uiCreate157('Label',f);bounds(message,16,342,588,62);message.AutoSize=false;message.WordWrap=true
 local s={rows={},closed=false,busy=false};t.boatWarpUI155={form=f,boats=boats,target=target,distance=distance,carry=carry,save=save,refresh=refresh,run=run,message=message,state=s}
 local function failure(e)if s.closed then return end;s.busy=false;refresh.Enabled=true;run.Enabled=#s.rows&gt;0;save.Enabled=#s.rows&gt;0;message.Caption=tostring(e);t.reason('boatWarp',tostring(e))end
 local function selected()local o=s.rows[boats.ItemIndex+1];assert(t.valid(o)and t.U.isA(o,'VoyageBoatPawn'),t.T('Select a boat.','船を選択してください。'));return o end
 local function reload()
  if s.busy then return end;s.busy=true;run.Enabled=false;save.Enabled=false;refresh.Enabled=false;message.Caption=t.T('Reading boats...','船を取得中…');s.rows={};boats.Items.clear()
  assert(t.enqueueAction025(function()local ok,e=pcall(t.queryActors112,'VoyageBoatPawn',function(rows)
   if s.closed then return end;s.rows=rows;for i=1,#rows do boats.Items.add(t.T('Boat ','船 ')..i)end
   s.busy=false;refresh.Enabled=true;run.Enabled=#rows&gt;0;save.Enabled=#rows&gt;0;if #rows&gt;0 then boats.ItemIndex=0 end;message.Caption=#rows&gt;0 and t.T('Choose an open-water destination.','移動先は開けた海上を指定してください。')or t.T('No boat is currently loaded.','読み込み済みの船がありません。')
  end);if not ok then failure(e)end end))
 end
 save.OnClick=function()local ok,e=pcall(function()local boat=selected();t.boatSaved155={world=assert(t.identity029(t.world())),location=t.actorLocation109(boat)};message.Caption=t.T('Boat position saved.','船の位置を保存しました。')end);if not ok then failure(e)end end
 run.OnClick=function()
  if s.busy then return end;local ok,e=pcall(function()local boat=selected();local kind=assert(kinds[target.ItemIndex+1]);s.busy=true;run.Enabled=false;save.Enabled=false;refresh.Enabled=false;message.Caption=t.T('Loading destination...','移動先を読み込み中…')
   t.warpBoat155(boat,kind,tonumber(distance.Text),function()if s.closed then return end;s.busy=false;run.Enabled=true;save.Enabled=true;refresh.Enabled=true;message.Caption=t.T('Boat warp completed.','船を移動しました。')end,failure)
  end);if not ok then failure(e)end
 end
 refresh.OnClick=reload;f.OnClose=function()s.closed=true;t.boatWarpForm155=nil;t.boatWarpUI155=nil;return caFree end;f.show();reload()
end
local forget=t.forgetProcess
function t.forgetProcess(...)if t.boatWarpForm155 then t.boatWarpForm155.close()end;t.boatSaved155=nil;t.boatWarpBusy155=nil;t.recyclerState155=nil;return forget(...)end
-- User-recorded destination; coordinates are world-origin-independent, not memory addresses.
t.boatBookmarks155={{en='Port Exodus Station',ja='ポートエクソダス・ステーション',location={1246821.1573471914,481332.23751330306,316.28952240222441}}}
t.NAMES[215]={'Warp boat (choose destination)...','船をワープ（移動先を選択）…'}
end)(TLC)

;(function(t)
local function finite(x)return type(x)=='number'and x==x and math.abs(x)&lt;1e15 end
function t.emptyAimedStorage156()
 t.need();assert(not t.aimEmptyBusy156 and not t.aimFillBusy088,'Another storage action is running')
 local actor,module=t.aimedTank088()
 if not actor or not module then t.msg('Target not eligible for emptying.','空にする対象外です。');return end
 local s={world=assert(t.identity029(t.world())),actor=assert(t.identity029(actor)),module=assert(t.identity029(module))};t.aimEmptyBusy156=s
 local function alive()return t.aimEmptyBusy156==s and t.sameIdentity029(s.world)and t.world()==s.world.object and t.sameIdentity029(s.actor)and t.sameIdentity029(s.module)end
 local function finish(ok,e)
  if t.aimEmptyBusy156==s then t.aimEmptyBusy156=nil end
  if ok then t.lastAimedStorageEmpty156=s;t.msg('Aimed tank / battery emptied.','照準先のタンク・バッテリーを空にしました。')
  elseif e then t.reason('aimEmpty',tostring(e))else t.msg('Target not eligible for emptying.','空にする対象外です。')end
 end
 local function fail(e)finish(false,e)end
 local function invoke(c,input,done)
  local okay,why=pcall(function()assert(t.enqueueAction025(function()
   if not alive()then fail('Storage or world changed; cancelled');return end
   local prior=t.catalogBusy075;t.catalogBusy075={busy=true,fail=fail}
   local ok,e=pcall(t.apiInvoke075,c,input,function(p)
    local yes,why=pcall(function()assert(alive(),'Storage or world changed; cancelled');done(p)end);if not yes then fail(why)end
   end);t.catalogBusy075=prior;if not ok then fail(e)end
  end))end);if not okay then fail(why)end
 end
 local ok,e=pcall(function()
  local function api(name)return t.objectApiContract076(module,'VoyageModuleComponent',name)end
  local primary,current,maximum,clear=api('GetPrimaryResourceType'),api('GetResourceAmount'),api('GetMaxResourceAmount'),api('ClearResource')
  local po=t.apiMember075(primary,'ReturnValue',1);local co=t.apiMember075(current,'ReturnValue',8);local mo=t.apiMember075(maximum,'ReturnValue',8);local ro=t.apiMember075(clear,'ReturnValue',1)
  local enums={};for _,c in ipairs({current,maximum,clear})do t.apiMember075(c,'Type',1);local enum=t.enumProperty076(t.property076(c.fn,'Type','function'));enums[#enums+1]=enum end
  local primaryEnum=t.enumProperty076(t.property076(primary.fn,'ReturnValue','function'));for _,enum in ipairs(enums)do assert(enum==primaryEnum,'Storage resource enum identity mismatch')end
  invoke(primary,{},function(p)
   s.resource=assert(readBytes(p+po,1));local input={Type={s.resource}}
   invoke(maximum,input,function(p)
    s.capacity=readDouble(p+mo);if not finite(s.capacity)or s.capacity&lt;=0 then finish(false);return end
    invoke(current,input,function(p)
     s.before=readDouble(p+co);if not finite(s.before)or s.before&lt;0 then finish(false);return end
     if s.before==0 then s.after=0;finish(true);return end
     invoke(clear,input,function(p)
      assert(readBytes(p+ro,1)==1,'Storage clear request rejected')
      invoke(current,input,function(p)s.after=readDouble(p+co);assert(finite(s.after)and s.after&gt;=0 and s.after&lt;=0.000001,'Storage is receiving resources; not empty');finish(true)end)
     end)
    end)
   end)
  end)
 end);if not ok then fail(e)end
end
t.NAMES[410]={'Empty aimed tank / battery','照準先のタンク・バッテリーを空'}
local forget=t.forgetProcess
function t.forgetProcess(...)t.aimEmptyBusy156=nil;return forget(...)end
end)(TLC)

;(function(t)
-- Palette and native report-list selection follow the supplied WP10 editor.
t.UI157={background=0x252525,input=0x353535,text=0xFFFFFF,secondary=0xCFCFCF,selected=0x805020,font='Yu Gothic UI'}
function t.uiDrawList157(sender,index,rect)
 if type(index)~='number'or index&lt;0 or index&gt;=sender.Items.Count then return end
 local c=sender.Canvas;c.Font.Color=t.UI157.text;c.Brush.Color=index==sender.ItemIndex and t.UI157.selected or t.UI157.background
 c.fillRect(rect.Left,rect.Top,rect.Right,rect.Bottom);c.textOut(rect.Left+4,rect.Top,sender.Items[index])
end
function t.uiCreate157(kind,owner)
 local constructors={Form=createForm,Edit=createEdit,Memo=createMemo,ListBox=createListBox,ListView=createListView,ComboBox=createComboBox,Label=createLabel}
 local c=assert(constructors[kind],'Unsupported UI control: '..tostring(kind))(owner);local p=t.UI157
 if kind=='Form'then
  c.Font.Name=p.font;c.Font.Size=10;c.Font.Color=p.text;c.Color=p.background;c.BorderStyle='bsSizeable'
  c.OnShow=function(form)
   -- Existing editor layouts define their minimum readable size after all controls exist.
   form.Constraints.MinWidth=math.max(form.Constraints.MinWidth,form.Width);form.Constraints.MinHeight=math.max(form.Constraints.MinHeight,form.Height)
  end
 elseif kind=='Edit'or kind=='ComboBox'then c.Color=p.input;c.Font.Color=p.text
 elseif kind=='Memo'then c.Color=p.background;c.Font.Color=p.text
 elseif kind=='ListBox'then c.Color=p.background;c.Font.Color=p.text;c.MultiSelect=false;c.Style='lbOwnerDrawFixed';c.OnDrawItem=t.uiDrawList157
 elseif kind=='ListView'then
  c.Color=p.background;c.Font.Color=p.text;c.RowSelect=true;c.ReadOnly=true;c.HideSelection=false
  c.OnCustomDrawItem=function(sender,item)
   if not item or item.Index&lt;0 or item.Index&gt;=sender.Items.Count then return true end
   sender.Canvas.Font.Color=p.text;sender.Canvas.Brush.Color=item.Selected and p.selected or p.background;return true
  end
 elseif kind=='Label'then c.Font.Color=p.text end
 return c
end
end)(TLC)

;(function(t)
local function now()return getTickCount()end
local ids={['ammo']=106,['battery']=103,['boat']=111,['boatSpeed']=209,['clearWater']=513,['cold']=112,['exp']=108,['float']=104,['fuel']=110,['fullTank']=406,['gametime']=506,['health']=102,['humanInstant068']=702,['instant']=402,['invincible']=101,['materials']=401,['noCraftPower']=403,['noclip040']=118,['noon']=501,['noresources']=113,['oneshot']=105,['plantGrowth129']=408,['powerTank']=404,['recyclerInstant155']=409,['seedCountdown']=115,['speed']=202,['time']=504,['waves051']=514,['weather']=503,['weight']=107,['wind']=510}
t.contextWanted157={};t.rebindFeatures157={};t.contextOff157={};t.contextReasons157={}
local function remember()
 for k in pairs(t.featOn or{})do if ids[k]and t.contextWanted157[k]~=false then t.contextWanted157[k]=true end end
end
local function recordOff(key)
 local a=getAddressList();local id=ids[key];local r=id and a.getMemoryRecordByID(id)
 if r then pcall(function()r.disableWithoutExecute()end)end
end
function t.isTransient157(why)
 local s=tostring(why):lower()
 if s:find('%f[%w]abi%f[%W]')then return false end
 for _,hard in ipairs({'signature','ambiguous','contract changed','layout','mismatch','unsupported','ownership','invalid ','parameters changed','metadata changed','out of bounds'})do if s:find(hard,1,true)then return false end end
 for _,word in ipairs({'target/world identity changed','world/process changed','world changed','objects expired','object expired','actor expired','target changed','identity changed','object unavailable','player unavailable','player character unavailable','player state unavailable','health attribute unavailable','persistentlevel unavailable','worldsettings unavailable','weather dependencies did not stabilize','native day clock/sky unavailable','weather native notification did not finish','ワールドが変わ','対象の実体が変わ','空制御の対象が変わ','操作対象・搭乗者の参照経路が未解決'})do if s:find(word,1,true)then return true end end
 return false
end
local reason=t.reason
function t.reason(key,why,...)
 t.contextReasons157[key]={text=tostring(why),at=now()};return reason(key,why,...)
end
function t.requestFeatureRebind157(key,why)
 if not ids[key]or t.contextWanted157[key]==false then return false end
 if not(t.featOn[key]or t.contextWanted157[key])then return false end
 t.contextWanted157[key]=true
 local r=t.rebindFeatures157[key]
 if not r then t.rebindFeatures157[key]={at=now()+250,why=tostring(why)}end
 return true
end
function t.retryWeather157(s,why)
 if not(s.on and t.featOn.weather and t.isTransient157(why))then return false end
 s.generation=s.generation+1;s.phase='idle';s.stage='rebind137';s.bindingStarted137=nil;s.bindingRetry137=now()+1000;s.bindingReason137=tostring(why);s.failed=nil
 if s.lastWait157~=tostring(why)then t.reason('weather',t.T('Weather targets are changing; waiting to rebind: ','天候の対象を再取得中です: ')..tostring(why));s.lastWait157=tostring(why)end
 return true
end
local feature=t.feature
function t.feature(key,on)
 if not on and not t.contextExplicitOff157 and not t.contextInternal157 and t.contextWanted157[key]then
  local r=t.contextReasons157[key]
  if t.contextWait157 or r and now()-r.at&lt;2000 and t.isTransient157(r.text)then
   t.requestFeatureRebind157(key,r and r.text or 'target/world identity changed');return
  end
 end
 local result=table.pack(pcall(feature,key,on))
 if result[1]then
  if ids[key]then t.contextWanted157[key]=on and true or false end
  if not on then t.rebindFeatures157[key]=nil end
  if on then t.contextReasons157[key]=nil end
 else error(result[2],0)end
 return table.unpack(result,2,result.n)
end
local toggle=t.toggleRecord
function t.toggleRecord(mr,key,on)
 if not on then t.contextWanted157[key]=false;t.rebindFeatures157[key]=nil end
 if t.contextWait157 then
  t.contextWanted157[key]=on and true or false
  if not on then t.contextOff157[key]=true else t.contextOff157[key]=nil;t.rebindFeatures157[key]={at=now(),why="waiting for game context"}end
  return
 end
 local prior=t.contextExplicitOff157;t.contextExplicitOff157=not on
 local r=table.pack(pcall(toggle,mr,key,on));t.contextExplicitOff157=prior
 if not r[1]then error(r[2],0)end;return table.unpack(r,2,r.n)
end
-- A waiting feature does no further task work until its verified on-contract succeeds.
for key,f in pairs(t.F)do if f.task then
 local original=f.task
 f.task=function(...)if t.rebindFeatures157[key]or t.contextOff157[key]then return end;return original(...)end
end end
local function cancelQueue()
 local q=t.actions025 or{};t.actions025={}
 for _,r in ipairs(q)do if r.cancelled then pcall(r.cancelled,'target/world identity changed')elseif r.guard and r.apiContinuation128~=nil then pcall(r.guard)end end
end
local function settle()
 local p=t.pendingJob;if not p then return true end
 local b=t.base();if not b then return false end
 local state=readInteger(b+0x500)
 if state==1 or state==2 then return false end -- Even queued state can race the dispatcher; wait for its acknowledgement.
 if state==3 or state==4 then
  assert(writeInteger(b+0x500,0));t.pendingJob=nil
  if p.cancelled074 then pcall(p.cancelled074,'target/world identity changed')else local c=p.apiRequest128 and p.apiRequest128.catalog or p.catalogOwner075;if c and c.fail then pcall(c.fail,'target/world identity changed')elseif c and c.itemFailure then pcall(c.itemFailure,'target/world identity changed')end end
  return true
 end
 return false
end
local function park(s)
 remember();t.contextWait157=true
 cancelQueue();if not settle()then return false end
 local old=t.weatherLock074
 if not t.weatherSelection074 and old and old.target then
  local values={};for k,v in pairs(old.target)do if type(v)=='number'then values[k]=v end end;t.weatherSelection074=values
 end
 t.keepChecks157=true;local parked,why=pcall(t.suspendWorld029);t.keepChecks157=nil;if not parked then error(why,0)end
 -- Old native frames are retired, not freed; no address from a new world reuses them.
 t.retiredAPIFrames157=t.retiredAPIFrames157 or{};t.retiredAPIFrames157[#t.retiredAPIFrames157+1]=t.apiFrames075
 t.apiFrames075=nil;t.catalogNative075=nil;t.weatherLock074=nil;t.env055=nil
 t.recyclerState155=nil;t.plantGrowthState129=nil;t.instantContext045=nil
 for k,wanted in pairs(t.contextWanted157)do if wanted then t.rebindFeatures157[k]={at=now(),why='world changed'}end end
 s.parked=true;return true
end
local function replay()
 if t.pendingJob or #(t.actions025 or{})&gt;0 then return end
 local keys={};for k in pairs(t.contextOff157)do keys[#keys+1]=k end;table.sort(keys)
 for _,k in ipairs(keys)do
  t.contextInternal157=true;local ok,e=pcall(feature,k,false);t.contextInternal157=nil
  if ok then t.contextOff157[k]=nil else t.reason(k,e)end
  return
 end
 keys={};for k,r in pairs(t.rebindFeatures157)do if r.at&lt;=now()then keys[#keys+1]=k end end
 local priority={invincible=1,health=2,battery=3,ammo=4,boat=5};table.sort(keys,function(a,b)local pa,pb=priority[a]or 100,priority[b]or 100;if pa~=pb then return pa&lt;pb end;return a&lt;b end)
 local k=keys[1];if not k then return end
 if not t.contextWanted157[k]then t.rebindFeatures157[k]=nil;return end
 if k=='noclip040'and t.controlledPawn(false)~=t.player(false)then t.rebindFeatures157[k].at=now()+500;return end
 t.contextInternal157=true;local ok,e=pcall(feature,k,true);t.contextInternal157=nil
 if ok then t.rebindFeatures157[k]=nil;t.contextReasons157[k]=nil
 elseif t.isTransient157(e)then t.rebindFeatures157[k].at=now()+1000
 else
  t.rebindFeatures157[k]=nil;t.contextWanted157[k]=false
  t.contextInternal157=true;local clean,why=pcall(feature,k,false);t.contextInternal157=nil
  t.reason(k,t.T('Could not restore this feature: ','この機能を再開できませんでした: ')..tostring(e)..(clean and ''or' / '..tostring(why)));recordOff(k)
 end
end
function t.contextGate157()
 if not t.attached()or t.pid~=getOpenedProcessID()then return true end
 remember()
 local s=t.regionContext157;if not s then s={};t.regionContext157=s end
 local okay,w,p,id=pcall(function()local w=t.world();local p=t.player(false);return w,p,w and t.identity029(w)end)
 if not okay or not id or not p then
  t.contextWait157=true;s.waiting=true;s.stable=0;settle();return false
 end
 local changed=s.world and(s.world.object~=w or not t.sameIdentity029(s.world))
 if changed and not s.parked then if not park(s)then return false end end
 if s.waiting or changed or s.parked then
  if s.candidateWorld==w and s.candidatePlayer==p then s.stable=(s.stable or 0)+1 else s.candidateWorld=w;s.candidatePlayer=p;s.stable=1 end
  if s.stable&lt;2 then t.contextWait157=true;return false end
 end
 s.world=id;s.waiting=nil;s.parked=nil;s.stable=0
 t.worldIdentity029=id;t.worldSuspended029=nil;t.contextWait157=nil
 replay();return true
end
local function gate(fn,...)
 if t.inContextTick157 then return fn(...)end
 t.inContextTick157=true
 local r=table.pack(pcall(function(...)if t.contextGate157()then return fn(...)end end,...))
 t.inContextTick157=nil;if not r[1]then error(r[2],0)end;return table.unpack(r,2,r.n)
end
local tick,portable=t.tick,t.portableTick074
function t.tick(...)return gate(tick,...)end
function t.portableTick074(...)return gate(portable,...)end
local disable=t.disableAll
function t.disableAll(...)
 t.contextWanted157={};t.rebindFeatures157={};t.contextOff157={}
 local prior=t.contextExplicitOff157;t.contextExplicitOff157=true
 local r=table.pack(pcall(disable,...));t.contextExplicitOff157=prior
 if not r[1]then error(r[2],0)end;return table.unpack(r,2,r.n)
end
local forget=t.forgetProcess
function t.forgetProcess(...)
 t.contextWanted157={};t.rebindFeatures157={};t.contextOff157={};t.contextReasons157={};t.regionContext157=nil;t.contextWait157=nil;t.inContextTick157=nil
 return forget(...)
end
end)(TLC)

;(function(TLC)
 local function clone(value,seen)
  if type(value)~='table'then return value end
  seen=seen or{};if seen[value]then return seen[value]end
  local result={};seen[value]=result
  for k,v in pairs(value)do result[clone(k,seen)]=clone(v,seen)end
  return setmetatable(result,getmetatable(value))
 end
 local factory,methods={},{}
 for k,v in pairs(TLC)do if type(v)=='function'then methods[k]=true end end
 for k,v in pairs(TLC)do if type(v)~='function'and k~='mapHotkey'then factory[k]=clone(v)end end
 local function replace(target,seed)
  for k in pairs(target)do target[k]=nil end
  for k,v in pairs(clone(seed))do target[k]=v end
  setmetatable(target,getmetatable(seed))
 end
 function TLC.resetObservations075()
  local language,exe,module,prefs=TLC.lang,TLC.EXE,TLC.MODULE,TLC.userValues075
  -- U is captured by existing metadata functions: reset that table in place.
  local u,a=TLC.U,TLC.A
  for k,v in pairs(TLC)do if not methods[k]and type(v)~='function'and k~='mapHotkey'then TLC[k]=nil end end
  for k,v in pairs(factory)do TLC[k]=clone(v)end
  replace(u,factory.U);TLC.U=u;replace(a,factory.A);TLC.A=a
  TLC.lang=language;TLC.EXE=exe;TLC.MODULE=module;TLC.userValues075=prefs
  TLC.classes038={}
 end
 local forget=TLC.forgetProcess
 function TLC.forgetProcess(...)
  local result=forget(...);if TLC.timer then TLC.timer.destroy();TLC.timer=nil end
  for name in pairs(TLC.SIGS)do pcall(unregisterSymbol,'tlcA_'..name)end
  for _,name in ipairs({'tlcFlags','tlcVars','tlcPtrs','tlcObjects','tlcObjectCount072','tlcEngine','tlcNpcClassSlot','tlcGameThreadId','tlcWeaponClassSlot','tlcWeaponClassStorage074','tlcSurvival076Data'})do pcall(unregisterSymbol,name)end
  _G.TLCObjectLayout072=nil;TLC.resetObservations075();return result
 end
 local init=TLC.init
 function TLC.init(...)
  local wasAttached=TLC.attached();local result=init(...)
  if not wasAttached and TLC.attached()then
   for offset,value in pairs(TLC.userValues075 or{})do
    local definition=TLC.VARDEF[offset]
    if definition and type(value)=='number'and value==value and math.abs(value)&lt;1e100 then
     if definition[1]=='float'then assert(writeFloat(TLC.var(offset),value))
     elseif definition[1]=='qword'then assert(writeQword(TLC.var(offset),value))
     else assert(writeInteger(TLC.var(offset),value))end
    end
   end
  end
  return result
 end
 local off=TLC.disableAll
 function TLC.disableAll(...)
  local prior=TLC.attached();local prefs={}
  if prior then
   for offset,definition in pairs(TLC.VARDEF)do
    local value=definition[1]=='float'and readFloat(TLC.var(offset))or definition[1]=='qword'and readQword(TLC.var(offset))or readInteger(TLC.var(offset))
    if type(value)=='number'and value==value and math.abs(value)&lt;1e100 then prefs[offset]=value end
   end
  end
  local result=off(...)
  if prior then
   assert(not next(TLC.hookState)and not next(TLC.featOn),'Release incomplete; attachment observations retained')
   TLC.userValues075=prefs;TLC.forgetProcess();TLC.init()
  end
  return result
 end
end)(TLC)
</LuaScript>
</CheatTable>