-
-
Post Thanks / Like - 2 Thanks
-
Member
LocalPlayerFacing = 0X2B36468
localPlayerPosition = 0X2AD9C78
thansk for share!
-
-
Member
Originally Posted by
Razzue
Or just use
UnitBase + Movement + Location
And UnitBase + Movement + RotationD/F (rotation can be read as double or single, either provide expected results) as it should be 🤔
Unless you're meaning the functions in which case.. 🤷*♂️
So that is what it is,your are my god!
-
Member
where the ClickToMove?
2.5.3 42940 it is
static inline uintptr_t ClickToMove = Base + 0x1327580; // Fix it urself 48 83 EC 48 48 8B 81 ? ? ? ? 48 83 B8 ? ? ? ? ?
-
Member
Thanks Razzue for this great post!
Other new joiners like me may find it difficult to find how to consume these offsets. Here are threads that can help:
Post from qop1832 to iterate through object manager: wor...d-42917-a.html
Post from razzue on the same: https://www.ownedcore.com/forums/wor...offsets-4.html
I think I'm able to get the objects from the object manager, but I'm unable to get their type. Do you have an idea why?
Using this enum:
Code:
public enum ManagerType
{
Object = 0,
Item = 1,
Container = 2,
EmpAzeriteItem = 3,
AzeriteItem = 4,
Unit = 5,
Player = 6,
LocalPlayer = 7,
GameObject = 8,
DynamicObject = 9,
Corpse = 10,
AreaTrigger = 11,
SceneObject = 12,
Conversation = 13,
Nil = 255
}
Here is my code (inspired from Razzue's one):
Code:
var objects = new List<(IntPtr,ManagerType)>();
Process wowProcess = _applicationService.GetWowProcess();
IntPtr baseAddress = wowProcess.MainModule.BaseAddress;
const int array = 0x8;
const int objGuid = 0x8;
const int entGuid = 0x18;
const int objType = 0x10;
IntPtr countAddr = _memoryAccessor.ReadAddress(IntPtr.Add(baseAddress, Offsets43638.ObjectManager.Base), 8);
IntPtr arrayAddr = _memoryAccessor.ReadAddress(IntPtr.Add(countAddr, array), 8);
_memoryAccessor.Read(countAddr, out uint count);
for (int i = 0; i < count; i++)
{
var ptr = _memoryAccessor.ReadAddress(arrayAddr + (i * array), 8);
if (ptr == IntPtr.Zero) continue;
while (ptr != IntPtr.Zero)
{
_memoryAccessor.Read(ptr + objGuid, out Guid guid); // Seems OK
IntPtr entryPtr = _memoryAccessor.ReadAddress(ptr + 0x18, 8);
_memoryAccessor.Read(entryPtr + objType, out ManagerType type); // <= this is KO
// _memoryAccessor.Read(entryPtr + Fields.Unit.Type, out ManagerType type); // KO as well
ptr = _memoryAccessor.ReadAddress(ptr, 8);
objects.Add((entryPtr, type));
}
}
foreach ((IntPtr unitPtr, _) in objects.Where(x => x.Item2 == ManagerType.Unit))
{
_memoryAccessor.Read(unitPtr + Fields.Unit.Level, out int level); // Fields.Unit.Level is provided by Razzue in the offset list
IntPtr namePtr = _memoryAccessor.ReadAddress(unitPtr + Fields.Unit.Name, 8); // Fields.Unit.Name is provided by Razzue in the offset list
_memoryAccessor.ReadString(namePtr, Encoding.UTF8, out string name);
Debug.WriteLine($"=> {name} lvl {level}");
}
Also, I did a similar attempt for the position with no more success:
Code:
_memoryAccessor.Read(entryPtr + Fields.Unit.Location, out Vector3 v3); // <= this is KO
Any idea why?
Last edited by 0xd5d; 05-15-2022 at 08:14 AM.
-
Post Thanks / Like - 1 Thanks
moisteroyster (1 members gave Thanks to 0xd5d for this useful post)
-
Member
Originally Posted by
0xd5d
Thanks Razzue for this great post!
Other new joiners like me may find it difficult to find how to consume these offsets. Here are threads that can help:
Post from qop1832 to iterate through object manager:
wor...d-42917-a.html
Post from razzue on the same:
https://www.ownedcore.com/forums/wor...offsets-4.html
I think I'm able to get the objects from the object manager, but I'm unable to get their type. Do you have an idea why?
Using this enum:
Code:
public enum ManagerType
{
Object = 0,
Item = 1,
Container = 2,
EmpAzeriteItem = 3,
AzeriteItem = 4,
Unit = 5,
Player = 6,
LocalPlayer = 7,
GameObject = 8,
DynamicObject = 9,
Corpse = 10,
AreaTrigger = 11,
SceneObject = 12,
Conversation = 13,
Nil = 255
}
Here is my code (inspired from Razzue's one):
Code:
var objects = new List<(IntPtr,ManagerType)>();
Process wowProcess = _applicationService.GetWowProcess();
IntPtr baseAddress = wowProcess.MainModule.BaseAddress;
const int array = 0x8;
const int objGuid = 0x8;
const int entGuid = 0x18;
const int objType = 0x10;
IntPtr countAddr = _memoryAccessor.ReadAddress(IntPtr.Add(baseAddress, Offsets43638.ObjectManager.Base), 8);
IntPtr arrayAddr = _memoryAccessor.ReadAddress(IntPtr.Add(countAddr, array), 8);
_memoryAccessor.Read(countAddr, out uint count);
for (int i = 0; i < count; i++)
{
var ptr = _memoryAccessor.ReadAddress(arrayAddr + (i * array), 8);
if (ptr == IntPtr.Zero) continue;
while (ptr != IntPtr.Zero)
{
_memoryAccessor.Read(ptr + objGuid, out Guid guid); // Seems OK
IntPtr entryPtr = _memoryAccessor.ReadAddress(ptr + 0x18, 8);
_memoryAccessor.Read(entryPtr + objType, out ManagerType type); // <= this is KO
// _memoryAccessor.Read(entryPtr + Fields.Unit.Type, out ManagerType type); // KO as well
ptr = _memoryAccessor.ReadAddress(ptr, 8);
objects.Add((entryPtr, type));
}
}
foreach ((IntPtr unitPtr, _) in objects.Where(x => x.Item2 == ManagerType.Unit))
{
_memoryAccessor.Read(unitPtr + Fields.Unit.Level, out int level); // Fields.Unit.Level is provided by Razzue in the offset list
IntPtr namePtr = _memoryAccessor.ReadAddress(unitPtr + Fields.Unit.Name, 8); // Fields.Unit.Name is provided by Razzue in the offset list
_memoryAccessor.ReadString(namePtr, Encoding.UTF8, out string name);
Debug.WriteLine($"=> {name} lvl {level}");
}
Also, I did a similar attempt for the position with no more success:
Code:
_memoryAccessor.Read(entryPtr + Fields.Unit.Location, out Vector3 v3); // <= this is KO
Any idea why?
objType is one byte in memory , Are you sure you read one byte only?
positon is 3 float in memory , each is 4 bytes,I read lik this:
x = self.pm.read_float(entry + position)
y = self.pm.read_float(entry + position + 4)
z = self.pm.read_float(entry + position +
Hope to hlep you!
also,anyone can tell me how to identify a GameObject is a herb or a mine?
-
Post Thanks / Like - 2 Thanks
-
Contributor
Avid Ailurophile
Originally Posted by
shmilyzxt
objType is one byte in memory , Are you sure you read one byte only?
positon is 3 float in memory , each is 4 bytes,I read lik this:
x = self.pm.read_float(entry + position)
y = self.pm.read_float(entry + position + 4)
z = self.pm.read_float(entry + position +
Hope to hlep you!
also,anyone can tell me how to identify a GameObject is a herb or a mine?
[StructLayout(LayoutType.Sequential)]
Public struct Vector
{
public float X;
public float Y;
public float Z;
}
Read the struct from the address of X and stop doing 3 reads where you only need 1 :P (sorry for formatting, on mobile, as such StructLayout may be spelled incorrectly but meh 🤷*♂️)
-
Post Thanks / Like - 1 Thanks
moisteroyster (1 members gave Thanks to Razzue for this useful post)
-
Member
objType is one byte in memory
Thanks a lot! This is what I was missing.
For the position (of unit, players), are you using Fields.Unit.Location offset to read x, y, z? (0x20 for this build). My z is empty.
also,anyone can tell me how to identify a GameObject is a herb or a mine
Just an idea, I hope it will help you: maybe you can find a real herb (or mine) and stand next to it in-game.
Then, read the object manager and find out what other objects have the same position as your character.
Last, check the properties of that object
Last edited by 0xd5d; 05-16-2022 at 02:13 AM.
-
Member
Originally Posted by
0xd5d
Thanks a lot! This is what I was missing.
For the position (of unit, players), are you using Fields.Unit.Location offset to read x, y, z? (0x20 for this build). My z is empty.
Just an idea, I hope it will help you: maybe you can find a real herb (or mine) and stand next to it in-game.
Then, read the object manager and find out what other objects have the same position as your character.
Last, check the properties of that object
I use [ Fields.Unit + 0x148] for Unit positon.but also can use [ [Fields.Unit + Movement] + Location] not [ Fields.Unit + Location]
as herb ,I have got the herb GameObje,but I dont't know wich properties is representative it is a herb
-
Post Thanks / Like - 1 Thanks
0xd5d (1 members gave Thanks to shmilyzxt for this useful post)
-
Contributor
Avid Ailurophile
Originally Posted by
0xd5d
Thanks a lot! This is what I was missing.
For the position (of unit, players), are you using Fields.Unit.Location offset to read x, y, z? (0x20 for this build). My z is empty.
Just an idea, I hope it will help you: maybe you can find a real herb (or mine) and stand next to it in-game.
Then, read the object manager and find out what other objects have the same position as your character.
Last, check the properties of that object
You read the movement I fo pointer from UnitBase + Movement (0xF0), then from that pointer read s struct from location (0x20) to get what you need.
You can also get a bit more info from that pointer such as:
Code:
public override IntPtr MovePTR => NtMemory.Read<IntPtr>(BaseAddress + Fields.Unit.Movement);
public override Vector Position => NtMemory.Read<Vector>(MovePTR + Fields.Unit.Location);
public override double RotationD => NtMemory.Read<double>(MovePTR + Fields.Unit.RotationD);
public override float RotationF => NtMemory.Read<float>(MovePTR + Fields.Unit.RotationF);
public override float Pitch => NtMemory.Read<float>(MovePTR + Fields.Unit.Pitch);
public override bool IsBehind(wUnit Unit)
{
{
try { return _Vector.NegativeAngle(Unit.RotationF - RotationF) < 0.6 || _Vector.NegativeAngle(Unit.RotationF - RotationF) > 5.5; }
catch (Exception) { return false; }
}
}
public override MoveFlag1 MoveFlag => (MoveFlag1)NtMemory.Read<uint>(MovePTR + Fields.Unit.MoveFlag);
public override bool IsTurning => MoveFlag.HasFlag(MoveFlag1.Left) |
MoveFlag.HasFlag(MoveFlag1.Right) |
MoveFlag.HasFlag(MoveFlag1.PitchUp) |
MoveFlag.HasFlag(MoveFlag1.PitchDown);
public override bool IsMoving => MoveFlag.HasFlag(MoveFlag1.Forward) |
MoveFlag.HasFlag(MoveFlag1.Backward) |
MoveFlag.HasFlag(MoveFlag1.Left) |
MoveFlag.HasFlag(MoveFlag1.Right) |
MoveFlag.HasFlag(MoveFlag1.StrafeLeft) |
MoveFlag.HasFlag(MoveFlag1.StrafeRight) |
MoveFlag.HasFlag(MoveFlag1.Falling) |
MoveFlag.HasFlag(MoveFlag1.Ascending) |
MoveFlag.HasFlag(MoveFlag1.Descending);
public override bool IsFlying
=> MoveFlag.HasFlag(MoveFlag1.Flying);
public override bool IsSwimming
=> MoveFlag.HasFlag(MoveFlag1.Swimming);
Last edited by Razzue; 05-16-2022 at 02:49 AM.
-
Post Thanks / Like - 1 Thanks
0xd5d (1 members gave Thanks to Razzue for this useful post)
-
Member
-
Member
I get messy code when I print the Name of Unit. Do you know why?
-
-
Post Thanks / Like - 1 Thanks
0xd5d (1 members gave Thanks to Razzue for this useful post)