Skip to content

Commit

Permalink
fix offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
k-i-o committed Nov 7, 2024
1 parent bf7083d commit 0fb7d9a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
3 changes: 2 additions & 1 deletion src/main/models/cheats/Aimbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export class Aimbot implements IBase {
execute(profile: string, delta: number): void {
const systemVar = Variables.getInstance().system;
const localplayer = Server.getInstance().localPlayer;
if (!systemVar.baseClientAddr || !localplayer) return;

if (!systemVar.baseClientAddr || !localplayer) return;

const nearest = getNearestToPlayer(this.maxDistance);
if(!nearest) return;

Expand Down
56 changes: 28 additions & 28 deletions src/main/models/singletons/Offsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,26 @@ export class Offsets {

this.profiles["DDPer"] = {
exeName: "DDPER.exe",
staticServerAddr: BigInt(0x33DD18),
staticClientAddr: BigInt(0x2F2CB8),
staticServerAddr: BigInt(0x403C60),
staticClientAddr: BigInt(0x3B2C90),
client: {
aimX: BigInt(0x10),
aimY: BigInt(0x14),
lWalk: BigInt(0xF0),
rWalk: BigInt(0xF8),
},
server: {
localPlayerId: BigInt(0x1428),
onlinePlayers: BigInt(0x142C),
gametick: BigInt(0x1454),
playerX: BigInt(0x1458),
playerY: BigInt(0x145C),
velX: BigInt(0x1460),
velY: BigInt(0x1464),
aimAngle: BigInt(0x1468),
frozenTime: BigInt(0x1498),
frozen: BigInt(0x14A4),
hookingTime: BigInt(0x147C)
localPlayerId: BigInt(0x22E0),
onlinePlayers: BigInt(0x22E4),
gametick: BigInt(0x230C),
playerX: BigInt(0x2310),
playerY: BigInt(0x2314),
velX: BigInt(0x2318),
velY: BigInt(0x231C),
aimAngle: BigInt(0x2320),
frozenTime: BigInt(0x2350),
frozen: BigInt(0x235C),
hookingTime: BigInt(0x2334)
}
}
}
Expand Down Expand Up @@ -125,26 +125,26 @@ export class Offsets {
case "DDPer":
this.profiles["DDPer"] = {
exeName: "DDPER.exe",
staticServerAddr: BigInt(0x33DD18),
staticClientAddr: BigInt(0x2F2CB8),
staticServerAddr: BigInt(0x403C60),
staticClientAddr: BigInt(0x3B2C90),
client: {
aimX: BigInt(0x10),
aimY: BigInt(0x14),
lWalk: BigInt(0xF0),
rWalk: BigInt(0xF8),
lWalk: BigInt(0x100),
rWalk: BigInt(0x108),
},
server: {
localPlayerId: BigInt(0x1428),
onlinePlayers: BigInt(0x142C),
gametick: BigInt(0x1454),
playerX: BigInt(0x1458),
playerY: BigInt(0x145C),
velX: BigInt(0x1460),
velY: BigInt(0x1464),
aimAngle: BigInt(0x1468),
frozenTime: BigInt(0x1498),
frozen: BigInt(0x14A4),
hookingTime: BigInt(0x147C)
localPlayerId: BigInt(0x22E0),
onlinePlayers: BigInt(0x22E4),
gametick: BigInt(0x230C),
playerX: BigInt(0x2310),
playerY: BigInt(0x2314),
velX: BigInt(0x2318),
velY: BigInt(0x231C),
aimAngle: BigInt(0x2320),
frozenTime: BigInt(0x2350),
frozen: BigInt(0x235C),
hookingTime: BigInt(0x2334)
}
}
break;
Expand Down
12 changes: 6 additions & 6 deletions src/main/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ export function distance(a: IVector2, b: IVector2) {
export function getNearestToPlayer(maxDistance: number): IPlayer | undefined {
const server = Server.getInstance();
const localPlayer = server.localPlayer;

if (!localPlayer) return undefined;

let closestPlayer: IPlayer | undefined;
let closestDist = maxDistance;

for (const player of server.players) {
if (player.id != localPlayer.id && !player.frozen && player.gametick != 0) {
if (player.gametick != 0 && player.id != localPlayer.id && !player.frozen) {
const dist = distance(player.position, localPlayer.position);

// console.log(player, localPlayer)

if (dist > 0 && dist < closestDist) {
closestDist = dist;
closestPlayer = player;
}
}
}

return closestPlayer;
}

Expand Down

0 comments on commit 0fb7d9a

Please sign in to comment.