From 0fb7d9a29ae0a24d3e4aff11fe17be96d253b084 Mon Sep 17 00:00:00 2001 From: k-i-o Date: Thu, 7 Nov 2024 12:03:11 +0100 Subject: [PATCH] fix offsets --- src/main/models/cheats/Aimbot.ts | 3 +- src/main/models/singletons/Offsets.ts | 56 +++++++++++++-------------- src/main/utils.ts | 12 +++--- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/main/models/cheats/Aimbot.ts b/src/main/models/cheats/Aimbot.ts index 0e26b45..338cecf 100644 --- a/src/main/models/cheats/Aimbot.ts +++ b/src/main/models/cheats/Aimbot.ts @@ -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; diff --git a/src/main/models/singletons/Offsets.ts b/src/main/models/singletons/Offsets.ts index e70f2f6..0764961 100644 --- a/src/main/models/singletons/Offsets.ts +++ b/src/main/models/singletons/Offsets.ts @@ -67,8 +67,8 @@ 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), @@ -76,17 +76,17 @@ export class Offsets { 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) } } } @@ -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; diff --git a/src/main/utils.ts b/src/main/utils.ts index 45bbc29..b40c041 100644 --- a/src/main/utils.ts +++ b/src/main/utils.ts @@ -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; }