In two days, the San Francisco 49ers took risks on a pair of players who weren't even in the NFL last year.

Randy Moss on Monday. Perrish Cox a day later.

They seem to have kept their talented and top-ranked run defense intact, too.

Cox is getting a fresh start with San Francisco, signing a two-year contract Tuesday after being acquitted on sexual assault charges in Colorado earlier this month.

"We are pleased to add Perrish to our team," general manager Trent Baalke said. "As an organization, from ownership on down, we have done our due diligence and are confident that Perrish will be a positive contributor to the 49ers, as well as our community."

San Francisco also reportedly re-signed cornerback Carlos Rogers to a four-year deal late Tuesday on the first day of NFL free agency, according to the NFL Network. Messages left for Rogers and his agent went unreturned and the 49ers declined to comment on the status of negotiations.

Rogers' return would mean, as of now, all 11 defensive starters will return in 2012. The Niners also re-signed linebacker Tavares Gooden, a valuable special teams player last season, to a one-year deal.

On Monday, San Francisco signed wide receiver Randy Moss after he sat out the 2011 season. Moss is to receive $2.5 million in base salary with the chance to earn an additional $1.5 million in incentives, according to a person with knowledge of the contract who spoke on condition of anonymity because details aren't released. There is no guaranteed money in the deal.

Cox was accused of sexually assaulting a woman at his apartment in September 2010 after a night of partying. She became pregnant, and prosecutors said DNA tests indicated Cox was the father.

Cox denied having sex with the woman, who testified that she believed she was drugged because she remembers little about what happened.

"I want to thank everybody for giving me the chance to actually express myself and go out and have dinner with the owner and the GM so they could figure out what kind of guy I am," Cox said. "I've worked hard through this whole process. Like I was telling them, whatever happened, happened, and I took full responsibility for my actions. But it will never happen again, ever again. I'm a positive guy, and if I can help in any way, I want to be there to help."

The 25-year-old Cox didn't play last year after the Broncos released him at the end of training camp, spending time with his family in Waco, Texas, and working out with his trainer father.

A capable defensive back and return man, Cox made it clear several times during a conference call that he appreciates the opportunity.

"First off, I never want to be in a position I was in before ever again," Cox said. "That's not me. I'm not that type of guy. To prove that, I'll show the community and the coaches and the team what type of guy I am and can be. From here on out, I'll show it."

Cox's addition didn't keep the team from bringing back Rogers, who shared the team lead with six interceptions for the NFC West champions last year.

Cox could become a key special teams addition returning kicks as San Francisco might not bring back Ted Ginn Jr. In a 20-17 overtime loss in the NFC championship game to the eventual Super Bowl champion New York Giants, Kyle Williams fumbled a punt that set up Lawrence Tynes' winning field goal.

During the trial that ended March 2 in Castle Rock, Colo., Cox's attorney, Harvey Steinberg, disputed the DNA test results and suggested they may have been contaminated. He tried to paint a picture of drunkenness and of the alleged victim being able to interact with people without remembering.

Cox had 57 solo tackles, two forced fumbles and an interception as a rookie in 2010. Playing for current 49ers defensive backs coach Ed Donatell while in Denver, he appeared in 15 games with nine starts and ranked third among 2010 rookies with 14 passes defensed.

Cox isn't ready to predict himself in a starting role for 2012 in Vic Fangio's stingy defense.

"Whatever role I need to be in, I'll take full pride in it and give it my whole for the whole organization," he said. "If I am (a starter), it'll be proven. But if not, I'll take the backup role, also. I'm here to prove whatever I can prove. Whatever I'm asked to do, I'm here to do it."

Gordon was originally drafted in the third round by Baltimore in 2008 and played 41 games with the Ravens before signing with San Francisco last September. He has 12 special teams tackles for the 49ers.