Help [AHK]GetDialogText

PeterL

Member
Joined
Dec 26, 2014
Messages
16
Reaction score
0
Hello
I need some help with this Function
Code:
GetDialogText()
{
Process = gta_sa.exe
DllName = samp.dll
Process, Exist, %Process%
PID = %ErrorLevel%
SetFormat, Integer, D
Base := GetDllBase(DllName, PID)
pointer1addr:= Base+0x2180a0
pointer1result := ReadMemory(pointer1addr, "GTA:SA:MP")
pointer2addr:=pointer1result+0x1c
pointer2result := ReadMemory(pointer2addr, "GTA:SA:MP")
text:=ReadMemory_Str(pointer2result,0,PID)
;SendInput tPointer 1: %pointer1addr%=%pointer1result% Pointer 2: %pointer2addr%=%pointer2result% Text: %text%{enter}
SetFormat, Integer, D
return text
}
I tried a lot of dialog offsets but they don´t work can anybody fix this function pls
mfg.
 

luxdav

Active member
Joined
Sep 17, 2014
Messages
45
Reaction score
5
Here are my getDialogText and getDialogTitle Functions:

Code:
; get the text in dialog
; @author luxdav aka David_Luchs
getDialogText()
{
	if(!checkHandles())
		return ""
	dwAddress := readDWORD(hGTA, dwSAMP + 0x21A0FC)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return ""
	}
	dwAddress := readDWORD(hGTA, dwAddress + 0x1C)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return ""
	}
	text := readString(hGTA, dwAddress, 4096)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return ""
	}

	ErrorLevel := ERROR_OK
	return text
}
Code:
; get the title of dialog
; @author luxdav aka David_Luchs
getDialogTitle()
{
	if(!checkHandles())
		return ""
	dwAddress := readDWORD(hGTA, dwSAMP + 0x21A0B8)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return ""
	}
	text := readString(hGTA, dwAddress + 0x40, 128)
	if(ErrorLevel) {
		ErrorLevel := ERROR_READ_MEMORY
		return ""
	}

	ErrorLevel := ERROR_OK
	return text
}
pls approve this, it's quite untested
 
Top