Page 1 of 13 12311 ... LastLast
Results 1 to 15 of 189
  1. #1
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty

    [RELEASE] Useful Functions

    Heyya.

    I have put together some Useful Hack Functions.
    Credits to Misc people, but mostly to UC.

    I did make the crosshair function.

    Mabye this could get stickied?
    If anybody wants to add a function, leave me a PM and ill add it in.

    Before we start, Make sure you have this in your globals:
    [php]
    LPD3DXFONT pFont;
    LPDIRECT3DDEVICE9 pDevice;
    [/php]

    Draw Text:

    After Globals:
    [php]
    void PrintText(LPD3DXFONT Font, long x, long y, D3DCOLOR fontColor, char *text, ...)//Draw Text Function
    {
    RECT rct;
    rct.left = x - 1;
    rct.right = x + 1;
    rct.top = y - 1 ;
    rct.bottom = y + 1;

    if(!text) { return; }
    va_list va_alist;
    char logbuf[256] = {0};
    va_start (va_alist, text);
    _vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
    va_end (va_alist);
    RECT FontRect = { x, y, x, y };
    pFont->DrawText(NULL, logbuf, -1, &rct, DT_NOCLIP, fontColor);
    }
    [/php]

    And to use the function (In Endscene):
    [php]
    PrintText(pFont, X, Y, D3DCOLOR_XRGB(0,0,0), "Your Text Here");
    [/php]


    NOP

    After Globals:
    [php]
    bool Memoria( void * pDest, char * szPatch, size_t sSize )//NOP Function
    {
    DWORD dwOrgProtect = NULL;
    if ( !VirtualProtect ( pDest, sSize, PAGE_EXECUTE_READWRITE, &dwOrgProtect ))
    return FALSE;

    memcpy( pDest, szPatch, sSize );
    VirtualProtect( pDest, sSize, dwOrgProtect, NULL );
    return TRUE;
    }
    [/php]

    And to use it:
    [php]
    Memoria(0x000000, "\x90\x90\x90", 3);
    [/php]


    Draw Crosshair:

    Globals:
    [php]
    float ScreenCenterX = 0.0f;//Horizontal Position
    float ScreenCenterY = 0.0f;//Vertical Position
    [/php]

    After Globals:
    [php]
    void DrawXHair(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR color)
    {
    D3DVIEWPORT9 viewP;
    pDevice->GetViewport( &viewP );
    DWORD ScreenCenterX = viewP.Width / 2;
    DWORD ScreenCenterY = viewP.Height / 2;

    D3DRECT rec1 = {ScreenCenterX-25, ScreenCenterY, ScreenCenterX+ 25, ScreenCenterY+1};
    D3DRECT rec2 = {ScreenCenterX, ScreenCenterY-25, ScreenCenterX+ 1,ScreenCenterY+25};

    pDevice->Clear( 1, &rec1, D3DCLEAR_TARGET, color, 0, 0 );
    pDevice->Clear( 1, &rec2, D3DCLEAR_TARGET, color, 0, 0 );
    }
    [/php]

    SetViewport:
    [php]
    ScreenCenterX = ( float )pViewport->Width / 2;
    ScreenCenterY = ( float )pViewport->Height / 2;
    [/php]

    Make Crosshair (Endscene):
    [php]
    DrawXHair(pDevice,D3DCOLOR_XRGB(0,0,0));
    [/php]


    Draw Box WITH Border

    After Globals:

    [php]
    void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
    {
    if( w < 0 )w = 1;
    if( h < 0 )h = 1;
    if( x < 0 )x = 1;
    if( y < 0 )y = 1;

    D3DRECT rec = { x, y, x + w, y + h };
    pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
    }

    void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
    FillRGB( x, (y + h - px), w, px, BorderColor, pDevice );
    FillRGB( x, y, px, h, BorderColor, pDevice );
    FillRGB( x, y, w, px, BorderColor, pDevice );
    FillRGB( (x + w - px), y, px, h, BorderColor, pDevice );
    }

    void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
    FillRGB( x, y, w, h, BoxColor, pDevice );
    DrawBorder( x, y, w, h, 1, BorderColor, pDevice );
    }
    [/php]

    And to create the box (Endscene):
    [php]
    DrawBox (X,Y,W,H,Back Color,Border Color,pDevice);
    [/php]


    Draw Circle

    Globals:
    [php]
    ID3DXLine *pLine;
    #define PI 3.14159265
    [/php]

    After Globals:
    [php]
    void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
    {
    D3DXVECTOR2 Line[128];
    float Step = PI * 2.0 / numSides;
    int Count = 0;
    for (float a=0; a < PI*2.0; a += Step)
    {
    float X1 = radius * cos(a) + X;
    float Y1 = radius * sin(a) + Y;
    float X2 = radius * cos(a+Step) + X;
    float Y2 = radius * sin(a+Step) + Y;
    Line[Count].x = X1;
    Line[Count].y = Y1;
    Line[Count+1].x = X2;
    Line[Count+1].y = Y2;
    Count += 2;
    }
    pLine->Begin();
    pLine->Draw(Line,Count,Color);
    pLine->End();
    }
    [/php]

    Create the line(with your font):
    [php]
    D3DXCreateLine(pDevice,&pLine);
    [/php]

    And to draw the circle(Endscene):
    [php]
    DrawCircle(X,Y,R,S,COLOR);
    [/php]

    I havent perfected the circle, but when i do i will update.

    Universal Draw FPS: - Thanks Longevity

    Globals:
    [php]
    float fFps = NULL;
    float fLastTickCount = NULL;
    float fCurrentTickCount;
    char cFrameRate[50] = {NULL};
    [/php]

    After Globals:
    [php]
    char *GetFrameRate()
    {
    fCurrentTickCount = clock() * 0.001f;
    ++fFps;
    if((fCurrentTickCount - fLastTickCount) > 1.0f)
    {
    fLastTickCount = fCurrentTickCount;
    sprintf( cFrameRate, "[ Current FPS: %d ]", int( fFps ) );
    fFps = 0;
    }
    return cFrameRate;
    }
    [/php]

    And to show the FPS (Endscene):
    [php]
    pFont->DrawTextA( 5, 0, D3DCOLOR_XRGB( 255, 250, 0 ), GetFrameRate());
    [/php]

    Hopefully this will go to good use and help people.
    Dont leech please.

    & a Thanks would be good /

    And heres are screenshot off what the functions are capable of:

    Last edited by ac1d_buRn; 06-19-2010 at 11:14 PM.

  2. The Following 67 Users Say Thank You to ac1d_buRn For This Useful Post:

    ★Rusty (10-19-2010),-Dimensions- (08-29-2010),anton969 (07-05-2010),austen407 (07-14-2010),[MPGH]AVGN (06-19-2010),BossMan. (06-20-2010),breenanna (01-24-2011),CAFlames (07-08-2010),carterv (07-12-2010),CodeDemon (07-20-2010),cruizrisner (06-20-2010),curtis730 (07-09-2010),d00ms33k3r (07-13-2010),Dead 4 Real (02-05-2011),demonfire (06-25-2010),dishank95 (09-29-2010),dkgecko (07-11-2010),DRAKE` (08-02-2010),edwardjiang (07-12-2010),extremehack (08-15-2010),fred4308 (08-23-2010),fvestrgenrl (07-03-2010),God601 (06-20-2010),GodHack2 (07-15-2010),grafvincent (07-01-2010),Hahaz (08-28-2010),haloassasin (06-20-2010),haloistaken100 (06-29-2010),HaX4LiFe! (07-24-2010),hgmf8124 (07-25-2010),hima (08-09-2010),I-JlStepper-I (07-08-2010),i7vSa7vi7y (06-28-2010),InterXa (01-28-2011),izmirdelisi (06-28-2010),jayhpatel2 (07-20-2010),josue18 (09-14-2010),juggernault5 (07-16-2010),killergod129 (07-14-2010),koolman33 (07-08-2010),kotentopf (08-08-2010),kufurbaz (07-17-2010),matypatty (06-20-2010),mo3ad001 (09-03-2010),mrxd.power (06-28-2010),mwb1234 (06-19-2010),NathanE (07-22-2010),o-o (09-24-2010),oFFiciaL101 (07-13-2010),Polo™ (07-05-2010),pr0h4x0r (06-21-2010),qwerty01 (06-30-2010),Sh3hw4z (08-03-2010),Sixx93 (07-23-2010),SkaiHunta (08-18-2010),Super Martin (07-21-2010),swatfx (06-19-2010),Timboy67678 (09-26-2010),tstert (07-03-2010),UGodly (11-09-2010),whatup777 (06-19-2010),whatup777+ (10-12-2010),whit (06-23-2010),xXWerneRXx (01-31-2011),Yepikiyay (06-19-2010),~GodLike~ (06-19-2010),~Liberty~ (07-21-2010)

  3. #2
    Yepikiyay's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    320
    Reputation
    10
    Thanks
    37
    My Mood
    Drunk
    thanks a bunch acid!

    edit-1st

  4. The Following User Says Thank You to Yepikiyay For This Useful Post:

    fred4308 (08-23-2010)

  5. #3
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,025
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Very Nice Acid I will be using these!

    For the print text how would you find the x and y?
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  6. #4
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    Quote Originally Posted by whatup777 View Post
    Very Nice Acid I will be using these!

    For the print text how would you find the x and y?
    Not sure actually.
    I just estimate and if its wrong, change it.

  7. The Following 2 Users Say Thank You to ac1d_buRn For This Useful Post:

    fred4308 (08-23-2010),izmirdelisi (06-28-2010)

  8. #5
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,025
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Do you atleast know where to estimate. Like a number range I dont wanna be guessing -100000 to 1000000
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  9. #6
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    lol .... ACID
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  10. #7
    swatfx's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    659
    Reputation
    20
    Thanks
    108
    My Mood
    Mellow
    Quote Originally Posted by whatup777 View Post
    Very Nice Acid I will be using these!

    For the print text how would you find the x and y?
    lol use the guess and check method... i'm sure there is a table out there somewhere but I find it easier to guess and check xD

  11. #8
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,025
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Quote Originally Posted by swatfx View Post
    lol use the guess and check method... i'm sure there is a table out there somewhere but I find it easier to guess and check xD
    That means logging in to CA like a billion time
    Hmm I bet topblast knows....
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  12. #9
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    Quote Originally Posted by whatup777 View Post
    Do you atleast know where to estimate. Like a number range I dont wanna be guessing -100000 to 1000000
    Its between your resolution numbers.

    If you want it at the top.
    Your going to put X at about 20-50.
    its just common sence.

    If you want the text to be half way down the screen, its gna be about 500 isnt it?

  13. The Following 2 Users Say Thank You to ac1d_buRn For This Useful Post:

    haloassasin (06-20-2010),kufurbaz (07-17-2010)

  14. #10
    Sub45's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0
    Very nice ! Hope you'll release it soon

  15. #11
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,025
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Found Mouse coordinate calculator so i should be fine
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  16. #12
    swatfx's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    659
    Reputation
    20
    Thanks
    108
    My Mood
    Mellow
    lololol Hackshield will d/c you if it detects the string MPGH.net.. just found that out, however it is easily bypassed by packing the hack

  17. #13
    xXNoobAlertXx's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    125
    Reputation
    9
    Thanks
    76
    Umm swat how do you use the D3D i dont know lol

  18. #14
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    Quote Originally Posted by swatfx View Post
    lololol Hackshield will d/c you if it detects the string MPGH.net.. just found that out, however it is easily bypassed by packing the hack
    LOL. Serious?

    Quote Originally Posted by xXNoobAlertXx View Post
    Umm swat how do you use the D3D i dont know lol
    Umm. GTFO

  19. #15
    Fabulous1's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Phoenix
    Posts
    808
    Reputation
    10
    Thanks
    60
    My Mood
    Brooding
    These are pretty useful for those that can actually make hacks. I cant
    My mod, ill make more?

    Rapid Fire Famas

Page 1 of 13 12311 ... LastLast

Similar Threads

  1. [Release] Class library with some useful functions.
    By t7ancients in forum C# Programming
    Replies: 8
    Last Post: 05-17-2011, 04:41 AM
  2. Useful Functions
    By Iamazn1 in forum Visual Basic Programming
    Replies: 6
    Last Post: 01-15-2011, 12:14 AM
  3. [Release] DrawCheckBox Function
    By DeadLinez in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 17
    Last Post: 09-10-2010, 04:49 AM
  4. [Discussion] Ideas for my next launcher release, look, functions & more
    By teun95 in forum CrossFire Hacks & Cheats
    Replies: 17
    Last Post: 03-02-2010, 04:38 PM
  5. [Release] USE OPK FOR COMBAT ARMS NO DOWNLOAD UNPATCHABLE AND UNDETECTABLE!!!
    By wetrichard in forum Combat Arms Hacks & Cheats
    Replies: 114
    Last Post: 05-24-2009, 09:40 AM