InfoLua Passive Anti Screengrab

Posts 1–6 of 6 · Page 1 of 1
Lua Passive Anti Screengrab
Code:
local fakeRT = GetRenderTarget( "fakeRT" .. os.time(), ScrW(), ScrH() )

hook.Add( "RenderScene", "AntiScreenGrab", function( vOrigin, vAngle, vFOV )
    local view = {
        x = 0,
        y = 0,
        w = ScrW(),
        h = ScrH(),
        dopostprocess = true,
        origin = vOrigin,
        angles = vAngle,
        fov = vFOV,
        drawhud = true,
        drawmonitors = true,
        drawviewmodel = true
    }

    render.RenderView( view )
    render.CopyTexture( nil, fakeRT )

    cam.Start2D()
        hook.Run( "CheatHUDPaint" )
    cam.End2D()

    render.SetRenderTarget( fakeRT )

    return true
end )

hook.Add( "ShutDown", "RemoveAntiScreenGrab", function()
    render.SetRenderTarget()
end )
Makes you basically impossible to screengrab, change your HUDPaints to CheatHUDPaint.

Test:
Code:
hook.Add( "CheatHUDPaint", "test", function()
    surface.SetDrawColor( color_white )
    surface.DrawRect( 0, 0, 100, 100 )
end )

hook.Add( "HUDPaint", "test", function()
    surface.SetDrawColor( Color( 255, 0, 0 ) )
    surface.DrawRect( 100, 0, 100, 100 )
end )
What screengrab sees:


What you see:
Quote Originally Posted by Promptitude View Post
Code:
local fakeRT = GetRenderTarget( "fakeRT" .. os.time(), ScrW(), ScrH() )

hook.Add( "RenderScene", "AntiScreenGrab", function( vOrigin, vAngle, vFOV )
    local view = {
        x = 0,
        y = 0,
        w = ScrW(),
        h = ScrH(),
        dopostprocess = true,
        origin = vOrigin,
        angles = vAngle,
        fov = vFOV,
        drawhud = true,
        drawmonitors = true,
        drawviewmodel = true
    }

    render.RenderView( view )
    render.CopyTexture( nil, fakeRT )

    cam.Start2D()
        hook.Run( "CheatHUDPaint" )
    cam.End2D()

    render.SetRenderTarget( fakeRT )

    return true
end )

hook.Add( "ShutDown", "RemoveAntiScreenGrab", function()
    render.SetRenderTarget()
end )
Makes you basically impossible to screengrab, change your HUDPaints to CheatHUDPaint.

Test:
Code:
hook.Add( "CheatHUDPaint", "test", function()
    surface.SetDrawColor( color_white )
    surface.DrawRect( 0, 0, 100, 100 )
end )

hook.Add( "HUDPaint", "test", function()
    surface.SetDrawColor( Color( 255, 0, 0 ) )
    surface.DrawRect( 100, 0, 100, 100 )
end )
What screengrab sees:


What you see:


timer.Simple(30, function()
if hook.GetTable()["CheatHUDPaint"] then
rac.AddDetection("Anti Screengrab", "Anti Screengrab [MPGH | Lua]", "ban", "none")
end
end)
Quote Originally Posted by Fatulatti View Post
timer.Simple(30, function()
if hook.GetTable()["CheatHUDPaint"] then
rac.AddDetection("Anti Screengrab", "Anti Screengrab [MPGH | Lua]", "ban", "none")
end
end)
could just rename the hook or use the actual HUDPaint hook.
Code:
require("genius")

local rt = GetRenderTarget("AntiScreengrabRT", ScrW(), ScrH())
local source = debug.getinfo(1, "S").source

hook.Add("RenderScene", "AntiScreenGrab", function(origin, ang, fov)
	if (gui.IsGameUIVisible()) then return end

	render.RenderView{
		x = 0,
		y = 0,
		w = ScrW(),
		h = ScrH(),

		fov = fov,
		angles = ang,
		origin = origin,

		drawhud = true,
		drawmonitors = true,
		drawviewmodel = true,
		dopostprocess = true,
	}

	render.CopyTexture(nil, rt)

	cam.Start2D()
		hook.Run("HUDPaint")
	cam.End2D()

	render.SetRenderTarget(rt)
	genius****UIPaint(PAINT_UIPANELS)

	return true
end)

hook.Add("ShutDown", "Remove RenderTarget", function()
	render.SetRenderTarget()
end)

hook.Add("HUDPaint", "oof", function(draw)
	if (debug.getinfo(3, "S").source ~= source) then return end -- could also just pass a bool to HUDPaint with hook.Run.

	surface.SetDrawColor(Color(255, 0, 0))
	surface.DrawRect(0, 0, 100, 100)
end)
could also just call render.SetRenderTarget before render.Capture or however you get a screengrab.
Quote Originally Posted by Cyaegha View Post
could just rename the hook or use the actual HUDPaint hook.
Code:
require("genius")

local rt = GetRenderTarget("AntiScreengrabRT", ScrW(), ScrH())
local source = debug.getinfo(1, "S").source

hook.Add("RenderScene", "AntiScreenGrab", function(origin, ang, fov)
	if (gui.IsGameUIVisible()) then return end

	render.RenderView{
		x = 0,
		y = 0,
		w = ScrW(),
		h = ScrH(),

		fov = fov,
		angles = ang,
		origin = origin,

		drawhud = true,
		drawmonitors = true,
		drawviewmodel = true,
		dopostprocess = true,
	}

	render.CopyTexture(nil, rt)

	cam.Start2D()
		hook.Run("HUDPaint")
	cam.End2D()

	render.SetRenderTarget(rt)
	genius****UIPaint(PAINT_UIPANELS)

	return true
end)

hook.Add("ShutDown", "Remove RenderTarget", function()
	render.SetRenderTarget()
end)

hook.Add("HUDPaint", "oof", function(draw)
	if (debug.getinfo(3, "S").source ~= source) then return end -- could also just pass a bool to HUDPaint with hook.Run.

	surface.SetDrawColor(Color(255, 0, 0))
	surface.DrawRect(0, 0, 100, 100)
end)
could also just call render.SetRenderTarget before render.Capture or however you get a screengrab.
Meh, Lua Cheats are detected easily anyway.
Quote Originally Posted by Fatulatti View Post
timer.Simple(30, function()
if hook.GetTable()["CheatHUDPaint"] then
rac.AddDetection("Anti Screengrab", "Anti Screengrab [MPGH | Lua]", "ban", "none")
end
end)
jesus you must have a bad anticheat if you have to add detections manually, plus, if anyone who decides to use this has any idea what they're doing you wont be able to see their hooks.
Quote Originally Posted by Promptitude View Post
jesus you must have a bad anticheat if you have to add detections manually, plus, if anyone who decides to use this has any idea what they're doing you wont be able to see their hooks.
Anyway, there's enough ways to still screengrab this.
Good luck running lua anyway
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?