Modifying an old Windows program not to call exit after a keypress without source access

Posted by rustyn2 on Stack Overflow See other posts from Stack Overflow or by rustyn2
Published on 2010-04-09T02:26:15Z Indexed on 2010/04/09 2:33 UTC
Read the original article Hit count: 417

Filed under:
|

I have an older C++ Windows program that I've been asked to get run in a kiosk style environment for a student project. From the main menu, hitting ESC will exit the program, which is undesirable. In ye olden days I would have trapped the keyboard interrupt or whatever and dug around to NOOP whatever JMP or CALL was getting referenced in the case statement that likely decides all that, but on Windows everything goes through various registered event handlers, and I haven't done any windows internals work in about 10 years.

Is there a good tool to breakpoint a program on certain WM_EVENT (WM_KEYDOWN being a prime target) messages or similar, so that I can narrow down where in the executable the check is made? I'm currently stepping back from various potential system calls made before the various thread cleanups and final exit calls but it seems like there has to be a better way to do this that I'm forgetting.

© Stack Overflow or respective owner

Related posts about debugging

Related posts about assembler