Fear3d

80 Days.ct

Jan 22nd, 2026 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 17.74 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <CheatTable CheatEngineTableVersion="46">
  3.   <CheatEntries>
  4.     <CheatEntry>
  5.       <ID>6</ID>
  6.       <Description>"Infinite Health"</Description>
  7.       <VariableType>Auto Assembler Script</VariableType>
  8.       <AssemblerScript>[enable]
  9. {$lua}  
  10. if syntaxcheck then return end
  11.  
  12.  
  13. LaunchMonoDataCollector()
  14.  
  15. if dotnetdetours==nil then
  16.   dotnetdetours={}
  17. else
  18.   local di=dotnetdetours['Player.AlterHealthBy']
  19.   if di and di.processid==getOpenedProcessID() then
  20.     --already detoured. Undo first
  21.     local r,err=autoAssemble(di.disablescript, di.disableinfo)
  22.    
  23.     if not r then
  24.       error(err)
  25.     else
  26.       dotnetdetours['Player.AlterHealthBy']=nil
  27.     end    
  28.   end
  29. end
  30. local detourinfo={}
  31.  
  32. local csharpscript=[[
  33. using System.Runtime.CompilerServices; //for NoInlining
  34. //feel free to add more
  35.  
  36.  
  37. public class patchedPlayer : Game.Player.Player
  38. {
  39.  
  40.   public void newAlterHealthBy(int delta)
  41.   {
  42.     if (delta &lt; 0)
  43.     {
  44.       delta = 0;
  45.     }
  46.     oldAlterHealthBy(delta);
  47.     return;    
  48.   }
  49.  
  50.   [MethodImpl(MethodImplOptions.NoInlining)]
  51.   public void oldAlterHealthBy(int delta)
  52.   {
  53.     //don't bother putting code in here. It will get replaced (just some stuff to make sure there's space)
  54.     return ;
  55.   }
  56. }
  57.  
  58. ]]
  59. local references, sysfile=dotnetpatch_getAllReferences() --you're free to build your own list
  60.  
  61. -- Iterate backwards through the table
  62. for i = #references, 1, -1 do
  63.   -- Check if the current item contains "mscorlib.dll" (case insensitive)
  64.   if string.find(string.lower(references[i]), "mscorlib.dll") then
  65.     -- Remove the item at index 'i'
  66.     table.remove(references, i)
  67.   end
  68. end
  69.  
  70. local csfile,msg=compileCS(csharpscript, references, sysfile)
  71.  
  72. if csfile==nil then
  73.   --sometimes having the sysfile causes an issue. Try without  
  74.   csfile,msg=compileCS(csharpscript, references)
  75.   if csfile==nil then
  76.     if msg==nil then msg=' (?Unknown error?)' end
  77.     messageDialog('Compilation error:'..msg, mtError, mbOK) --show compile error in a dialog instead of a lua error only
  78.     error(msg)
  79.   end
  80. end
  81.  
  82. --still here, c# dll created, now inject and hook
  83. local result, disableinfo, disablescript=InjectDotNetDetour(csfile, "Player::AlterHealthBy","patchedPlayer::newAlterHealthBy","patchedPlayer::oldAlterHealthBy")
  84.  
  85. if result then
  86.   detourinfo.disableinfo=di
  87.   detourinfo.disablescript=disablescript
  88.   detourinfo.processid=getOpenedProcessID()
  89.   dotnetdetours['Player.AlterHealthBy']=detourinfo
  90. else  
  91.   if disableinfo==nil then disableinfo='no reason' end  
  92.   error('InjectDotNetDetour failed : '..disableinfo) --prevents checking  
  93. end
  94. {$asm}
  95.  
  96.  
  97. [disable]
  98. {$lua}
  99. if syntaxcheck then return end
  100.  
  101. if dotnetdetours['Player.AlterHealthBy'] then
  102.   autoAssemble(dotnetdetours['Player.AlterHealthBy'].disablescript, dotnetdetours['Player.AlterHealthBy'].disableinfo)
  103. end
  104. {$asm}
  105. </AssemblerScript>
  106.     </CheatEntry>
  107.     <CheatEntry>
  108.       <ID>7</ID>
  109.       <Description>"Infinite Money"</Description>
  110.       <Options moAlwaysHideChildren="1" moActivateChildrenAsWell="1" moDeactivateChildrenAsWell="1"/>
  111.       <Color>000000</Color>
  112.       <VariableType>Auto Assembler Script</VariableType>
  113.       <AssemblerScript>[ENABLE]
  114. {$lua}
  115. if syntaxcheck then return end
  116.  
  117. memrec.Color = 0x0080FF
  118. memrec.Description = "Infinite Money (Activating...)"
  119.  
  120. -- 1. Launch the collector ONCE for the whole group
  121. LaunchMonoDataCollector()
  122.  
  123. -- 2. Do the heavy scan ONCE
  124. local refs, sys = dotnetpatch_getAllReferences()
  125.  
  126. -- 3. Run your filter loop ONCE
  127. for i = #refs, 1, -1 do
  128.   if string.find(string.lower(refs[i]), "mscorlib.dll") then
  129.     table.remove(refs, i)
  130.   end
  131. end
  132.  
  133. -- 4. Save to GLOBAL variables (Notice no 'local' keyword)
  134. -- We use unique names to avoid conflicts with other cheat tables
  135. Shared_References = refs
  136. Shared_SysFile = sys
  137.  
  138. {$asm}
  139. // ... (Your existing allocations/code) ...
  140.  
  141. [DISABLE]
  142. {$lua}
  143. if syntaxcheck then return end
  144. memrec.Color = 0x000000
  145. memrec.Description = "Infinite Money"
  146.  
  147. -- Optional: Clear the globals to save memory, though not strictly necessary
  148. Shared_References = nil
  149. Shared_SysFile = nil
  150. {$asm}
  151. </AssemblerScript>
  152.       <CheatEntries>
  153.         <CheatEntry>
  154.           <ID>3</ID>
  155.           <Description>"Money doesn't decrease when buying"</Description>
  156.           <VariableType>Auto Assembler Script</VariableType>
  157.           <AssemblerScript>[enable]
  158. {$lua}  
  159. if syntaxcheck then return end
  160.  
  161.  
  162. LaunchMonoDataCollector()
  163.  
  164. if dotnetdetours==nil then
  165.   dotnetdetours={}
  166. else
  167.   local di=dotnetdetours['Player.SpendMoney']
  168.   if di and di.processid==getOpenedProcessID() then
  169.     --already detoured. Undo first
  170.     local r,err=autoAssemble(di.disablescript, di.disableinfo)
  171.    
  172.     if not r then
  173.       error(err)
  174.     else
  175.       dotnetdetours['Player.SpendMoney']=nil
  176.     end    
  177.   end
  178. end
  179. local detourinfo={}
  180.  
  181. local csharpscript=[[
  182. using System.Runtime.CompilerServices; //for NoInlining
  183. using Game.Player;
  184. //feel free to add more
  185.  
  186.  
  187. public class patchedPlayer : Player
  188. {
  189.  
  190.   public void newSpendMoney(GameData.MoneyValue money)
  191.   {
  192.     //you have access to public fields.  Use reflection if you wish to access private fields
  193.     // We want this function to do nothing, so we don't call the old one
  194.     return;    
  195.   }
  196.  
  197.   [MethodImpl(MethodImplOptions.NoInlining)]
  198.   public void oldSpendMoney(GameData.MoneyValue money)
  199.   {
  200.     //don't bother putting code in here. It will get replaced (just some stuff to make sure there's space)
  201.     return ;
  202.   }
  203. }
  204.  
  205. ]]
  206. local references, sysfile
  207.  
  208. -- CHECK: Did the header already do the work?
  209. if Shared_References and Shared_SysFile then
  210.   -- Yes! Use the cached list (Instant)
  211.   references = Shared_References
  212.   sysfile = Shared_SysFile
  213. else
  214.   -- No (Header wasn't used). We must scan manually.
  215.   LaunchMonoDataCollector() -- Just in case
  216.   references, sysfile = dotnetpatch_getAllReferences()
  217.  
  218.   -- The Filter Loop (Only runs if fallback is triggered)
  219.   for i = #references, 1, -1 do
  220.     if string.find(string.lower(references[i]), "mscorlib.dll") then
  221.       table.remove(references, i)
  222.     end
  223.   end
  224. end
  225.  
  226. local csfile,msg=compileCS(csharpscript, references, sysfile)
  227.  
  228. if csfile==nil then
  229.   --sometimes having the sysfile causes an issue. Try without  
  230.   csfile,msg=compileCS(csharpscript, references)
  231.   if csfile==nil then
  232.     if msg==nil then msg=' (?Unknown error?)' end
  233.     messageDialog('Compilation error:'..msg, mtError, mbOK) --show compile error in a dialog instead of a lua error only
  234.     error(msg)
  235.   end
  236. end
  237.  
  238. --still here, c# dll created, now inject and hook
  239. local result, disableinfo, disablescript=InjectDotNetDetour(csfile, "Player::SpendMoney","patchedPlayer::newSpendMoney","patchedPlayer::oldSpendMoney")
  240.  
  241. if result then
  242.   detourinfo.disableinfo=di
  243.   detourinfo.disablescript=disablescript
  244.   detourinfo.processid=getOpenedProcessID()
  245.   dotnetdetours['Player.SpendMoney']=detourinfo
  246. else  
  247.   if disableinfo==nil then disableinfo='no reason' end  
  248.   error('InjectDotNetDetour failed : '..disableinfo) --prevents checking  
  249. end
  250. {$asm}
  251.  
  252.  
  253. [disable]
  254. {$lua}
  255. if syntaxcheck then return end
  256.  
  257. if dotnetdetours['Player.SpendMoney'] then
  258.   autoAssemble(dotnetdetours['Player.SpendMoney'].disablescript, dotnetdetours['Player.SpendMoney'].disableinfo)
  259. end
  260. {$asm}
  261. </AssemblerScript>
  262.         </CheatEntry>
  263.         <CheatEntry>
  264.           <ID>1</ID>
  265.           <Description>"Can buy items that you can't afford"</Description>
  266.           <Options moActivateChildrenAsWell="1" moDeactivateChildrenAsWell="1"/>
  267.           <VariableType>Auto Assembler Script</VariableType>
  268.           <AssemblerScript>[enable]
  269. {$lua}  
  270. if syntaxcheck then return end
  271.  
  272.  
  273. LaunchMonoDataCollector()
  274.  
  275. if dotnetdetours==nil then
  276.   dotnetdetours={}
  277. else
  278.   local di=dotnetdetours['Player.BuyItemFromMarket']
  279.   if di and di.processid==getOpenedProcessID() then
  280.     --already detoured. Undo first
  281.     local r,err=autoAssemble(di.disablescript, di.disableinfo)
  282.    
  283.     if not r then
  284.       error(err)
  285.     else
  286.       dotnetdetours['Player.BuyItemFromMarket']=nil
  287.     end    
  288.   end
  289. end
  290. local detourinfo={}
  291.  
  292. local csharpscript=[[
  293. using System.Runtime.CompilerServices; //for NoInlining
  294. using Game.Player;
  295.  
  296.  
  297. public class patchedPlayer : Player
  298. {
  299.  
  300.   public System.Boolean newBuyItemFromMarket(GameResources.Items.IItem item, GameData.MoneyValue price, Game.Luggage.Suitcase suitcase, Game.Luggage.SuitcasePosition suitcasePosition)
  301.   {
  302.     //you have access to public fields.  Use reflection if you wish to access private fields
  303.     return oldBuyItemFromMarket(item, GameData.MoneyValue.zero, suitcase, suitcasePosition);
  304.   }
  305.  
  306.   [MethodImpl(MethodImplOptions.NoInlining)]
  307.   public System.Boolean oldBuyItemFromMarket(GameResources.Items.IItem item, GameData.MoneyValue price, Game.Luggage.Suitcase suitcase, Game.Luggage.SuitcasePosition suitcasePosition)
  308.   {
  309.     //don't bother putting code in here. It will get replaced (just some stuff to make sure there's space)
  310.     return true;
  311.   }
  312. }
  313.  
  314. ]]
  315. local references, sysfile
  316.  
  317. -- CHECK: Did the header already do the work?
  318. if Shared_References and Shared_SysFile then
  319.   -- Yes! Use the cached list (Instant)
  320.   references = Shared_References
  321.   sysfile = Shared_SysFile
  322. else
  323.   -- No (Header wasn't used). We must scan manually.
  324.   LaunchMonoDataCollector() -- Just in case
  325.   references, sysfile = dotnetpatch_getAllReferences()
  326.  
  327.   -- The Filter Loop (Only runs if fallback is triggered)
  328.   for i = #references, 1, -1 do
  329.     if string.find(string.lower(references[i]), "mscorlib.dll") then
  330.       table.remove(references, i)
  331.     end
  332.   end
  333. end
  334.  
  335. local csfile,msg=compileCS(csharpscript, references, sysfile)
  336.  
  337. if csfile==nil then
  338.   --sometimes having the sysfile causes an issue. Try without  
  339.   csfile,msg=compileCS(csharpscript, references)
  340.   if csfile==nil then
  341.     if msg==nil then msg=' (?Unknown error?)' end
  342.     messageDialog('Compilation error:'..msg, mtError, mbOK) --show compile error in a dialog instead of a lua error only
  343.     error(msg)
  344.   end
  345. end
  346.  
  347. --still here, c# dll created, now inject and hook
  348. local result, disableinfo, disablescript=InjectDotNetDetour(csfile, "Player::BuyItemFromMarket","patchedPlayer::newBuyItemFromMarket","patchedPlayer::oldBuyItemFromMarket")
  349.  
  350. if result then
  351.   detourinfo.disableinfo=di
  352.   detourinfo.disablescript=disablescript
  353.   detourinfo.processid=getOpenedProcessID()
  354.   dotnetdetours['Player.BuyItemFromMarket']=detourinfo
  355. else  
  356.   if disableinfo==nil then disableinfo='no reason' end  
  357.   error('InjectDotNetDetour failed : '..disableinfo) --prevents checking  
  358. end
  359. {$asm}
  360.  
  361.  
  362. [disable]
  363. {$lua}
  364. if syntaxcheck then return end
  365.  
  366. if dotnetdetours['Player.BuyItemFromMarket'] then
  367.   autoAssemble(dotnetdetours['Player.BuyItemFromMarket'].disablescript, dotnetdetours['Player.BuyItemFromMarket'].disableinfo)
  368. end
  369. {$asm}
  370. </AssemblerScript>
  371.           <CheatEntries>
  372.             <CheatEntry>
  373.               <ID>5</ID>
  374.               <Description>"CanBuyItemAtPrice Patch"</Description>
  375.               <VariableType>Auto Assembler Script</VariableType>
  376.               <AssemblerScript>[enable]
  377. {$lua}  
  378. if syntaxcheck then return end
  379.  
  380.  
  381. LaunchMonoDataCollector()
  382.  
  383. if dotnetdetours==nil then
  384.   dotnetdetours={}
  385. else
  386.   local di=dotnetdetours['Player.CanBuyItemAtPrice']
  387.   if di and di.processid==getOpenedProcessID() then
  388.     --already detoured. Undo first
  389.     local r,err=autoAssemble(di.disablescript, di.disableinfo)
  390.    
  391.     if not r then
  392.       error(err)
  393.     else
  394.       dotnetdetours['Player.CanBuyItemAtPrice']=nil
  395.     end    
  396.   end
  397. end
  398. local detourinfo={}
  399.  
  400. local csharpscript=[[
  401. using System.Runtime.CompilerServices; //for NoInlining
  402. //feel free to add more
  403.  
  404.  
  405. public class patchedPlayer : Game.Player.Player
  406. {
  407.  
  408.   public System.Boolean newCanBuyItemAtPrice(GameResources.Items.IItem item, GameData.MoneyValue price)
  409.   {
  410.     //you have access to public fields.  Use reflection if you wish to access private fields
  411.     return oldCanBuyItemAtPrice(item, GameData.MoneyValue.zero);
  412.   }
  413.  
  414.   [MethodImpl(MethodImplOptions.NoInlining)]
  415.   public System.Boolean oldCanBuyItemAtPrice(GameResources.Items.IItem item, GameData.MoneyValue price)
  416.   {
  417.     //don't bother putting code in here. It will get replaced (just some stuff to make sure there's space)
  418.     return true;
  419.   }
  420. }
  421.  
  422. ]]
  423. local references, sysfile
  424.  
  425. -- CHECK: Did the header already do the work?
  426. if Shared_References and Shared_SysFile then
  427.   -- Yes! Use the cached list (Instant)
  428.   references = Shared_References
  429.   sysfile = Shared_SysFile
  430. else
  431.   -- No (Header wasn't used). We must scan manually.
  432.   LaunchMonoDataCollector() -- Just in case
  433.   references, sysfile = dotnetpatch_getAllReferences()
  434.  
  435.   -- The Filter Loop (Only runs if fallback is triggered)
  436.   for i = #references, 1, -1 do
  437.     if string.find(string.lower(references[i]), "mscorlib.dll") then
  438.       table.remove(references, i)
  439.     end
  440.   end
  441. end
  442.  
  443. local csfile,msg=compileCS(csharpscript, references, sysfile)
  444.  
  445. if csfile==nil then
  446.   --sometimes having the sysfile causes an issue. Try without  
  447.   csfile,msg=compileCS(csharpscript, references)
  448.   if csfile==nil then
  449.     if msg==nil then msg=' (?Unknown error?)' end
  450.     messageDialog('Compilation error:'..msg, mtError, mbOK) --show compile error in a dialog instead of a lua error only
  451.     error(msg)
  452.   end
  453. end
  454.  
  455. --still here, c# dll created, now inject and hook
  456. local result, disableinfo, disablescript=InjectDotNetDetour(csfile, "Player::CanBuyItemAtPrice","patchedPlayer::newCanBuyItemAtPrice","patchedPlayer::oldCanBuyItemAtPrice")
  457.  
  458. if result then
  459.   detourinfo.disableinfo=di
  460.   detourinfo.disablescript=disablescript
  461.   detourinfo.processid=getOpenedProcessID()
  462.   dotnetdetours['Player.CanBuyItemAtPrice']=detourinfo
  463. else  
  464.   if disableinfo==nil then disableinfo='no reason' end  
  465.   error('InjectDotNetDetour failed : '..disableinfo) --prevents checking  
  466. end
  467. {$asm}
  468.  
  469.  
  470. [disable]
  471. {$lua}
  472. if syntaxcheck then return end
  473.  
  474. if dotnetdetours['Player.CanBuyItemAtPrice'] then
  475.   autoAssemble(dotnetdetours['Player.CanBuyItemAtPrice'].disablescript, dotnetdetours['Player.CanBuyItemAtPrice'].disableinfo)
  476. end
  477. {$asm}
  478. </AssemblerScript>
  479.             </CheatEntry>
  480.           </CheatEntries>
  481.         </CheatEntry>
  482.         <CheatEntry>
  483.           <ID>2</ID>
  484.           <Description>"Can buy suitcases regardless of money"</Description>
  485.           <VariableType>Auto Assembler Script</VariableType>
  486.           <AssemblerScript>[enable]
  487. {$lua}  
  488. if syntaxcheck then return end
  489.  
  490.  
  491. LaunchMonoDataCollector()
  492.  
  493. if dotnetdetours==nil then
  494.   dotnetdetours={}
  495. else
  496.   local di=dotnetdetours['Player.BuyAndAddSuitcase']
  497.   if di and di.processid==getOpenedProcessID() then
  498.     --already detoured. Undo first
  499.     local r,err=autoAssemble(di.disablescript, di.disableinfo)
  500.    
  501.     if not r then
  502.       error(err)
  503.     else
  504.       dotnetdetours['Player.BuyAndAddSuitcase']=nil
  505.     end    
  506.   end
  507. end
  508. local detourinfo={}
  509.  
  510. local csharpscript=[[
  511. using System;
  512. using System.Reflection;
  513. using System.Runtime.CompilerServices;
  514. using Game.Player;
  515.  
  516. public class patchedPlayer : Player
  517. {
  518.  
  519.   public System.Boolean newBuyAndAddSuitcase(Game.Luggage.Suitcase suitcase)
  520.   {
  521.     var type = typeof(Player);
  522.     var prop = type.GetProperty("gameData", BindingFlags.Static | BindingFlags.NonPublic);
  523.     GameData.IGameData data = (GameData.IGameData)prop.GetValue(null);
  524.  
  525.     // Now we can access 'markets' through the interface
  526.     GameData.MoneyValue moneyValue = data.markets.PriceOfSuitcaseInMarket(this.currentCity);
  527.  
  528.     this.AddSuitcase(suitcase);
  529.     this.SpendMoney(moneyValue);
  530.     return true;
  531.   }
  532.  
  533.   [MethodImpl(MethodImplOptions.NoInlining)]
  534.   public System.Boolean oldBuyAndAddSuitcase(Game.Luggage.Suitcase suitcase)
  535.   {
  536.     return true;
  537.   }
  538. }
  539. ]]
  540. local references, sysfile
  541.  
  542. -- CHECK: Did the header already do the work?
  543. if Shared_References and Shared_SysFile then
  544.   -- Yes! Use the cached list (Instant)
  545.   references = Shared_References
  546.   sysfile = Shared_SysFile
  547. else
  548.   -- No (Header wasn't used). We must scan manually.
  549.   LaunchMonoDataCollector() -- Just in case
  550.   references, sysfile = dotnetpatch_getAllReferences()
  551.  
  552.   -- The Filter Loop (Only runs if fallback is triggered)
  553.   for i = #references, 1, -1 do
  554.     if string.find(string.lower(references[i]), "mscorlib.dll") then
  555.       table.remove(references, i)
  556.     end
  557.   end
  558. end
  559.  
  560. local csfile,msg=compileCS(csharpscript, references, sysfile)
  561.  
  562. if csfile==nil then
  563.   --sometimes having the sysfile causes an issue. Try without  
  564.   csfile,msg=compileCS(csharpscript, references)
  565.   if csfile==nil then
  566.     if msg==nil then msg=' (?Unknown error?)' end
  567.     messageDialog('Compilation error:'..msg, mtError, mbOK) --show compile error in a dialog instead of a lua error only
  568.     error(msg)
  569.   end
  570. end
  571.  
  572. --still here, c# dll created, now inject and hook
  573. local result, disableinfo, disablescript=InjectDotNetDetour(csfile, "Player::BuyAndAddSuitcase","patchedPlayer::newBuyAndAddSuitcase","patchedPlayer::oldBuyAndAddSuitcase")
  574.  
  575. if result then
  576.   detourinfo.disableinfo=di
  577.   detourinfo.disablescript=disablescript
  578.   detourinfo.processid=getOpenedProcessID()
  579.   dotnetdetours['Player.BuyAndAddSuitcase']=detourinfo
  580. else  
  581.   if disableinfo==nil then disableinfo='no reason' end  
  582.   error('InjectDotNetDetour failed : '..disableinfo) --prevents checking  
  583. end
  584.  
  585. local rec = memrec.Parent
  586.  
  587. if rec then
  588.   rec.Color = 0x008000
  589.   rec.Description = "Infinite Money (Activated)"
  590. end
  591. {$asm}
  592.  
  593.  
  594. [disable]
  595. {$lua}
  596. if syntaxcheck then return end
  597.  
  598. if dotnetdetours['Player.BuyAndAddSuitcase'] then
  599.   autoAssemble(dotnetdetours['Player.BuyAndAddSuitcase'].disablescript, dotnetdetours['Player.BuyAndAddSuitcase'].disableinfo)
  600. end
  601. {$asm}
  602. </AssemblerScript>
  603.         </CheatEntry>
  604.       </CheatEntries>
  605.     </CheatEntry>
  606.   </CheatEntries>
  607.   <UserdefinedSymbols/>
  608. </CheatTable>
  609.  
Advertisement
Add Comment
Please, Sign In to add comment