Against A Dark Background by Iain M Banks.
Meet Sharrow. She only has the one name because she is a Proper Lady, descendant of a noble family from the planet of Golter. It's not all croquet and cucumber sandwiches, though, as the family has seen some hard times - Sharrow herself in the novel's prologue watches her mother being assassinated and only escapes a similar fate herself by jumping out of a cable car. Sharrow's father then gambles away most of the family fortune in various casinos, there is a falling-out with Sharrow's cousin Geis and half-sister Breyguhn (largely as a result of a slightly incest-y love triangle) and Sharrow decides to bail out and join the army, eventually ending up as part of a crack team of mercenaries linked together at a near-telepathic level by some druggy neurological trickery.
In semi-retirement after all that excitement, Sharrow is obliged to take on One Last Mission. This one is prompted by the news that there's a religious cult, the Huhsz, whose rather niche belief system (but, then, aren't they all) involves the conviction that the end of Sharrow's family line will be the event which triggers some sort of Rapture/Second Coming thing, and moreover are taking a commendably hands-on attitude to bringing that moment about by taking out a contract on her life. Sharrow's options are basically try and hide for the year it takes for the contract to expire, or try to retrieve the last of the Lazy Guns, unimaginably, apocalyptically powerful weapons which the cult have some sort of attachment to, and either hand it over in exchange for her life, or use it to cook some fools.
Anyway, Sharrow has to get busy getting the old team back together, as well as visiting the bizarre religious order (not the Huhsz, a different one) where Breyguhn currently resides, because they know something of the whereabouts of an ancient religious tract which in turn holds some information about the whereabouts of the last Lazy Gun. Sharrow's own grandfather, Gorko, is involved here in some way as he colluded in the hiding of all this stuff in the first place and, it is theorised, only someone sharing some of his genetic material can gain access to the final resting place of the gun and answer some questions about swallows and coconuts or something.
So the group (all crack soldiers and deadly assassins in their own right, which is handy) head off, locate the book, decipher the cryptic clues within which point to the Lazy Gun's location, and head off to find it. Not without some mishaps, though: in particular Sharrow seems to have acquired some sort of brain implant which allows people with the right equipment to inflict pain on her if, for instance, they wish to persuade her to act in a certain way, or discourage her from doing certain things.
The Lazy Gun turns out to be in some sort of Forbidden Zone - I know, no shit, right - and in the course of trying to get to its location most of Sharrow's colleagues die. Sharrow herself only gets to her destination with the help of a useful android she's met along the way. It turns out, unsurprisingly, that several other parties have an interest in the Lazy Gun and a battle occurs, which Sharrow flees (with the Lazy Gun) on a conveniently-available giant armoured monowheel with, also conveniently, no apparent need ever to refuel. Sharrow and the android take the Lazy Gun back across the planet to the religious order's castle (no, not the Huhsz, the other one) only to find that cousin Geis, crazed with unrequited semi-incestuous love for her, is behind most of the Bad Stuff that's been happening. Needless to say it All Kicks Off at this point and the Lazy Gun finally gets an opportunity to show what it can do.
Against A Dark Background is the first non-Culture Iain M Banks novel, published in 1993, between Use Of Weapons and Excession, the third and fourth Culture novels. Banks evidently worked hard to establish some differences from the Culture novels - we're still on other planets with alien technology well in advance of our own, but there is none of the sense of technology as a liberating force here; it's just providing people with ever-more-efficient ways of maiming and killing each other. The key to understanding Against A Dark Background is that, like Use Of Weapons, it's a reworking of some early Banks material (from the mid-1970s in this case), and, in my view anyway, shares some of its faults - lots of fractured timeline tricksiness, far too much going on with the plot and therefore far too many unresolved loose ends, and, above all, a downbeat ending that just prompts a bit of head-scratching and a quizzical Is That It?
Part of the problem here is the conceit of the Lazy Gun itself: Banks obviously thought it was hilarious - a weapon that randomly destroys your enemies by poofing some random shit in from another dimension like a T. Rex, a 16-ton weight, a helmet full of bees, just seemingly whatever the Gun itself deemed whimsical (but also deadly). Two problems with this, really, firstly it's very silly and doesn't really fit into a gritty and violent sci-fi novel, and secondly Banks doesn't follow through on it properly - when the Gun finally gets unleashed in the castle when Geis and Sharrow are having their climactic fight at the end all it does is blow holes in the walls, rather than summon a swimming pool full of shaving foam or a plague of tap-dancing hamsters. Also, I've never read any Mervyn Peake but even I could see that the vast, rambling, decaying Sea House where the monks live was a bit of a steal from Peake's Gormenghast books. As an example of a loose end, the android, Feril, who plays a key role in the last third or so of the book, is one of the last of his kind because of some kind of Butlerian Jihad prohibiting the manufacture of further androids - no explanation or further detail is ever offered.
Banks' novels are never less than entertaining and full of interesting ideas, but this one (and I'm thinking back to my Culture novel league table here) is probably a mid- to lower-mid-table effort at best. Banks apparently wrote an epilogue which he chose not to include in the book when it was published, but which is available here: it doesn't really add a lot but rounds things off a bit more conclusively than the book does.