This is the AMP version of this page.
If you want to load the real page instead, click this text.

Help! Hook Array Field Offset [+1]

imls01245

Platinian
How to Hook This:

C#:
public Boards[] boards; // 0x54

I found the Reference but this time it is Field Offset


Here is struct

C++:
template <typename T>
struct monoArray
{
    void* klass;
    void* monitor;
    void* bounds;
    int max_length;
    void* vector [1];
    int getLength()
    {
        return max_length;
    }
    T getPointer()
    {
        return (T)vector;
    }
};

Here is my Hook but It wont work

C++:
void (*_casMenuUpdate)(void *ins);
void casMenuUpdate(void *ins) {
    if (ins != NULL) {
        monoArray<void> *boards = *(monoArray<void>**)((uint64_t) ins + 0x54);
        if (boards != NULL) {
            for (int i = 0; i < boards->getLength(); i++) {
                auto board = (*void) boards->getPointer();
                board[i] = 0; 
            }
        }
    }
}
 
Update: still dont know how to hook this field array


Here is the struct Related to Boards

C#:
public struct Boards // TypeDefIndex: 4262
{
	// Fields
	public string description; // 0x0
	public string boardTex; // 0x4
	public int coinCost; // 0x8
	public int sodaCost; // 0xC
	public bool isAvailableToPlayers; // 0x10
	public PerkType perkType; // 0x14
	public float perkAmount; // 0x18
}