Solved help me hook monoDictionary

Status
Not open for further replies.

alsya

Solid & Active Platinian
Original poster
Oct 21, 2021
80
18
8
unknown
Screenshot_2022-06-07-22-01-19-486_com.aide.ui.jpg

can anyone help me how to solve the error, and what is wrong with my mod menu hook, is there any reference for the monoDictionary source code hook?
 

·҉ dollaz·҉. .

Approved iModder
Approved iModder
Mar 26, 2021
159
1,819
193
Somewhere
Do you have the struct included? If you dont, here it is.


C++:
template <typename K, typename V>
struct monoDictionary {
    void *unk0;
    void *unk1;
    monoArray<int **> *table;
    monoArray<void **> *linkSlots;
    monoArray<K> *keys;
    monoArray<V> *values;
    int touchedSlots;
    int emptySlot;
    int size;
   
    K getKeys(){
        return keys->getPointer();
    }
   
    V getValues(){
        return values->getPointer();
    }
   
    int getNumKeys(){
        return keys->getLength();
    }
   
    int getNumValues(){
        return values->getLength();
    }
   
    int getSize(){
        return size;
    }
};
from the looks of it, "players" is already a variable. You didnt give any actual error message so I cant really help much
 

Sevol

Retired Staff
Retired but loved <3
Jun 8, 2019
219
5,941
193
Russia
Never used it but looks like pointers on screenshot not correct
 

alsya

Solid & Active Platinian
Original poster
Oct 21, 2021
80
18
8
unknown
Do you have the struct included? If you dont, here it is.


C++:
template <typename K, typename V>
struct monoDictionary {
    void *unk0;
    void *unk1;
    monoArray<int **> *table;
    monoArray<void **> *linkSlots;
    monoArray<K> *keys;
    monoArray<V> *values;
    int touchedSlots;
    int emptySlot;
    int size;
  
    K getKeys(){
        return keys->getPointer();
    }
  
    V getValues(){
        return values->getPointer();
    }
  
    int getNumKeys(){
        return keys->getLength();
    }
  
    int getNumValues(){
        return values->getLength();
    }
  
    int getSize(){
        return size;
    }
};
from the looks of it, "players" is already a variable. You didnt give any actual error message so I cant really help much
yes, I have it in the Unity.h file, did I take a screenshot to let you know what went wrong?
 

alsya

Solid & Active Platinian
Original poster
Oct 21, 2021
80
18
8
unknown
The pointer has errors, I personally cant help you because I have never modded a dictionary before, only list and array
do you have a dimain.cpp dictionary hook reference? I'm looking for a reference, it's not here, but about the monolist, I'm confused
 

Raebydett

Awesome Active Platinian
Jan 20, 2020
171
60
28
G
I think you need to know to do basic function pointer first, not just a copy pasta
 

alsya

Solid & Active Platinian
Original poster
Oct 21, 2021
80
18
8
unknown
The pointer has errors, I personally cant help you because I have never modded a dictionary before, only list and array
but if I remove the asterisk int * into int it works the error goes away, but there is still an error funticon getValues(); and getNumValues();
 

NepMods69

Inactive Approved Modder
Mar 6, 2022
122
5,091
193
Nepal
for(int u = 0; u < players->getNumValues(); u++) {
void* closestEnemy = players->getValues();



I am using This
 
  • Like
Reactions: alsya

GHr__><__

Solid & Active Platinian
May 22, 2020
71
3,434
1,193
Indonesia
// String / monoString
auto example= *(Dictionary<void *, String **> **)((uint64_t)instance + offset here);

// Int
auto example= *(Dictionary<int *, void **> **)((uint64_t)instance + offset here);

//void *
auto example= *(Dictionary<void *, void **> **)((uint64_t)instance + offset here);

//Random
auto example= *(Dictionary<uintptr_t , uintptr_t **> **)((uint64_t)instance + offset here);
 

alsya

Solid & Active Platinian
Original poster
Oct 21, 2021
80
18
8
unknown
// String / monoString
auto example= *(Dictionary<void *, String **> **)((uint64_t)instance + offset here);

// Int
auto example= *(Dictionary<int *, void **> **)((uint64_t)instance + offset here);

//void *
auto example= *(Dictionary<void *, void **> **)((uint64_t)instance + offset here);

//Random
auto example= *(Dictionary<uintptr_t , uintptr_t **> **)((uint64_t)instance + offset here);
// String / monoString
auto example= *(Dictionary<void *, String **> **)((uint64_t)instance + offset here);

// Int
auto example= *(Dictionary<int *, void **> **)((uint64_t)instance + offset here);

//void *
auto example= *(Dictionary<void *, void **> **)((uint64_t)instance + offset here);

//Random
auto example= *(Dictionary<uintptr_t , uintptr_t **> **)((uint64_t)instance + offset here);
oke thanks, i will try for this
 
Status
Not open for further replies.