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] Inventory Editor : adding items

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 356
Location: Algeria

PostPosted: Sat Jul 15, 2017 6:12 pm    Post subject: [mono] Inventory Editor : adding items Reply with quote

Hello,

I found the class WeaponManager, one of its fields is an array of weapon objects (the weapons that I own), every weapon object has many fields, some of them are pointers to other objects, strings, floats, integers etc.

What is the best approach to make an inventory editor (form that shows the currently owned weapons, and allows the users to remplace them with other weapons)? here are the ideas that I've had, but I couldn't implement any of them :

1) Find out how the objects are created, create one weapon object for every type of weapons, and store them somewhere in memory, after some research, I think that the constructor is the method '.ctor' (not 100% sure through), but from its signature, (I've used mono_method_getSignature), it looks like it doesn't take any arguments, so how do we create an instance?


2) Hook a method of the weapon class (preferably one that is not called very often, like the Start method for example), log the objects on which it is called, and check if it's a new weapon or not, if it is, add it to the list, but this way, it won't be possible to choose weapons that were not encountered during the current game.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 120

Joined: 09 Jun 2013
Posts: 3260

PostPosted: Sat Jul 15, 2017 9:30 pm    Post subject: Reply with quote

Does WeaponManager have an Add or Create method? Smile
There's probably some class in there that has an AddItem or CreateItem method.
Back to top
View user's profile Send private message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 356
Location: Algeria

PostPosted: Sun Jul 16, 2017 5:51 am    Post subject: Reply with quote

Zanzer wrote:
Does WeaponManager have an Add or Create method? Smile
There's probably some class in there that has an AddItem or CreateItem method.


I couldn't find any such method, there is a method WeaponManager:SwitchWeapons(currentWeapon: UnityEngine.GameObject, nextWeapon: UnityEngine.GameObject), but it probably just switches between existing weapons.

It must be a static method, no?

I'll keep searching, here are the results of the mono dissection :
weapon manager is at : be0a050 : WeaponManager
the weapon class is : bc135f8 : WeaponScript

https://drive.google.com/open?id=0B7U3AsTA9UVfM1NhVmhPUU9DZUE
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 120

Joined: 09 Jun 2013
Posts: 3260

PostPosted: Sun Jul 16, 2017 6:43 am    Post subject: Reply with quote

What's in the array WeaponPickUp.weapons?

What happens when you change the address of playerWeapons to equal the address of weapons?

Also, what classes are inside Assembly-CSharp?
Back to top
View user's profile Send private message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 356
Location: Algeria

PostPosted: Sun Jul 16, 2017 7:58 am    Post subject: Reply with quote

Zanzer wrote:
What's in the array WeaponPickUp.weapons?

What happens when you change the address of playerWeapons to equal the address of weapons?

Also, what classes are inside Assembly-CSharp?


playerWeapons is a list of WeaponScripts (every element represents a weapon), weapons is a list of GameObjects.

Forgot about Assembly-CSharp, I also couldn't find anything useful in it, but I'll keep searching, here it is :

https://drive.google.com/open?id=0B7U3AsTA9UVfc25HTDY3Uk9WZTg

Thanks for your time

[Edit] I forgot to add, the player can hold 6 weapons, the keys 1-6 are used to switch between them
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