Skip to content

Injectee method that returns a value stops working after injection #1

Description

@ZimM-LostPolygon

Injection ignores the return value of the original injectee method. As a result, the injected code returns with no return value on the stack.

  1. Methods that are injected as the start of the injectee method can't return any value. This makes it impossible to use MethodReturnBehaviour.ReturnFromInjectee, instead MethodReturnBehaviour.ReturnFromSelf must be forced, so the original injectee code can return a value.
  2. For methods that are injected at the end of the injectee method: save the return value of the injectee method into a local variable, load it to the stack when the injected method returns.

Similarly for out and ref variables.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions