Textdraws

KnowItAll

Member
Joined
Feb 3, 2018
Messages
7
Reaction score
0
Hey.

I'm trying to monitor SAMP and find all the text-draws on screen to read them (not the text-box).

(SAMP article) http://wiki.sa-mp.com/wiki/Textdraw

If someone could tell me the pointer to the function that draws them so I can hook that and write code from there, that'd be very helpful (I plan on releasing it here).

Alternatively, if anyone could tell me any information helpful to programmatically reading every text draw from screen, that'd be equally helpful.

Thanks,
 

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
Code:
struct stTextdrawPool // 0x10
{
	int					iIsListed[SAMP_MAX_TEXTDRAWS];
	int					iPlayerTextDraw[SAMP_MAX_PLAYERTEXTDRAWS]; 
	struct stTextdraw	*textdraw[SAMP_MAX_TEXTDRAWS];  -> 0x2400
	struct stTextdraw	*playerTextdraw[SAMP_MAX_PLAYERTEXTDRAWS];
};


just took samp ppools offset to stTextdraws (0x10)

wrote that on phone but may a help ::D

(dword)
dwTextdraws  =((( g_dwSAMPAddr+ 0x21A0F8) + 0x3CD) + 0x10) 
-> 


Code:
// for it

for(int i =0;i<2048;++i)
{
// size of each element  is 4
int iIsListed = *(INT*)(dwTextDraws + i * 0x4);
 if(iIsListed == 0)
    continue;

 DWORD dwAddr = *(DWORD*)(dwTextDraws + 0x2400 + i * 0x4); 
 if(dwAddr == 0)
  continue;
}
// at least read dwAddr as string -> textdraw text

//struct stTextdraw
//{
//	char		szText[800 + 1]; -> dwADDR + 0x0
//	char		szString[1600 + 2];
//	float		fLetterWidth;
    
gl
 

KnowItAll

Member
Joined
Feb 3, 2018
Messages
7
Reaction score
0
user88 said:
Code:
struct stTextdrawPool // 0x10
{
	int					iIsListed[SAMP_MAX_TEXTDRAWS];
	int					iPlayerTextDraw[SAMP_MAX_PLAYERTEXTDRAWS]; 
	struct stTextdraw	*textdraw[SAMP_MAX_TEXTDRAWS];  -> 0x2400
	struct stTextdraw	*playerTextdraw[SAMP_MAX_PLAYERTEXTDRAWS];
};


just took samp ppools offset to stTextdraws (0x10)

wrote that on phone but may a help ::D

(dword)
dwTextdraws  =((( g_dwSAMPAddr+ 0x21A0F8) + 0x3CD) + 0x10) 
-> 


Code:
// for it

for(int i =0;i<2048;++i)
{
// size of each element  is 4
int iIsListed = *(INT*)(dwTextDraws + i * 0x4);
 if(iIsListed == 0)
    continue;

 DWORD dwAddr = *(DWORD*)(dwTextDraws + 0x2400 + i * 0x4); 
 if(dwAddr == 0)
  continue;
}
// at least read dwAddr as string -> textdraw text

//struct stTextdraw
//{
//	char		szText[800 + 1]; -> dwADDR + 0x0
//	char		szString[1600 + 2];
//	float		fLetterWidth;
    
gl
Really helpful.

How did you find this?
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
KnowItAll said:
user88 said:
Code:
struct stTextdrawPool // 0x10
{
	int					iIsListed[SAMP_MAX_TEXTDRAWS];
	int					iPlayerTextDraw[SAMP_MAX_PLAYERTEXTDRAWS]; 
	struct stTextdraw	*textdraw[SAMP_MAX_TEXTDRAWS];  -> 0x2400
	struct stTextdraw	*playerTextdraw[SAMP_MAX_PLAYERTEXTDRAWS];
};


just took samp ppools offset to stTextdraws (0x10)

wrote that on phone but may a help ::D

(dword)
dwTextdraws  =((( g_dwSAMPAddr+ 0x21A0F8) + 0x3CD) + 0x10) 
-> 


