If any defensive player touches his upper arm below the upper arm (wrist, hand or even finger) before the attacker finishes shooting and returns to the state without the ball, he can be punished as a thug. Generally, the slight contact before hitting the ball can be ignored. If the intensity and nature of the violation affect the attacker's shot, even if the ball has been shot, it can still be punished.
Malicious attack by the defender: No matter what happens to the attacker at any time (including dribbling, shooting or passing the ball), it can be punished as a foul or even a malicious foul by the thugs.
If there is an attacker's punishment in blocking or stealing: theoretically, there should be no physical contact in blocking or stealing. If the attacker's behavior occurs after blocking or stealing, it can be ignored (for example, when the defender falls in the same series of actions, he blocks the attacker's shot and his arm touches the attacker's arm, so does stealing). If physical contact occurs at the same time as blocking or stealing, you can call the attacker a foul.