不转换为m_iItemDefinitionIndex的WeaponID

时间:2019-05-14 12:31:35

标签: c#

伙计们,我正在编写游戏作弊程序,因为获取武器ID的方法已经过时,所以我无法将其转换为新方法,因此我遇到了很多错误,并且在使它起作用后,我的作弊程序被检测到了,所以我的实际代码: 使用命名空间std;

enum CSGO_Weapon_ID
{
    weapon_none,
    weapon_deagle,
    weapon_elite,
    weapon_fiveseven,
    weapon_glock,
    weapon_p228,
    weapon_usp,
    weapon_ak47,
    weapon_aug,
    weapon_awp,
    weapon_famas,
    weapon_g3sg1,
    weapon_galil,
    weapon_galilar,
    weapon_m249,
    weapon_m3,
    weapon_m4a1,
    weapon_mac10,
    weapon_mp5navy,
    weapon_p90,
    weapon_scout,
    weapon_sg550,
    weapon_sg552,
    weapon_tmp,
    weapon_ump45,
    weapon_xm1014,
    weapon_bizon,
    weapon_mag7,
    weapon_negev,
    weapon_sawedoff,
    weapon_tec9,
    weapon_taser,
    weapon_hkp2000,
    weapon_mp7,
    weapon_mp9,
    weapon_nova,
    weapon_p250,
    weapon_scar17,
    weapon_scar20,
    weapon_sg556,
    weapon_ssg08,
    weapon_knifegg,
    weapon_knife,
    weapon_flashbang,
    weapon_hegrenade,
    weapon_smokegrenade,
    weapon_molotov,
    weapon_decoy,
    weapon_incgrenade,
    weapon_c4
};

string weaponClass;


DWORD GetEntityForWeaponId(int mIndex)
{
    DWORD dwEntity;
    ReadProcessMemory(hProcess, clientBase + entityList + ((mIndex-1) * 0x10), &dwEntity, sizeof(dwEntity), 0);
    return dwEntity;
}

void GetWeaponClass(int weaponId)
{
    if(weaponId == weapon_deagle || weaponId == weapon_elite || weaponId == weapon_fiveseven || weaponId == weapon_glock
                                || weaponId == weapon_p228 || weaponId == weapon_usp || weaponId == weapon_tec9
                                || weaponId == weapon_taser || weaponId == weapon_hkp2000 || weaponId == weapon_p250)
    {
        weaponClass = "pistol";
    }
    else if(weaponId == weapon_ak47 || weaponId == weapon_aug || weaponId == weapon_famas || weaponId == weapon_sg556
                                     || weaponId == weapon_galil || weaponId == weapon_galilar || weaponId == weapon_m249
                                      || weaponId == weapon_m3 || weaponId == weapon_m4a1 || weaponId == weapon_mac10
                                       || weaponId == weapon_mp5navy || weaponId == weapon_p90 || weaponId == weapon_sg550
                                        || weaponId == weapon_sg552 || weaponId == weapon_tmp || weaponId == weapon_ump45
                                         || weaponId == weapon_bizon || weaponId == weapon_negev || weaponId == weapon_mp7
                                          || weaponId == weapon_mp9)
    {
        weaponClass = "rifle";
    }
    else if(weaponId == weapon_awp || weaponId == weapon_scout || weaponId == weapon_ssg08)
    {
        weaponClass = "sniper";
    }
    else if(weaponId == weapon_scar17 || weaponId == weapon_scar20 || weaponId == weapon_g3sg1)
    {
        weaponClass = "autosniper";
    }
    else if(weaponId == weapon_xm1014 || weaponId == weapon_mag7 || weaponId == weapon_sawedoff || weaponId == weapon_nova)
    {
        weaponClass = "shotgun";
    }

    else if(weaponId == weapon_knifegg || weaponId == weapon_knife || weaponId == weapon_flashbang || weaponId == weapon_hegrenade
                                         || weaponId == weapon_smokegrenade || weaponId == weapon_molotov || weaponId == weapon_decoy
                                          || weaponId == weapon_incgrenade || weaponId == weapon_c4)
    {
        weaponClass = "none";
    }
}

void GetWeaponId()
{
    DWORD local;
    ReadProcessMemory(hProcess, clientBase + localPlayer, &local, sizeof(local), 0);

    DWORD hActiveWeapon;
    ReadProcessMemory(hProcess, (LPVOID)(local + activeWeapon), &hActiveWeapon, sizeof(hActiveWeapon), 0);
    int mIndex = hActiveWeapon & 0xFFF;
    ReadProcessMemory(hProcess, (LPVOID)(GetEntityForWeaponId(mIndex) + weaponOffset), &weaponId, sizeof(weaponId), 0);

    if(weaponId == lastWeaponId)
    {
        changedWeapon = false;
    }
    else
    {
        lastWeaponId = weaponId;
        changedWeapon = true;
        cout << weaponId << flush << endl << endl;
        GetWeaponClass(weaponId);
        cout << GetWeaponClass(weaponId) << flush << endl << endl;
    }
}

