In the U.S. it is perfectly legal to reverse anything that you obtained legally.
And https://en.wikipedia.org/wiki/Bowers_v._Baystate_Technologie....
Note that pretty much any EULA I've seen in the past 10 years has had an anti reverse engineering clause.