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

Improvements to missing class generation #668

Open
Col-E opened this issue Apr 5, 2023 · 0 comments
Open

Improvements to missing class generation #668

Col-E opened this issue Apr 5, 2023 · 0 comments

Comments

@Col-E
Copy link
Owner

Col-E commented Apr 5, 2023

Problem: JPhantom works for basic cases, consistently fails on large inputs & obfuscated code

Alternatives: Reconstruct - though not yet feature complete

Requirements for viable alternatives:

  • Generate missing @annotation when a @annotation(foo="bar") and such are seen annotating classes/fields/methods
  • Generate missing classes when getfield references are seen
    • Interfaces can only have constants, so if you see a getfield or putfield you know it must be a class/enum/record
  • Ensure type hierarchies must be regenerated to the best of their ability
    • The accuracy is limited to what is available in the known code being analyzed
  • Should prefer creating class over interface types when possible
    • If some type does not have enough known about it to be sure one way or another, default to class instead of interface
    • Must consider use in type hierarchies, due to single inheritance of classes you will need interfaces at times

Bonus points:

  • Allow a lazy model which can be updated over time
    • Rather than run analysis on the entire input at launch, only analyze one class at a time (such as what is open in the Recaf UI) and then update the generated model over time.
    • Saves a lot of CPU on startup, reduces over-all workload assuming a user will not be opening every single class in an input workspace
  • Allow manual tweaking of the model
    • It may be useful to allow users to provide the ability to "correct" the model. If there is some missing data that prevents the generation of some fields/methods in a phantom class, the user could tell the model these items exist, allowing the recompile feature to utilize their changes
    • The model changes sent by users must be validated such that they cannot "break" the model into making invalid classes.
@Col-E Col-E transferred this issue from Col-E/recaf-3x-issues Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant