Mzzzj / CS2_DMA_Radar

CS2 DMA 雷达
140 stars 53 forks source link

Players Location On The Map #3

Closed blueeorx1 closed 8 months ago

blueeorx1 commented 1 year ago

Hello Please help me I have everything is work fine but once i go to a match the map loaded but there is no players on the radar map Only Empty map It was working before but now no any solution to this problem please ? I have updated the dwEntityList + dwLocalPlayerPawn btw Thank you

xCorteX commented 1 year ago

update the offsets in CS2DMA/src/main/java/cs2/dma/main/PlayerAddressUpdateThread.java

@Override

public void run() {
    long EntityAddress = memoryTool.readAddress(EntityList + (index + 1) * 0x78, 8);
    if (EntityAddress == 0)
        return;
    long EntityPawnListEntry = memoryTool.readAddress(clientAddress + dwEntityList, 8);
    if (EntityPawnListEntry == 0)
        return;
    long Pawn = memoryTool.readAddress(EntityAddress + 0x7BC, 8);
    if (Pawn == 0)
        return;
    EntityPawnListEntry = memoryTool.readAddress(EntityPawnListEntry + 0x10 + 8 * ((Pawn & 0x7FFF) >> 9), 8);
    Pawn = memoryTool.readAddress(EntityPawnListEntry + 0x78 * (Pawn & 0x1FF), 8);
    if (Pawn == 0)
        return;
    float localPlayerZ = memoryTool.readFloat(LocalPlayerController + 0xCD8 + 0x8, 8);
    if (isKnowMap) {
        int teamId = memoryTool.readInt(EntityAddress + 0x3bf, 4);
        float playerZ = memoryTool.readFloat(Pawn + 0xCD8 + 0x8, 8);
        float levelDv = playerZ - localPlayerZ;
        levelDv = (levelDv < 0) ? -levelDv : levelDv;
        playerInfo = new PlayerInfo(
                EntityAddress,
                Pawn,
                teamId,
                memoryTool.readInt(EntityAddress + 0x7C8, 4),
                memoryTool.readInt(EntityAddress + 0x7CC, 4),
                memoryTool.readInt(EntityAddress + 0x7C4, 4) != 0,
                LocalPlayerController == Pawn,
                memoryTool.readInt(LocalPlayerController + 0x3bf, 4) != teamId,
                memoryTool.readFloat(Pawn + 0xCD8 + 0x4, 8),
                memoryTool.readFloat(Pawn + 0xCD8, 8),
                playerZ,
                90 - memoryTool.readFloat(Pawn + 0x1504, 8),
                levelDv < levelHeight);
    } else {
        float angle = memoryTool.readFloat(LocalPlayerController + 0x1504, 8) - 90;
        int teamId = memoryTool.readInt(EntityAddress + 0x3bf, 4);
        float pX = memoryTool.readFloat(Pawn + 0xCD8 + 0x4, 8);
        float pY = memoryTool.readFloat(Pawn + 0xCD8, 8);
        float newX = pX * (float) Math.cos(Math.toRadians(angle)) - pY * (float) Math.sin(Math.toRadians(angle));
        float newY = pX * (float) Math.sin(Math.toRadians(angle)) + pY * (float) Math.cos(Math.toRadians(angle));

        float playerZ = memoryTool.readFloat(Pawn + 0xCD8 + 0x8, 8);
        float levelDv = playerZ - localPlayerZ;
        levelDv = (levelDv < 0) ? -levelDv : levelDv;

        playerInfo = new PlayerInfo(
                EntityAddress,
                Pawn,
                teamId,
                memoryTool.readInt(EntityAddress + 0x7C8, 4),
                memoryTool.readInt(EntityAddress + 0x7CC, 4),
                memoryTool.readInt(EntityAddress + 0x7C4, 4) != 0,
                LocalPlayerController == Pawn,
                memoryTool.readInt(LocalPlayerController + 0x3bf, 4) != teamId,
                newX,
                newY,
                playerZ,
                90 - memoryTool.readFloat(Pawn + 0x1504, 8) + angle,
                levelDv < levelHeight);
    }
}
blueeorx1 commented 1 year ago

@xCorteX @MoZiHao I've replaced your file with mine now when i run java -jar cs2dma-1.0.jar nothing happen

xCorteX commented 1 year ago

dont repleace it, edit only the offsets

            memoryTool.readInt(EntityAddress + 0x7C8, 4),
            memoryTool.readInt(EntityAddress + 0x7CC, 4),
            memoryTool.readInt(EntityAddress + 0x7C4, 4) != 0,
rabume commented 1 year ago

@blueeorx1

I updated the offsets in my fork. Should work for you too: https://github.com/rabume/cs2-dma-radar/blob/main/app/src/main/java/cs2/dma/main/PlayerAddressUpdateThread.java

xCorteX commented 1 year ago

Thanks for the update

can you tell me what the 0x4 in float angle = memoryTool.readFloat(LocalPlayerController + 0x14F8 + 0x4, 8) is?

rabume commented 1 year ago

To be honest, I don't know. I noticed that before the update, the offset for 'm_angEyeAngles' was '0x1500', but in the codebase, '0x1504' was used. I also observed that on certain other offsets, '0x4' was added. So, I decided to try it with the new 'm_angEyeAngles' offset, and it worked! 😄

Previously, the offset was simply added to each other beforehand. In this case, it would be '14FC'. ( 0x14F8 + 0x4)