Apple has rather draconian anti-reverse engineering fine prints in most of their eula.
Furthermore, you are only breaking the contract if you accepted the contract in the first place; so it only covers what you can do with the product iff you purchased the product (and accepted the EULA that comes with it). So if you are doing blackbox reverse engineering, there is nothing the company can do to prevent you from figuring out how their physical product works.
Finally, as another comment noted, in most parts of the world reverse engineering for interoperability purposes is protected by law.