Silver
August 15th, 2005, 11:40
Hi guys,
I've run into a problem with an MFC app I'm playing with. The app in question has an "export" menu function that is disabled in the demo version. Some digging around seems to show that the coders have simply changed the message map for the menu item to point to a function that calls AfxMessageBox with a "you're not allowed" message. The original function that does the export still seems to exist. So the task is to alter the map to point to the function I believe contains the export code.
The problem I have is breaking in and finding the message map. I've set a bmsg on WM_COMMAND which correctly breaks when the menu item is selected, and leaves me in the middle of mfc42/user32.dll stack calls. I've traced back manually and found what looks like the messageloop in mfc42.dll. I've found the call eax which jumps me to the target.exe code. However what I see in the code are stacks of jmp [address] calls, one after the other. No instructions between them, just loads of jmp's. At this point I'm not sure what I'm looking at, and I don't understand how I find the handler for my menu item.
Interestingly the advice in the other related threads here ( http://www.woodmann.net/forum/showthread.php?t=4207 etc) doesn't actually relate to what I'm seeing. For example I see no call to AfxFindMessageEntry...
All help appreciated.
I've run into a problem with an MFC app I'm playing with. The app in question has an "export" menu function that is disabled in the demo version. Some digging around seems to show that the coders have simply changed the message map for the menu item to point to a function that calls AfxMessageBox with a "you're not allowed" message. The original function that does the export still seems to exist. So the task is to alter the map to point to the function I believe contains the export code.
The problem I have is breaking in and finding the message map. I've set a bmsg on WM_COMMAND which correctly breaks when the menu item is selected, and leaves me in the middle of mfc42/user32.dll stack calls. I've traced back manually and found what looks like the messageloop in mfc42.dll. I've found the call eax which jumps me to the target.exe code. However what I see in the code are stacks of jmp [address] calls, one after the other. No instructions between them, just loads of jmp's. At this point I'm not sure what I'm looking at, and I don't understand how I find the handler for my menu item.
Interestingly the advice in the other related threads here ( http://www.woodmann.net/forum/showthread.php?t=4207 etc) doesn't actually relate to what I'm seeing. For example I see no call to AfxFindMessageEntry...
All help appreciated.