Skip to content

Implement detour unit tests with emulator #192

@stevemk14ebr

Description

@stevemk14ebr

The current approach to unit testing the x86 and x64 detours is limited. It involves directly executing manually crafted assembly within the unit testing process. This is error prone and can make it hard to actually inspect CPU effects like ensuring registers / stack data is preserved and control flow is successful.

Instead, implement unit testing with an x86 / x64 emulator. We can create a set of CPU constraints that model what the before / after architectural state should look like per hook. We can then call polyhook functions to edit the memory buffers of the emulator, or mirror them temporarily and write back. This should be much better and unlock more confidence in quality and new tests to be written.

This is a long term goal. If someone is interested in working on this, please let me know. Unit Tests Here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions