SquishyPandaDev How do I cheat? Reputation: 0
Joined: 02 Sep 2019 Posts: 1
|
Posted: Mon Sep 02, 2019 11:47 am Post subject: Newbie needing advice on creating a table for Unity game |
|
|
So I decided that instead of waiting around or begging someone to make a cheat table, that I would take matters into my own hands and learn how to make cheat tables, how hard could it be? The answer, quite hard.
The game in question that I am working on is Shortest Trip to Earth, which use Unity. I am starting off by editing all the game resources save for fate points. Now, the catch is that I don't want to do infinite resources. What I would like to achieve is a table that allows me to easily set a resource to a given value.
In this game all resources are managed by the PlayerData class. All resources save for credits, it is just a simple field, is managed by PlayerResource class. This class has handy function to set the resource to a given value.
Is there a way I can create a cheat table that finds the PlayerData class and then change the resource values to a given amount that I input.
Edit:
Well I got somewhere. I went with using pointers to get the address of PlayerData class(idk how stable that is). I started writing up some scripts then my initialize script(called Start) crapped out by saying monopipe was nill. I called `LaunchMonoDataCollector` but at the end the "Activate mono features keep deselecting"
I have no idea what I am doing wrong
Edit Edit:
I have traced the problem to 'mono_method_get_parameters'. Using 'mono_method_getName' returns the right name, so I think that methodId is right.
Edit Edit Edit:
Well I am an idiot and well writing this script completely forgot how pointers worked. With the fixes to get the right address, I got it change the value of the resource, just not to what I inputted.
Code: |
[ENABLE]
{$lua}
if syntaxcheck then return end
local offsets = {0x2B0, 0x908, 0x30, 0x58, 0x78, 0x18}
local moduleAddr = getAddress("mono-2.0-bdwgc.dll")
local baseAddr = moduleAddr + 0x4A3290
local pointerChain = baseAddr
local i
for i=1, #offsets do
local pointer = readPointer(pointerChain)
print("P" .. i ..": " .. string.format("%x", pointer))
pointerChain = pointer + offsets[i]
end
print("P7: " .. string.format("%x", pointerChain))
playerDataAddr = readPointer(pointerChain)
print("PlayerData Addr: " .. string.format("%x", playerDataAddr))
local methodId = mono_findMethod("Assembly-CSharp", "PlayerResource", "Set")
local params = mono_method_get_parameters(methodId)
function SetResource(offset, value)
local args_t = {}
--- Amount
args_t[1] = {}
args_t[1].type = monoTypeToVartypeLookup[parms.parameters[1].type]
args_t[1].value = value
-- Reason
args_t[2] = {}
args_t[2].type = monoTypeToVartypeLookup[parms.parameters[2].type]
args_t[2].value = "Cheat Engine"
local addr = playerDataAddr + offset
local instanceAddr = readPointer(addr)
print("Instance Addr: " .. string.format("%x", instanceAddr))
print("Type: " .. args_t[1].type .. " & Value: " .. args_t[1].value)
local r = mono_invoke_method("Assembly-CSharp", methodId, instanceAddr, args_t)
return r
end
function Prompt(resource)
local response = inputQuery(resource, "Enter " .. resource .. " Amount:", "")
local value = tonumber(response)
return value
end
[DISABLE]
|
|
|