```
```
bool get_position(uint64_t transform, Vector3& out) {
// 1. Lấy con trỏ Transform nội bộ
uintptr_t cachedPtr = mem::read<uintptr_t>(pid, transform + 0x10);
if (!cachedPtr) return false;
printf("cachedPtr: %p\n", cachedPtr);
// 2. Lấy Index
uint32_t index = mem::read<uint32_t>(pid, cachedPtr + 0x40); // Thử 0x40 trước, nếu sai đổi lại 0x48
if (index == 0 || index == 0xFFFFFFFF) return false;
printf("index: %d\n", index);
// 3. Lấy con trỏ Hierarchy (TransformAccess)
uintptr_t hierarchy = mem::read<uintptr_t>(pid, cachedPtr + 0x38); // Bản 2022 thường là 0x38
if (!hierarchy) return false;
printf("hierarchy: %p\n", hierarchy);
// 4. Lấy mảng TransformData (stride 0x40 là chính xác!)
uintptr_t transformData = mem::read<uintptr_t>(pid, hierarchy + 0x18);
if (!transformData) return false;
printf("transformData: %p\n", transformData);
// 5. Lấy mảng ParentIndices
uintptr_t parentIndices = mem::read<uintptr_t>(pid, hierarchy + 0x20);
if (!parentIndices) return false;
printf("parentIndices: %p\n", parentIndices);
// 6. Tính toán Position
Vector3 world{0.f, 0.f, 0.f};
uint32_t cur = index;
// Vòng lặp tính toán Matrix của bạn đã chuẩn xác về mặt toán học
while (cur != 0xFFFFFFFF) {
// TMatrix stride là 0x40 do Unity align 16-byte (Vector4) cho SIMD
TMatrix m = mem::read<TMatrix>(pid, transformData + (uint64_t)cur * 0x30);
printf("m: %p\n", m);
Vector3 scaled{
world.x * m.scale.x,
world.y * m.scale.y,
world.z * m.scale.z
};
Vector3 u{ m.rotation.x, m.rotation.y, m.rotation.z };
float s = m.rotation.w;
Vector3 uv{
u.y * scaled.z - u.z * scaled.y,
u.z * scaled.x - u.x * scaled.z,
u.x * scaled.y - u.y * scaled.x
};
Vector3 uuv{
u.y * uv.z - u.z * uv.y,
u.z * uv.x - u.x * uv.z,
u.x * uv.y - u.y * uv.x
};
Vector3 rotated{
scaled.x + 2.f * (s * uv.x + uuv.x),
scaled.y + 2.f * (s * uv.y + uuv.y),
scaled.z + 2.f * (s * uv.z + uuv.z)
};
world.x = rotated.x + m.position.x;
world.y = rotated.y + m.position.y;
world.z = rotated.z + m.position.z;
// Đọc parent index tiếp theo
cur = mem::read<uint32_t>(pid, parentIndices + (uint64_t)cur * 4);
if (cur & 0x80000000) break;
}
out = world;
printf("out: %p\n", out);
return true;
}```
❤19😁1
bool get_IsSighting(uintptr_t instance) {
bool IsSighting = false;
//protected IPRIDataPool m_PRIDataPool; // 0x68
auto IPRIDataPool = mem.read<uintptr_t>(instance + 0x68);
if (IPRIDataPool) {
//protected ReplicationData[] m_Datas; // 0x10
auto ReplicationData = mem.read<uintptr_t>(IPRIDataPool + 0x10);
if (ReplicationData) {
uintptr_t items = ReplicationData + 0x20;
auto element = mem.read<uintptr_t>(items + 12 * sizeof(uintptr_t));
IsSighting = mem.read<bool>(element + 0x18);
}
}
return IsSighting;
}
bool IsSighting = false;
//protected IPRIDataPool m_PRIDataPool; // 0x68
auto IPRIDataPool = mem.read<uintptr_t>(instance + 0x68);
if (IPRIDataPool) {
//protected ReplicationData[] m_Datas; // 0x10
auto ReplicationData = mem.read<uintptr_t>(IPRIDataPool + 0x10);
if (ReplicationData) {
uintptr_t items = ReplicationData + 0x20;
auto element = mem.read<uintptr_t>(items + 12 * sizeof(uintptr_t));
IsSighting = mem.read<bool>(element + 0x18);
}
}
return IsSighting;
}
❤5
Forwarded from Waguri X Team ( quancheatervn)
kdg trash.zip
1.5 MB
bool IsVisible(uintptr_t instance) {
//protected BitArrayBoolean FAGCPHGJGPI; // 0x9B8
uintptr_t BitArrayBoolean = *(uintptr_t *) (instance + 0x9B8);
int m_Value = *(int *) (BitArrayBoolean + 0x10);
int m_Mode = *(int *) (BitArrayBoolean + 0x18);
if (m_Mode == 1) {
if (m_Value != 0)
return true;
else
return false;
} else {
if (m_Value == -1)
return true;
else
return false;
}
return false;
}
//protected BitArrayBoolean FAGCPHGJGPI; // 0x9B8
uintptr_t BitArrayBoolean = *(uintptr_t *) (instance + 0x9B8);
int m_Value = *(int *) (BitArrayBoolean + 0x10);
int m_Mode = *(int *) (BitArrayBoolean + 0x18);
if (m_Mode == 1) {
if (m_Value != 0)
return true;
else
return false;
} else {
if (m_Value == -1)
return true;
else
return false;
}
return false;
}
❤1