I'm wondering what the function of か is when it's not put in the end of the sentence. I'm fairly a beginner. I haven't learned how this work when's it followed by an を. Found this example here wherein 2 men fight.
やり出すと止まらない
どうすれば相手が傷つけるか知っていて
どうすれば自分が痛くなるかを知っている
From my little experience, this goes like.
I can't stop now that I started.
He knows what will wound him.
I know what will put me in pain.
On a sidenote, is my understanding of どうすれば here correct?