Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Call unity method

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
t6_x
How do I cheat?
Reputation: 0

Joined: 14 Dec 2015
Posts: 2

PostPosted: Wed Dec 16, 2015 1:03 pm    Post subject: Call unity method Reply with quote

I tried a lot but not found something basic, I'm starting to learn how to work in the EC.

I have a game made in unity, uses mono.

I'm trying to make a call to a specific method which is one of the dlls of unity.

How to do this through script?

There is something like

call Class.Method



Currently I made a small program that injects code into a remote thread, but is giving a lot of work to do small tests.

There making via script?

Tutorials sought but not found.

thank you
Back to top
View user's profile Send private message
Studio80
Advanced Cheater
Reputation: 2

Joined: 12 Sep 2012
Posts: 83

PostPosted: Wed Dec 16, 2015 1:40 pm    Post subject: Reply with quote

You can simply do a pointerscan and use that to write a new value to
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 959

PostPosted: Wed Dec 16, 2015 1:40 pm    Post subject: Reply with quote

If it is for ce's mono-feature, may have a look of tfigment's PoE tables, http://forum.cheatengine.org/viewtopic.php?t=580596
search inside his table as a text file in a editor or check 'enable script' (may hide until activated parent cheat entry) for 'mono_invoke_method', probably is what you want. It is in Lua like this:
Code:
    PoE_AddItem = function(item, count)
        if AddItem~=0 then
           local args = { {type = vtString, value = item}, {type = vtDword, value = tonumber(count)} }
           mono_invoke_method(nil, AddItem, nil, args)
        else
            messageDialog("Unable to find methods to call", mtError, mbClose)
        end
    end


If it is for self made trainer, may have a deeper look on
https://github.com/cheat-engine/cheat-engine/blob/48da5470e306b00141c8c49056164b03cf403237/Cheat%20Engine/MonoDataCollector/MonoDataCollector/PipeServer.cpp
for interaction between lua pipeserver & lower-level mono.dll

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
t6_x
How do I cheat?
Reputation: 0

Joined: 14 Dec 2015
Posts: 2

PostPosted: Wed Dec 16, 2015 2:25 pm    Post subject: Reply with quote

Did the entire script

It makes the whole procedure but the method is not executed

Code:
local foundMethods = 0
local domains = mono_enumDomains()
local domain = domains[1]
local assemblies = mono_enumAssemblies()

local OnTest


local GameStateClass = 0
for i=1, #assemblies do
    local image = mono_getImageFromAssembly(assemblies[i])
    local imagename = mono_image_get_name(image)
    if imagename == 'Assembly-CSharp' then
      OnTest = mono_class_findMethodByDesc(image, "Class01:Method02()")

      if OnTest ~=0 then
      messageDialog("aaaa", mtError, mbClose)
         foundMethods = 1
         local args = {}
         mono_invoke_method(nil, OnTest , nil, args)
     else
        messageDialog("Unable to find methods to call", mtError, mbClose)
      end
      break
    end
   
end




messagebox "aaaa" is executed

But the method is not

The address of OnTest is the same in dissectmono, but dind work.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites