<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>25</ID>
      <Description>"=== www.opencheattables.com ==="</Description>
      <GroupHeader>1</GroupHeader>
    </CheatEntry>
    <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>23</ID>
      <Description>"Free Inspirations (0 faith cost)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
if syntaxcheck then return end
_G._inspBackup = {}
local c = mono_findClass('', 'InspirationDef')
if c == 0 or c == nil then error('InspirationDef not found') end
local lst = mono_class_findInstancesOfClassListOnly(c)
local n = 0
for _,addr in ipairs(lst) do
  local idwPtr = readPointer(addr+24)
  if idwPtr and idwPtr ~= 0 then
    local ok,s = pcall(mono_string_readString, idwPtr)
    if ok and s and s ~= '' and s ~= '?' and s ~= 'nil' then
      local price = readInteger(addr+80)
      if price and price &gt;= 0 and price &lt;= 1000 then
        if price ~= 0 then
          _G._inspBackup[addr] = price
          writeInteger(addr+80, 0)
          n = n+1
        end
      end
    end
  end
end
print('Free Inspirations: set '..n..' prices to 0')
{$asm}
[ENABLE]
[DISABLE]
{$lua}
if syntaxcheck then return end
if _G._inspBackup then
  local n=0
  for addr,price in pairs(_G._inspBackup) do
    writeInteger(addr+80, price)
    n=n+1
  end
  print('Free Inspirations: restored '..n)
  _G._inspBackup = {}
end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>24</ID>
      <Description>"Never Wipe Vendor Weekly (disable when not using)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(ResetV, :TownSystem:ResetVendors)
FINDMONOMETHOD(UpdV, :VendorSystem:UpdateVendorsAtTheEndOfDay)

[ENABLE]
// Block weekly vendor wipe - progress/money never reset
ResetV:
  db C3
UpdV:
  db C3

[DISABLE]
// Restore originals (push rbp)
ResetV:
  db 55
UpdV:
  db 55
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>41</ID>
      <Description>"Weekday (refresh via Finder)"</Description>
      <VariableType>String</VariableType>
      <Length>0</Length>
      <Unicode>0</Unicode>
      <CodePage>0</CodePage>
      <ZeroTerminate>1</ZeroTerminate>
      <Address>p_weekday</Address>
    </CheatEntry>
    <CheatEntry>
      <ID>39</ID>
      <Description>"Free Mastery (ignore mastery locks)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(CraftMast, :PlayerCraftActivity:IsEnoughMastery)
FINDMONOMETHOD(HpMast, :PlayerHPActivity:IsEnoughMastery)

[ENABLE]
// Always enough mastery
CraftMast:
  db B0 01 C3
HpMast:
  db B0 01 C3

[DISABLE]
CraftMast:
  db 55 48 8B
HpMast:
  db 55 48 8B
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>40</ID>
      <Description>"Infinite Vendor Quota (wheat+certs)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
if syntaxcheck then return end
_G._vendQuotaBackup = {}
local c = mono_findClass('', 'TownVendorProductInfo')
if c == 0 or c == nil then error('TownVendorProductInfo not found') end
local lst = mono_class_findInstancesOfClassListOnly(c)
local n = 0
for _,addr in ipairs(lst) do
  local idPtr = readPointer(addr+16)
  if idPtr and idPtr ~= 0 then
    local ok,s = pcall(mono_string_readString, idPtr)
    if ok and s then
      local low = s:lower()
      if low=='wheat' or low=='body_certificate:1' or low=='body_certificate:2' or low=='body_certificate:3' then
        local cnt = readInteger(addr+24)
        local per = readFloat(addr+32)
        if cnt and per and cnt&gt;=1 and cnt&lt;=500 and per&gt;0.001 and per&lt;=2.0 then
          _G._vendQuotaBackup[addr] = {count=cnt, perOne=per}
          writeInteger(addr+24, 999)
          if per &lt; 1.0 then writeFloat(addr+32, 1.0) end
          n = n+1
        end
      end
    end
  end
