IntelSDM / RustDMACheat

Small DMA Cheat For Rust
MIT License
201 stars 54 forks source link

how do i check the entities found nearby? #67

Closed mesaruk closed 3 months ago

mesaruk commented 5 months ago

`void BaseNetworkable::ItterateEntities() { //' std::cout << "[BaseNetworkable] Iterating Entities" << std::endl; for (uint32_t i = 0; i < ObjectListSize; i++) { uint64_t currentobject = TargetProcess.Read(ObjectList + (0x20 + (i * 8))); if (currentobject == 0) { std::cout << "[BaseNetworkable] Skipping invalid object at index " << i << std::endl; continue; // Skip if the object is invalid }

    uint64_t baseobject = TargetProcess.Read<uint64_t>(currentobject + 0x10);
    uint64_t object = TargetProcess.Read<uint64_t>(baseobject + 0x30);
    uint64_t prefab = TargetProcess.Read<uint64_t>(object + 0x60);
    WORD tag = TargetProcess.Read<WORD>(object + 0x54);

    char buff[256] = { 0 };
    if (!TargetProcess.Read(prefab, reinterpret_cast<void*>(buff), sizeof(buff)))
    {
        std::cerr << "[BaseNetworkable] Failed to read prefab name for object at index " << i << std::endl;
        continue;
    }

    std::string prefabname = buff;
    std::cout << "[BaseNetworkable] PrefabName: " << prefabname << std::endl;
    std::cout << "[BaseNetworkable] Tag: " << tag << std::endl;

    if (prefabname.find("metal") != std::string::npos)
    {
        std::cout << "[BaseNetworkable] Found entity with 'metal' in the name: " << prefabname << std::endl;
    }
}

}`

what am i doing wrong?

mesaruk commented 5 months ago

solved the issue incorrect memory address