If a product is protected by a patent (or copyrighted) then it is unlawful to reverse engineer or make changes to an application if the SLA forbids you to do so.
If it is open source or the SLA does not forbid you from making changes to the application then you can go ahead and make the changes but if you break something, usually any warranty becomes void.