<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"Infinite Energy (no drain)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(CraftConsume, :PlayerCraftActivity:ConsumeEnergy)
FINDMONOMETHOD(HpConsume, :PlayerHPActivity:ConsumeEnergy)

[ENABLE]
// Infinite energy - skip drain
CraftConsume:
  db C3
HpConsume:
  db C3

[DISABLE]
// Restore original (push rbp)
CraftConsume:
  db 55
HpConsume:
  db 55
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>12</ID>
      <Description>"Freeze Time (no advance)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(TimeUpdate, :EnvironmentEngine:CustomUpdate)

[ENABLE]
TimeUpdate:
  db C3

[DISABLE]
TimeUpdate:
  db 55
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>22</ID>
      <Description>"No Insanity Gain (freeze sanity)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(InsAdd, :PlayerInsanityGameResSystem:Add)

[ENABLE]
InsAdd:
  db C3

[DISABLE]
InsAdd:
  db 55
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>10</ID>
      <Description>"Infinite Stamina (no drain)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
if syntaxcheck then return end
local function unregisterAll()
  unregisterSymbol('p_money')
  unregisterSymbol('p_tech_red')
  unregisterSymbol('p_tech_green')
  unregisterSymbol('p_tech_blue')
  unregisterSymbol('p_energy')
  unregisterSymbol('p_stamina')
  unregisterSymbol('p_insanity')
  unregisterSymbol('p_timeofday')
  unregisterSymbol('p_day')
  unregisterSymbol('p_hp')
  unregisterSymbol('p_maxhp')
  unregisterSymbol('p_immune')
end
unregisterAll()
local pdClass = mono_findClass('', 'PlayerData')
if pdClass == 0 or pdClass == nil then error('PlayerData not found') end
local lst = mono_class_findInstancesOfClassListOnly(pdClass)
local playerPd = 0
for _,pd in ipairs(lst) do
  local resPtr = readPointer(pd+128)
  if resPtr and resPtr ~= 0 then
    local listPtr = readPointer(resPtr+16)
    if listPtr and listPtr ~= 0 then
      local arrPtr = readPointer(listPtr+16)
      local sz = readInteger(listPtr+24)
      if arrPtr and arrPtr ~= 0 and sz and sz &gt; 10 and sz &lt; 500 then
        local hasTech, hasMoney, hasEnergy = false,false,false
        for i=0, sz-1 do
          local atom = readPointer(arrPtr+0x20+i*8)
          if atom and atom ~= 0 then
            local tptr = readPointer(atom+16)
            if tptr and tptr ~= 0 then
              local ok,s = pcall(mono_string_readString, tptr)
              if ok and s == 'tech_red' then hasTech = true end
              if ok and s == 'money' then hasMoney = true end
              if ok and s == 'energy' then hasEnergy = true end
              if hasTech and hasMoney and hasEnergy then break end
            end
          end
        end
        if hasTech and hasMoney and hasEnergy then playerPd = pd break end
      end
    end
  end
end
if playerPd == 0 then error('Player not found - load a save first?') end
local resPtr = readPointer(playerPd+128)
local listPtr = readPointer(resPtr+16)
local arrPtr = readPointer(listPtr+16)
local sz = readInteger(listPtr+24)
local wanted = {money='p_money', tech_red='p_tech_red', tech_green='p_tech_green', tech_blue='p_tech_blue', energy='p_energy', stamina='p_stamina', insanity='p_insanity'}
for i=0, sz-1 do
  local atom = readPointer(arrPtr+0x20+i*8)
  if atom and atom ~= 0 then
    local tptr = readPointer(atom+16)
    if tptr and tptr ~= 0 then
      local ok,s = pcall(mono_string_readString, tptr)
      if ok and wanted[s] then registerSymbol(wanted[s], atom+24) end
    end
  end
end
local hpPtr = readPointer(playerPd+200)
if hpPtr and hpPtr ~= 0 then
  registerSymbol('p_hp', hpPtr+60)
  registerSymbol('p_maxhp', hpPtr+56)
  registerSymbol('p_immune', hpPtr+71)
