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

Update README.md #11

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Update README.md #11

wants to merge 12 commits into from

Conversation

TheTedder
Copy link

Description

This PR adds more info to the README, including a brief description of how to use the library.


  • I have read and accept asl-help's license.

@TheTedder TheTedder marked this pull request as ready for review June 21, 2023 22:54
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@just-ero
Copy link
Owner

Please add empty lines before any new heading. Typo-fixing requests apply to the entire document.

@TheTedder TheTedder requested a review from just-ero June 22, 2023 22:12
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...);
Copy link
Owner

@just-ero just-ero Jun 22, 2023

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.

Copy link
Author

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.

Copy link
Author

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?

Copy link
Owner

@just-ero just-ero Jun 24, 2023

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.

Copy link
Owner

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", ...);

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

Successfully merging this pull request may close these issues.

2 participants