end
print('Vendor quota: boosted '..n)
{$asm}
[ENABLE]
[DISABLE]
{$lua}
if syntaxcheck then return end
if _G._vendQuotaBackup then
  local n=0
  for addr,v in pairs(_G._vendQuotaBackup) do
    writeInteger(addr+24, v.count)
    writeFloat(addr+32, v.perOne)
    n=n+1
  end
  print('Vendor quota: restored '..n)
  _G._vendQuotaBackup = {}
end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>42</ID>
      <Description>"Free Perks (0 cost)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
if syntaxcheck then return end
_G._perkBackup = {}
local c = mono_findClass('', 'TalentLevelUpDef')
if c == 0 or c == nil then error('TalentLevelUpDef not found') end
local lst = mono_class_findInstancesOfClassListOnly(c)
local n = 0
for _,addr in ipairs(lst) do
  local idPtr = readPointer(addr+16)
  if idPtr and idPtr ~= 0 then
    local ok,s = pcall(mono_string_readString, idPtr)
    if ok and s and s ~= '' then
      local price = readInteger(addr+84)
      if price and price &gt;= 1 and price &lt;= 100 then
        _G._perkBackup[addr] = price
        writeInteger(addr+84, 0)
        n = n+1
      end
    end
  end
end
print('Free Perks: set '..n..' prices to 0')
{$asm}
[ENABLE]
[DISABLE]
{$lua}
if syntaxcheck then return end
if _G._perkBackup then
  local n=0
  for addr,price in pairs(_G._perkBackup) do
    writeInteger(addr+84, price)
    n=n+1
  end
  print('Free Perks: restored '..n)
  _G._perkBackup = {}
end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>43</ID>
      <Description>"Free Crafting (no materials - turn off when not using)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(CraftStat, :CraftComponent:GetStartCraftStatus)
FINDMONOMETHOD(RemReq, :CraftComponent:RemoveRequirements)

[ENABLE]
// Always OK (0) + never consume materials
CraftStat:
  db 31 C0 C3
RemReq:
  db C3

[DISABLE]
CraftStat:
  db 55 48 8B
RemReq:
  db 55
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>44</ID>
      <Description>"Free Building (0 costs)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}
if syntaxcheck then return end
_G._buildBackup = {}
local function zeroNeeds(defClass, needOffName)
  local bc = mono_findClass('', defClass)
  if bc == 0 or bc == nil then return 0 end
  local needOff=nil
  for _,f in ipairs(mono_class_enumFields(bc, true)) do
    if f.name==needOffName then needOff=f.offset break end
  end
  if needOff==nil then return 0 end
  local lst = mono_class_findInstancesOfClassListOnly(bc)
  local n=0
  for _,addr in ipairs(lst) do
    local nl = readPointer(addr+needOff)
    if nl and nl~=0 then
      local na = readPointer(nl+16)
      local ns = readInteger(nl+24)
      if na and na~=0 and ns and ns&gt;0 and ns&lt;20 then
        for j=0,ns-1 do
          local needPtr = readPointer(na+0x20+j*8)
          if needPtr and needPtr~=0 then
            local cntPtr = readPointer(needPtr+24)
            if cntPtr and cntPtr~=0 then
              local pv = readFloat(cntPtr+44)
              if pv and pv&gt;0 and pv&lt;=5000 then
                _G._buildBackup[cntPtr] = pv
                writeFloat(cntPtr+44, 0)
                writeFloat(cntPtr+104, 0)
                n = n+1
              end
            end
          end
        end
      end
    end
  end
  return n
