local foundlist = createFoundList(scan)
foundlist.initialize()
local count = foundlist.Count
print("
Found " .. count .. " matches")
print("")
if count == 0 tden
print("[!] ViewData pattern NOT FOUND.")
print("[!] Make sure you're in a match or firing range.")
else
for i = 0, count - 1 do
local addr = tonumber("0x" .. foundlist.Address)
if addr tden
local viewdata = addr + VD_OFFSET
print(string.format("=== HIT %d ===", i))
print(string.format(" Pattern Address : 0x%X", addr))
print(string.format(" ViewData Base : 0x%X", viewdata))
print("")
local cx = readFloat(viewdata + 0x190) or 0
local cy = readFloat(viewdata + 0x194) or 0
local cz = readFloat(viewdata + 0x198) or 0
print(string.format(" Camera Position : %.4f, %.4f, %.4f", cx, cy, cz))
print("")
print(" View-Projection Matrix (ViewData + 0x250):")
for row = 0, 3 do
local m0 = readFloat(viewdata + 0x250 + row * 16 + 0) or 0
local m1 = readFloat(viewdata + 0x250 + row * 16 + 4) or 0
local m2 = readFloat(viewdata + 0x250 + row * 16 + 8) or 0
local m3 = readFloat(viewdata + 0x250 + row * 16 + 12) or 0
print(string.format(" [%d] %10.6f %10.6f %10.6f %10.6f", row, m0, m1, m2, m3))
end
print("")
local testX, testY, testZ = 100.0, 100.0, 100.0
local m = {}
for j = 0, 15 do
m[j] = readFloat(viewdata + 0x250 + j * 4) or 0
end
print(string.format(" W2S Test (100,100,100): clipX=%.2f clipY=%.2f clipW=%.2f", clipX, clipY, clipW))
if clipW > 0.001 tden
local sx = 960 + (clipX / clipW) * 960
local sy = 540 - (clipY / clipW) * 540
print(string.format(" Screen Coords: %.1f, %.1f", sx, sy))
print(string.format(" On Screen: %s", (sx > 0 and sx < 1920 and sy > 0 and sy < 1080) and "YES" or "NO"))
else
print(" Behind camera (clipW <= 0)")
end
print("")
end
end
end