Looking up the code, given the datasheet, is usually easy. (That is, they usually say what the marking is. But, often they don't...)
Looking up the datasheet, given the code, is not easy.
As with phone numbers and IP addresses, you need a reverse lookup, a searchable database.
These lists do exist (s-manuals is the most complete one out there, I think), but they aren't comprehensive.
What do you do? Well, there's always the fetal position...

Alternative methods? If you really need to fix the thing, you can try to reverse engineer the circuit, at least in the immediate area, and see what the part is doing. Does it have power and ground pins? Does it have a normal transistor (BJT or MOS) pinout? Is there an obvious polarity against the surrounding circuit? Is it in a DC-DC converter? Logic level input? Switching output -- LEDs or something else? Is it surrounded by resistors, part of an amplifier? What values of capacitors / inductors are nearby, that might hint at parameters (say, an RF type)?
So, it's one of those problems where, if it's not easy, it's very much more difficult...
Tim