import memory from "@native/memory";
const Player = memory.struct({
name: "char[32]",
pawn: "ptr",
health: "int32",
team: "uint8",
});
const hit = memory.scan("client.dll", "48 8B 0D ? ? ? ? 8B 41 10");
const list = hit && hit.add(7).add(hit.add(3).read("int32"));
on("tick", () => {
if (!list) return;
try {
const base = list.deref();
const count = base.add(0x10).read("int32");
const players = base.add(0x18).deref().read(Player, Math.min(count, 64));
for (const p of players)
if (!p.pawn.isNull) console.log(p.name, p.health, p.team, p.pawn);
} catch (e) {
if ((e as { code?: string }).code !== "EREAD") throw e;
}
});