Which IP law? The EU has them somewhat different from the US, you know.
...The unauthorised reproduction, translation, adaptation or transformation of the form of
the code in which a copy of a computer program has been made available constitutes an
infringement of the exclusive rights of the author. Nevertheless, circumstances may exist
when such a reproduction of the code and translation of its form are indispensable to obtain
the necessary information to achieve the interoperability of an independently created program
with other programs. It has therefore to be considered that, in these limited circumstances
only, performance of the acts of reproduction and translation by or on behalf of a person
having a right to use a copy of the program is legitimate and compatible with fair practice
and must therefore be deemed not to require the authorisation of the rightholder. An objective
of this exception is to make it possible to connect all components of a computer system,
including those of different manufacturers, so that they can work together. Such an exception
to the author's exclusive rights may not be used in a way which prejudices the legitimate
interests of the rightholder or which conflicts with a normal exploitation of the program.
...Protection of computer programs under copyright laws should be without prejudice to the
application, in appropriate cases, of other forms of protection. However, any contractual
provisions contrary to the provisions of this Directive laid down in respect of decompilation
or to the exceptions provided for by this Directive with regard to the making of a back-up
copy or to observation, study or testing of the functioning of a program should be null and void.
...The person having a right to use a copy of a computer program shall be entitled, without
the authorisation of the rightholder, to observe, study or test the functioning of the
program in order to determine the ideas and principles which underlie any element of the
program if he does so while performing any of the acts of loading, displaying, running,
transmitting or storing the program which he is entitled to do.
...In the absence of specific contractual provisions, the acts referred to in points (a) and (b)
of Article 4(1) [reproduction and alteration of the computer program — JvD] shall not require
authorisation by the rightholder where they are necessary for the use of the computer program by
the lawful acquirer in accordance with its intended purpose, including for error correction.
...The authorisation of the rightholder shall not be required where reproduction of the code and
translation of its form within the meaning of points (a) and (b) of Article 4(1) are indispensable
to obtain the information necessary to achieve the interoperability of an independently created
computer program with other programs, provided that the following conditions are met...
It's a very narrow exception, but it exists, and the the laws of the EU members follow this directive.