duki Posted August 10 Posted August 10 (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: Edited August 10 by duki typo Quote
duki Posted August 10 Author Posted August 10 (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 August 10 by duki Quote
azna Posted August 10 Posted August 10 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? Quote
duki Posted August 10 Author Posted August 10 (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)" 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 August 10 by duki Quote
azna Posted August 11 Posted August 11 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)" 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. Quote
kennylovecode Posted August 11 Posted August 11 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)" 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.... Quote
kennylovecode Posted August 11 Posted August 11 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)" 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.... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.