This Code allows you not only to rebattle legendaries, it lets you replay any events of the main storyline in a certain area (such as the Plasma Grunts in Pinwheel Forest, etc.) With this code, if you hold select + A as you walk into the Pokemon Center of the Pokemon League, the Plasma Grunt that warps you to N's Castle will be there, and you can Rebattle Reshiram/Zekrom, N, and Ghetsis! It truly works!
White:
52014324 42112001
12014328 0000d100
94000130 fffa0000
12014328 000046c0
d2000000 00000000
Black:
52014308 42112001
1201430c 0000d100
94000130 fffa0000
1201430c 000046c0
d2000000 00000000