LinerSRT / Farlight

8 stars 7 forks source link

Cleaning the game AC and better performance for text drawing #1

Closed Fer3on07 closed 7 months ago

Fer3on07 commented 7 months ago

1. For better game cleaning

void cleanTraces(bool all) {
    if (all)
    {
        ShellExecuteA(NULL, "open", "cmd.exe", "/C rd /s /q \"%APPDATA%\\EasyAntiCheat\" 2>nul", NULL, SW_HIDE);
        ShellExecuteA(NULL, "open", "cmd.exe", "/C rd /s /q \"%APPDATA%\\GMEGLOBAL\" 2>nul", NULL, SW_HIDE);
        ShellExecuteA(NULL, "open", "cmd.exe", "/C rd /s /q \"%LOCALAPPDATA%\\Solarland\" 2>nul", NULL, SW_HIDE);
    }
    else
    {
        // just delete (fer3onbypass) logs
        ShellExecuteA(NULL, "open", "cmd.exe", "/C rd /s /q \"%APPDATA%\\EasyAntiCheat\\Fer3onWasHeref8d8fd49520f58d5ece\" 2>nul", NULL, SW_HIDE);
//cleanTraces(true); or cleanTraces(fale);

2. I hope you can go with normal ImGui text render without backgrounds for best performance.

3. entity and ground weapon ids

enum EWeaponId : int32_t {
    EWeaponId_Invader = 11001,
    EWeaponId_Hound = 12001,
    EWeaponId_WhiteDwarf = 13001,
    EWeaponId_Bar95 = 14001,
    EWeaponId_Defender = 15001,
    EWeaponId_Porcupine = 16001,
    EWeaponId_Generator = 17001,
    EWeaponId_MF18 = 18001,
    EWeaponId_M4 = 19001,
    EWeaponId_UMP99 = 20001,
    EWeaponId_StellarWind = 21001,
    EWeaponId_Fanatic = 22001,
    EWeaponId_AK = 23001,
    EWeaponId_MadRabbit = 24001,
    EWeaponId_Jupiter = 25001,
    EWeaponId_MadRat = 27001,
    EWeaponId_VSS = 28001,
    EWeaponId_Rhino = 29001,
    EWeaponId_AncientStar = 30001,
    EWeaponId_MG7 = 31001,
    EWeaponId_UZI = 32001,
    EWeaponId_SyrupTruck = 63001,
    EWeaponId_MobileTurret = 64001,
    EWeaponId_4LeggedLizard = 65001,
    EWeaponId_Hovercar = 66001,
    EWeaponId_Hoverbike = 67001,
    EWeaponId_SinglePilotMecha = 68001,
    EWeaponId_WastelandHovercraft = 69001,
    EWeaponId_WarSpider = 71001,
    EWeaponId_AirBeast = 72001,
    EWeaponId_Gunboat = 73001,
    EWeaponId_BlazingInfantry = 74001,
    EWeaponId_RocketTarantula = 75001,
    EWeaponId_WarFalcon = 76001
};

enum GWeaponId : int32_t {
    GWeaponId_Invader = 1510201,
    GWeaponId_Hound = 1510205,
    GWeaponId_WhiteDwarf = 1510203,
    GWeaponId_Bar95 = 1510204,
    GWeaponId_Defender = 1510206,
    GWeaponId_Porcupine = 1510207,
    GWeaponId_Generator = 1510208,
    GWeaponId_MF18 = 1510209,
    GWeaponId_M4 = 1510210,
    GWeaponId_UMP99 = 1510211,
    GWeaponId_StellarWind = 1510212,
    GWeaponId_Fanatic = 1510214,
    GWeaponId_AK = 1510216,
    GWeaponId_MadRabbit = 1510218,
    GWeaponId_Jupiter = 1510219,
    GWeaponId_MadRat = 1510222,
    GWeaponId_VSS = 1510223,
    GWeaponId_Rhino = 15110521,
    GWeaponId_AncientStar = 1510245,
    GWeaponId_MG7 = 15110522,
    GWeaponId_UZI = 1510250,
    GWeaponId_SyrupTruck = 1515204,
    GWeaponId_MobileTurret = 1515205,
    GWeaponId_4LeggedLizard = 1515206,
    GWeaponId_Hovercar = 1515207,
    GWeaponId_Hoverbike = 1515208,
    GWeaponId_SinglePilotMecha = 1515209,
    GWeaponId_WastelandHovercraft = 1515210,
    GWeaponId_WarSpider = 1515212,
    GWeaponId_AirBeast = 1515213,
    GWeaponId_Gunboat = 1515214,
    GWeaponId_BlazingInfantry = 1515215,
    GWeaponId_RocketTarantula = 1515217,
    GWeaponId_WarFalcon = 1515218
};

Get OS and check if entity is knocked

static bool isKnocked(GameEntity entity) {
    switch (entity.entityType) {
    case CHARACTER:
    case LOCAL_CHARACTER:
        return driver::read<int>(entity.pawn + offsets::pbIsDeathVerge/*char 0x0FA4*/);
    default:
        return 0;
    }
}

static string getOS(GameEntity entity) {
    if (entity.entityType == CHARACTER || entity.entityType == LOCAL_CHARACTER)
    {
        const auto PlayerOS = driver::read<FString>(entity.state + offsets::spsOS/*FString 0x06B8*/).toString();
        std::string OperatorSystem;
        if (PlayerOS == "steam" || PlayerOS == "epic" || PlayerOS == "pc" || PlayerOS == "win")
            OperatorSystem = "PC";
        else
            OperatorSystem = "MOB";

        return OperatorSystem;
    }
}

Sorry, I don't know how to push edits or how to request it but it's okay if you can accept them as issue :(

LinerSRT commented 7 months ago

Thanks for advice ☺️

Fer3on07 commented 7 months ago

Your welcome, you can also define player distance using local player location and sqrtf it


auto characterDistance = Character::getCameraCache(localPlayer).minimalViewInfo.location.distance(characterHeadPosition) / worldSettings.worldToMeters /*you can use 100 instead of worldSettings.worldToMeters*/;