Jump to content
Returning Members: Password Reset Required ×

Recommended Posts

Posted (edited)

Old code found on my disk, this could be used as a gate to make a bot targeting specific strings in game... but this is just a cute rainbow example!!1!

You can also change font/text content in real-time too.

 

ShowStringEx:

HMODULE hGraphic = GetModuleHandleA("graphic.dll");
oShowStringEx = (tShowStringEx)GetProcAddress(
	hGraphic,
	"?ShowStringEx@CMyBitmap@@SA?AUC3_SIZE@@HHKPBD0H_NW4RENDER_TEXT_STYLE@@KUC3_POS@@@Z");

 

Example code:

typedef struct {
	int width;
	int height;
} C3_SIZE;

typedef struct {
	int x;
	int y;
} C3_POS;

enum RENDER_TEXT_STYLE {
	STYLE_DEFAULT = 0,
	STYLE_BOLD = 1,
};

typedef C3_SIZE(__cdecl* tShowStringEx)(int, int, unsigned long, const char*, const char*, int, bool, RENDER_TEXT_STYLE, unsigned long, C3_POS);
ShowStringEx_t oShowStringEx = nullptr;

float fRed = 0.0f, fGreen = 0.0f, fBlue = 0.0f;
float fTime = 0.0f;
DWORD lastTick = 0;

void updateRainbowColors() {
	DWORD currentTick = GetTickCount();

	float deltaTime = (currentTick - lastTick) / 1000.0f;
	lastTick = currentTick;

	fTime += deltaTime;

	fRed = (sin(fTime) + 1.0f) / 2.0f;
	fGreen = (sin(fTime + 2.0f) + 1.0f) / 2.0f;
	fBlue = (sin(fTime + 4.0f) + 1.0f) / 2.0f;
}

D3DCOLOR gRainbow() {
	return D3DCOLOR_RGBA(static_cast<int>(fRed * 255),
		static_cast<int>(fGreen * 255),
		static_cast<int>(fBlue * 255),
		255);
}

C3_SIZE __cdecl hkShowStringEx(int a1, int a2, unsigned long a3, const char* str1, const char* str2, int a6, bool a7, RENDER_TEXT_STYLE style, unsigned long a9, C3_POS pos)
{
	//example targeting fps/ping counter
	if (strstr(str1, ("FpsAver")) != nullptr)//or C3Ver:DX
	{
		updateRainbowColors();

		return oShowStringEx(a1, a2, gRainbow(), str1, str2, a6, a7, style, a9, pos);
	}

	return oShowStringEx(a1, a2, a3, str1, str2, a6, a7, style, a9, pos);
}

Preview:

spacer.png

Edited by duki
typo
Posted (edited)

Forgot to mention: newer versions of the game uses ShowStringW

 

Function:

?ShowStringW@CMyBitmap@@SA?AUC3_SIZE@@HHKPBGPBDH_NW4RENDER_TEXT_STYLE@@KUC3_POS@@@Z

 

Example:

typedef struct {
	int width;
	int height;
} C3_SIZE;

typedef struct {
	int x;
	int y;
} C3_POS;

enum RENDER_TEXT_STYLE {
	STYLE_DEFAULT = 0,
	STYLE_BOLD = 1,
};
  
typedef C3_SIZE(__cdecl* tShowStringW)(int, int, DWORD, const wchar_t*, const char*, int, bool, RENDER_TEXT_STYLE, DWORD, C3_POS);

tShowStringW oShowStringW = nullptr;

C3_SIZE __cdecl hkShowStringW(int iPosX, int iPosY, DWORD color, const wchar_t* pszString, const char* pszFont, int nFontSize, bool bAntialias, RENDER_TEXT_STYLE style, DWORD secondColor, C3_POS ptOffset)
{
	//call og function
}

 

Edited by duki
Posted

Excellent contribution, thats awesome!!

Have you tried to make a similar hook with the drop items, add an AddStringView to add a background and make them more visible, or change the default color (yellow) for some other one?

Posted (edited)
1 hour ago, azna said:

Excellent contribution, thats awesome!!

Have you tried to make a similar hook with the drop items, add an AddStringView to add a background and make them more visible, or change the default color (yellow) for some other one?

 

Yeah that's possible, if you have a prefix of the item such as "[S]" -> Super or any other prefix you can do that

Example targeting "(3rd)"

ayiENLAZvS.gif.f6b9f209c4b4bff031e6d53900422630.gif

 

You can prevent it from being draw, add to a list of drawable items & re-render it in endscene.

I'll upload in a few days my old imgui project for d3d9 client.

Edited by duki
Posted
5 hours ago, duki said:

 

Yeah that's possible, if you have a prefix of the item such as "[S]" -> Super or any other prefix you can do that

Example targeting "(3rd)"

ayiENLAZvS.gif.f6b9f209c4b4bff031e6d53900422630.gif

 

You can prevent it from being draw, add to a list of drawable items & re-render it in endscene.

I'll upload in a few days my old imgui project for d3d9 client.

Awesome. Do you think it's possible to use the same ShowString, but calling the drop item's address?

I'll wait for that project; I'm curious about ImGui.

Posted
11 hours ago, duki said:

 

Yeah that's possible, if you have a prefix of the item such as "[S]" -> Super or any other prefix you can do that

Example targeting "(3rd)"

ayiENLAZvS.gif.f6b9f209c4b4bff031e6d53900422630.gif

 

You can prevent it from being draw, add to a list of drawable items & re-render it in endscene.

I'll upload in a few days my old imgui project for d3d9 client.

I'm doing this, but I found that the function for drawing item names doesn't have an item ID, which means I can't draw item names based on the item ID....

Posted
11 hours ago, duki said:

 

Yeah that's possible, if you have a prefix of the item such as "[S]" -> Super or any other prefix you can do that

Example targeting "(3rd)"

ayiENLAZvS.gif.f6b9f209c4b4bff031e6d53900422630.gif

 

You can prevent it from being draw, add to a list of drawable items & re-render it in endscene.

I'll upload in a few days my old imgui project for d3d9 client.

I'm doing this, but I found that the function for drawing item names doesn't have an item ID, which means I can't draw item names based on the item ID....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...