View Single Post
Old 02 January 2019, 19:02   #40
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,539
As I have said, you can't reliably find the variable without first finding code that reads/write it and even if you find some way to directly search for the variable address (find data bytes "abcsdsdkj", add 17823 to its address to find the variable), it would be too difficult to use and it is impossible to know if it actually works in any other variant without testing. It is very difficult and time consuming to find out if data is static or it changes in some situation.

My method can be used (more or less) if you know basics of m68k assembly and it is quite reliable. Long (20+ bytes) code sequence is usually unique enough. Can't also misdetect code from some random temp buffer because it will be only detected if it is getting executed. This is very possible when only looking for data bytes.

If you don't like it that "watched" variable needs to be changed before address is found:

Find out code which is used to READ the variable (for example to show the life counter value on screen), it can be found immediately at game (level) startup. Job done, address is now known and it usually stays the same as long as game is running.

"fa" command should usually find all locations easily enough. This is why I prefer this method, it is simple: find the variable (using trainer options in debugger/ar3), then simply use "fa" and the rest is simple disassembly to check code around the read/write instruction. Of course there are situations when finding the variable requires much more m68k experience but I still don't want to make this too difficult when it does not need to be difficult.
Toni Wilen is online now  
 
Page generated in 0.04422 seconds with 11 queries