UnhappyHelpESP Line Drawing Methods

Posts 14 of 4 · Page 1 of 1
ESP Line Drawing Methods
Hi Everyone,
Right now i'm developping my first hack in C# for Battlefield 4, and I would like to if someone know the best method to draw the ESP Boxes and Lines into the screen. The hack is external.
So far, i managed to do this by making the main form invisible and draw a graphics on top of it, that worked ! But, " The Boxes seems to be a bit jumpy. Like they quickly dissapears" .
So if you can help me and show me another way of doing it || telling me how to achieve another way to draw, It would be really helpfull, and of course, i'll credit you on the realese of the hack : )
Easy thing. You can either try to make the Form you defined as your overlay rendering doublebuffered by setting its value to true...
Code:
public OverlayForm() {
    InitializeComponents();
    this.Doublebuffered = true;
}
..or you can use a timer to draw the stuff onto the form by using an external graphics object...
Code:
private static overlayTimer_Tick(object sender, EventArgs e) {
    Graphics dc = this.CreateGraphics();
    // render your stuff
}
Another but quit complex way would be to render the information directly into the games graphics handle. But this would require a dll injection.. and it wont be external..

Whatever. Hope I could help.. Pce.
Quote Originally Posted by sorpz View Post
Easy thing. You can either try to make the Form you defined as your overlay rendering doublebuffered by setting its value to true...
Code:
public OverlayForm() {
    InitializeComponents();
    this.Doublebuffered = true;
}
..or you can use a timer to draw the stuff onto the form by using an external graphics object...
Code:
private static overlayTimer_Tick(object sender, EventArgs e) {
    Graphics dc = this.CreateGraphics();
    // render your stuff
}
Another but quit complex way would be to render the information directly into the games graphics handle. But this would require a dll injection.. and it wont be external..

Whatever. Hope I could help.. Pce.
Yeah that's exactly what i did before posting this thread, and exactly what i wanted to change because that wasn't as efficient as rendering on D3D. I know, using DebugRender into the game, you can make overlay but that will make it internal and PKSS can dectect it, but of course you can bypass pkss by sending a black screenshot. Never mind. Now i figured out how to create an overlay with DirectX in C#, that was hard (really harder than in C++), but i managed to do it. whatever, thanks for trying to help me, realy appreciate that, and if you want some help to draw with DirectX in .NET just pm.
You'd be better off using SharpDX or SlimDX here's an example I made for line drawing:

Code:
Device device;
PresentParameters pparams;
Direct3D d3dObj;
SlimDX.Direct3D9.Font font;
Line line;

private void InitD3D(IntPtr hWnd, int width, int height)
        {
            d3dObj = new Direct3D();
            pparams = new PresentParameters();
            pparams.SwapEffect = SwapEffect.Discard;
            pparams.Windowed = true;
            pparams.EnableAutoDepthStencil = false;
            pparams.BackBufferHeight = height;
            pparams.BackBufferWidth = width;
            pparams.DeviceWindowHandle = this.Handle;
            pparams.BackBufferCount = 2;
            pparams.BackBufferFormat = Format.A8R8G8B8;

            device = new Device(d3dObj, 0, DeviceType.Hardware, this.Handle, CreateFlags.HardwareVertexProcessing, pparams);
            line = new Line(device);
            font = new SlimDX.Direct3D9.Font(device, new System.Drawing.Font("Calibri", 14));
        }

void DrawLine(float x1, float y1, float x2, float y2, int thickness, Color color)
        {
            Vector2[] vertices = 
             
            {
                new Vector2(x1, y1),
                new Vector2(x2, y2)
            };

            line.Width = thickness;

            line.Draw(vertices, (Color4)color);
        }

void Draw2DBox(int x, int y, int w, int h, Color color)
        {
            Vector2[] vertices = 
            {
                new Vector2(x, y),
                new Vector2(x + w, y),
                new Vector2(x + w, y + h),
                new Vector2(x, y + h),
                new Vector2(x, y)
            };

            line.Draw(vertices, (Color4)color);
        }line.Draw(vertices, (Color4)color);
        }
Hope this helps, pm me for any question
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?