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

Implement detour unit tests with emulator #192

Open
stevemk14ebr opened this issue Oct 30, 2023 · 1 comment
Open

Implement detour unit tests with emulator #192

stevemk14ebr opened this issue Oct 30, 2023 · 1 comment

Comments

@stevemk14ebr
Copy link
Owner

stevemk14ebr commented Oct 30, 2023

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.

@stevemk14ebr stevemk14ebr changed the title Implement unit tests with emulator Implement detour unit tests with emulator Nov 3, 2023
@stevemk14ebr
Copy link
Owner Author

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