Any person who knowingly and willfully makes any materially false statement or representation to (i) a law-enforcement officer or attorney for the Commonwealth who is in the course of conducting an investigation undertaken pursuant to this chapter or (ii) a court or magistrate during the petitioning process pursuant to this chapter is guilty of a Class 1 misdemeanor.