A Technique to Infer Magnetic Topology at Mars and Its Application to the Terminator Region