View previous topic :: View next topic |
Author |
Message |
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Wed Aug 29, 2018 7:18 pm Post subject: Help with Mono and Lua? |
|
|
I am trying to simply find a method (achieved) and then invoke it.
Invoking it with the gui is easy but.. I cannot figure out how to with lua script.
_________________
Wassup |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Wed Aug 29, 2018 10:33 pm Post subject: |
|
|
mono_invoke_method. (check out monoscipt.lua in ce's autorun folder)
give it a domain (or nil), the method identifier, and the address of an object. And if it takes parameters a lua array table containing entries which are lua tables containing type and value
also check out http://fearlessrevolution.com/viewtopic.php?t=7391
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 5:53 am Post subject: |
|
|
Thanks for the reply. I am confused on the
Code: |
local domain = mono_enumDomains()[1]
|
It errors on this part.
_________________
Wassup |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Thu Aug 30, 2018 10:58 am Post subject: |
|
|
have the mono features been activated yet?
and what is the error?
(and domain can have the value 0)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 1:12 pm Post subject: |
|
|
Yes mono is activated. Okay so here is what the mono looks like. And changing the 1 to 0 in the domain fixed the error.
4346e70
-> Assembly-CSharp
-> Health_Manager
-> methods
-> AddHealth(int amount)
here is the script I made
local hm = mono_findClass('', 'Health_Manager')
local addhealth = mono_class_findMethod(hm, 'AddHealth')
local paddress = 0x0F55E5E8
local domain = mono_enumDomains()[0]
mono_invoke_method(domain, addhealth, paddress, {type="int", value=55})
It does not work, but it does not give an error either.
_________________
Wassup |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Thu Aug 30, 2018 1:32 pm Post subject: |
|
|
try domain=0 or mono_enumDomains()[1]
have you confirmed that hm and addhealth are not nil ?
and paddress is the correct address ? (just asking since it doesn't happen that often that i see a valid one ending in 8, but it's possible it's valid)
what is the return value of mono_invoke_method?
Also, the args type is not valid, try vtDword
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 1:53 pm Post subject: |
|
|
Dark Byte wrote: | try domain=0 or mono_enumDomains()[1]
have you confirmed that hm and addhealth are not nil ?
and paddress is the correct address ? (just asking since it doesn't happen that often that i see a valid one ending in 8, but it's possible it's valid)
what is the return value of mono_invoke_method?
Also, the args type is not valid, try vtDword |
Okay, I will try that. And yes it is correct, I can use the CE gui to invoke it, and it works fine.
Update:
I made some adjustments to the script:
--
local hm = mono_findClass('', 'Health_Manager')
print("CLASS: ", hm);
local addhealth = mono_class_findMethod(hm, 'AddHealth')
print("METHOD: " , addhealth);
local paddress = 0x12516AF0
local domain = mono_enumDomains()[1]
local inv = mono_invoke_method(domain, addhealth, paddress, {type="vtDword ", value=55})
print("INVOKE RETURN: ", inv)
--
Output:
CLASS: 290064216
METHOD: 290064760
INVOKE RETURN:
--
I tried putting domain to 0 like you said, but that made no difference.
_________________
Wassup |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Thu Aug 30, 2018 2:01 pm Post subject: |
|
|
type is an integer. so type=vtDword
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 2:02 pm Post subject: |
|
|
Okay. Here is the new script.
--
local hm = mono_findClass('', 'Health_Manager')
print("CLASS: ", hm);
local addhealth = mono_class_findMethod(hm, 'AddHealth')
print("METHOD: " , addhealth);
local paddress = 0x12516AF0
local domain = mono_enumDomains()[1]
local inv = mono_invoke_method(domain, addhealth, paddress, {type=vtDword, value=55})
print("INVOKE RETURN: ", inv)
--
The output is the same as above.
_________________
Wassup |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Thu Aug 30, 2018 2:12 pm Post subject: |
|
|
try
Code: |
local inv = mono_invoke_method(domain, addhealth, paddress, {{type=vtDword, value=55}})
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 2:20 pm Post subject: |
|
|
Thank you, it worked. Now I need to figure out how to get a static mono address. I guess it works the same as a normal address, just do pointer scan and reopen the game
_________________
Wassup |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Thu Aug 30, 2018 2:38 pm Post subject: |
|
|
you can use
Code: |
mono_class_findInstancesOfClassListOnly(domain,class)
|
it will return a list of objects that resemble the object you're interested in
In case of multiple do some checks so see if it's actually what you are looking for (e.g used pointers filled in, proper values everywhere, etc...)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 2:53 pm Post subject: |
|
|
Thank you!!
Also, I know that what I am about to ask isn't SUPER related, but kinda? What I've been trying to do with this the whole time is create an unofficial "modding" support for a game. Even the developer of this game is encouraging me to do my best! Here is what I have so far.
Code: |
local Classes = {
Health_Manager = mono_findClass('', 'Health_Manager');
};
local Methods = {
AddHealth = mono_class_findMethod(Classes.Health_Manager, 'AddHealth')
};
local Addresses = {
Health_Manager = 0x12C56B98;
};
local domain = mono_enumDomains()[1];
local API = {};
function API:AddHealth(Amount)
inv = mono_invoke_method(domain, Methods.AddHealth, Addresses.Health_Manager, {{type=vtDword, value=Amount}})
end
API:AddHealth(500);
--local hm = mono_findClass('', 'Health_Manager')
--local addhealth = mono_class_findMethod(hm, 'AddHealth')
--local paddress = 0x12C56B98
--local domain = mono_enumDomains()[1]
--inv = mono_invoke_method(domain, addhealth, paddress, {{type=vtDword, value=55}})
|
As you can see, very basic so far. So, my question is, is there any way to make it so people can easily add their own scripts, and have CE execute them at run time, or whenever it hooks onto the process? That is my goal, and that would be awesome!
I was thinking have a folder named scripts, and CE goes through and runs each script. I have really no idea if this is possible or not.
_________________
Wassup |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu Aug 30, 2018 3:04 pm Post subject: |
|
|
You could use "getDirectoryList" and "getFileList" then use Lua's "dofile" (or "require") to execute a lua file in CE.
Form "celua.txt":
Code: |
getFileList(Path:string, searchMask:string OPTIONAL, SearchSubDirs: boolean OPTIONAL, DirAttrib: integer OPTIONAL): Returns an indexed table with filenames
getDirectoryList(Path:string, SearchSubDirs: boolean OPTIONAL): Returns an indexed table with directory names |
_________________
|
|
Back to top |
|
|
Voidage Newbie cheater Reputation: 0
Joined: 29 Aug 2018 Posts: 15
|
Posted: Thu Aug 30, 2018 3:08 pm Post subject: |
|
|
TheyCallMeTim13 wrote: | You could use "getDirectoryList" and "getFileList" then use Lua's "dofile" (or "require") to execute a lua file in CE.
Form "celua.txt":
Code: |
getFileList(Path:string, searchMask:string OPTIONAL, SearchSubDirs: boolean OPTIONAL, DirAttrib: integer OPTIONAL): Returns an indexed table with filenames
getDirectoryList(Path:string, SearchSubDirs: boolean OPTIONAL): Returns an indexed table with directory names |
|
How would I get the directory of the game? Ik the ACTUAL directory on my pc, but it is different for every person.
_________________
Wassup |
|
Back to top |
|
|
|