end
local n1 = zeroNeeds('BuildingDef', 'needItems')
local n2 = zeroNeeds('TownBuildingDef', 'needItems')
print('Free Building: set '..(n1+n2)..' costs to 0 (BuildingDef '..n1..', Town '..n2..')')
{$asm}
[ENABLE]
[DISABLE]
{$lua}
if syntaxcheck then return end
if _G._buildBackup then
  local n=0
  for addr,pv in pairs(_G._buildBackup) do
    writeFloat(addr+44, pv)
    n=n+1
  end
  print('Free Building: restored '..n)
  _G._buildBackup = {}
end
{$asm}
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>45</ID>
      <Description>"Unbreakable Fishing Line (never snap)"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>USEMONO()
FINDMONOMETHOD(FishFail, :FishingMiniGame:HandleFailure)

[ENABLE]
// Never fail - hold E forever
FishFail:
  db C3

[DISABLE]
FishFail:
  db 55
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>26</ID>
      <Description>"Find Player Resources (enable first!)"</Description>
      <Options moHideChildren="1"/>
      <GroupHeader>1</GroupHeader>
      <CheatEntries>
        <CheatEntry>
          <ID>27</ID>
          <Description>"Money"</Description>
          <VariableType>Float</VariableType>
          <Address>p_money</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>28</ID>
          <Description>"Tech Red"</Description>
          <VariableType>Float</VariableType>
          <Address>p_tech_red</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>29</ID>
          <Description>"Tech Green"</Description>
          <VariableType>Float</VariableType>
          <Address>p_tech_green</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>30</ID>
          <Description>"Tech Blue"</Description>
          <VariableType>Float</VariableType>
          <Address>p_tech_blue</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>31</ID>
          <Description>"Energy (current)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_energy</Address>
          <Hotkeys>
            <Hotkey>
              <Action>Set Value</Action>
              <Keys>
                <Key>17</Key>
                <Key>82</Key>
              </Keys>
              <Value>1</Value>
              <Description>1</Description>
              <ID>0</ID>
            </Hotkey>
          </Hotkeys>
        </CheatEntry>
        <CheatEntry>
          <ID>32</ID>
          <Description>"Stamina (current)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_stamina</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>33</ID>
          <Description>"Sanity (insanity current, 0=good)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_insanity</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>34</ID>
          <Description>"Time of Day (0-1)"</Description>
          <VariableType>Float</VariableType>
          <Address>p_timeofday</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>35</ID>
          <Description>"Day Number"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_day</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>36</ID>
          <Description>"HP (health current)"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_hp</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>37</ID>
          <Description>"Max HP"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_maxhp</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>38</ID>
          <Description>"God mode, set to 1 or 0"</Description>
          <VariableType>Byte</VariableType>
          <Address>p_immune</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>46</ID>
          <Description>"Inventory Size (slots)"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_invsize</Address>
        </CheatEntry>
        <CheatEntry>
          <ID>47</ID>
          <Description>"Inventory Fill (used)"</Description>
          <VariableType>4 Bytes</VariableType>
          <Address>p_invfill</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols>
    <SymbolEntry>
      <Name>p_weekday</Name>
      <Address>19BE4AA0000</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_invsize</Name>
      <Address>19EDCA29594</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_invfill</Name>
      <Address>19EDCA29598</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_money</Name>
      <Address>1F329F66378</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_energy</Name>
      <Address>1F329F662D8</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_insanity</Name>
      <Address>1F329F662B8</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_tech_red</Name>
      <Address>1F329F66298</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_tech_green</Name>
      <Address>1F329F66278</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_tech_blue</Name>
      <Address>1F329F66258</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_stamina</Name>
      <Address>1F329EECE98</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_hp</Name>
      <Address>1F33015694C</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_maxhp</Name>
      <Address>1F330156948</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_immune</Name>
      <Address>1F330156957</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_timeofday</Name>
      <Address>1F33007AB04</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>p_day</Name>
      <Address>1F33007AB08</Address>
    </SymbolEntry>
  </UserdefinedSymbols>
  <Comments>Info about this table:
</Comments>
  <LuaScript>
</LuaScript>
</CheatTable>
