What torpedo is the pistol in the first and second picture from?
That is a Pi1 (or Pi G7H as it was designated until 1942) pistol. It's hard to tell the exact variant from the photo (there were also variants Pi1a, Pi1c and Pi1d).
Even though the pistol in question appearently has the extended cover housing a battery (ie it most likely have to mechanical and two electrical detonators), I have not seen any description indicating that this feature were found in one specific variant (I have seen examples of pistols of same variant with both 4 mechanical detonators, and the mechanical/electrical combo).
The Pi1, Pi1a and Pi1c were used with Ka, Ka1 and Ka2 warheads. these heads were used on G7a(TI / TI Fat I / TI Lut I / TI Lut II), G7e(TII / TII Fat II) and G7es (TX) torpedoes.
It could also be used (not approved by regulations, so it required special approvement from the torpedoarsenal) in Kb and Kb1 heads as well.
Kb / Kb1 heads were by regulations used on the G7e(TIII / TIII Fat II / TIIIa / TIIIa Fat II / TIIIa Lut I / TIIIa Lut II / TIIIb / TIIIc / TIIId Lut) torpedoes, but Pi1 would only (by approvement) be used on the TII and TIIIa Fat II.
The Pi1d is distinguished by a similar protruding cover, but this has almost the same diametre as the main housing and is not offset.
The Pi1d was a unique variant made for the G7e(TIIId) "Dackel" torpedo (it used a Kb or Kb1 warhead). It had no safety-flap as the 11metre long torpedo had so low speed (9kn to obtain the extreme runningdistance of 57km), that the waterpressure would not free the armingpropeller. It was replaced by a manual safety which was removed by pulling it out with a long rope from the deck of launch-platform. In addition, it had a self-destruction feature as it was a large risk for the torpedo to be washed ashore by the tide and thus subject to allied intelligence (ie the longer housing).