end
-- find active EnvironmentData (largest day among plausible)
local ec=mono_findClass('', 'EnvironmentData')
if ec and ec~=0 then
  local elist=mono_class_findInstancesOfClassListOnly(ec)
  local best=0
  local bestDay=-1
  local bestTod=0
  for _,addr in ipairs(elist) do
    local tod=readFloat(addr+36)
    local day=readInteger(addr+40)
    local daylen=readFloat(addr+32)
    if tod and day and daylen and day&gt;=0 and day&lt;10000 and daylen&gt;0 and daylen&lt;120 and tod&gt;=0 and tod&lt;2 then
      if day&gt;bestDay or (day==bestDay and tod&gt;bestTod) then
        best=addr bestDay=day bestTod=tod
      end
    end
  end
  if best~=0 then
    registerSymbol('p_timeofday', best+36)
    registerSymbol('p_day', best+40)
  end
end
print(string.format('Player found pd=%x', playerPd))
{$asm}
[ENABLE]
[DISABLE]
{$lua}
if syntaxcheck then return end
unregisterSymbol('p_money')
unregisterSymbol('p_tech_red')
unregisterSymbol('p_tech_green')
unregisterSymbol('p_tech_blue')
unregisterSymbol('p_energy')
unregisterSymbol('p_stamina')
unregisterSymbol('p_insanity')
unregisterSymbol('p_timeofday')
unregisterSymbol('p_day')
unregisterSymbol('p_hp')
unregisterSymbol('p_maxhp')
unregisterSymbol('p_immune')
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>1</ID>
      <Description>"Find Player Resources (enable first!)"</Description>
      <Options moHideChildren="1"/>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>14</ID>
          <Description>"Sanity (insanity current, 0=good)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_insanity</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>5</ID>
          <Description>"Tech Blue"</Description>
          <VariableType>Float</VariableType>
          <Address>p_tech_blue</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>9</ID>
          <Description>"God mode, set to 1 or 0"</Description>
          <VariableType>Byte</VariableType>
          <Address>p_immune</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>15</ID>
          <Description>"Money"</Description>
          <VariableType>Float</VariableType>
          <Address>p_money</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>4</ID>
          <Description>"Tech Green"</Description>
          <VariableType>Float</VariableType>
          <Address>p_tech_green</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>8</ID>
          <Description>"Max HP"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_maxhp</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>16</ID>
          <Description>"Tech Red"</Description>
          <VariableType>Float</VariableType>
          <Address>p_tech_red</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>17</ID>
          <Description>"Energy (current)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_energy</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>18</ID>
          <Description>"HP (health current)"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_hp</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>19</ID>
          <Description>"Stamina (current)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_stamina</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>20</ID>
          <Description>"Time of Day (0-1)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_timeofday</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>21</ID>
          <Description>"Day Number"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_day</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols>
    <SymbolEntry>
      <Name>p_timeofday</Name>
      <Address>1CCE9B76A44</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_day</Name>
      <Address>1CCE9B76A48</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_money</Name>
      <Address>1CCE9BA46F8</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_energy</Name>
      <Address>1CCE9BA4658</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_insanity</Name>
      <Address>1CCE9BA4638</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_tech_red</Name>
      <Address>1CCE9BA4618</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_tech_green</Name>
      <Address>1CCE9BA45F8</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_tech_blue</Name>
      <Address>1CCE9BA45D8</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_stamina</Name>
      <Address>1CCE9BC5F78</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_hp</Name>
      <Address>1CCE9C177BC</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_maxhp</Name>
      <Address>1CCE9C177B8</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_immune</Name>
      <Address>1CCE9C177C7</Address>
    </SymbolEntry>
  </UserdefinedSymbols>
  <Comments>Info about this table:
</Comments>
  <LuaScript>
</LuaScript>
</CheatTable>
