Once a hotbed of sex workers and drug peddlers, Chungking Mansions, a ramshackle high-rise building in the heart of Hong Kong's shopping district, is no longer the glossy city's notorious core.

Built in the 1960s, Chungking Mansions has 17 floors of guesthouses and small businesses, run by people from all corners of the globe selling everything from fake electronics to gems. Long a hub for merchants from the developing world keen to turn a profit in Hong Kong, it's said that at least 20 percent of sub-Saharan Africa's mobile phones passed through Chungking Mansions first. Meanwhile, the drugs and prostitution that also made up a big chunk of business activity gave Chungking a seedy image at odds with Hong Kong's largely safe and sanitized aura.

But moves have been underway for the past decade to clean up the building's image.

"Chungking Mansions as a center of vice, that doesn't ring true anymore," noted Gordon Mathews, professor and chair of the Anthropology department at the Chinese University of Hong Kong, who first began exploring the building in 2005.

"My research interest was sparked because people thought it was a scary place." After living there over a four year period, he wrote a widely-acclaimed book "Ghetto at the Centre of the World" that detailed the building's intricate business networks.

Read MoreHK vs Singapore: Which is Asia's most liveable city?



So while backpackers and budget travelers continue to flock to the building for cheap lodgings—nightly prices start from $30, according to a search on Hotels.com—the sale of fake goods and illicit services is on the decline, Mathews explained.

"The peak of the counterfeit phone trade fell after the smartphone era. iPhones are cheap enough and copies are bad enough so nobody wants to buy a copy phone. Wholesale businesses aren't dealing well overall since that trade has moved to China."

Prostitutes and hashish vendors, who freely hawked their wares in the early years of the new millennium, have stopped actively soliciting in the building because buyers now have other options, such as the Tsim Sha Tsui or Wanchai neighborhoods, to find vice, Mathews told CNBC.