Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Pointer Scan does not find addresses on snes9x emulator

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
DQ323
How do I cheat?
Reputation: 0

Joined: 13 Oct 2023
Posts: 5

PostPosted: Fri Oct 13, 2023 8:02 am    Post subject: Pointer Scan does not find addresses on snes9x emulator Reply with quote

hello everybody.

I need help. I'm trying to find the static address in a Super Nintendo game that I'm emulating on snes9x, the game in question is Samurai Shodown. Whenever I search and find the address I need, I try to use the pointer scan to find a pointer, but even when I restart the emulator and search for the address again, which is a dynamic address, I can't find any pointer. I tried following the steps in this tutorial, but without success.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Fri Oct 13, 2023 9:55 am    Post subject: Reply with quote

Due to how emulators work, you're not likely to find a pointer using the pointer scanner. There's probably one offset that's ridiculously big- on the same order of magnitude as the emulated architecture's total memory size.

Try to find the last node / offset manually by debugging the emulator, then do a pointer scan for that node. If you don't know how to read assembly, this is easier said than done.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
DQ323
How do I cheat?
Reputation: 0

Joined: 13 Oct 2023
Posts: 5

PostPosted: Fri Oct 13, 2023 11:20 am    Post subject: Reply with quote

ParkourPenguin wrote:
Try to find the last node / offset manually by debugging the emulator, then do a pointer scan for that node. If you don't know how to read assembly, this is easier said than done.


I understand... ooh man, this is a little frustrating, I've been trying to solve this for about 3 weeks and with each search, I get more depressed haha ​​Sad

Now I'm going to have to learn even assembler ;(

Could you show me a tutorial with the basics so I can have a starting point?

Oh and thanks for responding
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Oct 13, 2023 11:24 am    Post subject: Reply with quote

Try increasing max offset to something like 80000, changing max level to 2 and unchecking the box that says addresses must be 32-bit aligned.

Also, try this using SNESGT, if you are not successful.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Fri Oct 13, 2023 12:02 pm    Post subject: Reply with quote

See the CE tutorial for information on how to find pointers manually.

You're probably looking for some instruction like "mov ebx,[rdi+rcx]", where rdi = 0x1632BD0800 and rcx = 0x18EC8. rdi is clearly the base address (last node) and rcx is the offset.
If it's something like "mov ebx,[rdx]", the offset was calculated prior to that instruction. e.g. "lea rdx,[rsi+rcx]" somewhere above that in the disassembler

Apparently the SNES only has 128 KB of general purpose ram, so it's not impractical to use the pointer scanner if you increase the max offset enough (i.e. 131071). Just don't use a high max level. e.g. start at 3 and see what happens.
Depending on the implementation of the emulator, this might not work.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
DQ323
How do I cheat?
Reputation: 0

Joined: 13 Oct 2023
Posts: 5

PostPosted: Sun Oct 15, 2023 8:16 am    Post subject: Reply with quote

Wow, thanks to your help, I'm starting to walk on my own two feet haha ​​Thanks for your guidance.

Using the tips, even increasing the offset value and the max level, I always get a similar number of pointers, something around 550.

I still don't understand why there are so many pointer addresses and
I still have some doubts regarding the static address to which the pointer should point, whenever I restart the emulator, as shown in the image.

Is the address snes9x.exe + 003053CC the real static address?



Captura de tela 2023-10-15 110429.png
 Description:
 Filesize:  91.17 KB
 Viewed:  3913 Time(s)

Captura de tela 2023-10-15 110429.png


Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Oct 15, 2023 8:53 am    Post subject: Reply with quote

It is not uncommon to have many pointer addresses. Just pick one that is continuously reliable.

If you want something more fool-proof, then injection may be a better approach.

As ParkourPenguin noted, emulators are usually easy to work with because the instructions that contain base address + offset are often all you need in order to filter out whatever it is that you are trying to manipulate.

So, for example, an instruction such as mov al,[ecx+eax], will often hold the base address in exc and the offset in eax. If you check the value of eax when attaching the debugger, this will usually be the ID that you can use for your filter.

With older, emulated games, you will often find that most, interesting values are all being handled by the same instruction (within the same data structure). So, when you find the money value, and check to see what is accessing it, you may see that the offset value is 4, for example. Then, when you find the health value, you may see that the offset value is 8, and so forth. The 4 and 8 are what you can use for your ID's or filters.

