Reversing : The Hacker's Guide to Reverse Engineering

(ff) #1

The next logical leap that supersedes procedures is to divide a program into
objects. Designing a program using objects is an entirely different process than
the process of designing a regular procedure-based program. This process is
called object-oriented design(OOD), and is considered by many to be the most
popular and effective approach to software design currently available.
OOD methodology defines an object as a program component that has both
data and code associated with it. The code can be a set of procedures that is
related to the object and can manipulate its data. The data is part of the object
and is usually private, meaning that it can only be accessed by object code, but
not from the outside world. This simplifies the design processes, because
developers are forced to treat objects as completely isolated entities that can
only be accessed through their well-defined interfaces. Those interfaces usu-
ally consist of a set of procedures that are associated with the object. Those pro-
cedures can be defined as publicly accessible procedures, and are invoked
primarily by clientsof the object. Clients are other components in the program
that require the services of the object but are not interested in any of its imple-
mentation details. In most programs, clients are themselves objects that simply
require the other objects’ services.
Beyond the mere division of a program into objects, most object-oriented
programming languages provide an additional feature called inheritance.
Inheritance allows designers to establish a generic object type and implement
many specific implementations of that type that offer somewhat different
functionality. The idea is that the interface stays the same, so the client using
the object doesn’t have to know anything about the specific object type it is
dealing with—it only has to know the base type from which that object is
derived.
This concept is implemented by declaring a base object, which includes a dec-
laration of a generic interface to be used by every object that inherits from that
base object. Base objects are usually empty declarations that offer little or no
actual functionality. In order to add an actual implementation of the object type,
another object is declared, which inherits from the base object and contains the
actual implementations of the interface procedures, along with any support
code or data structures. The beauty of this system is that for a single base object
there can be multiple descendant objects that can implement entirely different
functionalities, but export the same interface. Clients can use these objects with-
out knowing the specific object type they are dealing with—they are only aware
of the base object’s type. This concept is called polymorphism.


Data Management


A program deals with data. Any operation always requires input data, room
for intermediate data, and a way to send back results. To view a program from
below and understand what is happening, you must understand how data is


Low-Level Software 29
Free download pdf