A good example is the Rook-40 pistol as it's a ubiquitous sidearm.
1. Approach corpse and enter inventory screen to acquire the pistol.
2. Right-click on the corpse's Rook-40 to swap out yours for the new one (even if you already have one).
3. Right-click on the magazine of your new Rook-40 (as you would to unload it) and the magazine will replicate itself in the corpse's inventory and will not be removed from the weapon.
4. Right-click on the magazine repeatedly to reproduce it infinitely. It will return to normal upon exiting the inventory menu.