联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2018-07-23 03:03


//这一块数据 只是获取自瞄玩家 在世界里面的坐标 和 自身的坐标数据

void AimBot()

{


//获取自身PlayerController数据

UINT64 PlayerController = WPM_Get_PlayerController();


//偏移地址为:(PlayerController + 0x0490);

UINT64 PlayerCameraManager = WPM_Get_PlayerCameraManager();


//偏移地址为:(PlayerCameraManager + 0x1098);

UINT32 FOV = WPM_Get_FOV();  


//偏移地址为:PlayerCameraManager + 0x10a4 获取容器数据 Vector3 3D的向量[位置 方向 角度]

Vector3 LocationPos = WPM_Get_LocationPos();  


//偏移地址为:PlayerCameraManager + 0x10b8 获取容器数据 Vector3 3D的向量[位置 方向 角度]

Vector3 RotationPos = WPM_Get_RotationPos();  


//获取当前自瞄玩家 Actor坐标

Vector3 ActorPos = getActorVector(AimPlayer);    


//计算当前自瞄玩家  到 自身的 距离!

float distance = LocationPos.Distance(ActorPos) / 100.f;  


//读取Mesh偏移位 0x04d0

UINT64 mesh = Read_64(AimPlayer + Mesh_Offset);  


// 获取 自瞄玩家 额头 坐标

GetBoneMatrix(mesh, &AimPlayerV3, 15);  


Vector3 tempVelocity = { 0,0,0 };


//获取自身Actor();

UINT64 APawn = 获取自身Actor();




/*

//这段是计算开镜的呼吸摆动 我暂时没有添加 没必要过于精准, 代码我也放在这里

//当前版本的偏移:

ControlRotation_Offset        0x0420

   ControlRotation_CP_Offset     0x063c

   AnimScriptInstance_Offset     0x0b98

UINT64 AnimScriptInstances = Read_64(SkeletalMeshComponents + AnimScriptInstance_Offset);


if (AnimScriptInstances != 0)

{

tempControlRotation = getRVector3_ControlRotation(PlayerController);


//如果为空 返回

if (isEmpty(tempControlRotation))

{

return;

}


tempControlRotation_CP = getRVector3_ControlRotation_CP(AnimScriptInstances);


//如果为空 返回

if (isEmpty(tempControlRotation_CP))

{

continue;

}


CP = tempControlRotation_CP - tempControlRotation;

}


如果你需要添加在这一句 减去CP.x, CP.y 即可

Vector3 tempVelocity1 = { AimPlayerV3.x + ((ComponentVelocity.x * time_btop) * 1.10f) - CP.x,

 AimPlayerV3.y + ((ComponentVelocity.y * time_btop) * 1.10f) - CP.y,

 0

};

*/


//如果开启自瞄预测

if (ForecastSwitch)

{

//WeaponProcessor_Offset : 0x0a80 获取当前手上的武器

UINT64 WeaponProcessor = Read_64(APawn + WeaponProcessor_Offset);  


//获取当前手上武器数量

int Count = Read_32(WeaponProcessor + EquippedWeapons_Offset + 0x08);


//获取当前武器索引 代表当前手上拿的哪一把武器

int CurrentIndex = Read_32(WeaponProcessor + EquippedWeapons_Offset + 0x020);  


//获取武器数据

UINT64 pDatas = Read_64(WeaponProcessor + EquippedWeapons_Offset);  


UINT64 pcurrent_weapon = 0;


//如果当前手上武器的索引 小于0或者大于2  说明手上没有武器 返回 不自动瞄准

if (CurrentIndex < 0 || CurrentIndex > 2)

{

return;  

}



UINT64 EquippedWeapons = Read_64(pDatas + 8 * CurrentIndex);


if (!EquippedWeapons)

{

return;

}


//获取当前武器的 子弹速度

//偏移:

//Trajectory_Offset             0x0e10

//EquippedWeapons_Offset        0x04f8

//InitialSpeed_Offset           0x0064

float Speed = Read_32(EquippedWeapons + Trajectory_Offset + InitialSpeed_Offset);  


//计算子弹速度 飞行时间

float time_btop = distance / LocalWepInitialSpeed;  


LocalWepInitialSpeed = 0;



//获取当前自瞄玩家的人物移动速度

//CharacterMovement_Offset :0x0490  

UINT64 CharacterMovement = Decrypt(AimPlayer + CharacterMovement_Offset);  


//获取自瞄玩家的速度数据

Vector3 ComponentVelocity = getVelocity(CharacterMovement);  


//自瞄算法

Vector3 tempVelocity1 = { AimPlayerV3.x + ((ComponentVelocity.x * time_btop) * 1.10f),

 AimPlayerV3.y + ((ComponentVelocity.y * time_btop) * 1.10f),

 0

};


//转换到屏幕的坐标

tempVelocity = W2S(tempVelocity1, RotationPos, LocationPos, FOV);


//tempVelocity.x  代表屏幕的X 点

//tempVelocity.y  代表屏幕的Y 点



}


}


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp