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 


Dark Souls PTDE - Modifying Enemies?
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Tue May 10, 2016 9:51 am    Post subject: Reply with quote

What type are you viewing the values as? If you're looking at them like they're a 4 byte value, it could be that they're actually a float or a double (I'd bet on double). Try shifting around the alignment of viewing the data as a double on a 4 byte boundary. In other words, if the 4 bytes at the address 07001234 are changing, try adding a double to the address list, and put in 07001230 for the address. If that doesn't look right, try changing it to a float. If it still doesn't look right, try doing both of those but increase the address by 4 (view address 07001234 as a double and a float).

I'm not entirely sure what you meant by that last line, but if you want to track the changes to an address, I made a script that would do that here.

_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Tue May 10, 2016 10:07 am    Post subject: Reply with quote

Naw, they display fine; they're float values. It's just odd that there are duplicates of the position data, is all.


Not an address, but, like, watching a region of memory for addresses that change. When they do, display the address and the value that was changed, and the new value.

Even better, would be if CE could track the changes and display all of 'em.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Tue May 10, 2016 10:10 am    Post subject: Reply with quote

You can use that script I linked to and watch multiple addresses.
_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Tue May 10, 2016 1:54 pm    Post subject: Reply with quote

I managed to find the xzy positions that are actively updated (as in, when the enemy moves, these float addresses change in accordance), but, uh, oh my god is it insane.

The x z y positions (not ordered as x y z due to Havok I think) are stored in a pointed at offset 88 from the NPC's structure. The thing is...There are hundreds of addresses with the exact same position, surrounded by seemingly nonsensical variables consisting of decimals changing many times a second.

Sorting through the automatically generated structure data is a nightmare in and of itself (an address split up into four separate bytes when it should be a float for one of the axis' positions, for example).


It's just...Bloody what?

I managed to get 11 sets of the xzy values before I gave up, as I didn't even make the scroll bar the tiniest bit bigger, in the structure window.

Changing the address manually does nothing, as it's promptly overwritten. The instructions that write to the addresses, when looking at what writes to the xzy addresses, are modifying hundreds of addresses at any given moment.

Like, this is insane. I used CE's "Replace with code that does nothing" feature to see if that would freeze the npc in place, which immediately crashed the game.


Uuuurgh. It would have been a godsend if Technojacker explained what the code does and how it works, in his table, as I'm feeling utterly helpless.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Tue May 10, 2016 2:09 pm    Post subject: Reply with quote

Majin wrote:
Sorting through the automatically generated structure data is a nightmare in and of itself (an address split up into four separate bytes when it should be a float for one of the axis' positions, for example).

CE isn't perfect in its guesses. That's why you can change the elements if you want to.

From looking at that "monster vac" script in that table you posted earlier, it looks like the subroutine with the AoB "F3 0F 7E 44 24 08 66 0F D6 46 18" contains a reference to the monster coordinates with [esi+10] = x, [esi+14] = z, [esi+18] = y, and [esi+1C] = ???. Look at those offsets in the structure you found inside the enemy structure and see if they're significant at all (remember to view them as a float).

_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Tue May 10, 2016 2:22 pm    Post subject: Reply with quote

ParkourPenguin wrote:

CE isn't perfect in its guesses. That's why you can change the elements if you want to.


Aye, but when I said there were hundreds (maybe a couple thousand) of these bogus entries...Oh dear me.

Quote:

From looking at that "monster vac" script in that table you posted earlier, it looks like the subroutine with the AoB "F3 0F 7E 44 24 08 66 0F D6 46 18" contains a reference to the monster coordinates with [esi+10] = x, [esi+14] = z, [esi+18] = y, and [esi+1C] = ???. Look at those offsets in the structure you found inside the enemy structure and see if they're significant at all (remember to view them as a float).


Good thinking. I think 1C might be rotation? I'll take a look in a bit.

I swear, this stuff's giving me a migrane.

Edit: Nope, 10 & 18 are gibberish floats. The first X is at 0C, Z @ 1C, Y @ 2C

Probably for a different sub-structure. I'll check out the lock positions script.


Edit2: No dice, appears as another gibberish float (a 0.##### number instead of ###.#####)


Edit3: New idea. Is it possible to list the records being changed by a script in the cheat table? Similar to how the "Find out what writes to this address" thing works; something like "Find out what addresses this script writes to"
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Tue May 10, 2016 4:49 pm    Post subject: Reply with quote

You can right click on an instruction and select "Find out what addresses this instruction accesses". So find the script in the disassembler (register a symbol if the script doesn't do that already) and do that for whichever instruction(s) you want.
_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Wed May 11, 2016 9:22 am    Post subject: Reply with quote

ParkourPenguin wrote:
You can right click on an instruction and select "Find out what addresses this instruction accesses". So find the script in the disassembler (register a symbol if the script doesn't do that already) and do that for whichever instruction(s) you want.


You'll have to be more in-depth; explain it ta me like I'm 5. I've searched the Assembly by just typing in BasePTR (should be the easiest to find?) as the search query, and nada.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Wed May 11, 2016 9:36 am    Post subject: Reply with quote

Let's take the "Monster Vac" script for example. First, we need to look at all the registered symbols.
Code:
registersymbol(MoveSpeed)
registersymbol(NewCoords)
registersymbol(MonsterVacOff)
registersymbol(MovStart)
registersymbol(PlyTest)

Some of these would be more useful than others. Probably the easiest one is the one that's used for disabling the script and restoring the injection point to its original state. So, we now go to the AoB scans since the injection point has to be around them.
Code:
aobscan(PlyTestAOB,89 35 ?? ?? ?? ?? 33 C0 8d)
aobscan(MovAOB,F3 0F 7E 44 24 08 66 0F D6 46 18)

The PlyTestAOB doesn't look like it does anything at its injection point, so MovAOB is what we want. This script doesn't register that symbol, but it needs to if it wants to disable itself properly. So, let's go to the injection point and see what it does.
Code:
MovAOB:
MovStart:
jmp MonsterVac
db 90 90 90 90 90 90
TeleRet:

Now you see the label MovStart. That symbol is registered, so you can go to that in the disassembler when the script is enabled. I don't know why the creator didn't just register the symbol MovAOB, but whatever.

So, now that you know which symbol you can use to find it:
  1. Enable the script.
  2. In the disassembler, right click and go to the symbol MovAOB.
  3. Follow the jmp to the injected code.
  4. Look around the code and look for anything that looks like it's writing to something important.
  5. I'll save you the time and tell you it's movq [esi+10],xmm0 and movq [esi+18],xmm0
  6. Right click on the first one and select "Find out what addresses this instruction accesses".
  7. What should show up is the addresses of the different monsters' coordinates.

_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Wed May 11, 2016 10:11 am    Post subject: Reply with quote

AAAAH! Labels function as an address! That had me stumped for yonks. I was looking for a "Move to symbol" address. Ya just have to right-click -> "Go to address" -> Type in the name of the label.

Movq seems like a very bad thing to use, no? It moves a quadword, which is 64bit, and the game is only compiled for 32 bit. Would explain why enabling/disabling the script several times will crash the game.

esi+10 is the x axis, and esi+18 is the y axis. Yet, somehow, the script modifies the Z axis.

Since it's using quad words (eight bytes?), the z axis is included in the esi+10 instruction. Wonder why a quadword is used at esi+18 though, if the three axis are already obtained.

Anyhow, got one of the addresses. I'll go check where it is in the structure.


Edit: Huh. It's before what I thought was the base of the NPC structure. The offset of the x axis is @ -2C0. Maybe each NPC's data structure is placed right after the NPC position structure?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Wed May 11, 2016 10:21 am    Post subject: Reply with quote

The instruction movq isn't an x86-64 instruction, it's an extension of the x86 instruction set (probably introduced with SSE2). It's perfectly fine to use that on 32-bit systems.

The reason why it modifies the z axis is that it's moving 8 bytes at a time with the movq instruction and single-precision floats only take up 4 bytes. Sum up the different axes, and you get 4+4+4=12. So it uses two movq instructions to do this: The first one gets the X and Z axis, and the second one gets the Y axis along with something else.

It might be that another structure contains pointers to both the entity's position and the entity's data.

_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Wed May 11, 2016 10:42 am    Post subject: Reply with quote

Aaaaagh. Turns out that the offset is invalid; the address of the position data changes whenever the NPC is reset (e.g, resting at a bonfire) or reloaded (player died, load screen, restarting the game, etc).


Man, it would have been killer if the creators of the scripts shared info on this stuff.

One of the instructions run when the enemies are reset, has the esi register set to the NPC data with the +90 offset. Might be significant, I suppose. Adding that offset to the structure doesn't yield anything usable; it's not a pointer, but is good to have I suppose.
Back to top
View user's profile Send private message
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Sat May 14, 2016 6:56 am    Post subject: Reply with quote

Having utterly no luck with the position data, I was pointed to where much of the AI data is kept; a non-unicode string search for "NPC_THINK_PARAM_ST" will yield two searches. One earlier in memory, the other later. You want the latter.

I'm having to use the debug mode to identify the addresses, which is better than messing around with hex bytes manually I suppose.

Is it possible to add a group to the structure window, exactly like how Cheat Engine has groups in the address list? There are a lot of values at different offsets (all of them an equal offset apart, however).

The autocreated values are useless, as most of the generated ones are 4 byte hex values, instead of them actually being strings, floats or 2 byte hex values, with the odd 4 byte value.

So being able to group 'em up, so I'll be able to have the offset for the beginning of the Silver Knight AI data (for example), which will expand to show all the offsets in regards to the data.

I can add the offsets manually, since it will be easy once I have the first one done; get the proper offsets for one set of AI data, duplicate it, then just add an offset to the offsets, and BAM. All the AI data.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Sat May 14, 2016 8:41 am    Post subject: Reply with quote

You can go to File -> Add New Group, but I don't think that's what you're talking about.

You can delete elements that aren't important to you in the structure. And again, stop complaining about CE's autoguess values being wrong. If you want to try to make a better one, use the Lua functions registerStructureDissectOverride or onAutoGuess. Just change the elements if they're wrong; it's not that hard.

If you only want to display elements that fall under a specific category, you can define a new structure and add all the elements you want to it manually.

_________________
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
Majin
Advanced Cheater
Reputation: 0

Joined: 04 May 2016
Posts: 87

PostPosted: Sat May 14, 2016 9:11 am    Post subject: Reply with quote

ParkourPenguin wrote:
You can go to File -> Add New Group, but I don't think that's what you're talking about.


Yah, that ain't what I was meanin'. You know how a pointer in the structure is expandable? I was hoping for something like that, but for in-structure data.

Quote:

You can delete elements that aren't important to you in the structure. And again, stop complaining about CE's autoguess values being wrong. If you want to try to make a better one, use the Lua functions registerStructureDissectOverride or onAutoGuess. Just change the elements if they're wrong; it's not that hard.


Yeah, but, I gotta vent my frustrations somehow, me lord. Also, there are waaaaaaaaay too many entries to do 'em one by one; We're talking thousands 'ere.

I'll go back to me hole now.

Quote:

If you only want to display elements that fall under a specific category, you can define a new structure and add all the elements you want to it manually.


Aye, but it doesn't have the ol' 1-click-pa-pa-pa-pa-POW feel to it, ya know?


Edit: Okay, screw doing this by hand, it's time to give Lua a shot. The tutorial subforum had nothing for doing structures, judging by the titles, and the wiki page is just a flat list of functions.

Know of a thread that deals with this stuff? See if I can figure my way around.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 5 of 7

 
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