Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get address of BaseNode #19

Closed
Mik4sa opened this issue Nov 15, 2017 · 3 comments
Closed

Get address of BaseNode #19

Mik4sa opened this issue Nov 15, 2017 · 3 comments

Comments

@Mik4sa
Copy link

Mik4sa commented Nov 15, 2017

I want to extend the TypeInfo plugin for FrostBite games with the members of each class. For that I need to know the "base address" of the current class.
So for example when I want to read the membername of address AB37C8B8 the method INodeInfoReader.ReadNodeInfo gets called with the BaseNode of this item and the IntPtr with value AB37CAF8. From these values there is no way (atleast I haven't found one) to get the needed base address AB37C870.
See:
image

From this address I could check if it's a TypeInfo address/class and with the offset inside the BaseNode I can get the exact member.
So basically, I'm missing a way to get the current address of a BaseNode. Since I can get the base address of a class by subtracting from the address of a BaseNode the offset of the BaseNode.

@KN4CK3R Is there any way you can add the address to a BaseNode?

I hope everyone understood what I want, I had hard times writing this up :'D

@KN4CK3R
Copy link
Member

KN4CK3R commented Nov 16, 2017

A node doesn't know its address only the offset to the parent class. The real address is only important while rendering the node and then there is a related view object which knows the address.
To get the address of the parent of the current node you can calculate it from the information you have.

string ReadNodeInfo(BaseNode node, IntPtr value, MemoryBuffer memory)
{
	var parentAddress = value - node.Offset;
	
	...
}

I hope this helps. Should the ReadNodeInfo contain more informations?

(Du kannst auch auf deutsch schreiben, wenns dann klarer wird.)

@Mik4sa
Copy link
Author

Mik4sa commented Nov 17, 2017

Well ok, I'm trying it in german, sry to the non-german people :'(

Also ich brauch wohl von der View die Adresse (oder einfach die ganze View, das "Wie" ist dabei dir überlassen :) ).

Ich versuche es nochmal an einem Beispiel zu erklären.

Im nachfolgenden Screenshot befinde ich mich in der VeniceSoldierCustomizationAsset Klasse, die sieht wie folgt aus:
image

und in ReClass in etwa so:
image

So, und damit ich jetzt für den Offset 0x50 den Namen bspw. auslesen kann (also m_ClassSpecializationTable), muss ich wissen, in welcher TypeInfo-Klasse ich mich befinde (also VeniceSoldierCustomizationAsset). Damit ich das kann muss ich aber den Pointer 0x141C44180 lesen.
Diesen wiederrum kann ich nicht alleine aus den übergebenen Argumenten (eine BaseNode mit dem Offset 0x50 und ein IntPtr mit dem Wert 0xD3A9E0A0) ermitteln, aber aus 0xD3A9DDD0 (also der View-Adresse) und dem Offset.

Wenn du also zusätzlich die View-Adresse an die Methode mit übergeben könntest, wäre ich dir sehr verbunden :)

@KN4CK3R
Copy link
Member

KN4CK3R commented Nov 17, 2017

Mein Fehler. Der IntPtr, der ReadNodeInfo übergeben wird, ist nicht die Adresse, sondern der Wert des Knotens an dieser Adresse. Ich habe jetzt noch einen neuen Parameter für die Knoten-Adresse hinzugefügt.

KN4CK3R added a commit to ReClassNET/ReClass.NET-FrostbitePlugin that referenced this issue Nov 17, 2017
KN4CK3R added a commit to ReClassNET/ReClass.NET-SamplePlugin that referenced this issue Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants