ROWAREZ
rowarez hacking forum
|
Lista Forumurilor Pe Tematici
|
ROWAREZ | Reguli | Inregistrare | Login
POZE ROWAREZ
Nu sunteti logat.
|
Nou pe simpatie: Alexandra21
 | Femeie 22 ani Calarasi cauta Barbat 23 - 52 ani |
|
Google
Resident Elite
 Inregistrat: acum 12 ani
Postari: 433
|
|
Code:
// read memory like a boss
template<typename T>
const T ReadMemory(HMODULE hModule, DWORD dwAddr) {
T t;
ReadProcessMemory(m_hProcess, (LPCVOID)((DWORD)hModule + dwAddr), &t, sizeof(T), NULL);
return t;
}
// update this once per frame, before the first call of w2s
RECT m_Rect;
GetWindowRect(FindWindow(NULL, "Counter-Strike Source"), &m_Rect);
VMatrix m_vMatrix = ReadMemory<VMatrix>(m_hEngine, 0x50A244);
// originally on s0beit basehook, just edited a bit
bool cD3D::WorldToScreen(Vector from, Vector2D &to) {
float w = 0.0f;
to.x = m_vMatrix[0][0] * from[0] + m_vMatrix[0][1] * from[1] + m_vMatrix[0][2] * from[2] + m_vMatrix[0][3];
to.y = m_vMatrix[1][0] * from[0] + m_vMatrix[1][1] * from[1] + m_vMatrix[1][2] * from[2] + m_vMatrix[1][3];
w = m_vMatrix[3][0] * from[0] + m_vMatrix[3][1] * from[1] + m_vMatrix[3][2] * from[2] + m_vMatrix[3][3];
if(w < 0.01f)
return false;
float invw = 1.0f / w;
to.x *= invw;
to.y *= invw;
int width = (int)(m_Rect.right - m_Rect.left);
int height = (int)(m_Rect.bottom - m_Rect.top);
float x = width / 2;
float y = height / 2;
x += 0.5 * to.x * width + 0.5;
y -= 0.5 * to.y * height + 0.5;
to.x = x + m_Rect.left;
to.y = y + m_Rect.top;
return true;
} |
credits s0beit (original w2s function found in his basehook) me, for the little amount of work
|
|
pus acum 12 ani |
|