The "drill" appears to be attuned to disintegrate the rock, yet leave the valuable dilithium crystals intact.
They shuffled behind the others into the dim mine; the cold increased
to brutal intensity, seeming to emanate from frozen rock walls that
glittered dully with embedded crystal. Jim waited, shivering, as he
was issued a drill and a light helmet by one of the Klingon guards,
who then shoved him toward the wall. Jim watched the miner next to him
for a few seconds, then imitated him: drill the rock, pull the crystal
free, set it on the flatbed shuttle. Nearby, Martia - or the alien who claimed to be Martia - was already hard at work.
"I'll be," McCoy whispered at his elbow, gaping wide-eyed at the gleaming rock.
"Do you have any idea what all this dilithium must be worth?" The
sudden proximity of a guard encouraged him to get busy. The work was
far less brutal than the cold, and it helped warm him. Jim burned his
way into the rock with the drill, then tugged at the dilithium until
it came free. The trick was to keep the jagged crystal from cutting
his numbed hands by letting the drill remove most of the rock
beforehand. Beside him, McCoy cursed as he struggled to extract a
crystal by hand. Jim reached out to help him and was promptly struck
on the back by one of the guards.
Star Trek VI: The Undiscovered Country - Official Novelisation