Skip to content

Memory offsets? #385

@ikt32

Description

@ikt32

There's a few methods in there which don't use native functions, but access memory to change stuff. One of those is setting a headlight damage status:

void Vehicle::LeftHeadLightBroken::set(bool value) {
    unsigned char *const address = reinterpret_cast<unsigned char *>(Native::MemoryAccess::GetAddressOfEntity(Handle));
    if (address == nullptr) {
        return;
    }

    const unsigned char mask = 1 << 0;

    if (value) {
        *(address + 1916) |= mask;
    }
    else {
        *(address + 1916) &= ~mask;
    }
}

Now, I get the basic gist of it, but how did you discover this specific offset of 1916 bytes(?) to damage the headlights? Is there any other documentation available for what I think is a Vehicle struct? Specifically, I want to find out what damages the wheels such that the suspension lowers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions