Eagle Eye
(2008)

Short version:
Jerry Shaw prevents the assassination of the entire Presidential Cabinet (which it turns out is what the voice, which was a super computer controlling everything, was leading them all to do) and receives the Medal of Honor and a Purple Heart for both himself and his brother. Him and Rachel stay friends, as Jerry is seen dropping presents off at Sam's (her son) birthday - specifically, the Rock Band video game.

Long version:
Jerry Shaw and Rachel Holloman are eventually led all the way to the Pentagon, breaking into a top secret super computer. They discover that it is not a person, but this government funded and built super computer that has been leading them everywhere. (This is the same super computer at the beginning of the movie, the one that gave an abort recommendation at the launching of missiles at possibly innocent civilians). The super computer has had a "biometric" lock put on it, using Jerry's brother's face as the key. Since Jerry and his brother are identical twins, the computer is able to use Jerry's face to remove the lock, which leads to the computer being able to begin "Operation Guillotine".

Operation Guillotine is a top secret terrorist training operation. It is a scenario that allows the government to continue to run after the entire chain of command has been killed. The computer hopes to kill off everyone who could possibly take the seat of the President, leaving the President title to Defense Secretary Callister, the man at the beginning of the movie who wanted to NOT launch the missile at who they thought was a terrorist. This leads to Jerry discovering that the person they launched the missile at was NOT the terrorist - meaning the President ordered the assassination of innocent civilians. Because Callister tried to convince the president to not authorize the missile launch, the super computer wants him to be president.

The computer hopes to achieve the assassination of the entire Presidential Cabinet at the State of the Union speech being held that night. This is being done using the top secret (lots of secrets in this movie...) explosive crystal that was developed by the government. Earlier in the movie, Sam's trumpet was stolen and had the detonator implanted into it, meaning when he plays a certain note on it, it will set off the crystal explosive in the necklace Rachel is being forced to wear, (nobody but Jerry knows this), killing the entire Presidential Cabinet, leaving the space open for Callister to take.

Zoe Perez eventually stops the super computer by slamming a piece of metal pole into it's processor, but all of the plans to kill the president have already been set up, not needing any more help by the computer.

The explosive is set to detonate when Sam plays a certain note in the national anthem (specifically, "free" in the verse "land of the free"). Jerry bursts into the room just as they begin to play the verse, stands on a table and starts shooting a gun into the air, causing everyone to stop playing and the president to run for cover. Jerry is shot three times in the back and falls over.

The camera then cuts to Jerry, alive, wearing an arm sling, receiving the Medal of Honor and a Purple Heart, as well as his brother, though his brother is, of course, still dead. Jerry and Rachel stay friends after all they went through, as Jerry is then seen dropping off presents at Sam's birthday. Rachel kisses Jerry passionately on the cheek, hinting to a possible relationship between the two, and the camera fades to back.

Thanks Sal!