You can build a table using a single injection point, and then sort everything using the appropriate offset values. This is also an easy way to find all interesting values, without even having to search for them. Once you identify the offset value for each particular address that you are interested in, you can add it to your table without even having to alter your script, depending on how you structure things.
Back to top
View user's profile Send private message
DQ323
How do I cheat?
Reputation: 0

Joined: 13 Oct 2023
Posts: 5

PostPosted: Mon Oct 16, 2023 9:16 am    Post subject: Reply with quote

I'm doing the CE tutorials and also watching some on YouTube to better understand how pointers work and today I'm going to see some assembly basics to try to start doing code injection.

At the moment, I would like to understand how the CE locates the static address and then takes the dynamic address and adds it to the offset to always have it pointed to when restarting the application.

In the previous image, I have the "fixed base address" of:
snes9x.exe + 003053CC and right next to it a little arrow -> 01D8A810

How does the CE start from the base address and arrive at 01D8A810? Where do I see the static address that is represented by snes9x.exe + 003053CC?

I really appreciate everyone's attention for guiding me and I'm grateful for sharing their knowledge. They have been very helpful even though I don't understand everything quickly.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Oct 16, 2023 10:53 am    Post subject: Reply with quote

You can look at tutorials for how to manually traverse pointer paths by working backwards. Here is one:

https://www.youtube.com/watch?v=QVLeInTi3qI

Although, once you learn assembly, you probably won't need to deal with pointers in this way at all, in most cases. Learning assembly/scripting is what I would recommend.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Mon Oct 16, 2023 11:40 am    Post subject: Reply with quote

Here's another video by DB showing both the pointer scanner and manual methods:
https://www.youtube.com/watch?v=3dyIrcx8Z8g

CE locates the static address by using the windows API. Windows basically tells CE "snes9x.exe is located here: ...", and CE adds 0x3053CC to it to get the base address of the pointer path.
If you want to know the exact address, run this Lua code:
Code:
print(('%08X'):format(getAddress'snes9x.exe+3053CC'))

A pointer is a type that stores the address of something else. i.e. the value of a pointer is an address. Dereferencing a pointer means reading the value of the pointer- in other words, using the pointed-to address for something.
The syntax `[addr] -> val` means "`addr` points to `val`", or "the value of the pointer located at the address `addr` is the address `val`".
The last offset syntax `addr + offset = val` means it doesn't dereference a pointer node.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
DQ323
How do I cheat?
Reputation: 0

Joined: 13 Oct 2023
Posts: 5

PostPosted: Thu Oct 19, 2023 6:40 pm    Post subject: Reply with quote

ParkourPenguin wrote:

CE locates the static address by using the windows API. Windows basically tells CE "snes9x.exe is located here: ...", and CE adds 0x3053CC to it to get the base address of the pointer path.
If you want to know the exact address, run this Lua code:
Code:
print(('%08X'):format(getAddress'snes9x.exe+3053CC'))

.


Guys, I've been putting your tips into practice and thanks to that, I'm able to understand it better and find some important pointers.

However, I feel that to be able to evolve, I need to understand how C.E arrives at the memory address informed after the arrow next to snes9x.exe+3053CC because, after running the lua script, I obtain an address value that does not correspond to the value that is present. side of the arrow as this is dynamic.

My attention is focused on this point because my objective at the moment is to create a lua script that observes this pointer or dynamic address after the arrow and activate an invincibility command right after but I am not able to reach the value, even with the tips and with the videos.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Oct 19, 2023 7:49 pm    Post subject: Reply with quote

I think, you do not need to understand how CE arrives at that address. Simply learn about injection. That will be more beneficial, in my opinion.

In the case of old SNES emulators, where injection may not be a viable option, then the pointer scanner will work just fine and should not even take long at all if done correctly.

That being said, I could be wrong about the value of learning how CE arrives at the address. It is all subjective at the end of the day.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Thu Oct 19, 2023 8:14 pm    Post subject: Reply with quote

Code:
print(('Base address:\t%08X'):format(getAddress'snes9x.exe+3053CC'))
print(('Pointer value at base address:\t%08X'):format(readPointer'snes9x.exe+3053CC'))

It's kind of confusing because there are two addresses associated with a pointer: the address of the pointer itself and the value of the pointer. Again, the value of a pointer is the address of something else.

Look up tutorials for pointers online. Maybe you'll find something that clicks.

Add addresses manually to the cheat table, set the type to 8-byte (pointers in a 64-bit process are 8 bytes), right click the memory record, and make it show as hex. See what pointers are for yourself.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites