I guess in The Big Sleep, Marlowe is really the ultimate anti-hero. He really is doing his partner’s wife, which by any set of standards, is not cool. Perhaps you could make the argument that Sam Spade wouldn’t have done that - so maybe there is a difference there. In the Maltese falcon he double crosses Miss Wonderly, Gutman and Cairo but they all had it coming, so that is cool.
Did you red “The Glass Key” by Hammett? It’s one of my favorites and the lead character, Ned Beaumont is really a stand up guy. I must have read that book six times.