"Ga" usually indicates the subject, but also can indicate the object of some groups of verbs, including the -tai form as staren-san mentioned.
examples of verbs/adjectives that take "ga" as the object marker
state verbs; wakaru, iru(to need), dekiru,,,
potential forms/-tai forms; taberareru, tabetai,,,
adjectives(the ones which express emotion/sense); sukida, jouzuda, nikui, hitsuyouda,,,
As for "Anata wo shiritai", "Anata ga shiritai" is also OK, but "anata" could be misinterpreted as the subject of "shiritai". So, "anata wo" would be preferred over "anata ga".