|
#1
|
|||
|
|||
Possible to inject new menus into GUIs?
Wondering if it'd be possible to inject additional menu/submenu items into a program's menu bar/submenus (GUIs in Windows). For example, would it be possible to inject a new submenu item under "File" to open another program or save directly to a specific folder?
|
#2
|
|||
|
|||
Injecting the menu is not so hard it's just a Windows message as long as you have a way of getting the handle and have a way to locate where you want it. You could even use a resource editor to do it if the menu is statically created. But you need a click action handler and the logic in there would require you to know a good deal about the data structures of the underlying program. It's definitely possible but in complex apps can be prohibitively time consuming to figure out. Like adding the save menu back into IDA Pro demo for example. A complex database format like that has a large amount of C code to save with data structures gathered from all over. Sometimes it's very difficult. So it depends on the context if it is worth it or not.
|
The Following User Says Thank You to chants For This Useful Post: | ||
binarylaw (03-04-2020) |
#3
|
||||
|
||||
Make sure to know the (language / Technology) used to write that application, can be a major factor in deciding how complicated adding this new menu is.
|
The Following User Says Thank You to Kurapica For This Useful Post: | ||
binarylaw (03-04-2020) |
#4
|
|||
|
|||
Quote:
Quote:
|
#5
|
||||
|
||||
For the API on Windows to work with menus:
https://docs.microsoft.com/en-us/windows/win32/menurc/menus
__________________
Personal Projects Site: https://atom0s.com |
#6
|
|||
|
|||
Yes as Kurapica points out I assumed Windows desktop API native apps as in link from atom0s. If its Delphi, .Net, Java or VB6 or the like different approaches are needed based on their interpreter. Further in UWP apps though there is no menu, such modifications are much harder due to the maze of security restrictions and limited API you will have access to, making it probably the hardest of all.
Also if it is a multithreaded app, accessing data structures may require sharing synchronization objects of the app. Generally a task like this will be as much of a careful programming effort as it is a reversing one if you want a clean reliable solution. Adding functionality is significantly harder than modifying or removing it as a rule of thumb. Last edited by chants; 03-04-2020 at 05:45. |
#7
|
|||
|
|||
Try searching with "windows" "hook" "menu" as keywords.
such as: https://stackoverflow.com/questions/12132056/creating-a-windows-hook-to-detect-menu-clicks http://www.vbforums.com/showthread.php?776385-RESOLVED-Modify-right-click-context-menu-in-standard-controls |
#8
|
|||
|
|||
RegEditX does something similar to that for what you are asking with Microsoft's RegEdit (insert menu item).
dcsoft.com (Take it as an example). |
#9
|
||||
|
||||
@binarylaw : I would start by finding out which language the app is written with.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How you inject codes? | Hero | General Discussion | 8 | 10-10-2005 20:11 |
How to inject code into a process? | jonwil | General Discussion | 7 | 06-01-2005 23:23 |
Very Easy way to Inject a Dll | Rhodium | General Discussion | 9 | 10-28-2004 16:52 |