When the subject is an explicit noun and the object is a pronoun, the object attaches to the verb first:
● ضَرَبَهُ حَامِدٌ — Hamid hit him.
● ضَرَبَكَ حَامِدٌ — Hamid hit you.
● ضَرَبَنِي حَامِدٌ — Hamid hit me.
In every sentence, the colored ending is the object and حَامِدٌ is the nominative subject. Do not mistake the attached object for the doer.