Samp Client chat messages memory address
#1

Hi, I'm making an autoit script to translate the chat messages writen by the players in my Samp 'Client'(not server, so it's just for me).

I'm gonna read the new lines written, get their ****** translation, and write in the same memory address, so they appear automatically

I've found the address with CheatEngine looking for "chatlog.txt" and paging down so it works perfectly. I can see the translated messages. But I'd like to know the pointer (if it's static) of the chat messages, because I know that the memory address is dynamic. Also I'm kinda new to memory hacking stuff

There is this webpage : http://www.gtamodding.com/index.php?...dresses_(SAMP))
which says the pointer of the SAMP 0.3b R3 Client Chatbox. Since it's an old version, it changed and now it doesn't work

This is the part of my autoit script which I use the address:

Code:
_WinAPI_ReadProcessMemory($hwnd, $addr, DllStructGetPtr($s), DllStructGetSize($s), $iRead)
...
_WinAPI_WriteProcessMemory($hwnd, $addr, DllStructGetPtr($s2), DllStructGetSize($s2), $iRead)
Reply
#2

This doesn't even make sense. Why would you want to "manipulate the chat messages writen by the players" in the first place? You do realize that, even if you could pull this off, that it would only be modified for you, right? If you do not understand much about pointers, you really are in over your head.
Reply
#3

I thought that people ask why. Well, it's because the autoit script is gonna rewrite the chat msgs with translated ones. I want to understand what russians say
Reply
#4

Quote:
Originally Posted by JoshuaFoster
View Post
I thought that people ask why. Well, it's because the autoit script is gonna rewrite the chat msgs with translated ones. I want to understand what russians say
maybe try linking with chatlog.txt or server_log.txt and parse lines via it..
Reply
#5

Quote:
Originally Posted by JoshuaFoster
View Post
I thought that people ask why. Well, it's because the autoit script is gonna rewrite the chat msgs with translated ones. I want to understand what russians say
https://sampforum.blast.hk/showthread.php?tid=479169
Reply
#6

Clientwise translation isnt such a bad idea. There IS a translation plugin, but there wont be many servers using it, especially the russian ones. So in order to translate everything, a clientside mod is the logical solution.
Getting such a specific and well known address shouldnt be too hard. You know whats at that address, as you know what the first line ingame says (maybe except some internal format and style modifiers), I doubt the chat is somehow compressed or encrypted in memory. So join an empty server, type a simple but unique sentence in the chat, and get a memory dump of the game. Then open it with some hexeditor (hexeditor mx had good performance for such big files iirc) and search for that string. If you cant find it, try searching for single words of that string, or replace all spaces with generic regexes, so it also matches incase there are some format modifiers between the words.
Reply
#7

Quote:
Originally Posted by Mauzen
View Post
Clientwise translation isnt such a bad idea. There IS a translation plugin, but there wont be many servers using it, especially the russian ones. So in order to translate everything, a clientside mod is the logical solution.
Getting such a specific and well known address shouldnt be too hard. You know whats at that address, as you know what the first line ingame says (maybe except some internal format and style modifiers), I doubt the chat is somehow compressed or encrypted in memory. So join an empty server, type a simple but unique sentence in the chat, and get a memory dump of the game. Then open it with some hexeditor (hexeditor mx had good performance for such big files iirc) and search for that string. If you cant find it, try searching for single words of that string, or replace all spaces with generic regexes, so it also matches incase there are some format modifiers between the words.
IDAPro is the best for memory-wise stuff.
Reply
#8

I updated my post
Reply
#9

Why don't you simply announce the translation after they speak? For example:
----
ToKiller: OMG you noob!!1
RussianGuy: Все люди рождаются
-Trans: All human beings are born
Flimpto: I wasnt i was found in the garden
----
This is much simpler, no memory address required, no 'hacking' of the SA-MP processes required. No fear of issues with exceeding line length
Reply
#10

Quote:
Originally Posted by JoshuaFoster
View Post
I thought that people ask why. Well, it's because the autoit script is gonna rewrite the chat msgs with translated ones. I want to understand what russians say
Ok! That makes waaaay more sense. I took this post as something entirely different, I apologize. To be fair though, your first unedited post was far from clear aha. I am looking forward to see your progress!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)