You can help yourself with some source-code, i think this link drives you to the Source-code website of Shareaza
http://shareaza.svn.sourceforge.net/viewvc/shareaza/
Also, be sure to implement G1 and G2 as possible, and, if you want things simpler, use
DIYP2P, just modify some little things and you have your own, brand new P2P client