Help! Help please

raeivsky234

Platinian
public static GarageCarData AddOnlineCar(string prefab, string name, string instanceID, ObscuredInt sellPrice, byte[] data)

How can I intercept the obscured value in the sell price parameters
 
Last edited:


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
Forgot, here's the template for monoArray if you don't already have it.
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;
    }
};
 



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 mean the custom data type GarageСarData, did I do it right?
 
I mean the custom data type GarageСarData, did I do it right?
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:

C++:
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;
};
 
Игра вылетает при вызове

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);
 
Игра вылетает при вызове

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);
We 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);
 
We 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);
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 game
 
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);
 
This is how everything works perfectly
 

Attachments

  • photo_2025-04-07_18-19-29.jpg
    photo_2025-04-07_18-19-29.jpg
    105.4 KB · Views: 18
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);

void* not void
 
Back
Top Bottom