A scanner darkly is a 1977 book by Philip K. Dick about an undercover cop investigating the drug Substance D. He pretends to be a dealer, trying to work his way up through bigger and bigger dealers to find the source.
Since he has to conceal his identity even from his superiors, he eventually gets assigned to investigate himself.
Due to all the Substance D he has to take, he gets more and more confused about who he really is.
It's a pretty good mind drugs pseudo SF novel.

It has a really sad dedication in it to all the friends PK Dick lost to methamphetamine addiction - the memorable quote is something like "people were never punished more harshly for just trying to have some fun".