Results 1 to 3 of 3
  1. #1
    yodaliketaco's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    winsock.dll
    Posts
    645
    Reputation
    45
    Thanks
    514
    My Mood
    Tired

    [Help] Hooking into a game with a crosshair/setting resolution

    I finished a pretty good crosshair application, but I still have 2 issues.

    1- I had to make a different program for every resolution. Is it possible for it to adjust to whatever screen resolution is being used? How so?

    2- It only works for a few games. I was told that i needed to hook into the functions that whatever game i am trying to hack uses for graphics rendering. Can anyone tell me how I might go about doing this for Combat Arms north america, Wolfteam, F.E.A.R. combat, etc.? Any help is appreciated.


    If i can make my application more convenient and functional I will release it to the public. =)

    Here is a sample of the source I am currently using (this is for 1920x1200)




    #include<windows.h>
    #include<iostream>
    int main()
    {
    int x = 960;
    int y = 600;
    HDC hdc=GetDC(NULL);
    while(1)
    {
    SetPixel(hdc,x,y,255);
    SetPixel(hdc,x+1,y,255);
    SetPixel(hdc,x-1,y,255);
    SetPixel(hdc,x,y+1,255);
    SetPixel(hdc,x,y-1,255);
    SetPixel(hdc,x+2,y,255);
    SetPixel(hdc,x-2,y,255);
    SetPixel(hdc,x,y+2,255);
    SetPixel(hdc,x,y-2,255);
    SetPixel(hdc,x-1,y-1,255);
    SetPixel(hdc,x+1,y+1,255);
    SetPixel(hdc,x+1,y-1,255);
    SetPixel(hdc,x-1,y+1,255);
    SetPixel(hdc,x-3,y,255);
    SetPixel(hdc,x-2,y,255);
    SetPixel(hdc,x-4,y,255);
    SetPixel(hdc,x-3,y+1,255);
    SetPixel(hdc,x-3,y-1,255);
    SetPixel(hdc,x-1,y,255);
    SetPixel(hdc,x-5,y,255);
    SetPixel(hdc,x-3,y+2,255);
    SetPixel(hdc,x-3,y-2,255);
    SetPixel(hdc,x-4,y-1,255);
    SetPixel(hdc,x-2,y+1,255);
    SetPixel(hdc,x-2,y-1,255);
    SetPixel(hdc,x-4,y+1,255);
    SetPixel(hdc,x+3,y,255);
    SetPixel(hdc,x+4,y,255);
    SetPixel(hdc,x+2,y,255);
    SetPixel(hdc,x+3,y+1,255);
    SetPixel(hdc,x+3,y-1,255);
    SetPixel(hdc,x+5,y,255);
    SetPixel(hdc,x+1,y,255);
    SetPixel(hdc,x+3,y+2,255);
    SetPixel(hdc,x+3,y-2,255);
    SetPixel(hdc,x+2,y-1,255);
    SetPixel(hdc,x+4,y+1,255);
    SetPixel(hdc,x+4,y-1,255);
    SetPixel(hdc,x+2,y+1,255);
    SetPixel(hdc,x,y+3,255);
    SetPixel(hdc,x+1,y+3,255);
    SetPixel(hdc,x-1,y+3,255);
    SetPixel(hdc,x,y+4,255);
    SetPixel(hdc,x,y+2,255);
    SetPixel(hdc,x+2,y+3,255);
    SetPixel(hdc,x-2,y+3,255);
    SetPixel(hdc,x,y+5,255);
    SetPixel(hdc,x,y+1,255);
    SetPixel(hdc,x-1,y+2,255);
    SetPixel(hdc,x+1,y+4,255);
    SetPixel(hdc,x+1,y+2,255);
    SetPixel(hdc,x-1,y+4,255);
    SetPixel(hdc,x,y-3,255);
    SetPixel(hdc,x+1,y-3,255);
    SetPixel(hdc,x-1,y-3,255);
    SetPixel(hdc,x,y-2,255);
    SetPixel(hdc,x,y-4,255);
    SetPixel(hdc,x+2,y-3,255);
    SetPixel(hdc,x-2,y-3,255);
    SetPixel(hdc,x,y-1,255);
    SetPixel(hdc,x,y-5,255);
    SetPixel(hdc,x-1,y-4,255);
    SetPixel(hdc,x+1,y-2,255);
    SetPixel(hdc,x+1,y-4,255);
    SetPixel(hdc,x-1,y-2,255);
    SetPixel(hdc,x+6,y,255);
    SetPixel(hdc,x+7,y,255);
    SetPixel(hdc,x+5,y,255);
    SetPixel(hdc,x+6,y+1,255);
    SetPixel(hdc,x+6,y-1,255);
    SetPixel(hdc,x+8,y,255);
    SetPixel(hdc,x+4,y,255);
    SetPixel(hdc,x+6,y+2,255);
    SetPixel(hdc,x+6,y-2,255);
    SetPixel(hdc,x+5,y-1,255);
    SetPixel(hdc,x+7,y+1,255);
    SetPixel(hdc,x+7,y-1,255);
    SetPixel(hdc,x+5,y+1,255);
    SetPixel(hdc,x-6,y,255);
    SetPixel(hdc,x-5,y,255);
    SetPixel(hdc,x-7,y,255);
    SetPixel(hdc,x-6,y+1,255);
    SetPixel(hdc,x-6,y-1,255);
    SetPixel(hdc,x-4,y,255);
    SetPixel(hdc,x-8,y,255);
    SetPixel(hdc,x-6,y+2,255);
    SetPixel(hdc,x-6,y-2,255);
    SetPixel(hdc,x-7,y-1,255);
    SetPixel(hdc,x-5,y+1,255);
    SetPixel(hdc,x-5,y-1,255);
    SetPixel(hdc,x-7,y+1,255);
    SetPixel(hdc,x,y+6,255);
    SetPixel(hdc,x+1,y+6,255);
    SetPixel(hdc,x-1,y+6,255);
    SetPixel(hdc,x,y+7,255);
    SetPixel(hdc,x,y+5,255);
    SetPixel(hdc,x+2,y+6,255);
    SetPixel(hdc,x-2,y+6,255);
    SetPixel(hdc,x,y+8,255);
    SetPixel(hdc,x,y+4,255);
    SetPixel(hdc,x-1,y+5,255);
    SetPixel(hdc,x+1,y+7,255);
    SetPixel(hdc,x+1,y+5,255);
    SetPixel(hdc,x-1,y+7,255);
    SetPixel(hdc,x,y-6,255);
    SetPixel(hdc,x+1,y-6,255);
    SetPixel(hdc,x-1,y-6,255);
    SetPixel(hdc,x,y-5,255);
    SetPixel(hdc,x,y-7,255);
    SetPixel(hdc,x+2,y-6,255);
    SetPixel(hdc,x-2,y-6,255);
    SetPixel(hdc,x,y-4,255);
    SetPixel(hdc,x,y-8,255);
    SetPixel(hdc,x-1,y-7,255);
    SetPixel(hdc,x+1,y-5,255);
    SetPixel(hdc,x+1,y-7,255);
    SetPixel(hdc,x-1,y-5,255);
    Sleep(.1);
    }
    return 0;
    }

  2. #2
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    I'm not sure I can help you with the resolution portion, but you do indeed need to hook functions if you want to do it for games like CA, where it blocks trying to draw topmost.

    I posted something a few days ago, hopefully it could get you started. I suggest doing a little research though.

    https://www.mpgh.net/forum/31-c-c/125...3ddevice9.html

  3. The Following User Says Thank You to Void For This Useful Post:

    powerfear (03-17-2010)

  4. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    For variable screen resolution use:
    Code:
    int cx = GetSystemMetrics(SM_CXSCREEN);
    int cy = GetSystemMetrics(SM_CYSCREEN);

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. The Following User Says Thank You to why06 For This Useful Post:

    Void (03-17-2010)

Similar Threads

  1. [HELP]Information from a website into my Label with a click of a button!
    By Prfction in forum Visual Basic Programming
    Replies: 22
    Last Post: 06-30-2010, 08:18 PM
  2. [HELP]How to make game auto login with vb
    By BaZuGa in forum Visual Basic Programming
    Replies: 0
    Last Post: 01-19-2010, 11:55 AM
  3. Need help with editing crosshair
    By xtrylanx in forum Soldier Front General
    Replies: 4
    Last Post: 08-26-2009, 12:27 PM
  4. Go into game with me?
    By iownageXD in forum Combat Arms Hacks & Cheats
    Replies: 17
    Last Post: 08-21-2009, 04:10 AM
  5. [Help]Hooking Into PunkBuster
    By *Marneus901* in forum WarRock - International Hacks
    Replies: 14
    Last Post: 05-24-2008, 10:46 AM

Tags for this Thread