Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strFileName"></param>
        /// <returns></returns>
        public static ROSECrypt Instance(string strFileName)
        {
            if (s_ROSECrypt == null)
            {
                if (ROSECrypt.BuildCheckSum(out ROSECrypt.s_ByteSumBuffer, strFileName) == false)
                {
                    System.Diagnostics.Debug.WriteLine("ROSECrypt.Instance(...) - s_ROSECrypt == null error!");

                    return(null);
                }

                if (s_ByteSumBuffer.Length <= 0)
                {
                    System.Diagnostics.Debug.WriteLine("ROSECrypt.Instance(...) - s_ByteSumBuffer.Length <= 0 error!");

                    return(null);
                }

                ROSECrypt.BuildCryptTable(out ROSECrypt.s_ByteCryptTableBuffer, s_ByteSumBuffer);

                if (s_ByteCryptTableBuffer.Length <= 0)
                {
                    System.Diagnostics.Debug.WriteLine("ROSECrypt.Instance(...) - s_ByteCryptTableBuffer.Length <= 0 error!");

                    return(null);
                }

                s_ROSECrypt = new ROSECrypt();
            }

            return(s_ROSECrypt);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="strFileName"></param>
        /// <returns></returns>
        public static ROSECrypt Instance( string strFileName )
        {
            if ( s_ROSECrypt == null )
            {
                if ( ROSECrypt.BuildCheckSum( out ROSECrypt.s_ByteSumBuffer, strFileName ) == false)
                {
                    System.Diagnostics.Debug.WriteLine( "ROSECrypt.Instance(...) - s_ROSECrypt == null error!" );

                    return null;
                }

                if ( s_ByteSumBuffer.Length <= 0 )
                {
                    System.Diagnostics.Debug.WriteLine( "ROSECrypt.Instance(...) - s_ByteSumBuffer.Length <= 0 error!" );

                    return null;
                }
                
                ROSECrypt.BuildCryptTable( out ROSECrypt.s_ByteCryptTableBuffer, s_ByteSumBuffer );

                if ( s_ByteCryptTableBuffer.Length <= 0 )
                {
                    System.Diagnostics.Debug.WriteLine( "ROSECrypt.Instance(...) - s_ByteCryptTableBuffer.Length <= 0 error!" );

                    return null;
                }

                s_ROSECrypt = new ROSECrypt();
            }

            return s_ROSECrypt;
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static ROSECrypt Instance()
 {
     return(ROSECrypt.Instance("TRose.exe"));
 }