← 输入框|github.com|刷新
Skip to content

Hookgen creates events that are impossible to subscribe to #89

Open

Description

@flibber-hk

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions