Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void OnRenderer(int fps, EventArgs args)
- {
- if (!gameProcessExists) return; //process is dead, don't bother drawing
- if ((!isGameOnTop) && (!isOverlayOnTop)) return; //if game and overlay are not on top, don't draw
- if (!Components.MainAssemblyToggle.Enabled) return; //main menu boolean to toggle the cheat on or off
- if (GWorldPtr == IntPtr.Zero) return;
- double fClosestPos = 999999;
- GameCenterPos = new Vector2(wndSize.X / 2 + wndMargins.X, wndSize.Y / 2 + wndMargins.Y);
- GameCenterPos2 = new Vector2(wndSize.X / 2 + wndMargins.X, wndSize.Y / 2 + wndMargins.Y + 750.0f);//even if the game is windowed, calculate perfectly it's "center" for aim or crosshair
- Functions.Ppc();
- ULevel = Memory.ZwReadPointer(processHandle, GWorldPtr + 0x30, isWow64Process);
- AActors = Memory.ZwReadPointer(processHandle, (IntPtr)ULevel.ToInt64() + 0x98, isWow64Process);
- ActorCnt = Memory.ZwReadUInt32(processHandle, (IntPtr)ULevel.ToInt64() + 0xA0);
- if ((AActors == IntPtr.Zero) || (ActorCnt < 1)) return;
- for (uint i = 0; i <= ActorCnt; i++)
- {
- AActor = Memory.ZwReadPointer(processHandle, (IntPtr)(AActors.ToInt64() + i * 8), isWow64Process);
- if (AActor == IntPtr.Zero) continue;
- USceneComponent = Memory.ZwReadPointer(processHandle,
- (IntPtr)AActor.ToInt64() + 0x130, isWow64Process);
- if (USceneComponent == IntPtr.Zero) continue;
- tempVec = Memory.ZwReadVector3(processHandle,
- (IntPtr)USceneComponent.ToInt64() + 0x11C);
- AActorID = Memory.ZwReadUInt32(processHandle,
- (IntPtr)AActor.ToInt64() + 0x18);
- if (!CachedID.ContainsKey(AActorID))
- {
- var retname = GetNameFromFName(AActorID);
- CachedID.Add(AActorID, retname);
- }
- CurrentActorHP = Memory.ZwReadFloat(processHandle, (IntPtr)AActor.ToInt64() + 0x528);
- CurrentActorHPMax = Memory.ZwReadFloat(processHandle, (IntPtr)AActor.ToInt64() + 0x287C);
- //string retname = "";
- if ((AActorID > 0)) //&& (AActorID < 700000)
- {
- var retname = CachedID[AActorID];
- retname = GetNameFromFName(AActorID);
- if (retname.Contains("MainCharacter_C") || retname.Contains("DefaultPVPBotCharacter_C") || retname.Contains("DefaultBotCharacter_C")) EnemyID = AActorID;
- //Team Info////////////////////////////////////////////////////////////////////////////////////////////////////////
- actor_pawn = Memory.ZwReadPointer(processHandle, (IntPtr)AActor.ToInt64() + 0x118, true);
- Playerstate = Memory.ZwReadPointer(processHandle, (IntPtr)actor_pawn.ToInt64() + 0x240, true);
- IsDowned = Memory.ZwReadBool(processHandle, (IntPtr)AActor.ToInt64() + 0xC18);
- bool bKickbackEnableds = Memory.ZwReadBool(processHandle, (IntPtr)Program.ULocalPlayerControler.ToInt64() + 0xAF8);
- LAKSTeamState = Memory.ZwReadPointer(processHandle, (IntPtr)UplayerState.ToInt64() + Offset_AKSTeamState, true);
- LTeamNum = Memory.ZwReadPointer(processHandle, (IntPtr)LAKSTeamState.ToInt64() + Offset_r_TeamNum, true);
- AKSTeamState = Memory.ZwReadPointer(processHandle, (IntPtr)Playerstate.ToInt64() + Offset_AKSTeamState, true);
- TeamNum = Memory.ZwReadPointer(processHandle, (IntPtr)AKSTeamState.ToInt64() + Offset_r_TeamNum, true);
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- if (Components.AimbotComponent.NoRecoil.Enabled)
- {
- bKickbackEnableds = Memory.ZwWriteBool(processHandle, (IntPtr)Program.ULocalPlayerControler.ToInt64() + 0xAF8, false);
- }
- else
- {
- bKickbackEnableds = Memory.ZwWriteBool(processHandle, (IntPtr)Program.ULocalPlayerControler.ToInt64() + 0xAF8, true);
- }
- }
- if (!Components.VisualsComponent.DrawTheVisuals.Enabled) return;
- dist = (int)(GetDistance3D(FMinimalViewInfo_Location, tempVec));
- if (AActorID != EnemyID || CurrentActorHP == 0) continue;
- Vector2 vScreen_h3ad = new Vector2(0, 0);
- Vector2 vScreen_f33t = new Vector2(0, 0);
- if (!Renderer.WorldToScreenUE4(new Vector3(tempVec.X, tempVec.Y, tempVec.Z + 70.0f), out vScreen_h3ad, FMinimalViewInfo_Location, FMinimalViewInfo_Rotation, FMinimalViewInfo_FOV, wndMargins, wndSize)) continue;
- Renderer.WorldToScreenUE4(new Vector3(tempVec.X, tempVec.Y, tempVec.Z - 70.0f), out vScreen_f33t, FMinimalViewInfo_Location, FMinimalViewInfo_Rotation, FMinimalViewInfo_FOV, wndMargins, wndSize);
- if (Components.VisualsComponent.DrawBox.Enabled)
- {
- if (LTeamNum != TeamNum)
- {
- Renderer.DrawFPSBox(vScreen_h3ad, vScreen_f33t, Components.VisualsComponent.EnemyColor.Color, BoxStance.standing, Components.VisualsComponent.DrawBoxThic.Value, Components.VisualsComponent.DrawBoxBorder.Enabled, true, CurrentActorHP, CurrentActorHPMax);
- Renderer.DrawText("[" + dist + "m]", vScreen_f33t.X, vScreen_f33t.Y, Components.VisualsComponent.EnemyColor.Color, 12, TextAlignment.centered, false);
- }
- }
- else
- {
- Renderer.DrawFPSBox(vScreen_h3ad, vScreen_f33t, Color.Blue, BoxStance.standing, Components.VisualsComponent.DrawBoxThic.Value, Components.VisualsComponent.DrawBoxBorder.Enabled);
- Renderer.DrawText("[" + dist + "m]", vScreen_f33t.X, vScreen_f33t.Y, Color.Black, 12, TextAlignment.centered, false);
- }
- if (Components.AimbotComponent.DrawFov.Enabled) //draw fov circle
- {
- Renderer.DrawCircle(GameCenterPos, Components.AimbotComponent.AimFov.Value, Components.AimbotComponent.AimFovColor.Color);
- }
- var AimDist2D = GetDistance2D(vScreen_h3ad, GameCenterPos);
- if (Components.AimbotComponent.AimFov.Value < AimDist2D) continue;
- if (AimDist2D < fClosestPos)
- {
- fClosestPos = AimDist2D;
- AimTarg2D = vScreen_h3ad;
- if (Components.AimbotComponent.AimKey.Enabled && Components.AimbotComponent.AimGlobalBool.Enabled && dist > 5 && LTeamNum != TeamNum)
- {
- double DistX = AimTarg2D.X - GameCenterPos.X;
- double DistY = (AimTarg2D.Y) - GameCenterPos.Y;
- double slowDistX = DistX / (0.5f + (Math.Abs(DistX) / (1.0f + Components.AimbotComponent.AimSpeed.Value)));
- double slowDistY = DistY / (0.5f + (Math.Abs(DistY) / (1.0f + Components.AimbotComponent.AimSpeed.Value)));
- Input.mouse_eventWS(MouseEventFlags.MOVE, (int)slowDistX, (int)slowDistY, MouseEventDataXButtons.NONE, IntPtr.Zero);
- //Vector3 Aimassist = new Vector3()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement