CoD4 D3D Text

Posts 1–14 of 14 · Page 1 of 1
CoD4 D3D Text
hi guys how can i print text on screen of the iw3mp?

thanks
Hook d3d9.dll and then simply drawtext
how can i do this?
Learn enough Direct3D to figure out which functions are called each frame. Intercept the execution of one of these functions and place your code to draw text within the intercepted function.
Quote Originally Posted by Void View Post
Learn enough Direct3D to figure out which functions are called each frame. Intercept the execution of one of these functions and place your code to draw text within the intercepted function.
^This. Also, if you don't want to use DirectX, you can hook CoD Engine Functions (what is a lot better than D3D IMO).
Quote Originally Posted by MarkHC View Post

^This. Also, if you don't want to use DirectX, you can hook CoD Engine Functions (what is a lot better than D3D IMO).
Explain why this would be better.
In the end they're still relying on DirectX to render, so wether you hook into their drawing routine or directx's, they both execute once per frame so there's no difference.
Quote Originally Posted by Hell_Demon View Post
Explain why this would be better.
In the end they're still relying on DirectX to render, so wether you hook into their drawing routine or directx's, they both execute once per frame so there's no difference.
1. It's easier after you learn how do it.
2. It's more stable.
3. The functions have already been made so if you want, let's say, draw a string with a image of a gun between the words (like the Kill Feed), the engine has the function and all the images for it.
4. If you want to do a decent aimbot using Visibility Check and GetBone Position, you'll have to hook the Engine, since it seems you can't call engine function from D3D routines... so why not use it to draw the stuff either.
5. And it looks better.

That's my opinion.. I'm sure D3D is good too, I've used it a plenty of times either, but the Engine looks a lot better to me
Quote Originally Posted by MarkHC View Post

1. It's easier after you learn how do it.
2. It's more stable.
3. The functions have already been made so if you want, let's say, draw a string with a image of a gun between the words (like the Kill Feed), the engine has the function and all the images for it.
4. If you want to do a decent aimbot using Visibility Check and GetBone Position, you'll have to hook the Engine, since it seems you can't call engine function from D3D routines... so why not use it to draw the stuff either.
5. And it looks better.

That's my opinion.. I'm sure D3D is good too, I've used it a plenty of times either, but the Engine looks a lot better to me
1. The hooking is pretty much the exact same, I don't get how it could be more easy or difficult.
2. If you're properly hooking the required functions both are equally stable, providing they don't interfere with the default code and you don't try to access null pointers.
3. They're accessible from outside a hooked engine function too, so you wouldn't need to hook any engine functions for it.
4. Visibility check and GetBone are accessible without hooks, nearly all engine functions are. The only problem you prevent if you execute those from a hooked engine function is race conditions, but that is fixable with a little bit of extra coding.
5. #opinion.
This is a AMAZING tutorial series, I recommend you check it out. He uses the latest version of CoD4 aswell, its extremely easy to follow along.
 
video
Quote Originally Posted by obsta View Post
This is a AMAZING tutorial series, I recommend you check it out. He uses the latest version of CoD4 aswell, its extremely easy to follow along.
 
video
This guy teaches you how to leech. No where in that video did I find him explaining the concept.
Quote Originally Posted by Void View Post
This guy teaches you how to leech. No where in that video did I find him explaining the concept.
OP was asking for how to draw text to D3D not make a hook, this tutorial explains how to write text to directx?
Quote Originally Posted by obsta View Post
OP was asking for how to draw text to D3D not make a hook, this tutorial explains how to write text to directx?

He wanted to know how to print text to iw3mp. I don't see how you could do this without hooking a function.
This is some code out of my COD 4 Hack

Drawing.h:

Code:
#pragma once

#include "d3d9.h"

static class Drawing
{
public:
	static void Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour, LPD3DXFONT m_font);
	void Drawing::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont);

        LPD3DXFONT m_font;	
}

Drawing.cpp:

Code:
#include "Drawing.h"

void Drawing::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour, LPD3DXFONT m_font)
{
	// Create a rectangle to indicate where on the screen it should be drawn
	RECT rct = {x- 120, y, x+ 120, y + 15};
        m_font->DrawText(NULL, TextToDraw, -1, &rct, DT_NOCLIP, Colour );

};

How to use:

Code:
void Drawing::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont) //To create the font
{
	D3DXCreateFont( d3dDevice, 20, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET, 
			OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, 
			choiceFont.c_str(), &m_font );
}

To draw the Text:

Code:
Drawing.CreateFont(m_pD3Ddev, "Arial");


Drawing::Draw_Text("Hi there", 20, 30, D3DCOLOR_ARGB(255, 255, 255, 255), m_font);

Hope this helps
Even tho your post is to help, watch out for bumps please.
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us