Unfortunately, a ban would only take them out of the hands of those persons who are responsible (a majority).
Do you really think a ban will take away all unregistered/illegally obtained firearms?
Actually, a ban has worked to radically reduce the number of illegal weapons over time in other countries: Japan, for example.
It is estimated by the Department of Justice that 90% of the illegal guns in the US are produced in the US and are either stolen from their legal owners or are sold illegally by licensed gun shops. The attrition rate for existing weapons is generally agreed to be about 2%.
So yes, over time a ban will take away the majority of illegally obtained weapons if adequately enforced.
Whether or not Americans would agree to the enforcement is the fundamental question.