Measure it, if it is 4cmx4cm, just buy a standard NEMA17 to replace it. I sell them on Ebay for about $20

Finding the pins are very easy... Just use a multimeter.

Use the circuit tester beep.. Connect two of the 6 wires to the multimeter and turn the motor by hand - if you don't get a beep or circuit closed, then switch to another wire..

You are looking for the 2 pairs you need, 1A,1B - 2A,2B. Keep trying pairs until you get the beep.