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 


Mono jit information resolving flow within Cheat Engine

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

Joined: 16 Jul 2014
Posts: 5

PostPosted: Fri Jan 20, 2017 11:40 am    Post subject: Mono jit information resolving flow within Cheat Engine Reply with quote

Hi,
I'm trying to follow the flow in MonoDataCollector, which getting a jit address of method from it's name. Sadly I don't get it well and I got stuck at CPipeServer::GetJitInfo()
I'll simplify it since MonoDataCollector's using pipes to communicate with the target process.

So as far as I understand it looks like this:
Code:

    klass = mono_class_from_name_case(mage, namespace_name, class_name);
    method = mono_class_get_method_from_name(klass, method_name, -1);
    jit_info = mono_jit_info_table_find(domain, method);

Now, mono_jit_info_table_find doesn't work for me when I give it the address of the method, I debugged mono.dll to see what it actually gets from MonoDataCollector and it seems that other addresses are given to it,
I'm not quite sure what these addresses are, and I'd like to know it so I can understand how does CE get the jit information of a method.

Thanks.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 26

Joined: 01 Oct 2008
Posts: 659

PostPosted: Fri Jan 20, 2017 6:21 pm    Post subject: Reply with quote

The second parameter should be address (*, may called compiled_method_address) of the compiled method
typedef void* (__cdecl *MONO_JIT_INFO_TABLE_FIND)(void *domain, void *addr)

the address should be the return value if no error of
typedef void* (__cdecl *MONO_COMPILE_METHOD)(void *method)
should only work for managed function/method

where method(+, it is a number which may called method_address) is the return of the struct address of mono_class_get_method_from_name etc.

Different of compiled_method_address and method_address:

(*)This address should be exactly the CE returned symbol address from the data collector,
ie. for symbol "namespace:class:method", if return 07f0000 in AA,
then 0x7f0000 is the starting address of the compiled method, entry point of the native code of the function.

(+)method_address is the address of an internal struct used by mono


May be useful : http://forum.cheatengine.org/viewtopic.php?p=5711944#5711944

bye~


ADDED:
note that in CE symbol like "mono_class_get_method_from_name" and "mono.mono_class_get_method_from_name" is different,
the later is the entry point of the function in mono.dll, while the shorter one is the address with content as the later address (import address?).



cemonodlladdress.jpg
 Description:
 Filesize:  75.41 KB
 Viewed:  6717 Time(s)

cemonodlladdress.jpg



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

Joined: 16 Jul 2014
Posts: 5

PostPosted: Wed Jan 25, 2017 11:36 am    Post subject: Reply with quote

panraven wrote:
The second parameter should be address (*, may called compiled_method_address) of the compiled method
typedef void* (__cdecl *MONO_JIT_INFO_TABLE_FIND)(void *domain, void *addr)

the address should be the return value if no error of
typedef void* (__cdecl *MONO_COMPILE_METHOD)(void *method)
should only work for managed function/method

where method(+, it is a number which may called method_address) is the return of the struct address of mono_class_get_method_from_name etc.

Different of compiled_method_address and method_address:

(*)This address should be exactly the CE returned symbol address from the data collector,
ie. for symbol "namespace:class:method", if return 07f0000 in AA,
then 0x7f0000 is the starting address of the compiled method, entry point of the native code of the function.

(+)method_address is the address of an internal struct used by mono

bye~


ADDED:
note that in CE symbol like "mono_class_get_method_from_name" and "mono.mono_class_get_method_from_name" is different,
the later is the entry point of the function in mono.dll, while the shorter one is the address with content as the later address (import address?).


I've opened the topic you mentioned there, both were really helpful. Thanks Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source 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