How to get the Z value aka Hash of the outputs to be signed I get it that the "OP_CHECKSIG" does this, but I can't see how to recreate it.  I tried SHA1 and SHA256 of some of the info in a given bitcoin transaction but it didn't give me confirmed values of Z.  Can someone please select a transaction, tell me which one it is and show me what I need to cut and paste into a SHA1 calculator to get the actual Z value?

The hash value of TX 9ec4bc49e828d924af1d1029cacf709431abbde46d59554b62bc270e3b29c4b1 is supposed to be z = c0e2d0a89a348de88fda08211c70d1d7e52ccef2eb9459911bf977d587784c6e
and also z = 17b0f41c8c337ac1e18c98759e83a8cccbc368dd9d89e5f03cb633c265fd0ddc but I do not see how the z values are achieved.
0) read How to redeem a basic Tx?

1) take your transaction as array of bytes

2) replace all input scrips to empty scrips

3) replace one input script to original "OP_DUP OP_HASH160..."

4) append "hash code type" SIGHASH_ALL

5) take sha256 ( sha256 ( data ) )

that's all

Have a look on my code

const MyKey32 Transaction::getRawHash ( const int n, const QByteArray&amp; scr ) const
{
  MyByteArray ret;                                    // create empty array
  Stream stream ( s );
  ret.putInt32 ( stream.readU32 ( ) );                // version
  ret.putVarInt ( stream.readVar ( ) );               // input count
  for ( int i ( 0 ); i &lt; inputs; i++ )                // copy all inputs
  {
    ret.append ( stream.readHash ( ) );
    ret.putInt32 ( stream.readU32 ( ) );
    stream.skipVarData ( );                            // skip original script
    ret.putPrefixed ( i == n ? scr : QByteArray ( ) ); // !!! script replacement
    ret.putInt32 ( stream.readU32 ( ) );
  }
  ret.putVarInt ( stream.readVar ( ) );                // output count
  for ( int i ( 0 ); i &lt; outputs; i++ )                // copy all outputs byte-by-byte
  {
    ret.putInt64 ( stream.readU64 ( ) );
    ret.putPrefixed ( stream.readVarData ( ) );
  }
  ret.putInt32 ( stream.readU32 ( ) );                 // lock
  ret.putInt32 ( SIGHASH_ALL );                        // !!! append hashcode
  return MyKey32 ( ret.constData ( ), ret.size ( ) );  // create hash256 of array
}