Code:
// for it

for(int i =0;i<2048;++i)
{
// size of each element  is 4
int iIsListed = *(INT*)(dwTextDraws + i * 0x4);
 if(iIsListed == 0)
    continue;

 DWORD dwAddr = *(DWORD*)(dwTextDraws + 0x2400 + i * 0x4); 
 if(dwAddr == 0)
  continue;
}
// at least read dwAddr as string -> textdraw text

//struct stTextdraw
//{
//	char		szText[800 + 1]; -> dwADDR + 0x0
//	char		szString[1600 + 2];
//	float		fLetterWidth;
    
gl
Really helpful.

How did you find this?

sampfuncs I think
 

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
0x32789 said:
KnowItAll said:
user88 said:
Code:
struct stTextdrawPool // 0x10
{
	int					iIsListed[SAMP_MAX_TEXTDRAWS];
	int					iPlayerTextDraw[SAMP_MAX_PLAYERTEXTDRAWS]; 
	struct stTextdraw	*textdraw[SAMP_MAX_TEXTDRAWS];  -> 0x2400
	struct stTextdraw	*playerTextdraw[SAMP_MAX_PLAYERTEXTDRAWS];
};


just took samp ppools offset to stTextdraws (0x10)

wrote that on phone but may a help ::D

(dword)
dwTextdraws  =((( g_dwSAMPAddr+ 0x21A0F8) + 0x3CD) + 0x10) 
-> 


Code:
// for it

for(int i =0;i<2048;++i)
{
// size of each element  is 4
int iIsListed = *(INT*)(dwTextDraws + i * 0x4);
 if(iIsListed == 0)
    continue;

 DWORD dwAddr = *(DWORD*)(dwTextDraws + 0x2400 + i * 0x4); 
 if(dwAddr == 0)
  continue;
}
// at least read dwAddr as string -> textdraw text

//struct stTextdraw
//{
//	char		szText[800 + 1]; -> dwADDR + 0x0
//	char		szString[1600 + 2];
//	float		fLetterWidth;
    
gl
Really helpful.

How did you find this?

sampfuncs I think
No sampfuncs just samp.h from s0b
 

KnowItAll

Member
Joined
Feb 3, 2018
Messages
7
Reaction score
0
user88 said:
0x32789 said:
KnowItAll said:
user88 said:
Code:
struct stTextdrawPool // 0x10
{
	int					iIsListed[SAMP_MAX_TEXTDRAWS];
	int					iPlayerTextDraw[SAMP_MAX_PLAYERTEXTDRAWS]; 
	struct stTextdraw	*textdraw[SAMP_MAX_TEXTDRAWS];  -> 0x2400
	struct stTextdraw	*playerTextdraw[SAMP_MAX_PLAYERTEXTDRAWS];
};


just took samp ppools offset to stTextdraws (0x10)

wrote that on phone but may a help ::D

(dword)
dwTextdraws  =((( g_dwSAMPAddr+ 0x21A0F8) + 0x3CD) + 0x10) 
-> 


Code:
// for it

for(int i =0;i<2048;++i)
{
// size of each element  is 4
int iIsListed = *(INT*)(dwTextDraws + i * 0x4);
 if(iIsListed == 0)
    continue;

 DWORD dwAddr = *(DWORD*)(dwTextDraws + 0x2400 + i * 0x4); 
 if(dwAddr == 0)
  continue;
}
// at least read dwAddr as string -> textdraw text

//struct stTextdraw
//{
//	char		szText[800 + 1]; -> dwADDR + 0x0
//	char		szString[1600 + 2];
//	float		fLetterWidth;
    
gl
Really helpful.

How did you find this?

sampfuncs I think
No sampfuncs just samp.h from s0b


For anyone looking for this because you found this thread via search
https://github.com/BlastHackNet/mod_s0beit_sa/blob/samp-dl/src/samp.h

Anyways, you're an allstar. Hopefully I'll have something viable.
Thanks!
 
Top