Some people like to take apart watches and iPods to see how they work, some like to take apart software.
Dave Jewel describes how to reverse engineer software in Reverse Engineering Apple's OS X. He does this to find out undocumented APIs:
You can feed an executable to class-dump, and it will print out all the Objective-C class declarations contained within the file. This information alone is often enough to get you started with an undocumented API.
Why does a software program have undocumented APIs? They might not be ready for use, because they are not fully implemented. Or they contain links to features to be turned on in a future release. Or to thwart competitors whose software runs slower from using APIs that are documented.
Not that reverse engineering APIs is easy, warns Mr Jewel:
Popping this return address into EBX gives a position-independent offset that can be used to access global variables. For every EBX-relative data reference in this method (sometimes ECX or even EAX is used), we need to add the "thunk offset" (0000FA6B in this case) to determine the absolute address of the data that's being accessed.
We all reverse engineer. Because all reverse engineering entails is seeking to understand how something works.
Reverse engineering is considered by most courts to be "presumptively legal." Unfortunately, software license agreements often have anti-reverse engineering clauses. And while these clauses are often of dubious legality or enforceability, the specter of facing off in court against a multi-billion dollar corporation that whose management doesn't care about legal costs can be pretty chilling.
In the case you cite, the Jewel is reverse-engineering, but there are two things that would likely protect him if Apple decided to get testy:
1. He's not disassembling the code in OSX. He's simply discovering APIs which are not documented. It's rather analogous to fiddling with a camera in a dark room, to figure out what its buttons do.
2. He's reverse engineering is for the purpose of interoperability. His work has the legitimate purpose of letting him use OS X more effectively.
Posted by: Evan Yares | Mar 18, 2009 at 06:24 PM
Reverse engineering is considered by most courts to be presumptively legal. But these days, software license agreements often have anti-reverse engineering clauses.
Posted by: Reverse Engineering | Jul 30, 2009 at 06:46 AM