Solved Int array

Status
Not open for further replies.

Denka

Platinian
How to get int array field?
C++:
int[] stats = *(int[] *) ((uint64_t) instance + 0x30);
Here is error
Screenshot_20221217-101633_1.jpg
 
You could use this, just import it to your project
UnityStuff-1/Unity.h at master · Karveit/UnityStuff-1 · GitHub

example hooking using monoArray

let's take yours as example

in dump
int[] stats; //0x30


hooking would be like this

void (*old_update)(void *instance);
void update(void *instance) {
if (instance!= NULL) {

monoArray<int> *stats = *(monoArray<int> **) ((uint64_t) instance + 0x30);

if (stats != NULL) {

for (int i = 0; i < stats->getLength(); i++) {

auto stat = stats->getPointer(); //THIS IS THE STATS

}

}

}
old_update(instance);
}
 
You could use this, just import it to your project
UnityStuff-1/Unity.h at master · Karveit/UnityStuff-1 · GitHub

example hooking using monoArray

let's take yours as example

in dump
int[] stats; //0x30


hooking would be like this

void (*old_update)(void *instance);
void update(void *instance) {
if (instance!= NULL) {

monoArray<int> *stats = *(monoArray<int> **) ((uint64_t) instance + 0x30);

if (stats != NULL) {

for (int i = 0; i < stats->getLength(); i++) {

auto stat = stats->getPointer(); //THIS IS THE STATS

}

}

}
old_update(instance);
}
i have problem while compilling Unity.h
Screenshot_20221223-101057.jpg
Screenshot_20221223-101057.jpgTT
 
i have problem while compilling Unity.h View attachment 479327View attachment 479327TT
it's literally saying what the error is...
because im in the mood ill help you,
go to the unity file and change the following

#include <mach-o/dyld.h>
#define ASLR_BIAS _dyld_get_image_vmaddr_slide
uint64_t getRealOffset(uint64_t offset){
return ASLR_BIAS + offset;
}

to

#include "Includes/Utils.h"
uint64_t getRealOffset(uint64_t offset){
return getAbsoluteAddress("libil2cpp.so", offset);
}
 
Status
Not open for further replies.
Back
Top Bottom