Impossible to tell for sure just from your post, but it might well be legal.
From your description, you got a copy of Windows XP Pro OEM edition.
This ***IS*** legal ***IF*** it's genuine and not counterfeit.
The question is one of authenticity more than legality, because both
legitimate and counterfeit copies of this are sold on E-Bay. But if the
seller had a high rating and has been around for a while, it's probably
a legitimate copy. They are readily available, perfectly legal, and
usually sell for about $135-$140.
At one time, these were required to be sold only with "hardware", but
apparently even this requirement has been dropped within the past 6
months. Before that, although MS apparently intended "hardware" to mean
a functional CPU, motherboard or hard drive, the "letter of the
contract" (if not the spirit of the contract) was sometimes met by
selling it with an IDE cable, a cheap mouse or a DEAD CPU, motherboard
or hard drive.
There are some limitations on this version of Windows relative to a
retail version. Primarily, there are two that are of interest to most
people:
1. This version won't do an upgrade install (e.g. Win9x, 2000 or XP
Home to XP Pro). It's intended only for a clean install on a computer
that has no OS already installed. However, it will do a "repair"
install, and it will also do an install to a blank partition on a
comuter and hard drive that has another OS already installed IN ANOTHER
PARTITION (e.g. to setup dual boot).
2. Officially, unlike retail copies, it can never legally be moved to
another computer. However, it's not clear what this really means; that
is, it's not clear what constitutes the "computer" (the sheet metal with
the sticker on it? The motherboard? The hard drive?). It's also not
clear if or how Product Activation enforces this. It's been suggested
that unlike retail copies, for which the activation database resets
after 4 months with no activity for a given product key, the database
for OEM copies NEVER resets -- but I have not been able to verify that.
It is clear that it's "more" difficult to get MS to either reactivate
an OEM copy or give you a new key when talking with them by phone. But,
again, "more difficult" doesn't mean impossible (motherboards do fail
and get replaced). So this is a big black hole, in fact it's two
separate black holes, one being the "legal" hole (just what is the
"computer") and the other being the "legalities aside" practical black
hole of product activation.