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 


Trying to understand dotnet and lua scripting/hacking

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
maxhat
Newbie cheater
Reputation: 0

Joined: 10 Apr 2012
Posts: 23

PostPosted: Fri Sep 30, 2022 9:41 pm    Post subject: Trying to understand dotnet and lua scripting/hacking Reply with quote

Though I am still learning this, looking for help on invoking functions both from lua and dotnet...

My issue is lack of examples when using the dotnet or lua calls/functions

i.e.:

When using::
reinitializeDotNetSymbolhandler(modulename OPTIONAL)

is the 'modulename' supposed to be encapsulated in quotes ( single or double )

The other issue which is the reason for needing to use this command/call is when trying to use the ".net info" the images section always populates and the classes sometimes populates... whilst the methods, fields and static fields do not populate...

I try using the above command to refresh the list but still nothing populates, I've also tried to re-attach to the process...

Either I'm just not understanding all of the informatio out here or I'm doing something wrong... maybe a combination of both... Please help me... Thanks in advanced...

Game I'm practicing on:
"SpaceEngineers"

modules with data needed:
"Sandbox.Game.dll"

.net module used:
"netstandard.dll" << if this means anything, I am going on a wim here...
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 51

Joined: 01 Oct 2008
Posts: 912

PostPosted: Sat Oct 01, 2022 1:01 am    Post subject: Reply with quote

dotnet run from an cil assembly which game logic is not implemented in native instruction code from the start, but in byte-code form, which may JIT to native code in runtime by a cil runtime <mono/dotnet framework/dotnet core etc>.
Normally, there is no native code in memory for a certain function unless the game logic has reach that function for the first time. That why some ce table developer will ask user to do something before activate cheat <eg.being hit in game to activate hp related cheat>
CE has a mono-data-collector for Unity mono bytecode (mono bc) game which interop with the Unity mono runtime to ACTIVELY JIT certain function. <for Unity il2cpp game which is AOT complied with limited assembly info retained, the compiled function info is collected in a different way>
But for dotnet game, older CE can only PASSIVELY wait the function to be jit, but sometime, even the function has been jit-ed, CE still not know that, that's what reinitializeDotNetSymbolhandler for, which refresh CE's view on jit-ed functions.
Newer CE seems has ability to ACTIVELY jit a function <by .dotnet info windows' jit command>, but I has not tried or not success, so I cannot give more info.

btw,
1. The function address format are like,
dotnet: NAMESPACE"."CLASS"::"FUNCNAME
mono bc: NAMESPACE":"CLASS":"FUNCNAME
il2cpp: NAMESPACE"."CLASS"."FUNCNAME
2. there is an alternative way for making byetcode assembly game (dotnet or mono bc) cheat,
by using newer CE's InjectDotNetDetour function <search google with ce/fearless site may found more info>,
by injecting a custom assembly <that's written and compiled by us/ce > and modified functions using csharp language, here my example @ ItemNoDestroy_verCS entry. But for this particular cheat it work for ce [email protected] 10 but not ce [email protected] 11.

_________________
- Retarded.
Back to top
View user's profile Send private message
maxhat
Newbie cheater
Reputation: 0

Joined: 10 Apr 2012
Posts: 23

PostPosted: Sat Oct 01, 2022 3:05 am    Post subject: Reply with quote

Thanks, still kind of lost as to how to get the dotnet window to populate the methods field and static fields when refreshing symbols...

Many times I have to close or force close CE in order to get it to populate those sections of the dotnet info window...

Whilst the information given is still helpful, was wandering if anyone reading may shed light on how to get the methods and static field to populate.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 441

Joined: 09 May 2003
Posts: 24547
Location: The netherlands

PostPosted: Sat Oct 01, 2022 3:42 am    Post subject: Reply with quote

which class are you interested in?
Not all classes have static fields, fields, and or methods

_________________
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
View user's profile Send private message MSN Messenger
maxhat
Newbie cheater
Reputation: 0

Joined: 10 Apr 2012
Posts: 23

PostPosted: Sat Oct 01, 2022 3:28 pm    Post subject: Reply with quote

at the moment I know for sure that this class has methods, static fields and fields that can be populated

Sandbox.Game.Entities.Character.MyCharacter

it has a method to it of

get_SuitEnergyLevel

and a lot more, but as previously stated everytime that I try to enumerate through the classes the methods section just stop enumerating/populating

from what I gathered this morning

Sandbox.Game.Entities.Character.MyCharacter::get_SuitEnergyLevel()

has many more but if were to enumerate through lets say:

Sandbox.Game.EntityComponents.MyResourceSourceComponent

(which has methods in it)

it always goes blank, and I return to ..\mycharacter the methods field under that is empty also...

How do force the info window to refresh all the information


-----------------------

added an image to help describe the issue, in this image this is upon first loading it, but If I enter the game and play for a bit come back those 3 fields will be blank, I then disconnect dot net, close the info window and run LaunchDotNetInterface(), press Ctrl+Alt+N when navigating down to the section in the image... the 3 fields listed show nothing there... I have to force close CE and redo everything...



2022-10-01_18-09-21.png
 Description:
 Filesize:  164.17 KB
 Viewed:  511 Time(s)

2022-10-01_18-09-21.png


Back to top
View user's profile Send private message
maxhat
Newbie cheater
Reputation: 0

Joined: 10 Apr 2012
Posts: 23

PostPosted: Sun Oct 02, 2022 1:36 am    Post subject: Solved ---------- Reply with quote

So question is:

Is this the way to clear the dotnotinfo so that I can re-launch it manually

dotnet_disconnect()

and relaunching/refreshing the info

LaunchDotNetInterface()

I've literally tried using all of the function in every lua file for the dotnet feature.. but nothing is forcing the data to refresh... what is CE doing in the beginning of startup that the ffunction calls aren't...? Am I missing something...


----------------------------------------------


This issue happens whenever I attach debugger to the program all fields go blank except the Images and Classes section.. even if I detach from the process and just open the process again the window never refreshes...


Last edited by maxhat on Sun Oct 02, 2022 2:53 am; edited 2 times in total
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 51

Joined: 01 Oct 2008
Posts: 912

PostPosted: Sun Oct 02, 2022 2:25 am    Post subject: Reply with quote

Some function may be inlined if it is simple, like a property getter return a field just by an offset, then such function will not(means never) be jit-ed.

Try use a de-compiler (eg. dnSpy) and check the function/property/field 's USAGE, which will show where it being used.
For example, your MyCharacter 's state hp/suitEnergyLevel etc may be accessed by a hud/ui displaying function, which likely being jit-ed, so you can locate and inject there.
Similarly also check your interested static variable' usage.

Alternatively, you may locate the Address MyCharacter by injecting to any function access this address, eg. Update/MakeBlueprintFromBuiltPlanItem etc, then access MyCharacter's field by hardcoded offset.

_________________
- Retarded.
Back to top
View user's profile Send private message
maxhat
Newbie cheater
Reputation: 0

Joined: 10 Apr 2012
Posts: 23

PostPosted: Sun Oct 02, 2022 2:49 am    Post subject: Reply with quote

Thanks will follow-up on this and post back what I learned.. thank @DB & @panraven
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 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