Solved Int array

Status
Not open for further replies.

Denka

Platinian
Original poster
Sep 1, 2019
15
0
1
24
Ukr
How to get int array field?
C++:
int[] stats = *(int[] *) ((uint64_t) instance + 0x30);
Here is error
Screenshot_20221217-101633_1.jpg
 

Smiley3rd

Platinian
Oct 4, 2020
28
226
28
23
Indonesia
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);
}
 

Smiley3rd

Platinian
Oct 4, 2020
28
226
28
23
Indonesia
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()[ i ]; //THIS IS THE STATS

}

}

}
old_update(instance);
}
 

Denka

Platinian
Original poster
Sep 1, 2019
15
0
1
24
Ukr
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.jpg TT
 

Smiley3rd

Platinian
Oct 4, 2020
28
226
28
23
Indonesia
i have problem while compilling Unity.h View attachment 479327 View attachment 479327 TT
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);
}
 
  • Like
Reactions: Denka

G-Bo ッ

Administrator
Staff member
Administrator
Mar 22, 2017
8,876
345,795
2,350
Behind you.
platinmods.com
It seems this question is solved, so i will lock the thread.
If you're unhappy with that, just send me a message and i will reopen the thread.
 
Status
Not open for further replies.