,我需要转换成类似的内容:

int nWeaponIndex = Game.ReadMemory<int>(dwWeaponEntity + m_AttributeManager + m_Item + m_iItemDefinitionIndex);



   enum ItemDefinitionIndex
{
    ITEM_NONE = 0,
    WEAPON_DEAGLE = 1
    WEAPON_ELITE = 2
    WEAPON_FIVESEVEN = 3
    WEAPON_GLOCK = 4
    WEAPON_AK47 = 7
    WEAPON_AUG = 8
    WEAPON_AWP = 9
    WEAPON_FAMAS = 10
    WEAPON_G3SG1 = 11
    WEAPON_GALILAR = 13
    WEAPON_M249 = 14
    WEAPON_M4A1 = 16
    WEAPON_MAC10 = 17
    WEAPON_P90 = 19
    WEAPON_MP5SD = 23
    WEAPON_UMP45 = 24
    WEAPON_XM1014 = 25
    WEAPON_BIZON = 26
    WEAPON_MAG7 = 27
    WEAPON_NEGEV = 28
    WEAPON_SAWEDOFF = 29
    WEAPON_TEC9 = 30
    WEAPON_TASER = 31
    WEAPON_HKP2000 = 32
    WEAPON_MP7 = 33
    WEAPON_MP9 = 34
    WEAPON_NOVA = 35
    WEAPON_P250 = 36
    WEAPON_SHIELD = 37
    WEAPON_SCAR20 = 38
    WEAPON_SG556 = 39
    WEAPON_SSG08 = 40
    WEAPON_KNIFEGG = 41
    WEAPON_KNIFE = 42
    WEAPON_FLASHBANG = 43
    WEAPON_HEGRENADE = 44
    WEAPON_SMOKEGRENADE = 45
    WEAPON_MOLOTOV = 46
    WEAPON_DECOY = 47
    WEAPON_INCGRENADE = 48
    WEAPON_C4 = 49
    WEAPON_HEALTHSHOT = 57
    WEAPON_KNIFE_T = 59
    WEAPON_M4A1_SILENCER = 60
    WEAPON_USP_SILENCER = 61
    WEAPON_CZ75A = 63
    WEAPON_REVOLVER = 64
    WEAPON_TAGRENADE = 68
    WEAPON_FISTS = 69
    WEAPON_BREACHCHARGE = 70
    WEAPON_TABLET = 72
    WEAPON_MELEE = 74
    WEAPON_AXE = 75
    WEAPON_HAMMER = 76
    WEAPON_SPANNER = 78
    WEAPON_KNIFE_GHOST = 80
    WEAPON_FIREBOMB = 81
    WEAPON_DIVERSION = 82
    WEAPON_FRAG_GRENADE = 83
    WEAPON_SNOWBALL = 84
    WEAPON_BUMPMINE = 85
    WEAPON_BAYONET = 500
    WEAPON_KNIFE_FLIP = 505
    WEAPON_KNIFE_GUT = 506
    WEAPON_KNIFE_KARAMBIT = 507
    WEAPON_KNIFE_M9_BAYONET = 508
    WEAPON_KNIFE_TACTICAL = 509
    WEAPON_KNIFE_FALCHION = 512
    WEAPON_KNIFE_SURVIVAL_BOWIE = 514
    WEAPON_KNIFE_BUTTERFLY = 515
    WEAPON_KNIFE_PUSH = 516
    WEAPON_KNIFE_URSUS = 519
    WEAPON_KNIFE_GYPSY_JACKKNIFE = 520
    WEAPON_KNIFE_STILETTO = 522
    WEAPON_KNIFE_WIDOWMAKER = 523
    STUDDED_BLOODHOUND_GLOVES = 5027
    T_GLOVES = 5028
    CT_GLOVES = 5029
    SPORTY_GLOVES = 5030
    SLICK_GLOVES = 5031
    LEATHER_HANDWRAPS = 5032
    MOTORCYCLE_GLOVES = 5033
    SPECIALIST_GLOVES = 5034
    STUDDED_HYDRA_GLOVES = 5035
};

there are more details on another forum

我有点想喂汤,但我只花了几天时间,总是禁止或出错,所以我只需要有人来展示如何正确地做到这一点:)

我的整个代码Pastebin:whole code pastebin

最好的问候,B3liar:)

0 个答案:

没有答案