Skip to content
Guest Big Announcement

How to determine the size of object in a List of that object

Featured Replies

Have a field in a class called Labyrinth:

List<EnemyInstance> BattleZoneEnemy; // 0x98


Wants to use this function but need an EnemyInstance:

kill( Labyrinth *this, EnemyInstance enemy);



How can I determine the size of enemy so I can iterate BattleZoneEnemy list so I can call Kill() on each of the enemyinstances 

What I am thinking :

void Update(void *_LabyrinthInstance) {
	// get BattleZoneEnemy (Not sure what are the data type to receive I assume a pointer since its a list)
	void* BattleZoneEnemy = *(void*)((uint64_t)_LabyrinthInstance + 0x98);
	if (BattleZoneEnemy) {
    		kill(_LabyrinthInstance, BattleZoneEnemy + size? ); // Can I loop this statement if I know the size of each EnemyInstance?
      									// So I would just add the size for each iteration
   	 }
}



Some advices would be appreciated!

You can use unity functions 

void* EnemyInstance = *(void**)((uint64_t)this_ + 0x98);

int count = List.getCount(EnemyInstance);

for(int i = 0; i < 0; i++){
 void* enemies = List.getItem(EnemyInstance, i); // now you have your enemies object

//do what ever you want

}
 

  • Author
21 minutes ago, X204 said:

You can use unity functions 

void* EnemyInstance = *(void**)((uint64_t)this_ + 0x98);

int count = List.getCount(EnemyInstance);

for(int i = 0; i < 0; i++){
 void* enemies = List.getItem(EnemyInstance, i); // now you have your enemies object

//do what ever you want

}
 

How should I include/import unity's function to the tweak?

Are you kidding  🤐,  Copy and past! I gave you example try to understand the main idea, and declare what you want before trying to call it.

  • Author
8 minutes ago, X204 said:

Are you kidding  🤐,  Copy and past! I gave you example try to understand the main idea, and declare what you want before trying to call it.

Yep, understood now 

On 3/5/2022 at 3:07 PM, BenGorr said:

Have a field in a class called Labyrinth:

List<EnemyInstance> BattleZoneEnemy; // 0x98


Wants to use this function but need an EnemyInstance:

kill( Labyrinth *this, EnemyInstance enemy);



How can I determine the size of enemy so I can iterate BattleZoneEnemy list so I can call Kill() on each of the enemyinstances 

What I am thinking :

void Update(void *_LabyrinthInstance) {
	// get BattleZoneEnemy (Not sure what are the data type to receive I assume a pointer since its a list)
	void* BattleZoneEnemy = *(void*)((uint64_t)_LabyrinthInstance + 0x98);
	if (BattleZoneEnemy) {
    		kill(_LabyrinthInstance, BattleZoneEnemy + size? ); // Can I loop this statement if I know the size of each EnemyInstance?
      									// So I would just add the size for each iteration
   	 }
}



Some advices would be appreciated!

You discord I’d ?

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.