Results 1 to 5 of 5
  1. #1
    UnOwN CoD3R's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Elmo's World!
    Posts
    296
    Reputation
    14
    Thanks
    371

    Tutorial Draw Strings

    Well, thought I'd sum up the info I posted in another thread for everyone who wants to draw strings through MOHAA's string function.

    In the early stages of WAMbot development, I stumbled over that function more or less by chance in OllyDBG:
    Code:
    void (*R_DrawString) ( int *font, const char *text, float x, float y, int length, int unknown );
    Offset: 0x004ac7c0
    i chose the names appropreately.
    font is actually not int* but probably something like font_t* but i didnt find anything useful inside that struct. declaring it as a pointer to any type is satisfactory. i'll explain how to get that pointer.
    text, x, y - text to be drawn at x, y coordinates
    length if unknown, pass -1, else it will print only as many letters as you want (gives you the ability to limit the length of the drawn string)
    unknown pass 0, or try to find out what other values effect

    now, to get a font pointer, you can call a nice function i searched for you:
    Code:
    int *(*R_RegisterFont) ( const char *name );
    Offset: 0x004ac2f0
    possible arguments are:
    "facfont-20" (standard)
    "courier-16"
    "courier-18"
    "courier-20"
    "handle-16"
    "handle-18"
    "handle-22"
    "handle-23"
    "marlett"
    "verdana-12"
    "verdana-14"

    If you like colors then this is probably what you want:

    Code:
    void (*R_SetColor) ( vec4_t rgba );
    Offset: 0x004b7fe0
    Now, how do you use it? Good question!
    Hook the function at offset 0x30020624. It's void func(void) call it whatever you like. (search the forums for info on how to hoook functions). It gets called every frame so you can place your draw code inside it.
    Inside your hooked function, you can draw strings like that:
    Code:
    void	hooked_func( void ) {
    	int *font;
    	vec4_t		colorTransBlue	= { 0, 0, 1, 0.5 };
    	font = R_RegisterFont( "verdana-14" );
    	R_SetColor( colorTransBlue );
    	R_DrawString( font, "1337 power by the codinGanimal", 320, 280, -1, 0 );
    	R_SetColor( NULL ); //reset to white
    }
    that will draw at 320,280. of course this is inefficient because it would be enough to call R_RegisterFont only once!

    I hope I won't find the wrong people using or spreading that stuff without the proper credits!

    //edit: i am not sure about the last argument so i better call it "unknown" ...

    Credz:
    codinGanimal

  2. The Following User Says Thank You to UnOwN CoD3R For This Useful Post:

    Benjamin40 (07-16-2010)

  3. #2
    Skyline.'s Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    10,160
    Reputation
    416
    Thanks
    1,614
    is this like "strings" as in ESP or wallhacks or something?...


  4. #3
    UnOwN CoD3R's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Elmo's World!
    Posts
    296
    Reputation
    14
    Thanks
    371
    Yes, it is for name esp.

    HACK MAKER ALL GAMES

  5. #4
    maxfighterr's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    help

    help me plz help me

  6. #5
    iRobot™'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Mpgh.net
    Posts
    2,463
    Reputation
    20
    Thanks
    322
    My Mood
    Twisted
    with what?

Similar Threads

  1. [Tutorial]Drawing a triangle
    By ♪~ ᕕ(ᐛ)ᕗ in forum DirectX/D3D Development
    Replies: 2
    Last Post: 06-24-2011, 06:32 PM
  2. In-depth Tutorial Comparing Strings
    By Shark23 in forum Assembly
    Replies: 5
    Last Post: 11-30-2010, 07:33 AM
  3. [Tutorial] String collections and settings. I think so.
    By Jason in forum Visual Basic Programming
    Replies: 18
    Last Post: 09-14-2010, 09:47 PM
  4. [Tutorial] String Manipulation
    By NextGen1 in forum Visual Basic Programming
    Replies: 3
    Last Post: 01-19-2010, 11:57 PM
  5. Warrock Hack - Tutorial
    By Dave84311 in forum WarRock - International Hacks
    Replies: 667
    Last Post: 10-09-2007, 10:10 AM