fix looping decrypt key,

This commit is contained in:
Merith 2025-03-18 18:39:16 -07:00
parent ea448c9fe1
commit 68869b9c80

View file

@ -28,7 +28,7 @@ internal class Utils
private const int SPIF_SENDWININICHANGE = 2; private const int SPIF_SENDWININICHANGE = 2;
private string[] bannedlist = new string[6] { "booru.allthefallen.moe", "mega.nz", "thecontrolapp.co.uk/Pages/ControlPC", "paradroid-gamma.vercel", "imagekit.io/tools/asset-public-link", "paradroid-gamma.web.app" }; private string[] bannedlist = new string[1] { "thecontrolapp.co.uk/Pages/ControlPC", };
private string[] bannedref = new string[2] { "money", "pay" }; private string[] bannedref = new string[2] { "money", "pay" };
@ -36,19 +36,21 @@ internal class Utils
public void writetolog(string shortvr, string longvr) public void writetolog(string shortvr, string longvr)
{ {
shortvr = shortvr + "~~" + Decrypt(shortvr); writetolog(shortvr, longvr, false);
longvr = longvr + "~~" + Decrypt(longvr); }
if (ConfigurationManager.AppSettings["Logging"] == "On")
public void writetolog(string shortvr, string longvr, bool isDecrypted)
{ {
if (ConfigurationManager.AppSettings["Logging"] == "On") if (!isDecrypted)
{ {
shortvr = Decrypt(shortvr);
longvr = Decrypt(longvr);
}
shortvr = shortvr + "\n";
longvr = longvr + "\n";
File.AppendAllText("log.txt", shortvr); File.AppendAllText("log.txt", shortvr);
}
else
{
File.AppendAllText("log.txt", longvr); File.AppendAllText("log.txt", longvr);
} Console.WriteLine($"{shortvr}: {longvr}");
}
} }
public string[] GetLatestItem() public string[] GetLatestItem()
@ -68,7 +70,7 @@ internal class Utils
} }
catch (Exception ex) catch (Exception ex)
{ {
writetolog("Error running process \n\r", ex.Message); writetolog("Error running process", ex.Message);
} }
return ret; return ret;
} }
@ -206,7 +208,7 @@ internal class Utils
{ {
ret = false; ret = false;
new CustomMessage("Sending file to server failed", "", 4, tts: false).ShowDialog(); new CustomMessage("Sending file to server failed", "", 4, tts: false).ShowDialog();
writetolog("Error sending ftp process \n\r", ex.Message); writetolog("Error sending ftp process", ex.Message);
} }
return ret; return ret;
} }
@ -255,7 +257,7 @@ internal class Utils
} }
catch (Exception ex) catch (Exception ex)
{ {
writetolog("Error getting outstanding \n\r", ex.Message); writetolog("Error getting outstanding", ex.Message);
} }
return returned; return returned;
} }
@ -314,10 +316,11 @@ internal class Utils
ToReturn = ToReturn.Replace("]", "aaa"); ToReturn = ToReturn.Replace("]", "aaa");
ToReturn = ToReturn.Replace("G0", "ppp"); ToReturn = ToReturn.Replace("G0", "ppp");
ToReturn = ToReturn.Replace("0x", "lll"); ToReturn = ToReturn.Replace("0x", "lll");
writetolog("Encrypted: " + Line , ToReturn, true);
} }
catch (Exception ex) catch (Exception ex)
{ {
writetolog("Error enrypt " + Line + "\n\r", ex.Message); writetolog("Error enrypt " + Line , ex.Message, true);
} }
return ToReturn; return ToReturn;
} }
@ -346,10 +349,11 @@ internal class Utils
cryptoStream.Write(inputbyteArray, 0, inputbyteArray.Length); cryptoStream.Write(inputbyteArray, 0, inputbyteArray.Length);
cryptoStream.FlushFinalBlock(); cryptoStream.FlushFinalBlock();
ToReturn = Encoding.UTF8.GetString(ms.ToArray()); ToReturn = Encoding.UTF8.GetString(ms.ToArray());
writetolog("Decrypted: " + Line , ToReturn, true);
} }
catch (Exception ex) catch (Exception ex)
{ {
writetolog("Decrypt error for : " + Line + "\n\r", ex.Message); writetolog("Decrypt error for : " + Line , ex.Message, true);
} }
return ToReturn; return ToReturn;
} }
@ -379,7 +383,7 @@ internal class Utils
catch (Exception ex) catch (Exception ex)
{ {
filename = "FAILED"; filename = "FAILED";
writetolog("Error getting file for : " + url + "\n\r", ex.Message); writetolog("Error getting file for : " + url , ex.Message);
} }
return filename; return filename;
} }
@ -983,7 +987,7 @@ internal class Utils
} }
catch (Exception ex) catch (Exception ex)
{ {
writetolog("Error getting webcam \n\r", ex.Message); writetolog("Error getting webcam", ex.Message);
} }
break; break;
case "7=": case "7=":
@ -1027,7 +1031,7 @@ internal class Utils
} }
catch (Exception ex2) catch (Exception ex2)
{ {
writetolog("Error proccessing for : " + line + "\n\r", ex2.Message); writetolog("Error proccessing for : " + line , ex2.Message);
} }
} }
} }