Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    headsup's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Pa
    Posts
    1,232
    Reputation
    8
    Thanks
    207
    My Mood
    Cynical

    Basic chams Tut (Any renderer)

    [U]I take No credits in this

    Credits go to s0Biot

    Any way here it is I take credits for finding and posting.






    Ok, in this tutorial i will be explaining the basic concept behind chams, how they work, why they work and how this can be done easily in other renderers, but i will be using D3D9 as an example.

    The term "chams" is short for "chameleon colors", which basically (you guessed it) changes the color of the model being rendered, but not just simple changes it, that would be a skinhack, the trick to chams is that the model is rendered one way behind the wall, and one way in front of the wall.

    This can be a change in colors, wireframe, or whatever effects you want behind/in front of the wall.

    The factor that controls the visibility (or pseudo-visibility) is a value called the Z-Buffer


    n computer graphics, z-buffering is the management of image depth coordinates in three-dimensional (3-D) graphics, usually done in hardware, sometimes in software. It is one solution to the visibility problem, which is the problem of deciding which elements of a rendered scene are visible, and which are hidden. The painter's algorithm is another common solution which, though less efficient, can also handle non-opaque scene elements. Z-buffering is also known as depth buffering.
    or this concept to work at all, one model has to be rendered behind the wall, this can be achieved by bringing your model to the top of the Z-Order, the Z-Order traditionally used to describe 2-Dimensional elements in this case describes the dilemma quite well

    Our model is not on the top of the Z-Order, therefore, is not visible
    what you see instead is a wall, the engine you use depends on how you do it exactly, but usually you can control the "flow" of the z-buffer for your current model in the model rendering function, once the z-buffer value is edited it is usually re-cached each frame, so you only need not apply the "hack" that frame to "stop" the chams

    Once your model is on top, what you have is a simple wallhack, easy but it is not chams that is for certain.

    You want to have two colors for the model, one behind and one in front
    this can not be achieved without redrawing the model

    in OpenGL the function to draw models is "glDrawElements", in d3d8/d3d9 the function is "DrawIndexedPrimitive" and in Source engine, the function is "DrawModelEx/DrawModelExecute"

    to disable the "depth test" or bring your model to the top of the "z-order",
    in OpenGL the function is "glDisable(GL_DEPTH_TEST)", in DirectX it is "g_pGlobalDevice->SetRenderState( D3DRS_ZENABLE, FALSE )" or "g_pGlobalDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_NEVER )",
    i won't go into detail much about the Source engine because it involves a lot of explanation.

    whatever the renderer is, the same idea still applies to all of them

    To complete the chams, you need one model being drawn without a Z-buffer, and one drawn with one enabled.

    this serves two purposes, you can edit the color of the model behind the wall and in front, and because you rendered the model in front of the wall after you rendered the "wallhacked" model, the model rendered after gets rendered over the wallhack model, and since it has a depth-test you will have effectively drawn one model of one color behind the wall, and another in front of the wall with a (hopefully) separate color.

    now that the explanation is out of the way, here is the basic concept.


    [PHP]int __cdecl Hooked_DrawModel( ... )
    {
    if( IsPlayer( ... ) )
    {
    //disable z-buffer checking
    //color model blue

    Original_DrawModel( ... );

    //enable the z-buffer
    //color model red
    }

    return Original_DrawModel( ... );
    } [/PHP]

    i have made chams for many games, but the same method still applies.

    here is some other examples, in other renderers (which are not imaginary) which may help you

    [PHP]void new_glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indicies )
    {
    if( _ReturnAddress() == 0x123456 )
    {
    glDisable( GL_DEPTH_TEST );
    glDisable( GL_TEXTURE_2D );
    glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &green );
    Original_glDrawElements( mode, count, type, indicies );
    glEnable( GL_DEPTH_TEST );
    glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &blue );
    }

    Original_glDrawElements( mode, count, type, indicies );[/PHP]

    [PHP]int __stdcall new_DrawIndexedPrimitive( IDirect3DDevice9 *pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount )
    {
    if( UC_IS_MARINE || UC_IS_REDARMY )
    {
    g_pGlobalDevice->SetTexture( 0, NULL );
    g_pGlobalDevice->SetPixelShader( g_pBackAllied );
    g_pGlobalDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
    g_pGlobalDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_NEVER );

    pDrawIndexedPrimitive( pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );

    g_pGlobalDevice->SetRenderState( D3DRS_ZENABLE, dwOldZEnable );
    g_pGlobalDevice->SetRenderState( D3DRS_ZFUNC, dwOldZFunc );
    g_pGlobalDevice->SetPixelShader( g_pFrontAllied );
    }

    return pDrawIndexedPrimitive( pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );
    }[/PHP]

  2. The Following 9 Users Say Thank You to headsup For This Useful Post:

    Akisuzi (02-07-2010),bcrrillo (02-22-2010),Dreamcast (02-06-2010),fly777 (02-07-2010),greenviking (02-18-2010),hopefordope (02-20-2010),jellybash12 (04-03-2010),raghib33 (02-07-2010),why06 (02-07-2010)

  3. #2
    Dreamcast's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    In the data center.
    Posts
    307
    Reputation
    11
    Thanks
    39
    My Mood
    Relaxed
    Nice tut.
    Not to easy for the average choob.
    But very helpful for any D3D coder.
    GJ.

  4. The Following 2 Users Say Thank You to Dreamcast For This Useful Post:

    Akisuzi (02-07-2010),jellybash12 (04-03-2010)

  5. #3
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    nice man, but i found an easier way
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  6. The Following User Says Thank You to zmansquared For This Useful Post:

    Akisuzi (02-07-2010)

  7. #4
    raghib33's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    98
    Reputation
    10
    Thanks
    16
    My Mood
    Psychedelic
    Boxes are much more easier. Don't forget about nametags and other esp stuff. But thnx anyway, no boxes for A.V.A , this helped me with that. VERY GJ, +Rep.
    "You will never know peace... you will rise, again and again... that is your curse."

  8. The Following User Says Thank You to raghib33 For This Useful Post:

    Akisuzi (02-07-2010)

  9. #5
    thegreatn00b's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    In Bruswood's plane.
    Posts
    290
    Reputation
    9
    Thanks
    17
    My Mood
    Sneaky
    Nice, even if im not very good in D3D code im still a choob making some basic injector
    Quote Originally Posted by cokenmentos View Post
    If this works i will make love to you even if you refuse.
    lol
    Quote Originally Posted by CHOOBINATOR View Post
    What is an Injector
    rofl




  10. The Following User Says Thank You to thegreatn00b For This Useful Post:

    jellybash12 (04-03-2010)

  11. #6
    Deadlocked007's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Posts
    139
    Reputation
    10
    Thanks
    41
    My Mood
    Bored
    I must not be an average choob cause this is very confusing!! Someone help?
    Omg you're the one who stole my pic thegreatn00b!!!

    My role model isnt Obama its that nigga!!~Deadlocked007^
    My mods:
    MP5A4 to MP7 steel mod
    M16A3 to Famas
    For homo

  12. #7
    ainkut's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    137
    Reputation
    10
    Thanks
    14
    My Mood
    Innocent
    Quote Originally Posted by Deadlocked007 View Post
    I must not be an average choob cause this is very confusing!! Someone help?
    Omg you're the one who stole my pic thegreatn00b!!!
    You have to write a function telling you the model is more important than a building. Simple.

    As in, it chooses to render the character instead of the building, letting you see the character...

    And cant this be used to color the 'behind something' into..say red..while leaving the 'shootable, killable marine' the normal texture? green, red..it hurts my eyes XD

  13. #8
    ViittO's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    169
    Reputation
    10
    Thanks
    25
    My Mood
    Psychedelic
    NICE! thanks

  14. #9
    MugNuf's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    792
    Reputation
    9
    Thanks
    160
    My Mood
    Goofy
    You guys do know, he didn't write this.. right?

    Its ******'s thread on it. And theres more to chams then just that code.

    EDIT: Lol, it got bleeped.

  15. The Following User Says Thank You to MugNuf For This Useful Post:

    jellybash12 (04-03-2010)

  16. #10
    Jabuuty671's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    21,221
    Reputation
    1468
    Thanks
    4,093
    FML.
    I'm such a choob, I don't understand it.
    This'll take a while for me to understand it, so I'll try making hacks later.


  17. The Following User Says Thank You to Jabuuty671 For This Useful Post:

    jellybash12 (04-03-2010)

  18. #11
    CAFlames's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Where ever my imagination takes me
    Posts
    3,014
    Reputation
    202
    Thanks
    2,934
    My Mood
    Twisted
    What format will we save this.. and how will we make it a .dll?

    Current Works:
    ---Horror Game






    Special thanks to drgnforce9 for my sig picture

    Quote Originally Posted by m_t_h View Post

    CAflames is one epic coder.

    Rep and thanks him.. or you're perma banned.

  19. #12
    Deadlocked007's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Posts
    139
    Reputation
    10
    Thanks
    41
    My Mood
    Bored
    Umm... what program am i supposed to use.. lmao im a super noob

    My role model isnt Obama its that nigga!!~Deadlocked007^
    My mods:
    MP5A4 to MP7 steel mod
    M16A3 to Famas
    For homo

  20. #13
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Quote Originally Posted by msflames3 View Post
    What format will we save this.. and how will we make it a .dll?
    It's quite simple actually.

    Open up Notepad or Notepad++, copy and paste the code. Next hit save and save as a .txt. Then you open up an injector and inject it with any other hack.dll and you have chams!

  21. #14
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,991
    My Mood
    Flirty
    Quote Originally Posted by Sealionone View Post
    It's quite simple actually.

    Open up Notepad or Notepad++, copy and paste the code. Next hit save and save as a .txt. Then you open up an injector and inject it with any other hack.dll and you have chams!
    If it was only that simple D:

  22. #15
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,305
    Reputation
    170
    Thanks
    2,194
    My Mood
    Flirty
    Quote Originally Posted by msflames3 View Post
    What format will we save this.. and how will we make it a .dll?
    I thought it would be that simple once, but you have to understand this is a VERY generic overview of chams. It is not specific to CA or any game. It does not tell you how models are drawn and how to specify which models are drawn. I think a lot of that deals with getting structures out or memory, but I wouldn't know for sure. However the basic concept is there. So what he's saying is learn more about some of these functions on your own, and what you need to use them, then you can apply this technique. It looked like one of his examples were for OpenGL too, so you see it was very generic, but meant to convey a concept. C&P'in does not a hack make. ;l

    "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

Page 1 of 2 12 LastLast

Similar Threads

  1. Basic Chams (unpatchable)
    By tabbyowns in forum Combat Arms Hacks & Cheats
    Replies: 14
    Last Post: 04-17-2009, 10:34 PM
  2. [V]Chams Tut, Now stop these effin threads.
    By Evilipod in forum Combat Arms Hacks & Cheats
    Replies: 29
    Last Post: 09-14-2008, 06:56 PM
  3. Post ure anything about Strife's chams, tuts, complains etc,,...
    By jekai15 in forum Combat Arms Hacks & Cheats
    Replies: 30
    Last Post: 09-14-2008, 12:20 AM
  4. Stife Chams Tut And Hidden AIMBOT!
    By ModaFoca in forum Combat Arms Hacks & Cheats
    Replies: 28
    Last Post: 09-13-2008, 04:23 AM
  5. [EXCLUSIVE!!] Basic Wall Hack/Chams TuT
    By warrockk1ngs in forum WarRock - International Hacks
    Replies: 33
    Last Post: 08-28-2007, 10:59 PM