When computer data or electronic data, stored in any form, the possession of which is otherwise unlawful, are seized as evidence in a criminal prosecution of any offense involving obscenity or child pornography, neither the original data nor a copy thereof shall be released to the defendant or his counsel, nor shall a court order the release of such evidence to the defendant or his counsel except as provided herein. The defendant and his counsel shall be allowed the reasonable opportunity to review such evidence in accordance with the rules of discovery. Upon a finding that the production of the original data or a copy thereof to counsel or his designee is necessary and material to the defense of the accused, the court may order such production only under terms that restrict access to specifically identified recipients, prohibit any duplication of the data beyond what is reasonably necessary for the purpose of the production, and require the return of the data to the law-enforcement agency maintaining custody or control of the seized data for appropriate disposition.
Va. Code § 19.2-270.1:1