having failed in overthrowing the republic by a coup , hitler pursued a `` strategy of legality : '' this meant formally adhering to the rules of the weimar republic until he had legally gained power .