There’s a bit of precedent in the RPG world, where people have taken out of print RPG’s, reworded them, removed references to trademarked terms and then published them.
That doesn’t stop someone from hassling you legally if you were to rewrite 40K and sell your “BattleMace 39.111” with “Star Soldiers” and “Korks” of course.
If serious money is on the table, talk to a lawyer who specializes in intellectual property. I imagine most of the rest of us just make do.
Nordic Weasel Games