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

Error with Vector Exception Handler #222

Open
HongThatCong opened this issue Dec 31, 2022 · 2 comments
Open

Error with Vector Exception Handler #222

HongThatCong opened this issue Dec 31, 2022 · 2 comments

Comments

@HongThatCong
Copy link
Contributor

HongThatCong commented Dec 31, 2022

With this sample: 16d1d189a2bdcff3389b83dcf767152722cf66d445990c4d8dd1bde4ab6aec57
It install vector exception handler, by RemoveVectoredExceptionHandler, then AddVectoredExceptionHandler, and execute int 3 to redirect execution to new VectorExceptionHandler
In speaky easy code, speakeasy\windows\winemu.py, class WindowsEmulator, method _hook_interrupt don't check VectorExceptionHandler list and call proc in that list to handler interrupt.
I have made some changes in kernel32.py and win32.py to add RemoveVectoredExceptionHandler API:

    @apihook('RemoveVectoredExceptionHandler', argc=1)
    def RemoveVectoredExceptionHandler(self, emu, argv, ctx={}):
        '''
        ULONG RemoveVectoredExceptionHandler(
            PVOID Handle);
        '''
        Handler = argv
        emu.remove_vectored_exception_handler(Handler)
        return 1

And:

    def remove_vectored_exception_handler(self, handler):
        """
        Remove a vectored exception handler
        """
        if handler in self.veh_handlers:    # check the handler existed in the self.veh_handlers list
            self.veh_handlers.remove(handler)

Hope you will fix this bug in method _hook_interrupt soon
Thanks

@williballenthin
Copy link
Contributor

would you please submit these changes as a PR so that we can merge them?

@HongThatCong
Copy link
Contributor Author

Sorry my friend, @williballenthin
I still could not find how to fix that bug by change the code in WindowsEmulator._hook_interrupt, and I've edited and changed speakeasy's original code a lot, so I'm afraid I can't pull the request.
Hope you can understand what I mean about this bug
Tks and best regards,
TQN (HTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants