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

Documentation and tests #261

Open
2 of 6 tasks
vfsfitvnm opened this issue Mar 10, 2023 · 11 comments
Open
2 of 6 tasks

Documentation and tests #261

vfsfitvnm opened this issue Mar 10, 2023 · 11 comments
Labels
documentation Improvements or additions to documentation help me The maintainer needs help

Comments

@vfsfitvnm
Copy link
Owner

vfsfitvnm commented Mar 10, 2023

Hi all!
This discussion made me realize we need to massively improve the documentation and usability of this project.

  • Newcomers often find difficult to get started - and I really can't blame them.
  • There are no tests/code coverage/benchmarks - and I can't blame me either!

However, we can address these two problems if we had the source code of a simple game, so that we could create a tutorial to show how to think and what to do when using frida-il2cpp-bridge (also, it would allow testing!).

For documenting, the ideal game should be catchy and well-made, whereas it should be cross-platform and compatible with the Unity versions supported by frida-il2cpp-bridge for testing.

Edit:
#261 (comment)
We can have separated sources for testing and documenting.

Steps:

  • Find or create a game that satisfies that is well-made, open source, cross-platform and has a permissive license.
  • Create or use a build system to build the game for different platforms so that people can easily download the binaries.
  • Write a comprehensive walkthrough to illustrate the basics of Frida, Il2Cpp and TypeScript and possible usages against the game (i.e. how to have infinite health).
  • Find a way to build IL2CPP tests sources. Ideally, we should also edit the IL2CPP source code to apply some common anti reverse engineering techniques (for code coverage).
  • Determine where these tests should run (locally or GitHub actions).
  • Write tests.

This is the high level plan - I don't even know the feasibility of it. Most importantly, I don't know how much time it requires and I can't even estimate its time of arrival (ETA).

Possibly useful:
https://github.com/game-ci/docker
https://github.com/nneonneo/Il2CppVersions

@vfsfitvnm vfsfitvnm added documentation Improvements or additions to documentation feature New feature or request help me The maintainer needs help labels Mar 10, 2023
@vfsfitvnm vfsfitvnm pinned this issue Mar 10, 2023
@ChuJiani
Copy link

ChuJiani commented Mar 12, 2023

I just created a template for this library and I think it could be a good starting point for beginners. Please let me know if there are any issues that I should correct.

@vfsfitvnm
Copy link
Owner Author

Thanks, it looks good! Here's another template :P

@Chensem
Copy link

Chensem commented Mar 14, 2023

perfect ~

@vfsfitvnm vfsfitvnm removed the feature New feature or request label Mar 28, 2023
@vfsfitvnm
Copy link
Owner Author

vfsfitvnm commented Apr 1, 2023

Find a way to build IL2CPP tests sources. Ideally, we should also edit the IL2CPP source code to apply some common anti reverse engineering techniques (for code coverage).

Thanks to @djkaty (blog, file) I managed to build a "standalone" shared library for Linux, GameAssembly.so (already played around with frida-il2cpp-bridge 😜 ).

It means testing does not need a real game anymore! This simplifies the whole process by a lot.

Bash script: https://gist.github.com/vfsfitvnm/bada5805f46d5198e8757986fa9c8cc9

@djkaty
Copy link

djkaty commented Apr 2, 2023

Thanks to @djkaty (blog, file) I managed to build a "standalone" shared library for Linux, GameAssembly.so (already played around with frida-il2cpp-bridge 😜 ).

It means testing does not need a real game anymore! This simplifies the whole process by a lot.

Bash script: https://gist.github.com/vfsfitvnm/bada5805f46d5198e8757986fa9c8cc9

Sick project, would never have seen it without the tag mention. Looks really impressive, amazing work!

@vfsfitvnm
Copy link
Owner Author

Sick project, would never have seen it without the tag mention. Looks really impressive, amazing work!

Thank you for the kind words, but it wouldn't have been possible without Frida!
And, of course, thank you for your valuable resources about IL2CPP 😺

@vfsfitvnm
Copy link
Owner Author

Determine where these tests should run (locally or GitHub actions).

The biggest concern with using GitHub Actions is the slow feedback (i.e. I don't want to push and wait to see if I broke something), so local tests are preferred. However, if I got it correctly, GitHub Actions can be ran on Windows and MacOS too at no cost - so I can comfortably make changes or tests to see if I broke cross platforming.

So, the answer is both (https://github.com/nektos/act)!
Writing the actions will be very painful, however :<

@vfsfitvnm
Copy link
Owner Author

Alright, the first step to setup a test environment would be building and publishing Docker images (we cannot use https://github.com/game-ci/docker as they only provide 2018+ images):

  • One image to rule them all, or one image per Unity version?
    I have zero Docker knowledge, but I don't want to download a whole ubuntu-latest for each Unity version.
  • Download and extract the Unity editor;
  • Download and extract the IL2CPP Linux standalone support;
  • Delete/do not extract any unnecessary file so that the total size is > 300MB (instead of > 5GB).

Using Docker images isn't absolutely necessary - we could do that process within the runner itself and cache the whole unity directory instead (downloading and extracting takes some time).
However, GitHub's cache has a limit of 10GB per repository and it gets evicted after being unused for 7 days. We should be fine with that, however I don't know how caching would play in a local environment using https://github.com/nektos/act.

@UPON-2021
Copy link

Can we use INDEPENDENT GAMES or BUY-OUTS for single player games for testing and documenting?

@vfsfitvnm
Copy link
Owner Author

I don't know, we must ask for permission to the owner(s) of the game, but I don't think they would accept (comprehensibly).

I already run tests locally (see the test folder), they surely need more work, but a real game isn't necessary anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help me The maintainer needs help
Projects
None yet
Development

No branches or pull requests

5 participants