Envisiontec Ultra 3DP SLA printer/encrypt/decrypt

From NURDspace

Jump to: navigation, search

Decompiled C# code from the original binary:

    private string Decrypt(string csString)
    {
      for (int index = csString.Length - 1; index >= 0; --index)
      {
        int iPosB = index;
        int iPosA = this.GetPrimaryIndex(index + 3) % csString.Length;
        this.SwapCharacter(ref csString, iPosA, iPosB);
      }
      return csString;
    }

    private void SwapCharacter(ref string csString, int iPosA, int iPosB)
    {
      char[] charArray = csString.ToCharArray();
      char ch1 = charArray[iPosA];
      char ch2 = charArray[iPosB];
      charArray[iPosA] = ch2;
      charArray[iPosB] = ch1;
      csString = new string(charArray);
    }

    private int GetPrimaryIndex(int iIndex)
    {
      int iInitialIndex = 1;
      for (int index = 1; index < iIndex; ++index)
        iInitialIndex = this.GetNextReturn(iInitialIndex);
      return iInitialIndex;
    }

    private int GetNextReturn(int iInitialIndex)
    {
      int num;
      do
      {
        ++iInitialIndex;
        num = 2;
        while (num < iInitialIndex && iInitialIndex % num != 0)
          ++num;
      }
      while (num != iInitialIndex);
      return iInitialIndex;
    }
 
Our site is hosted by Site4U
Site4U
Our connectivity is made available by BIT
To BIT's website