diff --git a/App.config b/App.config new file mode 100644 index 0000000..c6b6e74 --- /dev/null +++ b/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Config/Offsets.cs b/Config/Offsets.cs new file mode 100644 index 0000000..c588d77 --- /dev/null +++ b/Config/Offsets.cs @@ -0,0 +1,1398 @@ +namespace GTAVCSMM.Config +{ + class Offsets + { + #region World Offsets + // World Offsets + private int _ReadValuePointer = 3; + private int _ReadValuePointer2 = 6; + private int _MovePointer = 7; + private int _MovePointer2 = 10; + private int _MovePointer3 = 0x89; + + public int ReadValuePointer + { + get + { + return _ReadValuePointer; + } + } + + public int ReadValuePointer2 + { + get + { + return _ReadValuePointer2; + } + } + + public int MovePointer + { + get + { + return _MovePointer; + } + } + + public int MovePointer2 + { + get + { + return _MovePointer2; + } + } + + public int MovePointer3 + { + get + { + return _MovePointer3; + } + } + #endregion + + #region CNetworkPlayerMgr + // CNetworkPlayerMgr + private int _pCNetPlayerInfo = 0xA0; + private int _pCNetPed = 0x1E8; + private int _oNumPlayers = 0x180; + private int _oRid = 0x090; + + public int pCNetPlayerInfo + { + get + { + return _pCNetPlayerInfo; + } + } + + public int pCNetPed + { + get + { + return _pCNetPed; + } + } + + public int oNumPlayers + { + get + { + return _oNumPlayers; + } + } + + public int oRid + { + get + { + return _oRid; + } + } + #endregion + + #region AutoConnect + // Landing Page Offsets for AutoConnect function / story mode. + private int _oStartupFlow = 0x2B0; + private int _oGTAOnline = 0xF0; + + public int oStartupFlow + { + get + { + return _oStartupFlow; + } + } + + public int oGTAOnline + { + get + { + return _oGTAOnline; + } + } + #endregion + + #region CPedFactory + // CPedFactory (WorldPTR) + private int _pCPed = 0x08; + + public int pCPed + { + get + { + return _pCPed; + } + } + #endregion + + #region CPed Offsets + // CPed Offsets + private int _oEntityType = 0x2B; // int 156:Player 152:Other + private int _pCNavigation = 0x30; + private int _oVisualX = 0x90; + private int _oVisualY = 0x94; + private int _oVisualZ = 0x98; // float, vector3 + private int _oGod = 0x189; // int8 0:false 1:true + private int _oHostility = 0x18C; + private int _oHealth = 0x280; // float + private int _oHealthMax = 0x2A0; + private int _pAttackers = 0x2A8; + private int _pCVehicle = 0xD30; + private int _oRagdoll = 0x10B8; // int 32:false 1/0:true + private int _pCPlayerInfo = 0x10C8; + private int _pCPedWeaponManager = 0x10D8; + private int _oSeatbelt = 0x145C; // byte 55:false 56:true + private int _oInVehicle = 0x1618; // int 16:false 0:true (perhaps 0xE52) + private int _pedArmor = 0x1530; // not working what + + public int oEntityType + { + get + { + return _oEntityType; + } + } + + public int pCNavigation + { + get + { + return _pCNavigation; + } + } + + public int oVisualX + { + get + { + return _oVisualX; + } + } + + public int oVisualY + { + get + { + return _oVisualY; + } + } + + public int oVisualZ + { + get + { + return _oVisualZ; + } + } + + public int oGod + { + get + { + return _oGod; + } + } + + public int oHostility + { + get + { + return _oHostility; + } + } + + public int oHealth + { + get + { + return _oHealth; + } + } + + public int oHealthMax + { + get + { + return _oHealthMax; + } + } + + public int pAttackers + { + get + { + return _pAttackers; + } + } + + public int pCVehicle + { + get + { + return _pCVehicle; + } + } + + public int oRagdoll + { + get + { + return _oRagdoll; + } + } + + public int pCPlayerInfo + { + get + { + return _pCPlayerInfo; + } + } + + public int pCPedWeaponManager + { + get + { + return _pCPedWeaponManager; + } + } + + public int oSeatbelt + { + get + { + return _oSeatbelt; + } + } + + public int oInVehicle + { + get + { + return _oInVehicle; + } + } + + public int pedArmor + { + get + { + return _pedArmor; + } + } + #endregion + + #region CNavigation Offsets + // CNavigation Offsets + private int _oHeading = 0x20; // float + private int _oHeading2 = 0x24; + private int _oRotation = 0x30; + private int _oRotation2 = 0x34; + private int _oRotation3 = 0x38; // float, vector3 + private int _oPositionX = 0x50; + private int _oPositionY = 0x54; + private int _oPositionZ = 0x58; + + public int oHeading + { + get + { + return _oHeading; + } + } + + public int oHeading2 + { + get + { + return _oHeading2; + } + } + + public int oRotation + { + get + { + return _oRotation; + } + } + + public int oRotation2 + { + get + { + return _oRotation2; + } + } + + public int oRotation3 + { + get + { + return _oRotation3; + } + } + + public int oPositionX + { + get + { + return _oPositionX; + } + } + + public int oPositionY + { + get + { + return _oPositionY; + } + } + + public int oPositionZ + { + get + { + return _oPositionZ; + } + } + #endregion + + #region CPlayerInfo Offsets + // CPlayerInfo Offsets + private int _oName = 0xA4; // string[20] + private int _oSwimSpeed = 0x170; // float + private int _oFrameFlags = 0x219; + private int _oWalkSpeed = 0x18C; + private int _oWanted = 0x888; // int8 + private int _oRunSpeed = 0xCF0; // float + private int _oStamina = 0xCF4; + private int _oStaminaRegen = 0xCF8; + + public int oName + { + get + { + return _oName; + } + } + + public int oSwimSpeed + { + get + { + return _oSwimSpeed; + } + } + + public int oFrameFlags + { + get + { + return _oFrameFlags; + } + } + + public int oWalkSpeed + { + get + { + return _oWalkSpeed; + } + } + + public int oWanted + { + get + { + return _oWanted; + } + } + + public int oRunSpeed + { + get + { + return _oRunSpeed; + } + } + + public int oStamina + { + get + { + return _oStamina; + } + } + + public int oStaminaRegen + { + get + { + return _oStaminaRegen; + } + } + #endregion + + #region CPedWeaponManager Offsets + // CPedWeaponManager Offsets + private int _pCWeaponInfo = 0x20; + private int _oImpactType = 0x20; // int 3:bullet 5:explosion + private int _oImpactExplosion = 0x24; // int32 + private int _oImpactType2 = 0x54; // int + private int _pCAmmoInfo = 0x60; + private int _pCVehicleWeapon = 0x70; + private int _oSpread = 0x7C; // float + private int _oDamage = 0xB0; + private int _oForce = 0xD8; + private int _oForcePed = 0xDC; + private int _oForceVehicle = 0xE0; + private int _oForceFlying = 0xE4; + private int _oPenetration = 0x110; + private int _oMuzzleVelocity = 0x11C; + private int _oBulletBatch = 0x124; + private int _oReloadVehicleMult = 0x130; + private int _oReloadMult = 0x134; + private int _oShotTime = 0x13C; + private int _oLockRange = 0x288; + private int _oRange = 0x28C; + private int _pCAmmoWrap = 0x8; + private int _oMaxAmmo = 0x28; + private int _pCAmmo = 0x0; + private int _oCurrentAmmo = 0x18; + public int pCWeaponInfo + { + get + { + return _pCWeaponInfo; + } + } + public int oImpactType + { + get + { + return _oImpactType; + } + } + public int oImpactExplosion + { + get + { + return _oImpactExplosion; + } + } + public int oImpactType2 + { + get + { + return _oImpactType2; + } + } + public int pCAmmoInfo + { + get + { + return _pCAmmoInfo; + } + } + public int pCVehicleWeapon + { + get + { + return _pCVehicleWeapon; + } + } + public int oSpread + { + get + { + return _oSpread; + } + } + public int oDamage + { + get + { + return _oDamage; + } + } + public int oForce + { + get + { + return _oForce; + } + } + public int oForcePed + { + get + { + return _oForcePed; + } + } + public int oForceVehicle + { + get + { + return _oForceVehicle; + } + } + public int oForceFlying + { + get + { + return _oForceFlying; + } + } + public int oPenetration + { + get + { + return _oPenetration; + } + } + public int oMuzzleVelocity + { + get + { + return _oMuzzleVelocity; + } + } + public int oBulletBatch + { + get + { + return _oBulletBatch; + } + } + public int oReloadVehicleMult + { + get + { + return _oReloadVehicleMult; + } + } + public int oReloadMult + { + get + { + return _oReloadMult; + } + } + public int oShotTime + { + get + { + return _oShotTime; + } + } + public int oLockRange + { + get + { + return _oLockRange; + } + } + public int oRange + { + get + { + return _oRange; + } + } + public int pCAmmoWrap + { + get + { + return _pCAmmoWrap; + } + } + public int oMaxAmmo + { + get + { + return _oMaxAmmo; + } + } + public int pCAmmo + { + get + { + return _pCAmmo; + } + } + public int oCurrentAmmo + { + get + { + return oCurrentAmmo; + } + } + #endregion + + #region CVehicle Offsets + // CVehicle Offsets + private int _pCModelInfo = 0x20; + private int _oVInvisibility = 0x2C; // int + private int _pCVehicleDrawHandler = 0x48; + private int _oVPositionX = 0x90; + private int _oVPositionY = 0x94; + private int _oVPositionZ = 0x98; // float, vector3 + private int _oVState = 0xD8; // int 0:Player 1:NPC 2:Unused 3:Destroyed + private int _oVBurnt = 0x18A; // int 64:off 72:on + private int _oVHealth = 0x280; // float + private int _oVHealthMax = 0x2A0; + private int _oVBoostSpeed = 0x120; + private int _oVBoost = 0x320; + private int _oVBoostRecharge = 0x324; + private int _oVHealth2 = 0x840; + private int _oVHealth3 = 0x844; // used + private int _oVEngineHealth = 0x908; // used + private int _pCHandlingData = 0x938; + private int _oVDirt = 0x9F8; // float + private int _oBulletproofTires = 0x943; // int + private int _oLightMult = 0xA14; // float + private int _oVGravity = 0xC5C; // float + private int _oCurPassenger = 0xC62; + private int _oMk2Missiles = 0x12A4; // int + private int _oAircraftBomb = 0x12B4; + private int _oCountermeasures = 0x12B8; + public int pCModelInfo + { + get + { + return _pCModelInfo; + } + } + public int oVInvisibility + { + get + { + return _oVInvisibility; + } + } + public int pCVehicleDrawHandler + { + get + { + return _pCVehicleDrawHandler; + } + } + public int oVPositionX + { + get + { + return _oVPositionX; + } + } + public int oVPositionY + { + get + { + return _oVPositionY; + } + } + public int oVPositionZ + { + get + { + return _oVPositionZ; + } + } + public int oVState + { + get + { + return _oVState; + } + } + public int oVBurnt + { + get + { + return _oVBurnt; + } + } + public int oVHealth + { + get + { + return _oVHealth; + } + } + public int oVHealthMax + { + get + { + return _oVHealthMax; + } + } + public int oVBoostSpeed + { + get + { + return _oVBoostSpeed; + } + } + public int oVBoost + { + get + { + return _oVBoost; + } + } + public int oVBoostRecharge + { + get + { + return _oVBoostRecharge; + } + } + public int oVHealth2 + { + get + { + return _oVHealth2; + } + } + public int oVHealth3 + { + get + { + return _oVHealth3; + } + } + public int oVEngineHealth + { + get + { + return _oVEngineHealth; + } + } + public int pCHandlingData + { + get + { + return _pCHandlingData; + } + } + public int oVDirt + { + get + { + return _oVDirt; + } + } + public int oBulletproofTires + { + get + { + return _oBulletproofTires; + } + } + public int oLightMult + { + get + { + return _oLightMult; + } + } + public int oVGravity + { + get + { + return _oVGravity; + } + } + public int oCurPassenger + { + get + { + return _oCurPassenger; + } + } + public int oMk2Missiles + { + get + { + return _oMk2Missiles; + } + } + public int oAircraftBomb + { + get + { + return _oAircraftBomb; + } + } + public int oCountermeasures + { + get + { + return _oCountermeasures; + } + } + #endregion + + #region CHandlingData Offsets + // CHandlingData Offsets + private int _oMass = 0xC; // float + private int _oBouyancy = 0x40; // float + private int _oAcceleration = 0x4C; + private int _oDriveInertia = 0x54; + private int _oInitialDriveForce = 0x60; + private int _oBrakeForce = 0x6C; + private int _oHandbrakeForce = 0x7C; + private int _oTractionCurveMax = 0x88; + private int _oTractionCurveMin = 0x90; + private int _oCollisionMult = 0xF0; + private int _oWeaponMult = 0xF4; + private int _oDeformationMult = 0xF8; + private int _oEngineMult = 0xFC; + private int _oThrust = 0x338; + public int oMass + { + get + { + return _oMass; + } + } + public int oBouyancy + { + get + { + return _oBouyancy; + } + } + public int oAcceleration + { + get + { + return _oAcceleration; + } + } + public int oDriveInertia + { + get + { + return _oDriveInertia; + } + } + public int oInitialDriveForce + { + get + { + return _oInitialDriveForce; + } + } + public int oBrakeForce + { + get + { + return _oBrakeForce; + } + } + public int oHandbrakeForce + { + get + { + return _oHandbrakeForce; + } + } + public int oTractionCurveMax + { + get + { + return _oTractionCurveMax; + } + } + public int oTractionCurveMin + { + get + { + return _oTractionCurveMin; + } + } + public int oCollisionMult + { + get + { + return _oCollisionMult; + } + } + public int oWeaponMult + { + get + { + return _oWeaponMult; + } + } + public int oDeformationMult + { + get + { + return _oDeformationMult; + } + } + public int oEngineMult + { + get + { + return _oEngineMult; + } + } + public int oThrust + { + get + { + return _oThrust; + } + } + #endregion + + #region CVehicleDrawHandler Offsets + // CVehicleDrawHandler Offsets + private int _pCVehicleVisual = 0x20; + private int _oNeonR = 0x3A2; // int + private int _oNeonG = 0x3A1; + private int _oNeonB = 0x3A0; + private int _oNeonLeft = 0x402; + private int _oNeonRight = 0x403; + private int _oNeonFront = 0x404; + private int _oNeonBack = 0x405; + private int _oEMS = 0x3D6; + private int _oBrakes = 0x3D7; + private int _oTransmission = 0x3D8; + private int _oHorn = 0x3D9; + private int _oSuspension = 0x3DA; + private int _oArmor = 0x3DB; + private int _oTurbo = 0x3DD; + private int _oXenonLight = 0x3E1; + private int _oSmokeR = 0x3FC; + private int _oSmokeG = 0x3FD; + private int _oSmokeB = 0x3FE; + private int _oWindows = 0x3FF; + private int _oColorLight = 0x406; + public int pCVehicleVisual + { + get + { + return _pCVehicleVisual; + } + } + public int oNeonR + { + get + { + return _oNeonR; + } + } + public int oNeonG + { + get + { + return _oNeonG; + } + } + public int oNeonB + { + get + { + return _oNeonB; + } + } + public int oNeonLeft + { + get + { + return _oNeonLeft; + } + } + public int oNeonRight + { + get + { + return _oNeonRight; + } + } + public int oNeonFront + { + get + { + return _oNeonFront; + } + } + public int oNeonBack + { + get + { + return _oNeonBack; + } + } + public int oEMS + { + get + { + return _oEMS; + } + } + public int oBrakes + { + get + { + return _oBrakes; + } + } + public int oTransmission + { + get + { + return _oTransmission; + } + } + public int oHorn + { + get + { + return _oHorn; + } + } + public int oSuspension + { + get + { + return _oSuspension; + } + } + public int oArmor + { + get + { + return _oArmor; + } + } + public int oTurbo + { + get + { + return _oTurbo; + } + } + public int oXenonLight + { + get + { + return _oXenonLight; + } + } + public int oSmokeR + { + get + { + return _oSmokeR; + } + } + public int oSmokeG + { + get + { + return _oSmokeG; + } + } + public int oSmokeB + { + get + { + return _oSmokeB; + } + } + public int oWindows + { + get + { + return _oWindows; + } + } + public int oColorLight + { + get + { + return _oColorLight; + } + } + #endregion + + #region CVehicleVisual + // CVehicleVisual + private int _oPrimaryR = 0xA6; // int + private int _oPrimaryG = 0xA5; + private int _oPrimaryB = 0xA4; + private int _oSecondaryR = 0xAA; + private int _oSecondaryG = 0xA9; + private int _oSecondaryB = 0xA8; + private int _oLicensePlate = 0x130; // dword / byte array[8] + public int oPrimaryR + { + get + { + return _oPrimaryR; + } + } + public int oPrimaryG + { + get + { + return _oPrimaryG; + } + } + public int oPrimaryB + { + get + { + return _oPrimaryB; + } + } + public int oSecondaryR + { + get + { + return _oSecondaryR; + } + } + public int oSecondaryG + { + get + { + return _oSecondaryR; + } + } + public int oSecondaryB + { + get + { + return _oSecondaryB; + } + } + public int oLicensePlate + { + get + { + return _oLicensePlate; + } + } + #endregion + + #region CModelInfo + // CModelInfo + private int _oModelHash = 0x18; // int + private int _oCamDist = 0x38; // float + private int _oVName = 0x298; // string[10] + private int _oVMaker = 0x2A4; // string[10] + private int _oVExtras = 0x58B; // short + private int _oVParachute = 0x58C; + public int oModelHash + { + get + { + return _oModelHash; + } + } + public int oCamDist + { + get + { + return _oCamDist; + } + } + public int oVName + { + get + { + return _oVName; + } + } + public int oVMaker + { + get + { + return _oVMaker; + } + } + public int oVExtras + { + get + { + return _oVExtras; + } + } + public int oVParachute + { + get + { + return _oVParachute; + } + } + #endregion + + #region CReplayInterface Offsets + // CReplayInterface Offsets and more below + private int _pCPedInterface = 0x18; + private int _pVehList = 0x180; + private int _oVehNum = 0x190; + private int _pPedList = 0x100; + private int _oPedNum = 0x110; + public int pCPedInterface + { + get + { + return _pCPedInterface; + } + } + public int pVehList + { + get + { + return _pVehList; + } + } + public int oVehNum + { + get + { + return _oVehNum; + } + } + public int pPedList + { + get + { + return _pPedList; + } + } + public int oPedNum + { + get + { + return _oPedNum; + } + } + #endregion + + #region CPickupData/CReplayInterface Offsets + // CPickupData/CReplayInterface Offsets from DMKiller + private int _pBST = 0x160; + private int _pFixVeh = 0x228; + private int _pPickupList = 0x100; + private int _oPickupNum = 0x110; + private int _pDroppedPickupData = 0x490; + private int _pCPickupInterface = 0x20; + public int pBST + { + get + { + return _pBST; + } + } + public int pFixVeh + { + get + { + return _pFixVeh; + } + } + public int pPickupList + { + get + { + return _pPickupList; + } + } + public int oPickupNum + { + get + { + return _oPickupNum; + } + } + public int pDroppedPickupData + { + get + { + return _pDroppedPickupData; + } + } + public int pCPickupInterface + { + get + { + return _pCPickupInterface; + } + } + #endregion + + #region Vehicle Menus Globals + // Vehicle Menus Globals + private int _oVMCreate = 2463533; // Create any vehicle. + private int _oVMYCar = 2544210; // Get my car. + private int _oVGETIn = 2409299; // Spawn into vehicle. + private int _oVMSlots = 1323703; // Get vehicle slots. + public int oVMCreate + { + get + { + return _oVMCreate; + } + } + public int oVMYCar + { + get + { + return _oVMYCar; + } + } + public int oVGETIn + { + get + { + return _oVGETIn; + } + } + public int oVMSlots + { + get + { + return _oVMSlots; + } + } + #endregion + + #region Some Player / Network times associated Globals + // Some Player / Network times associated Globals + private int _oPlayerGA = 2441237; + private int _oPlayerIDHelp = 2426865; + private int _oNETTimeHelp = 2441237; + public int oPlayerGA + { + get + { + return _oPlayerGA; + } + } + public int oPlayerIDHelp + { + get + { + return _oPlayerIDHelp; + } + } + public int oNETTimeHelp + { + get + { + return _oNETTimeHelp; + } + } + #endregion + } +} diff --git a/Config/Patterns.cs b/Config/Patterns.cs new file mode 100644 index 0000000..c390c88 --- /dev/null +++ b/Config/Patterns.cs @@ -0,0 +1,215 @@ +namespace GTAVCSMM.Config +{ + class Patterns + { + #region Global Patterns + private byte[] _globalptr = new byte[] { 0x4C, 0x8D, 0x05, 0x0, 0x0, 0x0, 0x0, 0x4D, 0x8B, 0x08, 0x4D, 0x85, 0xC9, 0x74, 0x11 }; + private string _globalptr_mask = "xxx????xxxxxxxx"; + + private byte[] _worldptr = new byte[] { 0x48, 0x8B, 0x05, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x48, 0x8B, 0x48, 0x08, 0x48, 0x85, 0xC9, 0x74, 0x07 }; + private string _worldptr_mask = "xxx????x????xxxxxxxxx"; + + private byte[] _blipptr = new byte[] { 0x4C, 0x8D, 0x05, 0x0, 0x0, 0x0, 0x0, 0x0F, 0xB7, 0xC1 }; + private string _blipptr_mask = "xxx????xxx"; + + private byte[] _replayinterfaceptr = new byte[] { 0x48, 0x8D, 0x0D, 0x0, 0x0, 0x0, 0x0, 0x48, 0x8B, 0xD7, 0xE8, 0x0, 0x0, 0x0, 0x0, 0x48, 0x8D, 0x0D, 0x0, 0x0, 0x0, 0x0, 0x8A, 0xD8, 0xE8 }; + private string _replayinterfaceptr_mask = "xxx????xxxx????xxx????xxx"; + + private byte[] _localscriptsptr = new byte[] { 0x48, 0x8B, 0x05, 0x0, 0x0, 0x0, 0x0, 0x8B, 0xCF, 0x48, 0x8B, 0x0C, 0xC8, 0x39, 0x59, 0x68 }; + private string _localscriptsptr_mask = "xxx????xxxxxxxxx"; + + private byte[] _playercountptr = new byte[] { 0x48, 0x8B, 0x0D, 0x0, 0x0, 0x0, 0x0, 0xE8, 0x0, 0x0, 0x0, 0x0, 0x48, 0x8B, 0xC8, 0xE8, 0x0, 0x0, 0x0, 0x0, 0x48, 0x8B, 0xCF }; + private string _playercountptr_mask = "xxx????x????xxxx????xxx"; + + private byte[] _pickupdataptr = new byte[] { 0x48, 0x8B, 0x05, 0x0, 0x0, 0x0, 0x0, 0x48, 0x8B, 0x1C, 0xF8, 0x8B }; + private string _pickupdataptr_mask = "xxx????xxxxx"; + + private byte[] _weatheraddr = new byte[] { 0x48, 0x83, 0xEC, 0x0, 0x8B, 0x05, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x3D, 0x0, 0x0, 0x0, 0x0, 0x49 }; + private string _weatheraddr_mask = "xxx?xx????xx????x"; + + private byte[] _settingsptr = new byte[] { 0x44, 0x39, 0x05, 0x0, 0x0, 0x0, 0x0, 0x75, 0x0D }; + private string _settingsptr_mask = "xxx????xx"; + + private byte[] _aimcpedptr = new byte[] { 0x48, 0x8B, 0x0D, 0x0, 0x0, 0x0, 0x0, 0x48, 0x85, 0xC9, 0x74, 0x0C, 0x48, 0x8D, 0x15, 0x0, 0x0, 0x0, 0x0, 0xE8, 0x0, 0x0, 0x0, 0x0, 0x48, 0x89, 0x1D }; + private string _aimcpedptr_mask = "xxx????xxxxxxxx????x????xxx"; + + private byte[] _friendlistptr = new byte[] { 0x48, 0x8B, 0x0D, 0x0, 0x0, 0x0, 0x0, 0x8B, 0xC6, 0x48, 0x8D, 0x5C, 0x24, 0x70 }; + private string _friendlistptr_mask = "xxx????xxxxxxx"; + + public byte[] GlobalPTR + { + get + { + return _globalptr; + } + } + public string GlobalPTR_Mask + { + get + { + return _globalptr_mask; + } + } + + public byte[] WorldPTR + { + get + { + return _worldptr; + } + } + + public string WorldPTR_Mask + { + get + { + return _worldptr_mask; + } + } + + public byte[] BlipPTR + { + get + { + return _blipptr; + } + } + + public string BlipPTR_Mask + { + get + { + return _blipptr_mask; + } + } + + public byte[] ReplayInterfacePTR + { + get + { + return _replayinterfaceptr; + } + } + + public string ReplayInterfacePTR_Mask + { + get + { + return _replayinterfaceptr_mask; + } + } + + public byte[] LocalScriptsPTR + { + get + { + return _localscriptsptr; + } + } + + public string LocalScriptsPTR_Mask + { + get + { + return _localscriptsptr_mask; + } + } + + public byte[] PlayerCountPTR + { + get + { + return _playercountptr; + } + } + + public string PlayerCountPTR_Mask + { + get + { + return _playercountptr_mask; + } + } + + public byte[] PickupDataPTR + { + get + { + return _pickupdataptr; + } + } + + public string PickupDataPTR_Mask + { + get + { + return _pickupdataptr_mask; + } + } + + public byte[] WeatherADDR + { + get + { + return _weatheraddr; + } + } + + public string WeatherADDR_Mask + { + get + { + return _weatheraddr_mask; + } + } + + public byte[] SettingsPTR + { + get + { + return _settingsptr; + } + } + + public string SettingsPTR_Mask + { + get + { + return _settingsptr_mask; + } + } + + public byte[] AimCPedPTR + { + get + { + return _aimcpedptr; + } + } + + public string AimCPedPTR_Mask + { + get + { + return _aimcpedptr_mask; + } + } + + public byte[] FriendlistPTR + { + get + { + return _friendlistptr; + } + } + + public string FriendlistPTR_Mask + { + get + { + return _friendlistptr_mask; + } + } + #endregion + } +} diff --git a/GTAVCSMM.csproj b/GTAVCSMM.csproj new file mode 100644 index 0000000..cdc75f9 --- /dev/null +++ b/GTAVCSMM.csproj @@ -0,0 +1,101 @@ + + + + + Debug + AnyCPU + {B727A908-C9EA-4CFA-8C2F-B209847607A4} + WinExe + GTAVCSMM + GTAVCSMM + v4.8 + 512 + true + true + + + + app.manifest + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + default + prompt + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + default + prompt + true + + + gtavcsmm.ico + + + + ..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll + + + + + + ..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Microsoft.CSharp.dll + + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + \ No newline at end of file diff --git a/GTAVCSMM.sln b/GTAVCSMM.sln new file mode 100644 index 0000000..cdba9fb --- /dev/null +++ b/GTAVCSMM.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GTAVCSMM", "GTAVCSMM.csproj", "{B727A908-C9EA-4CFA-8C2F-B209847607A4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Debug|Any CPU.ActiveCfg = Debug|x64 + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Debug|Any CPU.Build.0 = Debug|x64 + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Debug|x64.ActiveCfg = Debug|x64 + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Debug|x64.Build.0 = Debug|x64 + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Release|Any CPU.ActiveCfg = Release|x64 + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Release|x64.ActiveCfg = Release|x64 + {B727A908-C9EA-4CFA-8C2F-B209847607A4}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1A9868FA-81ED-4632-83D7-1937FB01B5BC} + EndGlobalSection +EndGlobal diff --git a/Helpers/JOAAT.cs b/Helpers/JOAAT.cs new file mode 100644 index 0000000..de6ba37 --- /dev/null +++ b/Helpers/JOAAT.cs @@ -0,0 +1,93 @@ +/// +/// Represents a class for generating hash keys compatible with the JOAAT hash algorithm. +/// +namespace GTAVCSMM.Helpers +{ + public class JOAAT + { + // copied directly from the game -- performs uppercase to lowercase conversions amongst other things + private static readonly byte[] m_LookupTable = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x5B, 0x2F, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, + }; + + private static uint GetHashKeySubString(string str, uint initialHash) + { + var hash = initialHash; + for (int i = 0; i < str.Length; i++) + { + hash += m_LookupTable[str[i]]; + hash += (hash << 10); + hash ^= (hash >> 6); + } + return hash; + } + + private static uint GetHashKeyFinalize(string str, uint initialHash) + { + var hash = GetHashKeySubString(str, initialHash); + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; + } + + /// + /// Gets the hash key of the specified string. + /// + /// The string used to generate a hash key. + /// A case-insensitive JOAAT hash key. + public static uint GetHashKey(string str) + { + return GetHashKey(str, 0); + } + + /// + /// Gets the hash key of the specified string, using an initial hash key value. + /// + /// The string used to generate a hash key. + /// The initial hash key value used to generate the result. + /// A case-insensitive JOAAT hash key. + public static uint GetHashKey(string str, uint initialHash) + { + return GetHashKeyFinalize(str, initialHash); + } + + /// + /// Gets the hash key of the specified string concatenated with an additional string. + /// + /// The string used to generate a hash key. + /// The additional string to concatenate to the input string. + /// A case-insensitive JOAAT hash key. + public static uint GetHashKey(string str, string concat) + { + return GetHashKey(str, concat, 0); + } + + /// + /// Gets the hash key of the specified string concatenated with an additional string, using an initial hash key value. + /// + /// The string used to generate a hash key. + /// The additional string to concatenate to the input string. + /// The initial hash key value used to generate the result. + /// A case-insensitive JOAAT hash key. + public static uint GetHashKey(string str, string concat, uint initialHash) + { + return GetHashKeyFinalize(concat, GetHashKeySubString(str, initialHash)); + } + } +} \ No newline at end of file diff --git a/Helpers/Key.cs b/Helpers/Key.cs new file mode 100644 index 0000000..d4e457b --- /dev/null +++ b/Helpers/Key.cs @@ -0,0 +1,45 @@ +using System; + +namespace GTAVCSMM.Helpers +{ + class Key + { + private string keyName; + private int keyId; + private bool keyDown; + + public Key(int keyId, string keyName) + { + this.keyId = keyId; + this.keyName = keyName; + } + + public string Name + { + get + { + return keyName; + } + } + + public int Id + { + get + { + return keyId; + } + } + + public bool IsKeyDown + { + get + { + return keyDown; + } + set + { + keyDown = value; + } + } + } +} diff --git a/Helpers/KeysMgr.cs b/Helpers/KeysMgr.cs new file mode 100644 index 0000000..b027cab --- /dev/null +++ b/Helpers/KeysMgr.cs @@ -0,0 +1,113 @@ +using System; +using System.Threading; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace GTAVCSMM.Helpers +{ + class KeysMgr + { + // Keys holder + private Dictionary keys; + + // Update thread + private Thread thread; + private int interval = 20; // ms + + // Keys events + public delegate void KeyHandler(int Id, string Name); + public event KeyHandler KeyUpEvent; + public event KeyHandler KeyDownEvent; + + // Key Up + protected void OnKeyUp(int Id, string Name) + { + if (KeyUpEvent != null) + { + KeyUpEvent(Id, Name); + } + } + + // Key Down + protected void OnKeyDown(int Id, string Name) + { + if (KeyDownEvent != null) + { + KeyDownEvent(Id, Name); + } + } + + // Init + public KeysMgr() + { + keys = new Dictionary(); + thread = new Thread(new ParameterizedThreadStart(Update)); + thread.Start(); + } + + // Add key + public void AddKey(int keyId, string keyName) + { + if (!keys.ContainsKey(keyId)) + { + keys.Add(keyId, new Key(keyId, keyName)); + } + } + + // Add key + public void AddKey(System.Windows.Forms.Keys key) + { + int keyId = (int)key; + if (!keys.ContainsKey(keyId)) + { + keys.Add(keyId, new Key(keyId, key.ToString())); + } + } + + // Is Key Down + public bool IsKeyDown(int keyId) + { + Key value; + if (keys.TryGetValue(keyId, out value)) + { + return value.IsKeyDown; + } + return false; + } + + // Update Thread + private void Update(object sender) + { + while (true) + { + if (keys.Count > 0) + { + List keysData = new List(keys.Values); + if (keysData != null && keysData.Count > 0) + { + foreach (Key key in keysData) + { + if (Convert.ToBoolean(Manager.GetKeyState(key.Id) & Manager.KEY_PRESSED)) + { + if (!key.IsKeyDown) + { + key.IsKeyDown = true; + OnKeyDown(key.Id, key.Name); + } + } + else + { + if (key.IsKeyDown) + { + key.IsKeyDown = false; + OnKeyUp(key.Id, key.Name); + } + } + } + } + } + Thread.Sleep(interval); + } + } + } +} diff --git a/Helpers/Manager.cs b/Helpers/Manager.cs new file mode 100644 index 0000000..208cfcc --- /dev/null +++ b/Helpers/Manager.cs @@ -0,0 +1,165 @@ +using System; +using System.Runtime.InteropServices; + +namespace GTAVCSMM.Helpers +{ + class Manager + { + // READ FLAGS + public static uint PROCESS_VM_READ = 0x0010; + public static uint PROCESS_VM_WRITE = 0x0020; + public static uint PROCESS_VM_OPERATION = 0x0008; + public static uint PAGE_READWRITE = 0x0004; + + // WINDOW FLAGS + public static uint WS_MAXIMIZE = 0x1000000; + public static uint WS_CAPTION = 0xC00000; // WS_BORDER or WS_DLGFRAME + public static uint WS_BORDER = 0x800000; + public static uint WS_VISIBLE = 0x10000000; + public static int GWL_STYLE = (-16); + + // KEY PRESSED + public const int KEY_PRESSED = 0x8000; + + //MOUSE BUTTONS + public const int VK_LEFTBUTTON = 0x01; + public const int VK_MIDBUTTON = 0x04; + public const int VK_RIGHTBUTTON = 0X02; + public const int VK_LBUTTON = VK_LEFTBUTTON; + public const int VK_MBUTTON = VK_MIDBUTTON; + public const int VK_RBUTTON = VK_RIGHTBUTTON; + + // KEYBOARD + public const int VK_CANCEL = 0x03; + public const int VK_BACKSPACE = 0x08; + public const int VK_TAB = 0x09; + public const int VK_CLEAR = 0x0C; + public const int VK_ENTER = 0x0D; + public const int VK_SHIFT = 0x10; // Any of the 2 shift keys + public const int VK_LSHIFT = 0xA0; // Left Shift Key + public const int VK_RSHIFT = 0xA1; // Right shift key + public const int VK_CTRL = 0x11; // Any of the 2 CTRL keys + public const int VK_LCTRL = 0xA2; // Left CTRL key + public const int VK_RCTRL = 0xA3; // Right CTRL key + public const int VK_ALT = 0x12; // Any of the 2 ALT keys + public const int VK_LMENU = 0xA4; // Left ALT key + public const int VK_RMENU = 0xA5; // Right ALT key + public const int VK_CAPSLOCK = 0x14; + public const int VK_ESCAPE = 0x1B; + public const int VK_SPACE = 0x20; + public const int VK_LEFT = 0x25; + public const int VK_UP = 0x26; + public const int VK_RIGHT = 0x27; + public const int VK_DOWN = 0x28; + public const int VK_SELECT = 0x29; + public const int VK_INSERT = 0x2D; + public const int VK_DELETE = 0x2E; + public const int VK_HELP = 0x2F; + + // KEYBOARD NUMBERS + public const int VK_KEYB0 = 0x30; + public const int VK_KEYB1 = 0x31; + public const int VK_KEYB2 = 0x32; + public const int VK_KEYB3 = 0x33; + public const int VK_KEYB4 = 0x34; + public const int VK_KEYB5 = 0x35; + public const int VK_KEYB6 = 0x36; + public const int VK_KEYB7 = 0x37; + public const int VK_KEYB8 = 0x38; + public const int VK_KEYB9 = 0x39; + + // NUMPAD + public const int VK_NUMLOCK = 0x90; + public const int VK_NUMPAD0 = 0x60; + public const int VK_NUMPAD1 = 0x61; + public const int VK_NUMPAD2 = 0x62; + public const int VK_NUMPAD3 = 0x63; + public const int VK_NUMPAD4 = 0x64; + public const int VK_NUMPAD5 = 0x65; + public const int VK_NUMPAD6 = 0x66; + public const int VK_NUMPAD7 = 0x67; + public const int VK_NUMPAD8 = 0x68; + public const int VK_NUMPAD9 = 0x69; + public const int VK_MULTIPLY = 0x6A; + public const int VK_ADD = 0x6B; + public const int VK_SEPARATOR = 0x6C; + public const int VK_SUBTRACT = 0x6D; + public const int VK_DECIMAL = 0x6E; + public const int VK_DIVIDE = 0x6F; + + // FUNCTION KEYS + public const int VK_F1 = 0x70; + public const int VK_F2 = 0x71; + public const int VK_F3 = 0x72; + public const int VK_F4 = 0x73; + public const int VK_F5 = 0x74; + public const int VK_F6 = 0x75; + public const int VK_F7 = 0x76; + public const int VK_F8 = 0x77; + public const int VK_F9 = 0x78; + public const int VK_F10 = 0x79; + public const int VK_F11 = 0x7A; + public const int VK_F12 = 0x7B; + public const int VK_F13 = 0x7C; + public const int VK_F14 = 0x7D; + public const int VK_F15 = 0x7E; + public const int VK_F16 = 0x7F; + public const int VK_F17 = 0x80; + public const int VK_F18 = 0x81; + public const int VK_F19 = 0x82; + public const int VK_F20 = 0x83; + public const int VK_F21 = 0x84; + public const int VK_F22 = 0x85; + public const int VK_F23 = 0x86; + public const int VK_F24 = 0x87; + + // LETTERS + public const int VK_A = 0x41; + public const int VK_B = 0x42; + public const int VK_C = 0x43; + public const int VK_D = 0x44; + public const int VK_E = 0x45; + public const int VK_F = 0x46; + public const int VK_G = 0x47; + public const int VK_H = 0x48; + public const int VK_I = 0x49; + public const int VK_J = 0x4A; + public const int VK_K = 0x4B; + public const int VK_L = 0x4C; + public const int VK_M = 0x4D; + public const int VK_N = 0x4E; + public const int VK_O = 0x4F; + public const int VK_P = 0x50; + public const int VK_Q = 0x51; + public const int VK_R = 0x52; + public const int VK_S = 0x53; + public const int VK_T = 0x54; + public const int VK_U = 0x55; + public const int VK_V = 0x56; + public const int VK_W = 0x57; + public const int VK_X = 0x58; + public const int VK_Y = 0x59; + public const int VK_Z = 0x5A; + + [DllImport("user32.dll")] + public static extern short GetKeyState(int KeyStates); + + //These will be needed for function hooking (infinite ammo) + //Expect an update with that included + [DllImport("kernel32.dll")] + public static extern IntPtr OpenProcess(UInt32 dwAccess, bool inherit, int pid); + + [DllImport("kernel32.dll")] + public static extern bool CloseHandle(IntPtr handle); + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, UInt32 dwSize, uint flNewProtect, out uint lpflOldProtect); + + [DllImport("kernel32.dll", SetLastError = true)] + public static extern bool ReadProcessMemory(IntPtr hProcess, Int64 lpBaseAddress, [In, Out] byte[] lpBuffer, UInt64 dwSize, out IntPtr lpNumberOfBytesRead); + + [DllImport("kernel32.dll")] + public static extern bool WriteProcessMemory(IntPtr hProcess, Int64 lpBaseAddress, [In, Out] byte[] lpBuffer, UInt64 dwSize, out IntPtr lpNumberOfBytesWritten); + + } +} diff --git a/Helpers/Speeder.cs b/Helpers/Speeder.cs new file mode 100644 index 0000000..2d0a147 --- /dev/null +++ b/Helpers/Speeder.cs @@ -0,0 +1,134 @@ +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace GTAVCSMM.Helpers +{ + + public static class Speeder + { + public static bool Suspend(int process) + { + try + { + // Obtain process instance. + Process proc = Process.GetProcessById(process); + + if (proc == null) + return false; + + // Obtain thread handle. + ProcessThread thread = proc.Threads[0]; + IntPtr lpThreadHandle = NativeAPI.OpenThread(NativeAPI.ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id); + if (lpThreadHandle == IntPtr.Zero) + return false; + + NativeAPI.SuspendThread(lpThreadHandle); + NativeAPI.CloseHandle(lpThreadHandle); + + return true; + } + catch { return false; } + } + + public static bool Resume(int process, bool bForceResume = false) + { + try + { + // Obtain process instance. + Process proc = Process.GetProcessById(process); + if (proc == null) + return false; + + // Obtain thread handle. + ProcessThread thread = proc.Threads[0]; + IntPtr lpThreadHandle = NativeAPI.OpenThread(NativeAPI.ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id); + if (lpThreadHandle == IntPtr.Zero) + return false; + + if (bForceResume == true) + while (NativeAPI.ResumeThread(lpThreadHandle) != 0) ; + else + NativeAPI.ResumeThread(lpThreadHandle); + + NativeAPI.CloseHandle(lpThreadHandle); + return true; + } + catch { return false; } + } + + #region "Native Win32 API Definitions" + /// + /// Native Win32 API Definitions + /// + /// API needed in order to do the required tasks of + /// loading, injection, and remote export calling. + /// + internal class NativeAPI + { + /// + /// kernel32.CloseHandle + /// + /// + /// + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool CloseHandle( + IntPtr hObject + ); + + /// + /// kernel32.OpenThread + /// + /// + /// + /// + /// + [DllImport("kernel32.dll")] + public static extern IntPtr OpenThread( + ThreadAccess dwDesiredAccess, + bool bInheritHandle, + uint dwThreadId + ); + + + /// + /// kernel32.ResumeThread + /// + /// + /// + [DllImport("kernel32.dll")] + public static extern uint ResumeThread( + IntPtr hThread + ); + + /// + /// kernel32.SuspendThread + /// + /// + /// + [DllImport("kernel32.dll")] + public static extern uint SuspendThread( + IntPtr hThread + ); + + /// + /// Thread access flags. + /// + [Flags] + public enum ThreadAccess : int + { + TERMINATE = (0x0001), + SUSPEND_RESUME = (0x0002), + GET_CONTEXT = (0x0008), + SET_CONTEXT = (0x0010), + SET_INFORMATION = (0x0020), + QUERY_INFORMATION = (0x0040), + SET_THREAD_TOKEN = (0x0080), + IMPERSONATE = (0x0100), + DIRECT_IMPERSONATION = (0x0200) + } + } + #endregion + } +} diff --git a/Memory/Mem.cs b/Memory/Mem.cs new file mode 100644 index 0000000..8028bfd --- /dev/null +++ b/Memory/Mem.cs @@ -0,0 +1,124 @@ +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; + +namespace GTAVCSMM.Memory +{ + class Mem + { + + [DllImport("kernel32.dll")] + public static extern int WriteProcessMemory(IntPtr Handle, long Address, byte[] buffer, int Size, int BytesWritten = 0); + [DllImport("kernel32.dll")] + public static extern int ReadProcessMemory(IntPtr Handle, long Address, byte[] buffer, int Size, int BytesRead = 0); + + public Process Proc; + public long BaseAddress; + + public Mem(string process) + { + try + { + Proc = Process.GetProcessesByName(process)[0]; + BaseAddress = Proc.MainModule.BaseAddress.ToInt64(); + } + catch { throw new Exception(); } + } + + public IntPtr GetProcHandle() + { + try { return Proc.Handle; } catch { return IntPtr.Zero; } + } + + public long GetPtrAddr(long Pointer, int[] Offset = null) + { + byte[] Buffer = new byte[8]; + + ReadProcessMemory(GetProcHandle(), Pointer, Buffer, Buffer.Length); + + if (Offset != null) + { + for (int x = 0; x < (Offset.Length - 1); x++) + { + Pointer = BitConverter.ToInt64(Buffer, 0) + Offset[x]; + ReadProcessMemory(GetProcHandle(), Pointer, Buffer, Buffer.Length); + } + + Pointer = BitConverter.ToInt64(Buffer, 0) + Offset[Offset.Length - 1]; + } + + return Pointer; + } + + public long FindPattern(byte[] pattern, string mask) + { + int moduleSize = Proc.MainModule.ModuleMemorySize; + + if (moduleSize == 0) throw new Exception($"Size of module {Proc.MainModule.ModuleName} is INVALID."); + + byte[] moduleBytes = new byte[moduleSize]; + ReadProcessMemory(GetProcHandle(), BaseAddress, moduleBytes, moduleSize); + + for (long i = 0; i < moduleSize; i++) + { + for (int l = 0; l < mask.Length; l++) + //dirty hack heh + if (!(mask[l] == '?' || moduleBytes[l + i] == pattern[l])) goto SKIP; + + return i; + SKIP:; + } + return 0; + } + + public byte[] ReadBytes(long BasePTR, int[] offset, int Length) + { + byte[] Buffer = new byte[Length]; + ReadProcessMemory(GetProcHandle(), GetPtrAddr(BaseAddress + BasePTR, offset), Buffer, Length); + return Buffer; + } + + public byte[] ReadBytes_new(long BasePTR, int[] offset, int Length) + { + byte[] Buffer = new byte[Length]; + ReadProcessMemory(GetProcHandle(), BasePTR, Buffer, Length); + return Buffer; + } + + public void Write(long BasePTR, int[] offset, byte[] Bytes) => WriteProcessMemory(GetProcHandle(), GetPtrAddr(BaseAddress + BasePTR, offset), Bytes, Bytes.Length); + + public void Write(long BasePTR, int[] offset, bool b) => Write(BasePTR, offset, b ? new byte[] { 0x01 } : new byte[] { 0x00 }); + public void Write(long BasePTR, int[] offset, float Value) => Write(BasePTR, offset, BitConverter.GetBytes(Value)); + public void Write(long BasePTR, int[] offset, double Value) => Write(BasePTR, offset, BitConverter.GetBytes(Value)); + public void Write(long BasePTR, int[] offset, int Value) => Write(BasePTR, offset, BitConverter.GetBytes(Value)); + public void Write(long BasePTR, int[] offset, string String) => Write(BasePTR, offset, new ASCIIEncoding().GetBytes(String)); + public void Write(long BasePTR, int[] offset, long Value) => Write(BasePTR, offset, BitConverter.GetBytes(Value)); + public void Write(long BasePTR, int[] offset, uint Value) => Write(BasePTR, offset, BitConverter.GetBytes(Value)); + public void Write(long BasePTR, int[] offset, byte Value) => Write(BasePTR, offset, new byte[] { Value }); + + public void writeInt(long BasePTR, int[] offset, int Value) + { + WriteProcessMemory(Proc.Handle, BasePTR, BitConverter.GetBytes(Value), 4); + } + public void writePointer(long BasePTR, int[] offset, long Value) + { + WriteProcessMemory(Proc.Handle, BasePTR, BitConverter.GetBytes(Value), 8); + } + public void writeFloat(long BasePTR, int[] offset, float Value) + { + WriteProcessMemory(Proc.Handle, BasePTR, BitConverter.GetBytes(Value), 8); + } + + public bool ReadBool(long BasePTR, int[] offset) => ReadByte(BasePTR, offset) != 0x00; + public float ReadFloat(long BasePTR, int[] offset) => BitConverter.ToSingle(ReadBytes(BasePTR, offset, 4), 0); + public double ReadDouble(long BasePTR, int[] offset) => BitConverter.ToDouble(ReadBytes(BasePTR, offset, 8), 0); + public int ReadInt(long BasePTR, int[] offset) => BitConverter.ToInt32(ReadBytes(BasePTR, offset, 4), 0); + public uint ReadUInt(long BasePTR, int[] offset) => BitConverter.ToUInt32(ReadBytes(BasePTR, offset, 4), 0); + public string ReadString(long BasePTR, int[] offset, int size) => new ASCIIEncoding().GetString(ReadBytes(BasePTR, offset, size)); + public long ReadPointer(long BasePTR, int[] offset) => BitConverter.ToInt64(ReadBytes(BasePTR, offset, 8), 0); + public byte ReadByte(long BasePTR, int[] offset) => ReadBytes(BasePTR, offset, 1)[0]; + public string ReadStr(long BasePTR, int[] offset, int size) => new ASCIIEncoding().GetString(ReadBytes_new(BasePTR, offset, size)); + + } +} \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..8692fc0 --- /dev/null +++ b/Program.cs @@ -0,0 +1,2407 @@ +using GTAVCSMM.Config; +using GTAVCSMM.Helpers; +using GTAVCSMM.Memory; +using GTAVCSMM.Settings; +using System; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; + +namespace GTAVCSMM +{ + static class Program + { + private const int WH_KEYBOARD_LL = 13; + private const int WM_KEYDOWN = 0x0100; + private static LowLevelKeyboardProc _proc = HookCallback; + private static IntPtr _hookID = IntPtr.Zero; + const int SW_HIDE = 0; + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern IntPtr SetWindowsHookEx(int idHook, + LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId); + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool UnhookWindowsHookEx(IntPtr hhk); + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, + IntPtr wParam, IntPtr lParam); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern IntPtr GetModuleHandle(string lpModuleName); + + [DllImport("user32.dll")] + static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); + + private static bool isHidden = false; + private static IntPtr formHandle; + + private static int menuMainLvl = 0; + private static int LastMenuMainLvl = 0; + private static int menuLvl = 0; + private static int LastMenuLvl = 0; + private static int menuItm = 0; + private static int LastMenuItm = 0; + private static Form mainForm = new Form(); + private static ListBox listBx = new ListBox(); + private static Label label1 = new Label(); + private static Label label2 = new Label(); + private static string lastNavigation = string.Empty; + + #region WINDOW SETUP + + public const string WINDOW_NAME = "Grand Theft Auto V"; + public static IntPtr handle = FindWindow(null, WINDOW_NAME); + + public static RECT rect; + + public struct RECT + { + public int left, top, right, bottom; + } + + [DllImport("user32.dll", SetLastError = true)] + static extern IntPtr FindWindow(string IpClassName, string IpWindowName); + + [DllImport("user32.dll")] + static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); + + [DllImport("user32.dll", SetLastError = true)] + static extern int GetWindowLong(IntPtr hWnd, int nIndex); + + [DllImport("user32.dll")] + public static extern bool GetWindowRect(IntPtr hwnd, out RECT IpRect); + + public static Offsets offsets = new Offsets(); + public static Addresses addresses = new Addresses(); + public static Patterns pattern = new Patterns(); + public static TSettings settings = new TSettings(); + public static Mem Mem; + public static Thread _getPointer; + public static Thread _freezeGame; + + public static System.Windows.Forms.Timer ProcessTimer = new System.Windows.Forms.Timer(); + public static System.Windows.Forms.Timer MemoryTimer = new System.Windows.Forms.Timer(); + public static System.Windows.Forms.Timer fastTimer = new System.Windows.Forms.Timer(); + + #endregion + + #region PROCESS INFO + private static bool bGodMode = false; + private static bool bgodState = false; + private static bool bNeverWanted = false; + private static bool bNoRagdoll = false; + private static bool bUndeadOffRadar = false; + private static bool bSeatBelt = false; + private static bool bSuperJump = false; + private static bool bExplosiveAmmo = false; + private static bool bDisableCollision = false; + private static bool bVehicleGodMode = false; + private static int frameFlagCount = 0; + + [DllImport("user32.dll")] + static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey); + + [DllImport("user32.dll")] + public static extern void mouse_event(int a, int b, int c, int d, int damnIwonderifpeopleactuallyreadsthis); + #endregion + + #region METHODS + public static void pGODMODE() + { + if (bGodMode) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oGod }, 1); + if (!settings.pgodm) + { + Activate(); + } + settings.pgodm = true; + } + else + { + if (settings.pgodm) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oGod }, 0); + settings.pgodm = false; + Deactivate(); + } + } + } + + public static void pNEVERWANTED() + { + if (bNeverWanted) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 0); + if (!settings.pnwanted) + { + Activate(); + } + settings.pnwanted = true; + } + else + { + if (settings.pnwanted) + { + settings.pnwanted = false; + Deactivate(); + } + } + } + + public static void pNORAGDOLL() + { + if (bNoRagdoll) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRagdoll }, 1); + if (!settings.pnragdoll) + { + Activate(); + } + settings.pnragdoll = true; + } + else + { + if (settings.pnragdoll) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRagdoll }, 32); + settings.pnragdoll = false; + Deactivate(); + } + } + } + + public static void pUNDEADOFFRADAR() + { + if (bUndeadOffRadar) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oHealthMax }, 0); + if (!settings.puoffradar) + { + Activate(); + } + settings.puoffradar = true; + } + else + { + if (settings.puoffradar) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oHealthMax }, 328f); + settings.puoffradar = false; + Deactivate(); + } + } + } + + public static void pSEATBELT() + { + if (bSeatBelt) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oSeatbelt }, -55); + if (!settings.psbelt) + { + Activate(); + } + settings.psbelt = true; + } + else + { + if (settings.psbelt) + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oSeatbelt }, -56); + settings.psbelt = false; + Deactivate(); + } + } + } + + public static void pSUPERJUMP() + { + if (bSuperJump) + { + if (!settings.psjump) + { + frameFlagCount = frameFlagCount + 64; + Activate(); + } + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oFrameFlags }, frameFlagCount); + settings.psjump = true; + } + else + { + if (settings.psjump) + { + frameFlagCount = frameFlagCount - 64; + Deactivate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oFrameFlags }, frameFlagCount); + settings.psjump = false; + } + } + } + + public static void pEXPLOSIVEAMMO() + { + if (bExplosiveAmmo) + { + if (!settings.psexammo) + { + frameFlagCount = frameFlagCount + 8; + Activate(); + } + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oFrameFlags }, frameFlagCount); + settings.psexammo = true; + } + else + { + if (settings.psexammo) + { + frameFlagCount = frameFlagCount - 8; + Deactivate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oFrameFlags }, frameFlagCount); + settings.psexammo = false; + } + } + } + public static void pDISABLECOLLISION() + { + long paddr = Mem.ReadPointer(settings.WorldPTR, new int[] { offsets.pCPed, 0x30, 0x10, 0x20, 0x70, 0x0 }); + long paddr2 = Mem.GetPtrAddr(paddr + 0x2C, null); + + if (bDisableCollision) + { + Mem.writeFloat(paddr2, null, -1.0f); + if (!settings.pdiscol) + { + Activate(); + } + settings.pdiscol = true; + } + else + { + if (settings.pdiscol) + { + Mem.writeFloat(paddr2, null, 0.25f); + settings.pdiscol = false; + Deactivate(); + } + } + } + public static void vGODMODE() + { + long paddr = Mem.ReadPointer(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle }); + if (paddr > 0) + { + long paddr2 = Mem.GetPtrAddr(paddr + offsets.oGod, null); + if (bVehicleGodMode) + { + Mem.writeInt(paddr2, null, 1); + if (!settings.vgodm) + { + Activate(); + } + settings.vgodm = true; + } + else + { + if (settings.vgodm) + { + Mem.writeInt(paddr2, null, 0); + settings.vgodm = false; + Deactivate(); + } + } + } + } + + public static void getPointer() + { + try + { + Mem = new Mem(settings.gameName); + + var processes = Process.GetProcessesByName(settings.gameName); + foreach (var p in processes) + { + if (p.Id > 0) + { + settings.gameProcess = p.Id; + } + } + + // GlobalPTR + long addr = Mem.FindPattern(pattern.GlobalPTR, pattern.GlobalPTR_Mask); + settings.GlobalPTR = addr + Mem.ReadInt(addr + 3, null) + 7; + + // WorldPTR + long addr2 = Mem.FindPattern(pattern.WorldPTR, pattern.WorldPTR_Mask); + settings.WorldPTR = addr2 + Mem.ReadInt(addr2 + 3, null) + 7; + + // BlipPTR + long addr3 = Mem.FindPattern(pattern.BlipPTR, pattern.BlipPTR_Mask); + settings.BlipPTR = addr3 + Mem.ReadInt(addr3 + 3, null) + 7; + + // ReplayInterfacePTR + long addr4 = Mem.FindPattern(pattern.ReplayInterfacePTR, pattern.ReplayInterfacePTR_Mask); + settings.ReplayInterfacePTR = addr4 + Mem.ReadInt(addr4 + 3, null) + 7; + + // LocalScriptsPTR + long addr5 = Mem.FindPattern(pattern.LocalScriptsPTR, pattern.LocalScriptsPTR_Mask); + settings.LocalScriptsPTR = addr5 + Mem.ReadInt(addr5 + 3, null) + 7; + + // PlayerCountPTR + long addr6 = Mem.FindPattern(pattern.PlayerCountPTR, pattern.PlayerCountPTR_Mask); + settings.PlayerCountPTR = addr6 + Mem.ReadInt(addr6 + 3, null) + 7; + + // PickupDataPTR + long addr7 = Mem.FindPattern(pattern.PickupDataPTR, pattern.PickupDataPTR_Mask); + settings.PickupDataPTR = addr7 + Mem.ReadInt(addr7 + 3, null) + 7; + + // WeatherADDR + long addr8 = Mem.FindPattern(pattern.WeatherADDR, pattern.WeatherADDR_Mask); + settings.WeatherADDR = addr8 + Mem.ReadInt(addr8 + 6, null) + 10; + + // SettingsPTR + long addr9 = Mem.FindPattern(pattern.SettingsPTR, pattern.SettingsPTR_Mask); + settings.SettingsPTR = addr9 + Mem.ReadInt(addr9 + 3, null) - Convert.ToInt64("0x89", 16); + + // AimCPedPTR + long addr10 = Mem.FindPattern(pattern.AimCPedPTR, pattern.AimCPedPTR_Mask); + settings.AimCPedPTR = addr10 + Mem.ReadInt(addr10 + 3, null) + 7; + + // FriendlistPTR + long addr11 = Mem.FindPattern(pattern.FriendlistPTR, pattern.FriendlistPTR_Mask); + settings.FriendlistPTR = addr11 + Mem.ReadInt(addr11 + 3, null) + 7; + } + catch + { + MessageBox.Show("GTA is not Running!", "Serious Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Quit(); + } + _getPointer.Abort(); + } + + public static void freezeGame() + { + Console.WriteLine("Freezing game"); + Speeder.Suspend(settings.gameProcess); + Thread.Sleep(10000); + Speeder.Resume(settings.gameProcess); + _freezeGame.Abort(); + } + #endregion + + + #region TIMERS + + private static void ProcessTimer_Tick(object sender, EventArgs e) + { + + } + + private static void MemoryTimer_Tick(object sender, EventArgs e) + { + pGODMODE(); + pNEVERWANTED(); + pNORAGDOLL(); + pUNDEADOFFRADAR(); + pSEATBELT(); + pDISABLECOLLISION(); + vGODMODE(); + } + + private static void fastTimer_Tick(object sender, EventArgs e) + { + pSUPERJUMP(); + pEXPLOSIVEAMMO(); + } + + #endregion + + private static void Quit() + { + Environment.Exit(0); + } + + //audio response to actions + public static void Activate() + { + Console.Beep(523, 75); + Console.Beep(587, 75); + Console.Beep(700, 75); + } + + public static void Deactivate() + { + Console.Beep(700, 75); + Console.Beep(587, 75); + Console.Beep(523, 75); + } + + public static void Toggle() + { + Console.Beep(523, 75); + Console.Beep(523, 75); + Console.Beep(523, 75); + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + bool createdNew = true; + using (Mutex mutex = new Mutex(true, "GTA5TrainerCS", out createdNew)) + + if (createdNew) + { + _getPointer = new Thread(getPointer) { IsBackground = true }; + _getPointer.Start(); + + // + // listBx + // + listBx.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); + listBx.BorderStyle = System.Windows.Forms.BorderStyle.None; + listBx.Font = new System.Drawing.Font("Arial", 13.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + listBx.FormattingEnabled = true; + listBx.ItemHeight = 24; + listBx.Location = new System.Drawing.Point(6, 50); + listBx.Margin = new System.Windows.Forms.Padding(10); + listBx.MaximumSize = new System.Drawing.Size(290, 500); + listBx.Name = "listBox1"; + listBx.Size = new System.Drawing.Size(290, 480); + listBx.TabIndex = 0; + + // + // label1 + // + label1.AutoSize = true; + label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); + label1.Font = new System.Drawing.Font("Arial Black", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + label1.Location = new System.Drawing.Point(1, 9); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(168, 33); + label1.TabIndex = 1; + label1.Text = "GTAVCSMM"; + // + // label2 + // + label2.AutoSize = true; + label2.Font = new System.Drawing.Font("Arial", 15.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + label2.Location = new System.Drawing.Point(162, 16); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(65, 24); + label2.TabIndex = 2; + label2.Text = "o1.58"; + // + // fastTimer + // + fastTimer.Enabled = true; + fastTimer.Interval = 1; + fastTimer.Tick += new System.EventHandler(fastTimer_Tick); + // + // ProcessTimer + // + ProcessTimer.Enabled = true; + ProcessTimer.Interval = 100; + ProcessTimer.Tick += new System.EventHandler(ProcessTimer_Tick); + // + // MemoryTimer + // + MemoryTimer.Enabled = true; + MemoryTimer.Interval = 100; + MemoryTimer.Tick += new System.EventHandler(MemoryTimer_Tick); + // + // Form1 + // + mainForm.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + mainForm.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + mainForm.AutoSize = true; + mainForm.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + mainForm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); + mainForm.ClientSize = new System.Drawing.Size(207, 116); + mainForm.Controls.Add(label2); + mainForm.Controls.Add(label1); + mainForm.Controls.Add(listBx); + mainForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + mainForm.KeyPreview = true; + mainForm.Name = "Form1"; + mainForm.Opacity = 0.8D; + mainForm.ShowIcon = false; + mainForm.ShowInTaskbar = false; + mainForm.Text = "GTAVCSMM"; + mainForm.TopMost = true; + + formHandle = mainForm.Handle; + listboxStyle(); + listboxFill(0, 0); + _hookID = SetHook(_proc); + + mainForm.FormBorderStyle = FormBorderStyle.None; + int InitialStyle = GetWindowLong(mainForm.Handle, -10); + SetWindowLong(mainForm.Handle, -10, InitialStyle | 0x800000 | 0x20); + GetWindowRect(handle, out rect); + mainForm.Top = rect.top - 20; + mainForm.Left = rect.left + 30; + + mainForm.Show(); + + Application.EnableVisualStyles(); + Application.Run(); + + } + } + + public static void listboxStyle() + { + } + + public static void listboxFill(int mainMenulevel, int menulevel) + { + listBx.Items.Clear(); + switch (mainMenulevel) + { + case 0: + /* + * Mainlevel 0 + */ + listBx.Items.Add("Main \t\t\t ►"); // 0,0 + listBx.Items.Add("Session \t\t\t ►"); // 0,1 + listBx.Items.Add("Player \t\t\t ►"); // 0,2 + listBx.Items.Add("Vehicle \t\t\t ►"); // 0,3 + listBx.Items.Add("Weapon \t\t\t ►"); // 0,4 + listBx.Items.Add("Teleport \t\t\t ►"); // 0,5 + listBx.Items.Add("Tunables \t\t\t ►"); // 0,6 + listBx.Items.Add("Online Services \t\t ►"); // 0,7 + + menuMainLvl = 0; + menuLvl = 0; + + LastMenuMainLvl = 0; + LastMenuLvl = 0; + LastMenuItm = 0; + break; + + case 1: + switch (menulevel) + { + case 0: + listBx.Items.Add("Re-Init"); + listBx.Items.Add("Quit (Del)"); + + menuMainLvl = 1; + menuLvl = 0; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 0; + break; + + case 1: + listBx.Items.Add("Join Public Session"); + listBx.Items.Add("New Public Session"); + listBx.Items.Add("Solo Session"); + listBx.Items.Add("Leave Online"); + listBx.Items.Add("Empty Session (10 Sec. Freeze)"); + listBx.Items.Add("Invite Only Session"); + listBx.Items.Add("Find Friend Session"); + listBx.Items.Add("Closed Friend Session"); + listBx.Items.Add("Crew Session"); + listBx.Items.Add("Join Crew Session"); + listBx.Items.Add("Closed Crew Session"); + /* + listBx.Items.Add("Disconnect"); + */ + + menuMainLvl = 1; + menuLvl = 1; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 1; + break; + + case 2: + listBx.Items.Add("God Mode (F6)"); + listBx.Items.Add("Super Jump"); + listBx.Items.Add("Never Wanted (F7)"); + listBx.Items.Add("Seatbelt"); + listBx.Items.Add("No Ragdoll"); + listBx.Items.Add("Undead Off-Radar"); + listBx.Items.Add("Disable Collision"); + listBx.Items.Add("Skills \t\t\t ►"); + listBx.Items.Add("Swim Speed \t\t ►"); + listBx.Items.Add("Stealth Speed \t\t ►"); + listBx.Items.Add("Run Speed \t\t ►"); + listBx.Items.Add("Wanted Level \t\t ►"); + + menuMainLvl = 1; + menuLvl = 2; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 2; + break; + + case 3: + listBx.Items.Add("God Mode"); + + menuMainLvl = 1; + menuLvl = 3; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 3; + break; + + case 4: + listBx.Items.Add("Explosive Ammo"); + listBx.Items.Add("Long Range"); + + menuMainLvl = 1; + menuLvl = 4; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 4; + break; + + case 5: + listBx.Items.Add("Waypoint (F8)"); + listBx.Items.Add("Objective"); + listBx.Items.Add("Locations \t\t ►"); + + menuMainLvl = 1; + menuLvl = 5; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 5; + break; + + case 6: + listBx.Items.Add("RP Multipler \t\t ►"); + listBx.Items.Add("REP Multipler \t\t ►"); + listBx.Items.Add("Nightclub Popularity"); + + menuMainLvl = 1; + menuLvl = 6; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 6; + break; + + case 7: + listBx.Items.Add("Get Lucky Wheel Price \t ►"); + + menuMainLvl = 1; + menuLvl = 7; + + LastMenuMainLvl = 0; + LastMenuLvl = 1; + LastMenuItm = 7; + break; + } + break; + + case 2: + switch (menulevel) + { + case 7: + listBx.Items.Add("Stamina"); + listBx.Items.Add("Strength"); + listBx.Items.Add("Lung Capacity"); + listBx.Items.Add("Driving"); + listBx.Items.Add("Flying"); + listBx.Items.Add("Shooting"); + listBx.Items.Add("Stealth"); + + menuMainLvl = 2; + menuLvl = 7; + + LastMenuMainLvl = 1; + LastMenuLvl = 2; + LastMenuItm = 7; + break; + + case 8: + listBx.Items.Add("Swim Speed = 0.0"); + listBx.Items.Add("Swim Speed = 0.5"); + listBx.Items.Add("Swim Speed = 1.0 (Default)"); + listBx.Items.Add("Swim Speed = 1.5"); + listBx.Items.Add("Swim Speed = 2.0"); + listBx.Items.Add("Swim Speed = 2.5"); + listBx.Items.Add("Swim Speed = 3.0"); + listBx.Items.Add("Swim Speed = 3.5"); + listBx.Items.Add("Swim Speed = 4.0"); + listBx.Items.Add("Swim Speed = 4.5"); + listBx.Items.Add("Swim Speed = 5.0"); + + menuMainLvl = 2; + menuLvl = 8; + + LastMenuMainLvl = 1; + LastMenuLvl = 2; + LastMenuItm = 8; + break; + + case 9: + listBx.Items.Add("Stealth Speed = 0.0"); + listBx.Items.Add("Stealth Speed = 0.5"); + listBx.Items.Add("Stealth Speed = 1.0 (Default)"); + listBx.Items.Add("Stealth Speed = 1.5"); + listBx.Items.Add("Stealth Speed = 2.0"); + listBx.Items.Add("Stealth Speed = 2.5"); + listBx.Items.Add("Stealth Speed = 3.0"); + listBx.Items.Add("Stealth Speed = 3.5"); + listBx.Items.Add("Stealth Speed = 4.0"); + listBx.Items.Add("Stealth Speed = 4.5"); + listBx.Items.Add("Stealth Speed = 5.0"); + + menuMainLvl = 2; + menuLvl = 9; + + LastMenuMainLvl = 1; + LastMenuLvl = 2; + LastMenuItm = 9; + break; + + case 10: + listBx.Items.Add("Run Speed = 0.0"); + listBx.Items.Add("Run Speed = 0.5"); + listBx.Items.Add("Run Speed = 1.0 (Default)"); + listBx.Items.Add("Run Speed = 1.5"); + listBx.Items.Add("Run Speed = 2.0"); + listBx.Items.Add("Run Speed = 2.5"); + listBx.Items.Add("Run Speed = 3.0"); + listBx.Items.Add("Run Speed = 3.5"); + listBx.Items.Add("Run Speed = 4.0"); + listBx.Items.Add("Run Speed = 4.5"); + listBx.Items.Add("Run Speed = 5.0"); + + menuMainLvl = 2; + menuLvl = 10; + + LastMenuMainLvl = 1; + LastMenuLvl = 2; + LastMenuItm = 10; + break; + + case 11: + listBx.Items.Add("Wanted Level = 0"); + listBx.Items.Add("Wanted Level = 1"); + listBx.Items.Add("Wanted Level = 2"); + listBx.Items.Add("Wanted Level = 3"); + listBx.Items.Add("Wanted Level = 4"); + listBx.Items.Add("Wanted Level = 5"); + + menuMainLvl = 2; + menuLvl = 11; + + LastMenuMainLvl = 1; + LastMenuLvl = 2; + LastMenuItm = 11; + break; + } + break; + + case 5: + switch (menulevel) + { + case 2: + listBx.Items.Add("Nightclub"); + listBx.Items.Add("Arcade"); + listBx.Items.Add("Office"); + listBx.Items.Add("Bunker"); + listBx.Items.Add("Facility"); + listBx.Items.Add("Hangar"); + listBx.Items.Add("Yacht"); + listBx.Items.Add("Kosatka"); + listBx.Items.Add("Sell Vehicles & Cargo"); + listBx.Items.Add("MC Clubhouse"); + listBx.Items.Add("Meth Lab"); + listBx.Items.Add("Cocaine Lockup"); + listBx.Items.Add("Weed Farm"); + listBx.Items.Add("Counterfeit Cash"); + listBx.Items.Add("Document Forgery"); + listBx.Items.Add("Casino"); + listBx.Items.Add("LS Car Meet"); + + menuMainLvl = 5; + menuLvl = 1; + + LastMenuMainLvl = 1; + LastMenuLvl = 5; + LastMenuItm = 2; + break; + } + break; + + case 6: + switch (menulevel) + { + case 0: + listBx.Items.Add("RP x 1.0"); + listBx.Items.Add("RP x 2.0"); + listBx.Items.Add("RP x 3.0"); + listBx.Items.Add("RP x 5.0"); + listBx.Items.Add("RP x 10.0"); + listBx.Items.Add("RP x 15.0"); + listBx.Items.Add("RP x 20.0"); + listBx.Items.Add("RP x 25.0"); + listBx.Items.Add("RP x 30.0"); + listBx.Items.Add("RP x 35.0"); + listBx.Items.Add("RP x 40.0"); + listBx.Items.Add("RP x 50.0"); + listBx.Items.Add("RP x 100.0"); + + menuMainLvl = 6; + menuLvl = 0; + + LastMenuMainLvl = 1; + LastMenuLvl = 6; + LastMenuItm = 0; + break; + + case 1: + listBx.Items.Add("REP x 1.0"); + listBx.Items.Add("REP x 2.0"); + listBx.Items.Add("REP x 3.0"); + listBx.Items.Add("REP x 5.0"); + listBx.Items.Add("REP x 10.0"); + listBx.Items.Add("REP x 15.0"); + listBx.Items.Add("REP x 20.0"); + listBx.Items.Add("REP x 25.0"); + listBx.Items.Add("REP x 30.0"); + listBx.Items.Add("REP x 35.0"); + listBx.Items.Add("REP x 40.0"); + listBx.Items.Add("REP x 50.0"); + listBx.Items.Add("REP x 100.0"); + listBx.Items.Add("REP x 200.0"); + listBx.Items.Add("REP x 300.0"); + listBx.Items.Add("REP x 500.0"); + listBx.Items.Add("REP x 1000.0"); + + menuMainLvl = 6; + menuLvl = 1; + + LastMenuMainLvl = 1; + LastMenuLvl = 6; + LastMenuItm = 1; + break; + } + break; + + case 7: + switch (menulevel) + { + case 0: + listBx.Items.Add("Clothes (0)"); + listBx.Items.Add("RP (1)"); + listBx.Items.Add("Cash (1)"); + listBx.Items.Add("Chips (1)"); + listBx.Items.Add("Discount"); + listBx.Items.Add("RP (2)"); + listBx.Items.Add("Cash (2)"); + listBx.Items.Add("Chips (2)"); + listBx.Items.Add("Clothes (2)"); + listBx.Items.Add("RP (3)"); + listBx.Items.Add("Chips (3)"); + listBx.Items.Add("Mystery Price"); + listBx.Items.Add("Clothes (3)"); + listBx.Items.Add("RP (4)"); + listBx.Items.Add("Chips (4)"); + listBx.Items.Add("Clothes (4)"); + listBx.Items.Add("RP (5)"); + listBx.Items.Add("Podium Vehicle"); + + menuMainLvl = 7; + menuLvl = 0; + + LastMenuMainLvl = 1; + LastMenuLvl = 7; + LastMenuItm = 0; + break; + } + break; + } + listBx.SelectedIndex = 0; + mainForm.TopMost = true; + } + + public static void runitem(int mainMenulevel, int menulevel, int menuItem) + { + Console.WriteLine("Command to run: " + mainMenulevel + " " + menulevel + " " + menuItem); + switch (mainMenulevel) + { + case 0: + switch (menulevel) + { + case 0: + switch (menuItem) + { + case 0: + listboxFill(1, 0); + break; + case 1: + listboxFill(1, 1); + break; + case 2: + listboxFill(1, 2); + break; + case 3: + listboxFill(1, 3); + break; + case 4: + listboxFill(1, 4); + break; + case 5: + listboxFill(1, 5); + break; + case 6: + listboxFill(1, 6); + break; + case 7: + listboxFill(1, 7); + break; + } + break; + } + break; + + case 1: + switch (menulevel) + { + case 0: + switch (menuItem) + { + case 0: + // Re-Init + Console.WriteLine("Nothing to do"); + break; + case 1: + Quit(); + break; + } + break; + case 1: + switch (menuItem) + { + case 0: + Activate(); + LoadSession(0); + break; + case 1: + Activate(); + LoadSession(1); + break; + case 2: + Activate(); + LoadSession(10); + break; + case 3: + Activate(); + LoadSession(-1); + break; + case 4: + Activate(); + _freezeGame = new Thread(freezeGame) { IsBackground = true }; + _freezeGame.Start(); + break; + case 5: + Activate(); + LoadSession(11); + break; + case 6: + Activate(); + LoadSession(9); + break; + case 7: + Activate(); + LoadSession(6); + break; + case 8: + Activate(); + LoadSession(3); + break; + case 9: + Activate(); + LoadSession(12); + break; + case 10: + Activate(); + LoadSession(2); + break; + /* + case 11: + Activate(); + LoadSession(-2); + break; + */ + } + break; + case 2: + switch (menuItem) + { + case 0: + bGodMode = !bGodMode; + break; + case 1: + bSuperJump = !bSuperJump; + break; + case 2: + bNeverWanted = !bNeverWanted; + break; + case 3: + bSeatBelt = !bSeatBelt; + break; + case 4: + bNoRagdoll = !bNoRagdoll; + break; + case 5: + bUndeadOffRadar = !bUndeadOffRadar; + break; + case 6: + bDisableCollision = !bDisableCollision; + break; + case 7: + listboxFill(2, 7); + break; + case 8: + listboxFill(2, 8); + break; + case 9: + listboxFill(2, 9); + break; + case 10: + listboxFill(2, 10); + break; + case 11: + listboxFill(2, 11); + break; + } + break; + case 3: + switch (menuItem) + { + case 0: + bVehicleGodMode = !bVehicleGodMode; + break; + } + break; + case 4: + switch (menuItem) + { + case 0: + bExplosiveAmmo = !bExplosiveAmmo; + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oRange }, 250F); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oLockRange }, 250F); + break; + } + break; + case 5: + switch (menuItem) + { + case 0: + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + Activate(); + teleportWaypoint(); + if (!bgodState) + { + bGodMode = false; + } + break; + case 1: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + int[] tpIdArray = new int[] { 1 }; + int[] tpColArray = new int[] { 5, 60, 66 }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 2: + listboxFill(5, 2); + break; + } + break; + case 6: + switch (menuItem) + { + case 0: + listboxFill(6, 0); + break; + case 1: + listboxFill(6, 1); + break; + case 2: + Activate(); + setStat("MP0_CLUB_POPULARITY", 1000); + setStat("MP1_CLUB_POPULARITY", 1000); + break; + } + break; + case 7: + switch (menuItem) + { + case 0: + listboxFill(7, 0); + break; + } + break; + + } + break; + case 2: + switch (menulevel) + { + case 7: + switch (menuItem) + { + case 0: + Activate(); + setStat("MP0_SCRIPT_INCREASE_STAM", 100); + setStat("MP1_SCRIPT_INCREASE_STAM", 100); + break; + case 1: + Activate(); + setStat("MP0_SCRIPT_INCREASE_STRN", 100); + setStat("MP1_SCRIPT_INCREASE_STRN", 100); + break; + case 2: + Activate(); + setStat("MP0_SCRIPT_INCREASE_LUNG", 100); + setStat("MP1_SCRIPT_INCREASE_LUNG", 100); + break; + case 3: + Activate(); + setStat("MP0_SCRIPT_INCREASE_DRIV", 100); + setStat("MP1_SCRIPT_INCREASE_DRIV", 100); + break; + case 4: + Activate(); + setStat("MP0_SCRIPT_INCREASE_FLY", 100); + setStat("MP1_SCRIPT_INCREASE_FLY", 100); + break; + case 5: + Activate(); + setStat("MP0_SCRIPT_INCREASE_SHO", 100); + setStat("MP1_SCRIPT_INCREASE_SHO", 100); + break; + case 6: + Activate(); + setStat("MP0_SCRIPT_INCREASE_STL", 100); + setStat("MP1_SCRIPT_INCREASE_STL", 100); + break; + } + break; + + case 8: + switch (menuItem) + { + case 0: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 0.0f); + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 0.5f); + break; + case 2: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 1.0f); + break; + case 3: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 1.5f); + break; + case 4: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 2.0f); + break; + case 5: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 2.5f); + break; + case 6: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 3.0f); + break; + case 7: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 3.5f); + break; + case 8: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 4.0f); + break; + case 9: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 4.5f); + break; + case 10: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oSwimSpeed }, 5.0f); + break; + } + break; + + case 9: + switch (menuItem) + { + case 0: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 0.0f); + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 0.5f); + break; + case 2: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 1.0f); + break; + case 3: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 1.5f); + break; + case 4: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 2.0f); + break; + case 5: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 2.5f); + break; + case 6: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 3.0f); + break; + case 7: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 3.5f); + break; + case 8: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 4.0f); + break; + case 9: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 4.5f); + break; + case 10: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWalkSpeed }, 5.0f); + break; + } + break; + + case 10: + switch (menuItem) + { + case 0: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 0.0f); + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 0.5f); + break; + case 2: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 1.0f); + break; + case 3: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 1.5f); + break; + case 4: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 2.0f); + break; + case 5: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 2.5f); + break; + case 6: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 3.0f); + break; + case 7: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 3.5f); + break; + case 8: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 4.0f); + break; + case 9: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 4.5f); + break; + case 10: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oRunSpeed }, 5.0f); + break; + } + break; + + case 11: + switch (menuItem) + { + case 0: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 0); + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 1); + break; + case 2: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 2); + break; + case 3: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 3); + break; + case 4: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 4); + break; + case 5: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPlayerInfo, offsets.oWanted }, 5); + break; + } + break; + } + break; + + case 4: + switch (menulevel) + { + case 0: + switch (menuItem) + { + case 0: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oImpactType }, 2); + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oImpactType }, 3); + break; + case 2: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oImpactType }, 5); + break; + } + break; + + case 1: + switch (menuItem) + { + case 0: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oImpactExplosion }, -1); + break; + case 1: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oImpactExplosion }, 0); + break; + case 2: + Activate(); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCPedWeaponManager, offsets.pCWeaponInfo, offsets.oImpactExplosion }, 59); + break; + } + break; + } + break; + + case 5: + switch (menulevel) + { + case 1: + switch (menuItem) + { + case 0: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + int[] tpIdArray = new int[] { 614 }; + int[] tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 1: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 740 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 2: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 475 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 3: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 557 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 4: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 590 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 5: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 569 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 6: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 455 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 7: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 760 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 8: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 64, 427, 478, 423, 501, 556 }; + tpColArray = new int[] { 2, 3 }; + teleportBlip(tpIdArray, tpColArray, 2); + + /* + Location loc = new Location { x = 721.968f, y = -821.941f, z = 25.153f }; + Teleport(loc); + */ + if (!bgodState) + { + bGodMode = false; + } + break; + case 9: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 492 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 10: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 499 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 11: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 497 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 12: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 496 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 13: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 500 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 14: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + tpIdArray = new int[] { 498 }; + tpColArray = new int[] { }; + teleportBlip(tpIdArray, tpColArray); + if (!bgodState) + { + bGodMode = false; + } + break; + case 15: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + Location loc = new Location { x = 918.2499f, y = 50.25024f, z = 80.89696f }; + Teleport(loc); + if (!bgodState) + { + bGodMode = false; + } + break; + case 16: + Activate(); + + if (bGodMode) + { + bgodState = true; + } + else + { + bGodMode = true; + bgodState = false; + } + loc = new Location { x = 777f, y = -1876f, z = 29.29654f }; + Teleport(loc); + if (!bgodState) + { + bGodMode = false; + } + break; + } + break; + } + break; + + case 6: + switch (menulevel) + { + case 0: + switch (menuItem) + { + case 0: + Activate(); + setRPMultipler(1.0f); + break; + case 1: + Activate(); + setRPMultipler(2.0f); + break; + case 2: + Activate(); + setRPMultipler(3.0f); + break; + case 3: + Activate(); + setRPMultipler(5.0f); + break; + case 4: + Activate(); + setRPMultipler(10.0f); + break; + case 5: + Activate(); + setRPMultipler(15.0f); + break; + case 6: + Activate(); + setRPMultipler(20.0f); + break; + case 7: + Activate(); + setRPMultipler(25.0f); + break; + case 8: + Activate(); + setRPMultipler(30.0f); + break; + case 9: + Activate(); + setRPMultipler(35.0f); + break; + case 10: + Activate(); + setRPMultipler(40.0f); + break; + case 11: + Activate(); + setRPMultipler(50.0f); + break; + case 12: + Activate(); + setRPMultipler(100.0f); + break; + } + break; + + case 1: + switch (menuItem) + { + case 0: + Activate(); + setREPMultipler(1.0f); + break; + case 1: + Activate(); + setREPMultipler(2.0f); + break; + case 2: + Activate(); + setREPMultipler(3.0f); + break; + case 3: + Activate(); + setREPMultipler(5.0f); + break; + case 4: + Activate(); + setREPMultipler(10.0f); + break; + case 5: + Activate(); + setREPMultipler(15.0f); + break; + case 6: + Activate(); + setREPMultipler(20.0f); + break; + case 7: + Activate(); + setREPMultipler(25.0f); + break; + case 8: + Activate(); + setREPMultipler(30.0f); + break; + case 9: + Activate(); + setREPMultipler(35.0f); + break; + case 10: + Activate(); + setREPMultipler(40.0f); + break; + case 11: + Activate(); + setREPMultipler(50.0f); + break; + case 12: + Activate(); + setREPMultipler(100.0f); + break; + case 13: + Activate(); + setREPMultipler(200.0f); + break; + case 14: + Activate(); + setREPMultipler(300.0f); + break; + case 15: + Activate(); + setREPMultipler(500.0f); + break; + case 16: + Activate(); + setREPMultipler(1000.0f); + break; + } + break; + } + break; + + case 7: + switch (menulevel) + { + case 0: + switch (menuItem) + { + case 0: + Activate(); + getLuckyWheelPrice(1); + break; + case 1: + Activate(); + getLuckyWheelPrice(2); + break; + case 2: + Activate(); + getLuckyWheelPrice(3); + break; + case 3: + Activate(); + getLuckyWheelPrice(4); + break; + case 4: + Activate(); + getLuckyWheelPrice(5); + break; + case 5: + Activate(); + getLuckyWheelPrice(6); + break; + case 6: + Activate(); + getLuckyWheelPrice(7); + break; + case 7: + Activate(); + getLuckyWheelPrice(8); + break; + case 8: + Activate(); + getLuckyWheelPrice(9); + break; + case 9: + Activate(); + getLuckyWheelPrice(10); + break; + case 10: + Activate(); + getLuckyWheelPrice(11); + break; + case 11: + Activate(); + getLuckyWheelPrice(12); + break; + case 12: + Activate(); + getLuckyWheelPrice(13); + break; + case 13: + Activate(); + getLuckyWheelPrice(14); + break; + case 14: + Activate(); + getLuckyWheelPrice(15); + break; + case 15: + Activate(); + getLuckyWheelPrice(16); + break; + case 16: + Activate(); + getLuckyWheelPrice(17); + break; + case 17: + Activate(); + getLuckyWheelPrice(18); + break; + } + break; + } + break; + } + + } + + public static void runSingleItem() + { + Console.WriteLine("Command to run backward: " + LastMenuMainLvl + " " + LastMenuLvl + " " + LastMenuItm); + int oldMenuItm = LastMenuItm; + listboxFill(LastMenuMainLvl, LastMenuLvl); + listBx.SelectedIndex = oldMenuItm; + } + + private static void mainlistup() + { + if (listBx.SelectedIndex > 0) + { + listBx.SelectedIndex = listBx.SelectedIndex - 1; + menuItm = listBx.SelectedIndex; + } + } + + private static void mainlistdown() + { + if (listBx.SelectedIndex < listBx.Items.Count - 1) + { + listBx.SelectedIndex = listBx.SelectedIndex + 1; + menuItm = listBx.SelectedIndex; + } + } + + public static void showHideOverlay() + { + if (!isHidden) + { + isHidden = true; + ShowWindow(formHandle, SW_HIDE); + } + else + { + isHidden = false; + ShowWindow(formHandle, 1); + } + } + + private static IntPtr SetHook(LowLevelKeyboardProc proc) + { + using (Process curProcess = Process.GetCurrentProcess()) + using (ProcessModule curModule = curProcess.MainModule) + { + return SetWindowsHookEx(WH_KEYBOARD_LL, proc, + GetModuleHandle(curModule.ModuleName), 0); + } + } + + private delegate IntPtr LowLevelKeyboardProc( + int nCode, IntPtr wParam, IntPtr lParam); + + private static IntPtr HookCallback( + int nCode, IntPtr wParam, IntPtr lParam) + { + if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) + { + int vkCode = Marshal.ReadInt32(lParam); + if ((Keys)vkCode == Keys.F5) + { + showHideOverlay(); + } + else if ((Keys)vkCode == Keys.NumPad0) + { + if (!isHidden) + { + if (menuMainLvl <= 0) + { + isHidden = true; + ShowWindow(formHandle, SW_HIDE); + } + else + { + runSingleItem(); + } + } + } + else if ((Keys)vkCode == Keys.NumPad5) + { + runitem(menuMainLvl, menuLvl, listBx.SelectedIndex); + } + else if ((Keys)vkCode == Keys.Up || (Keys)vkCode == Keys.Down || (Keys)vkCode == Keys.Left || (Keys)vkCode == Keys.Right) + { + if (!isHidden) + { + return (IntPtr)1; + } + } + else if ((Keys)vkCode == Keys.NumPad2) + { + if (!isHidden) + { + mainlistdown(); + } + } + else if ((Keys)vkCode == Keys.NumPad8) + { + if (!isHidden) + { + mainlistup(); + } + } + else if ((Keys)vkCode == Keys.Delete) + { + if (!isHidden) + { + Quit(); + } + } + } + return CallNextHookEx(_hookID, nCode, wParam, lParam); + } + + public static void LoadSession(int id) + { + if (id == -1) + { + _SG_Int(1574587 + 2, -1); + _SG_Int(1574587, 1); + Thread.Sleep(200); + _SG_Int(1574587, 0); + } + else if (id == -2) + { + _SG_Int(1574587 + 2, 1); + Thread.Sleep(200); + _SG_Int(1574587, 0); + } + else + { + _SG_Int(1575004, id); + _SG_Int(1574587, 1); + Thread.Sleep(200); + _SG_Int(1574587, 0); + } + } + + public static void getLuckyWheelPrice(int id) + { + string script = "casino_lucky_wheel"; + int Index = 274 + 14; + long scriptAddr = GetLocalScript(script); + if (scriptAddr > 0 && id > 0) + { + long scriptAddr2 = scriptAddr + (8 * Index); + Console.WriteLine(scriptAddr2); + int scriptInt = Mem.ReadInt(scriptAddr2, null); + Console.WriteLine(scriptInt); + Mem.writeInt(scriptAddr2, null, id); + } + } + + #region Teleport part + + private static void teleportWaypoint() + { + Teleport(WaypointCoords); + } + public static void setRPMultipler(float m) + { + _SG_Float(262145 + 1, m); + } + + public static void setREPMultipler(float m) + { + _SG_Float(262145 + 31278, m); // Street Race + _SG_Float(262145 + 31279, m); // Pursuit Race + _SG_Float(262145 + 31280, m); // Scramble + _SG_Float(262145 + 31281, m); // Head 2 Head + _SG_Float(262145 + 31283, m); // Car Meet + _SG_Float(262145 + 31284, m); // Test Track + } + + private static void Teleport(Location l) + { + if (Mem.ReadInt(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oInVehicle }) == 0) + { + CarX = l.x; + CarY = l.y; + CarZ = l.z; + } + else + { + PlayerX = l.x; + PlayerY = l.y; + PlayerZ = l.z; + } + } + + private static void teleportBlip(int[] ID, int[] color, int height = 0) + { + Location tmpLoc = getBlipCoords(ID, color); + Location returnLoc = new Location + { + x = tmpLoc.x, + y = tmpLoc.y, + z = tmpLoc.z + height + 3 + }; + Console.WriteLine("New location: " + returnLoc.x + ", " + returnLoc.y + ", " + returnLoc.z); + Teleport(tmpLoc); + } + + private static Location WaypointCoords + { + get + { + float tX = Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionX }); + float tY = Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionY }); + float tZ = Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionZ }); + Console.WriteLine("New location: " + tX + ", " + tY + ", " + tZ); + for (int i = 2000; i > 1; i--) + { + if (Mem.ReadInt(settings.BlipPTR + (i * 8), new int[] { 0x48 }) == 84 && Mem.ReadInt(settings.BlipPTR + (i * 8), new int[] { 0x40 }) == 8) + { + return new Location + { + x = Mem.ReadFloat(settings.BlipPTR + (i * 8), new int[] { 0x10 }), + y = Mem.ReadFloat(settings.BlipPTR + (i * 8), new int[] { 0x14 }), + z = -210F + }; + } + } + return new Location { x = PlayerX, y = PlayerY, z = PlayerZ }; + } + } + + private static Location getBlipCoords(int[] id, int[] color = null) + { + Location tempLocation = new Location { }; + for (int i = 2000; i > 1; i--) + { + long blip = settings.BlipPTR + (i * 8); + int blipId = Mem.ReadInt(blip, new int[] { 0x40 }); + int blipColor = Mem.ReadInt(blip, new int[] { 0x48 }); + if (id.Contains(blipId)) + { + tempLocation = new Location + { + x = Mem.ReadFloat(blip, new int[] { 0x10 }), + y = Mem.ReadFloat(blip, new int[] { 0x14 }), + z = Mem.ReadFloat(blip, new int[] { 0x18 }) + }; + + if(color.Contains(blipColor)) + { + tempLocation = new Location + { + x = Mem.ReadFloat(blip, new int[] { 0x10 }), + y = Mem.ReadFloat(blip, new int[] { 0x14 }), + z = Mem.ReadFloat(blip, new int[] { 0x18 }) + }; + } + } + } + return new Location { x = tempLocation.x, y = tempLocation.y, z = tempLocation.z }; + } + + public static float PlayerX + { + get { return Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionX }); } + set + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionX }, value); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oVisualX }, value); + } + } + public static float PlayerY + { + get { return Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionX }); } + set + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionY }, value); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oVisualY }, value); + } + } + public static float PlayerZ + { + get { return Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionX }); } + set + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oRotation, offsets.oPositionZ }, value); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.oVisualZ }, value); + } + } + + public static float CarX + { + get { return Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oPositionX }); } + set + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oPositionX }, value); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oVPositionX }, value); + } + } + public static float CarY + { + get { return Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oPositionY }); } + set + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oPositionY }, value); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oVPositionY }, value); + } + } + public static float CarZ + { + get { return Mem.ReadFloat(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oPositionZ }); } + set + { + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oPositionZ }, value); + Mem.Write(settings.WorldPTR, new int[] { offsets.pCPed, offsets.pCVehicle, offsets.pCNavigation, offsets.oVPositionZ }, value); + } + } + #endregion + + #region Global Addresses function + public static long GA(long Index) + { + long p = settings.GlobalPTR + (8 * (Index >> 0x12 & 0x3F)); + long p_ga = Mem.ReadPointer(p, null); + long p_ga_final = p_ga + (8 * (Index & 0x3FFFF)); + return p_ga_final; + } + public static long _GG_Int(int Index) + { + return Mem.ReadInt(GA(Index), null); + } + public static float _GG_Float(int Index) + { + return Mem.ReadFloat(GA(Index), null); + } + public static string _GG_String(int Index, int size) + { + return Mem.ReadString(GA(Index), null, size); + } + public static void _SG_Int(int Index, int value) + { + Mem.writeInt(GA(Index), null, value); + } + public static void _SG_Float(int Index, float value) + { + Mem.writeFloat(GA(Index), null, value); + } + public static void _SG_String(int Index, string value) + { + Mem.Write(GA(Index), null, value); + } + + public static void setStat(string stat, int value) + { + long oldhash = _GG_Int(1655444 + 4); + long oldvalue = _GG_Int(1020252 + 5526); + _SG_Int(1655444 + 4, (int)JOAAT.GetHashKey(stat)); + _SG_Int(1020252 + 5526, value); + _SG_Int(1644209 + 1139, -1); + Thread.Sleep(1000); + _SG_Int(1655444 + 4, (int)oldhash); + _SG_Int(1020252 + 5526, (int)oldvalue); + } + public static long GetLocalScript(string name) + { + int size = name.Length; + for (int i = 0; i <= 52; i++) + { + long lc_p = Mem.ReadPointer(settings.LocalScriptsPTR, new int[] { (i * 8), 0xB0 }); + string lc_n = Mem.ReadString(settings.LocalScriptsPTR, new int[] { (i * 8), 0xD0 }, size); + if (lc_n == name) + { + i = 53; + Console.WriteLine(lc_p); + return (lc_p); + } + } + return 0; + } + #endregion + + } + struct Location { public float x, y, z; } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3881573 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GTAV C# MM")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GTAV C# MM")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b728a908-c9ea-4cfa-8c2f-b209847607a8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..290086f --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace GTAVCSMM.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GTAVCSMM.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..52a9672 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace GTAVCSMM.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..b249b19 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# GTAVCSMM +GTA5 CSharp Mod Menu + +Based on an idea by Nknights23 https://www.unknowncheats.me/forum/grand-theft-auto-v/463157-gta-simple-external-overlay.html + +With code from Complexicon https://github.com/Complexicon/BunkerMoney / https://www.unknowncheats.me/forum/grand-theft-auto-v/305760-bunkermoney-v3-0-a.html + +No external DLLs needed. + +New overlay menu. Navigate with Numpad: 8 Up, 2 Down, 5 Enter, 0 Back. Show/Hide: F5, quit: Del + +Casino Lucky Wheel: set the price before pressing the spin button. + ++++ Online 1.58 +++ + +Donations: https://www.buymeacoffee.com/linewalker85 + +... Code cleanup later ... diff --git a/Settings/Addresses.cs b/Settings/Addresses.cs new file mode 100644 index 0000000..2d61d87 --- /dev/null +++ b/Settings/Addresses.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GTAVCSMM.Settings +{ + class Addresses + { + private string _f_godm = "0x0"; + private string _f_nwanted = "0x0"; + private string _f_nragdoll = "0x0"; + private string _f_uoffradar = "0x0"; + private string _f_sbelt = "0x0"; + private string _f_sjump = "0x0"; + + public string f_godm + { + get + { + return _f_godm; + } + set + { + _f_godm = value; + } + } + public string f_nwanted + { + get + { + return _f_nwanted; + } + set + { + _f_nwanted = value; + } + } + public string f_nragdoll + { + get + { + return _f_nragdoll; + } + set + { + _f_nragdoll = value; + } + } + public string f_uoffradar + { + get + { + return _f_uoffradar; + } + set + { + _f_uoffradar = value; + } + } + public string f_sbelt + { + get + { + return _f_sbelt; + } + set + { + _f_sbelt = value; + } + } + public string f_sjump + { + get + { + return _f_sjump; + } + set + { + _f_sjump = value; + } + } + } +} diff --git a/Settings/TSettings.cs b/Settings/TSettings.cs new file mode 100644 index 0000000..499dd5f --- /dev/null +++ b/Settings/TSettings.cs @@ -0,0 +1,660 @@ +namespace GTAVCSMM.Settings +{ + class TSettings + { + #region Globals + private string _gameName = "GTA5"; + private int _gameProcess = 0; + private long _globalptr; + private long _worldptr; + private long _blipptr; + private long _replayinterfaceptr; + private long _localscriptsptr; + private long _playercountptr; + private long _pickupdataptr; + private long _weatheraddr; + private long _settingsptr; + private long _aimcpedptr; + private long _friendlistptr; + + public string gameName + { + get + { + return _gameName; + } + } + + public int gameProcess + { + get + { + return _gameProcess; + } + set + { + _gameProcess = value; + } + } + + public long GlobalPTR + { + get + { + return _globalptr; + } + set + { + _globalptr = value; + } + } + + public long WorldPTR + { + get + { + return _worldptr; + } + set + { + _worldptr = value; + } + } + + public long BlipPTR + { + get + { + return _blipptr; + } + set + { + _blipptr = value; + } + } + + public long ReplayInterfacePTR + { + get + { + return _replayinterfaceptr; + } + set + { + _replayinterfaceptr = value; + } + } + + public long LocalScriptsPTR + { + get + { + return _localscriptsptr; + } + set + { + _localscriptsptr = value; + } + } + + public long PlayerCountPTR + { + get + { + return _playercountptr; + } + set + { + _playercountptr = value; + } + } + + public long PickupDataPTR + { + get + { + return _pickupdataptr; + } + set + { + _pickupdataptr = value; + } + } + + public long WeatherADDR + { + get + { + return _weatheraddr; + } + set + { + _weatheraddr = value; + } + } + + public long SettingsPTR + { + get + { + return _settingsptr; + } + set + { + _settingsptr = value; + } + } + + public long AimCPedPTR + { + get + { + return _aimcpedptr; + } + set + { + _aimcpedptr = value; + } + } + + public long FriendlistPTR + { + get + { + return _friendlistptr; + } + set + { + _friendlistptr = value; + } + } + #endregion + + #region Trainer settings + private int _aConnect = 0; + private int _aFKtoggle = 0; + private int _aGodMode = 0; + private int _aLogPlayers = 0; + private int _aDarkMode = 0; + private int _player_tracking = 0; + //tbl_origPlayersList = {} + private int _pictureGrabOFF = 0; + //player_watch = {} + //tbl_Players = {} + //tbl_PlayersAll = {} + //tbl_Tracking = {} + private int _markMyRid = -1; + private int _myCPed = -1; + + private bool _GlobalPTRFound = false; + private bool _WorldPTRFound = false; + private bool _BlipPTRFound = false; + private bool _ReplayInterfacePTRFound = false; + private bool _LocalScriptsPTRFound = false; + private bool _PlayerCountPTRFound = false; + private bool _PickupDataPTRFound = false; + private bool _WeatherADDRFound = false; + private bool _SettingsPTRFound = false; + private bool _AimCPedPTRFound = false; + private bool _FriendlistPTRFound = false; + + public int aConnect + { + get + { + return _aConnect; + } + set + { + _aConnect = value; + } + } + + public int aFKtoggle + { + get + { + return _aFKtoggle; + } + set + { + _aFKtoggle = value; + } + } + + public int aGodMode + { + get + { + return _aGodMode; + } + set + { + _aGodMode = value; + } + } + + public int aLogPlayers + { + get + { + return _aLogPlayers; + } + set + { + _aLogPlayers = value; + } + } + + public int aDarkMode + { + get + { + return _aDarkMode; + } + set + { + _aDarkMode = value; + } + } + + public int player_tracking + { + get + { + return _player_tracking; + } + set + { + _player_tracking = value; + } + } + + public int pictureGrabOFF + { + get + { + return _pictureGrabOFF; + } + set + { + _pictureGrabOFF = value; + } + } + + public int markMyRid + { + get + { + return _markMyRid; + } + set + { + _markMyRid = value; + } + } + + public int myCPed + { + get + { + return _myCPed; + } + set + { + _myCPed = value; + } + } + + public bool GlobalPTRFound + { + get + { + return _GlobalPTRFound; + } + set + { + _GlobalPTRFound = value; + } + } + + public bool WorldPTRFound + { + get + { + return _WorldPTRFound; + } + set + { + _WorldPTRFound = value; + } + } + + public bool BlipPTRFound + { + get + { + return _BlipPTRFound; + } + set + { + _BlipPTRFound = value; + } + } + + public bool ReplayInterfacePTRFound + { + get + { + return _ReplayInterfacePTRFound; + } + set + { + _ReplayInterfacePTRFound = value; + } + } + + public bool LocalScriptsPTRFound + { + get + { + return _LocalScriptsPTRFound; + } + set + { + _LocalScriptsPTRFound = value; + } + } + + public bool PlayerCountPTRFound + { + get + { + return _PlayerCountPTRFound; + } + set + { + _PlayerCountPTRFound = value; + } + } + + public bool PickupDataPTRFound + { + get + { + return _PickupDataPTRFound; + } + set + { + _PickupDataPTRFound = value; + } + } + + public bool WeatherADDRFound + { + get + { + return _WeatherADDRFound; + } + set + { + _WeatherADDRFound = value; + } + } + + public bool SettingsPTRFound + { + get + { + return _SettingsPTRFound; + } + set + { + _SettingsPTRFound = value; + } + } + + public bool AimCPedPTRFound + { + get + { + return _AimCPedPTRFound; + } + set + { + _AimCPedPTRFound = value; + } + } + + public bool FriendlistPTRFound + { + get + { + return _FriendlistPTRFound; + } + set + { + _FriendlistPTRFound = value; + } + } + #endregion + + private bool _pgodm = false; + private bool _pgodm_last_hit = false; + private bool _pnwanted = false; + private bool _pnwanted_last_hit = false; + private bool _pnragdoll = false; + private bool _pnragdoll_last_hit = false; + private bool _puoffradar = false; + private bool _puoffradar_last_hit = false; + private bool _psbelt = false; + private bool _psbelt_last_hit = false; + private bool _psjump = false; + private bool _psjump_last_hit = false; + private bool _psexammo = false; + private bool _psexammo_last_hit = false; + private bool _pdiscol = false; + private bool _pdiscol_last_hit = false; + private bool _vgodm = false; + private bool _vgodm_last_hit = false; + + public bool pgodm + { + get + { + return _pgodm; + } + set + { + _pgodm = value; + } + } + public bool pgodm_last_hit + { + get + { + return _pgodm_last_hit; + } + set + { + _pgodm_last_hit = value; + } + } + public bool pnwanted + { + get + { + return _pnwanted; + } + set + { + _pnwanted = value; + } + } + public bool pnwanted_last_hit + { + get + { + return _pnwanted_last_hit; + } + set + { + _pnwanted_last_hit = value; + } + } + public bool pnragdoll + { + get + { + return _pnragdoll; + } + set + { + _pnragdoll = value; + } + } + public bool pnragdoll_last_hit + { + get + { + return _pnragdoll_last_hit; + } + set + { + _pnragdoll_last_hit = value; + } + } + public bool puoffradar + { + get + { + return _puoffradar; + } + set + { + _puoffradar = value; + } + } + public bool puoffradar_last_hit + { + get + { + return _puoffradar_last_hit; + } + set + { + _puoffradar_last_hit = value; + } + } + public bool psbelt + { + get + { + return _psbelt; + } + set + { + _psbelt = value; + } + } + public bool psbelt_last_hit + { + get + { + return _psbelt_last_hit; + } + set + { + _psbelt_last_hit = value; + } + } + public bool psjump + { + get + { + return _psjump; + } + set + { + _psjump = value; + } + } + public bool psjump_last_hit + { + get + { + return _psjump_last_hit; + } + set + { + _psjump_last_hit = value; + } + } + public bool psexammo + { + get + { + return _psexammo; + } + set + { + _psexammo = value; + } + } + public bool psexammo_last_hit + { + get + { + return _psexammo_last_hit; + } + set + { + _psexammo_last_hit = value; + } + } + public bool pdiscol + { + get + { + return _pdiscol; + } + set + { + _pdiscol = value; + } + } + public bool pdiscol_last_hit + { + get + { + return _pdiscol_last_hit; + } + set + { + _pdiscol_last_hit = value; + } + } + public bool vgodm + { + get + { + return _vgodm; + } + set + { + _vgodm = value; + } + } + public bool vgodm_last_hit + { + get + { + return _vgodm_last_hit; + } + set + { + _vgodm_last_hit = value; + } + } + } +} diff --git a/app.manifest b/app.manifest new file mode 100644 index 0000000..d72e750 --- /dev/null +++ b/app.manifest @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gtavcsmm.ico b/gtavcsmm.ico new file mode 100644 index 0000000..035bef6 Binary files /dev/null and b/gtavcsmm.ico differ