Created the Tuesday 13 October 2020. Updated 5 months ago.

Edit controls are a type of user interface element that allows a user to enter and edit text in a graphical user interface (GUI). They are commonly used in Windows applications and can be embedded directly into a GUI or subclassed as a separate window. Edit controls can be set to display text in multiline mode, in which case they use a special callback function called the EditWordBreakProc to handle word wrapping.

The EditWordBreakProc callback function is called anytime the control needs to perform an operation related to word wrapping. In some cases, it may be possible to manipulate this callback function to achieve a desired effect, such as injecting code into the host system.

One method that has been used to manipulate the EditWordBreakProc callback function is to send the EM_GETOLECALLBACK message to the edit control window using the SendMessage function. This message is not well documented and can cause the rich edit window to crash if the LPARAM parameter does not point to locally accessible memory. Additionally, the EM_GETOLECALLBACK message does not return a pointer to the IRichEditOleCallback interface as expected, but rather to the IRichEditOle interface. As a result, the EM_SETOLECALLBACK message cannot be used to modify the callback function.

Instead, it may be possible to modify the IRichEditOle.lpVtbl heap memory, which holds a table of methods that can be called on the IRichEditOle interface. By overwriting the address of one of these methods with the address of the payload, it may be possible to execute the payload when the method is called. In this case, the payload is the GetClipboardData function. It is important to note that manipulating the EditWordBreakProc callback function and modifying heap memory in this way is likely to be detected by security systems and may result in the host system being compromised.

Code Snippets


Additional Resources

External Links

The resources provided below are associated links that will give you even more detailed information and research on current evasion technique. It is important to note that, while these resources may be helpful, it is important to exercise caution when following external links. As always, be careful when clicking on links from unknown sources, as they may lead to malicious content.

Subscribe to our Newsletter

The information entered into this form is mandatory. It will be subjected to computer processing. It is processed by computer in order to support our users and readers. The recipients of the data will be : contact@unprotect.it.

According to the Data Protection Act of January 6th, 1978, you have at any time, a right of access to and rectification of all of your personal data. If you wish to exercise this right and gain access to your personal data, please write to Thomas Roccia at contact@unprotect.it.

You may also oppose, for legitimate reasons, the processing of your personal data.