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

Hookgen creates events that are impossible to subscribe to #89

Open
flibber-hk opened this issue Feb 13, 2022 · 0 comments
Open

Hookgen creates events that are impossible to subscribe to #89

flibber-hk opened this issue Feb 13, 2022 · 0 comments
Labels

Comments

@flibber-hk
Copy link

Description

If the original dll has a private struct with methods, then HookGen creates events to Hook those methods, but it's impossible to subscribe to those events.

Example

There's a type in Hollow Knight that looks like

public class HealthManager
{
  private struct HPScaleGG
  {
    public int GetScaledHP()
    {
      // Code goes here
    }
  }
}

HookGen creates the event On.HealthManager.HPScaleGG.GetScaledHP of type delegate int hook_GetScaledHP(... orig, ref ValueType self). But this event is unhookable, because the HookEndpointManager is expecting a parameter of type ref HealthManager.HPScaleGG which is not compatible with ref ValueType.

I'm not entirely sure what the best fix would be, but I feel that not creating the event is probably better than creating an event that can't be hooked.

@flibber-hk flibber-hk added the bug label Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant