-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update README.md #11
base: main
Are you sure you want to change the base?
Update README.md #11
Conversation
Please add empty lines before any new heading. Typo-fixing requests apply to the entire document. |
Co-authored-by: Ero <56401411+just-ero@users.noreply.github.com>
Co-authored-by: Ero <56401411+just-ero@users.noreply.github.com>
README.md
Outdated
### Pointers | ||
Pointers in asl-help are declared with the following syntax inside of the TryLoad function. | ||
```cs | ||
vars.Helper["WatcherName"] = mono["ClassName"].Make<Type>("FieldName", offset1, offset...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way of creating pointers is discouraged. The user should be using the MonoHelper
overloads for making pointers. If their game is IL2CPP'd, they should be encouraged to store the class in a local.
mono.Make<T>("ClassName", "StaticFieldName", "InstanceField", "NextField", ...);
var c = mono["ClassName"]; // mono["Assembly", "ClassName"];
mono.Make<T>(c, "StaticFieldName", "InstanceField", "NextField", ...);
// on IL2CPP
var d = mono["DlassName"];
c.Make<T>("StaticFieldName", "InstanceField", d["NextField"], ...);
Please apply this information to the explanations below, as well as the Inheritance
heading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does storing it in a local matter for il2cpp? I believe you that it does but I am just curious as to why that would make a difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also how do you specify inheritance without using the syntax that I put down?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does storing it in a local matter for il2cpp?
So that you don't attempt to query the classes every time you need them (it will be cached, but you still have to check the cache unnecessarily when you already queried it once), and to reduce on code length and increase readability.
You can write
var c = mono["CClass"];
var d = mono["DClass"];
var e = mono["EClass"];
var f = mono["FClass"];
vars.Helper["Value"] = c.Make<T>("StaticField", "InstanceField", d["dField"], e["eField"], f["fField"]);
as
vars.Helper["Value"] = mono["CClass"].Make<T>("StaticField", "InstanceField", mono["DClass"]["dField"], mono["EClass"]["eField"], mono["FClass"]["fField"]);
but that just becomes unwieldy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also how do you specify inheritance without using the syntax that I put down?
vars.Helper["Value"] = mono.Make<T>("ClassName", 1, "StaticField", "InstanceField", "NextField", ...);
or
var c = mono["CClass", 1];
vars.Helper["Value"] = mono.Make<T>(c, "StaticField", "InstanceField", "NextField", ...);
Description
This PR adds more info to the README, including a brief description of how to use the library.