-----------------------------------
engine drawing aka cDebugTextRenderer for swtor
-----------------------------------
hi it has been a long time
i have reverse all of GOM and a Render method if someone can get a good method for finding the GOM pointer i can release a base for ESP and Rader
the method need to be easy to use
you are going to need EASTL to get the DebugTextRenderer to work
-----------------------------------
renderer.h
-----------------------------------
Code:
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment( lib, "d3d9.lib" )
#pragma comment( lib, "d3dx9.lib" )
#ifndef _DEBUG_TEXT_RENDERER_H_
#define _DEBUG_TEXT_RENDERER_H_
#pragma once
enum TextFlags
{
TOP = 0x00000000,
LEFT = 0x00000000,
CENTER = 0x00000001,
RIGHT = 0x00000002,
VCENTER = 0x00000004,
BOTTOM = 0x00000008,
WORDBREAK = 0x00000010,
SINGLELINE = 0x00000020,
EXPANDTABS = 0x00000040,
TABSTOP = 0x00000080,
NOCLIP = 0x00000100,
EXTERNALLEADING = 0x00000200,
CALCRECT = 0x00000400,
NOPREFIX = 0x00000800,
INTERNAL = 0x00001000,
};
class cDebugTextRenderer
{
public:
cDebugTextRenderer( HMODULE hRemoteRenderer )
{
Flush = (tFlush)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_Flush@RemoteRenderer@bwa@@QAEXXZ" );
SetFont = (tSetFont)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_SetFont@RemoteRenderer@bwa@@QAEXI@Z" );
SetFlags = (tSetFlags)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_SetFlags@RemoteRenderer@bwa@@QAEXI@Z" );
SetColor = (tSetColor)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_SetColor@RemoteRenderer@bwa@@QAEXK@Z" );
SetDropShadow = (tSetDropShadow)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_SetDropShadow@RemoteRenderer@bwa@@QAEXM@Z" );
SetClipRegion = (tSetClipRegion)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_SetClipRegion@RemoteRenderer@bwa@@QAEXHHHH@Z" );
DrawTextEx = (tDrawTextEx)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_DrawTextEx@RemoteRenderer@bwa@@QAEXHHABV?$basic_string@DVallocator@eastl@@@eastl@@IUtagRECT@@KIM@Z" );
DrawText = (tDrawText)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_DrawText@RemoteRenderer@bwa@@QAEXHHABV?$basic_string@DVallocator@eastl@@@eastl@@@Z" );
DrawText3D = (tDrawText3D)(DWORD)GetProcAddress( hRemoteRenderer, "?DebugTextRenderer_DrawText3d@RemoteRenderer@bwa@@QAEXABVVector3@2@MMABV?$basic_string@DVallocator@eastl@@@eastl@@@Z" );
}
void MyDrawText( int x, int y, eastl::string & str, DWORD dwColor, int iFont )
{
Flush();
SetFont( iFont );
SetColor( dwColor );
DrawText( x, y, str );
}
void MyDrawText3D( D3DXVECTOR3& vec, eastl::string & str, DWORD dwColor, int iFont, int iFlag )
{
Flush();
SetFont( iFont );
SetFlags( iFlag );
SetColor( dwColor );
DrawText3D( vec, 1, 1, str );
}
void MyDrawTextEx( int x, int y, eastl::string & str, unsigned int iFont, RECT rect, DWORD dwColor, unsigned int iFlags, float fSetDropShadow )
{
Flush();
SetFont( iFont );
SetColor( dwColor );
SetFlags( iFlags );
SetDropShadow( fSetDropShadow );
SetClipRegion( rect.left, rect.right, rect.top, rect.bottom );
DrawText( x, y, str );
}
typedef void ( WINAPI *tFlush )( void );
tFlush Flush;
typedef void ( WINAPI *tSetColor )( DWORD dwColor );
tSetColor SetColor;
typedef void ( WINAPI *tSetDropShadow )( float fvalue );
tSetDropShadow SetDropShadow;
typedef void ( WINAPI *tSetFont )( unsigned int iFont );
tSetFont SetFont;
typedef void ( WINAPI *tSetFlags )( unsigned int iFlags );
tSetFlags SetFlags;
typedef void ( WINAPI *tDrawText )( int x, int y, eastl::string & str );
tDrawText DrawText;
typedef void ( WINAPI *tSetClipRegion )( int left, int right, int top, int bottom );
tSetClipRegion SetClipRegion;
typedef void ( WINAPI *tDrawText3D )( D3DXVECTOR3& vec, float fDist, float fScaleFactor, eastl::string & str ); //still not entirely sure what the two floats are
tDrawText3D DrawText3D;
typedef void ( WINAPI *tDrawTextEx )( int x, int y, eastl::string & str, unsigned int unk, RECT rect, DWORD dwColor, unsigned int unk2, float fSetDropShadow );
tDrawTextEx DrawTextEx; //unk and unk2 is flags and font pointer unsure which is which
};
extern class cDebugTextRenderer* DebugTextRenderer;
#endif
Code:
Entry::g_hMemoryModule = Utils::GetModuleHandleInterLocked("MemoryMan.dll");
Entry::g_hRendereModule = Utils::GetModuleHandleInterLocked("RemoteRenderer.dll");
DebugTextRenderer = new cDebugTextRenderer( Entry::g_hRendereModule );
eastl::string str = "Test Hack by The1Domo";
DebugTextRenderer->SetFlags(0x1);
DebugTextRenderer->MyDrawText(10, 10, str, 0xFFFF0000, 0);
example
Code:
void CHack::Drawinfo(IDirect3DDevice9 *pD3Ddev)
{
eastl::string str = "Test Hack by The1Domo";
DebugTextRenderer->SetFlags(0x1);
DebugTextRenderer->MyDrawText(10, 10, str, 0xFFFF0000, 0);
DebugTextRenderer->SetFlags(0x1);
DebugTextRenderer->MyDrawText(10, 20, eastl::string(g_pDrawTools->GetTime(2)), 0xFFFF0000, 0);
if(g_main)
{
GOM_ObjList &Nodes = (GOM_ObjList&)g_main->nodes;
ULONG m_PlayersCount = Nodes.Count;
for(LONG_PTR i = 0, x = 0; i < Nodes.Limit; i++, x += 4)
{
if( !Nodes.pList && !Nodes.pList->p )
GOM_entry *pGE = (GOM_entry *) ((PPVOID)&Nodes.pList->p) [i];
while (pGE)
{
if(pGE->Type && pGE->Type == 1)
{
const tGUID &guid = pGE->GUID;
const ULONG tcid = (((guid.B << 6) + guid.A + (guid.B >> 2)) ^ guid.B) % Nodes.Limit;
printf("tcid: %i\n", tcid);
Utils::add_log("tcid: %i", tcid);
if(tcid != i)
break;
g_pHero->HandleNode_V1(pGE);
HeroNode* hNode = g_pHero->FindNode(pGE->GUID, g_main);
if(!hNode || !hNode->pCnt)
break;
printf("HeroNode: 0x%X\n", hNode);
Utils::add_log("HeroNode: 0x%X", hNode);
printf("hNode->pCnt: 0x%X\n", hNode->pCnt);
Utils::add_log("hNode->pCnt: 0x%X", hNode->pCnt);
Node &pContainerNode = (Node&)hNode->pCnt;
if(!&pContainerNode)
break;
printf("pContainerNode: 0x%X\n\n",pContainerNode);
Utils::add_log("pContainerNode: 0x%X", pContainerNode);
ULONG Type = NodeType(&pContainerNode);
if(Type == ~0)
break;
if(Type == 2) //<- pc/npc
{
printf("pc/npc \n");
CharacterNode* targetNode = (CharacterNode*)hNode->pCnt;
char szDebug1[256];
sprintf(szDebug1, "(player/npc)");
DebugTextRenderer->MyDrawText3D( D3DXVECTOR3( targetNode->Pos3.X, targetNode->Pos3.Y + 0.23f, targetNode->Pos3.Z ), eastl::string( szDebug1 ), 0xFFFF0000, 0, DT_CENTER );
}
if(Type == 17) //<- vehs
printf("vehs \n");
if(Type == 13) //<- placeablez
printf("placeablez \n");
}
else
if(pGE->Type == 2)
{
//continue;
}
}
}
}
}
Good luck