Forgot, here's the template for monoArray if you don't already have it.This is a custom data type, I don't even know if it is used, but in the il2cpp tool this method works perfectly, please show me if it is not difficult for you how to completely pass the data parameter and also for verification how to use this data type GarageCarData
/*
This struct can hold a native C# array. Credits to caoyin.
Think of it like a wrapper for a C array. For example, if you had Player[] players in a dump,
the resulting monoArray definition would be monoArray<void **> *players;
To get the C array, call getPointer.
To get the length, call getLength.
*/
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;
}
};
I mean the custom data type GarageСarData, did I do it right?
Here's the template for monoArray, its publicly available.
C++:/* This struct can hold a native C# array. Credits to caoyin. Think of it like a wrapper for a C array. For example, if you had Player[] players in a dump, the resulting monoArray definition would be monoArray<void **> *players; To get the C array, call getPointer. To get the length, call getLength. */ 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; } };
I don't think there's a need for "public" and "private". I'm not really experienced with structs since i lazily use void* with my hooks instead of complicating things, but here's what I think would be more appropriate:I mean the custom data type GarageСarData, did I do it right?
struct GarageCarData {
monoString* ID;
monoString* InstanceID;
monoString* Name;
monoString* Prefab;
monoString* DeviceId;
bool UpdateIcon;
bool BetaSave;
bool _synchronize;
bool SkipOnSync;
ObscuredInt CoinsSellPrice;
ObscuredInt CoinsSubtractAmount;
ObscuredInt GoldSubtractAmount;
};
this is the data type of this method: public static GarageCarData AddOnlineCar(string prefab, string name, string instanceID, ObscuredInt sellPrice, byte[] data)As for how to use it... What are you trying to do with it, to start with?
We gotta do trial and error.Игра вылетает при вызове
GarageCarData* (*old_AddOnlineCar)(monoString* prefab, monoString* name, monoString* instanceID, ObscuredInt sellPrice, monoArray<uint8_t>* data);
если (кнопка 8) {
btn8 = ложь;
old_AddOnlineCar(CreateString("STRING_B"), CreateString("STRING B"), CreateString("STRING"), CreateObscuredInt(1, 1), nullptr);
}
old_AddOnlineCar = (GarageCarData*(*)(monoString*, monoString*, monoString*, ObscuredInt, monoArray<uint8_t>*)) getAbsoluteAddress(targetLibName, 0xD5CA54);
These are not unknown lines, I gave this car to my garage using the il2cpp tool, this is a limited car and there are only 20 of them in the gameWe gotta do trial and error.
1. Try using void* instead of GarageCarData* as you're just calling the AddOnlineCar method.
2. For prefab and name parameter, try specifying it without using unknown strings. For example do this instead:
old_AddOnlineCar(CreateString("TRK_82Com"), CreateString("TRAKTOR Communal"), CreateString("CanBeAnythingHonestly"), CreateObscuredInt(1, 1), nullptr);
Send your updated code againit still crashes with void
void (*old_AddOnlineCar)(monoString* prefab, monoString* name, monoString* instanceID, ObscuredInt sellPrice, monoArray<uint8_t>* data);Send your updated code again
void (*old_AddOnlineCar)(monoString* prefab, monoString* name, monoString* instanceID, ObscuredInt sellPrice, monoArray<uint8_t>* data);
if (btn8) {
btn8 = false;
old_AddOnlineCar(CreateString("STRING_B"), CreateString("STRING B"), CreateString("STRING"), CreateObscuredInt(1, 1), nullptr);
}
old_AddOnlineCar = (void(*)(monoString*, monoString*, monoString*, ObscuredInt, monoArray<uint8_t>*)) getAbsoluteAddress(targetLibName, 0xD5CA54);
No workvoid* not voidN
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies