Foul Play inflicts damage. It uses the target's Attack stat to calculate damage, as opposed to the user's Attack stat. The target's stat boosts (anything that changes the stat stage, such as Swords Dance or Growl) are incorporated into the damage calculations. Any remaining boosts (such as Huge Power or Guts) are calculated with the user of Foul Play's items, Abilities, and status
So, if your opponent has +6 attack, then foul play will get the +6 attack bonus because the power of the move is based on your opponent's attack stat. However, you will not get the +6 attack bonus if your attack is at +6.