barspinoff
Известный
- 126
- 33
видимо, ты совсем ничего не понялНу вот, как-то так, но с 37 по 43 нельзя преобразовать float в LPVOID
C++:private: System::Void TEST_Click(System::Object^ sender, System::EventArgs^ e) { WORD wID; DWORD pActor, pPed, pMtrx1, pMtrx2; float fPlayerHP; ReadProcessMemory(hProcess, (LPVOID)0xBAA410, &wID, sizeof(wID),0); ReadProcessMemory(hProcess, (LPVOID)0xBAA410, &pActor, sizeof(pActor),0); ReadProcessMemory(hProcess, (LPVOID)(pActor + 0x79C), &pPed, sizeof(pPed),0); ReadProcessMemory(hProcess, (LPVOID)(pPed + 0x14), &pMtrx2, sizeof(pMtrx2),0); ReadProcessMemory(hProcess, (LPVOID)(pPed + 0x540), &fPlayerHP, sizeof(fPlayerHP),0); if (&pPed > 0) { float* x = (float*)((&pMtrx1) + 0x30);//X position Ped float* y = (float*)((&pMtrx1) + 0x34);//Y position Ped float* z = (float*)((&pMtrx1) + 0x38);//Z position Ped float* x1 = (float*)((&pMtrx2) + 0x30);//X position Target float* y1 = (float*)((&pMtrx2) + 0x34);//Y position Target float* z1 = (float*)((&pMtrx2) + 0x38);//Z position Target float* RotAngle = (float*)((&pActor) + 0x558);//health of target player float Xwiping = (float)*x + 2 * (float)cos(*RotAngle + 1.48353F); float Ywiping = (float)*y + 2 * (float)sin(*RotAngle + 1.48353F); float Zwiping = (float)*z + 0.5F; *x1 = (float)Xwiping; *y1 = (float)Ywiping; *z1 = (float)Zwiping; ReadProcessMemory(hProcess, (LPVOID)(float*)((&pMtrx1) + 0x30), &pMtrx1, sizeof(pMtrx1), 0); ReadProcessMemory(hProcess, (LPVOID)(float*)((&pMtrx1) + 0x34), &pMtrx1, sizeof(pMtrx1), 0); ReadProcessMemory(hProcess, (LPVOID)(float*)((&pMtrx1) + 0x38), &pMtrx1, sizeof(pMtrx1), 0); ReadProcessMemory(hProcess, (LPVOID)(float*)((&pMtrx1) + 0x30), &pMtrx2, sizeof(pMtrx2), 0); ReadProcessMemory(hProcess, (LPVOID)(float*)((&pMtrx1) + 0x34), &pMtrx2, sizeof(pMtrx2), 0); ReadProcessMemory(hProcess, (LPVOID)(float*)((&pMtrx1) + 0x38), &pMtrx2, sizeof(pMtrx2), 0); ReadProcessMemory(hProcess, (LPVOID)(float*)((&pActor) + 0x558), &pActor, sizeof(pActor), 0); ReadProcessMemory(hProcess, (LPVOID)(float)*x + 2 * (float)cos(*RotAngle + 1.48353F), &RotAngle, sizeof(RotAngle), 0); ReadProcessMemory(hProcess, (LPVOID)(float)*y + 2 * (float)sin(*RotAngle + 1.48353F), &RotAngle, sizeof(RotAngle), 0); ReadProcessMemory(hProcess, (LPVOID)(float)*z + 0.5F, &RotAngle, sizeof(RotAngle), 0); WriteProcessMemory(hProcess, (LPVOID)(float)Xwiping, &Xwiping, sizeof(Xwiping), 0); WriteProcessMemory(hProcess, (LPVOID)(float)Ywiping, &Ywiping, sizeof(Ywiping), 0); WriteProcessMemory(hProcess, (LPVOID)(float)Zwiping, &Zwiping, sizeof(Zwiping), 0); } }
C:
float x, y, z, xt, yt, zt, angle, xw, yw, zw;
ReadProcessMemory(hProcess, (LPVOID)(pMtrx1 + 0x30), &x, sizeof(x), 0);
ReadProcessMemory(hProcess, (LPVOID)(pMtrx1 + 0x34), &y, sizeof(y), 0);
ReadProcessMemory(hProcess, (LPVOID)(pMtrx1 + 0x38), &z, sizeof(z), 0);
ReadProcessMemory(hProcess, (LPVOID)(pMtrx2 + 0x30), &xt, sizeof(xt), 0);
ReadProcessMemory(hProcess, (LPVOID)(pMtrx2 + 0x34), &yt, sizeof(yt), 0);
ReadProcessMemory(hProcess, (LPVOID)(pMtrx2 + 0x38), &zt, sizeof(zt), 0);
ReadProcessMemory(hProcess, (LPVOID)(pActor + 0x558), &angle, sizeof(angle), 0);
xw = (float)x + 2 * (float)cos(angle + 1.48353F);
yw = (float)y + 2 * (float)sin(angle + 1.48353F);
zw = (float)z + 0.5F;
WriteProcessMemory(hProcess, (LPVOID)(pMtrx2 + 0x30), &xw, sizeof(xw), 0);
WriteProcessMemory(hProcess, (LPVOID)(pMtrx2 + 0x34), &yw, sizeof(yw), 0);
WriteProcessMemory(hProcess, (LPVOID)(pMtrx2 + 0x38), &zw, sizeof(zw), 0);