Skip to content
This repository was archived by the owner on Oct 5, 2019. It is now read-only.

Commit 9c24df0

Browse files
author
Zaczero
committed
Small renaming, added md5 hash
1 parent 05d66b4 commit 9c24df0

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

SharpLoader/Core/SourceRandomizer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ private void Encrypt(ref string str)
734734
tmp1[i + 2] = (byte)(tmp1[0] % tmp1[1] * (i + tmp1[1]) ^ stringBytes[i]);
735735
}
736736

737-
var funcArg = ByteArrayToString(tmp1);
737+
var funcArg = ByteArrayToCode(tmp1);
738738

739739
var output = $"{_stringDecryptorFunction}({funcArg})";
740740

@@ -838,7 +838,7 @@ private void Encrypt(ref string str)
838838
tmp1[i + 2] = (byte)(tmp1[0] % tmp1[1] * (i + tmp1[1]) ^ stringBytes[i]);
839839
}
840840

841-
var funcArg = ByteArrayToString(tmp1);
841+
var funcArg = ByteArrayToCode(tmp1);
842842

843843
var output = $"{_charDecryptorFunction}({funcArg})";
844844

@@ -939,7 +939,7 @@ private void Encrypt(ref string str)
939939
var tmp2 = BitConverter.GetBytes(encrypted);
940940
Array.Copy(tmp2, 0, tmp1, 2, 4);
941941

942-
var funcArg = ByteArrayToString(tmp1);
942+
var funcArg = ByteArrayToCode(tmp1);
943943

944944
var output = $"{_valueDecryptorFunction}({funcArg})";
945945

@@ -1222,7 +1222,7 @@ private void Flow(ref string str)
12221222
var tmp1 = new byte[8];
12231223
Array.Copy(tmp2, 0, tmp1, 0, 4);
12241224
Array.Copy(tmp3, 0, tmp1, 4, 4);
1225-
var baseDecryptor = ByteArrayToString(tmp1);
1225+
var baseDecryptor = ByteArrayToCode(tmp1);
12261226

12271227
cases[i] = $"case {switchValues[i]}:{{{finalBlocks[i]}{switchName}={_xorDecryptorFunction}({baseDecryptor});break;}}<block>";
12281228
}
@@ -1380,7 +1380,7 @@ private string[] GetCodeBlocks(string str)
13801380
return blocks;
13811381
}
13821382

1383-
private string ByteArrayToString(byte[] byteArray)
1383+
private string ByteArrayToCode(byte[] byteArray)
13841384
{
13851385
var returnSb = new StringBuilder("new byte[] {");
13861386
foreach (var b in byteArray)

SharpLoader/Program.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Globalization;
55
using System.IO;
66
using System.Linq;
7+
using System.Security.Cryptography;
78
using System.Text;
89
using SharpLoader.Core;
910

@@ -344,6 +345,12 @@ public static void Main(string[] args)
344345
Process.Start(outputName);
345346
}
346347

348+
var outputBytes = File.ReadAllBytes(outputName);
349+
var hash = MD5.Create().ComputeHash(outputBytes);
350+
351+
Console.ForegroundColor = ConsoleColor.Yellow;
352+
Console.WriteLine($"-=: MD5 : {ByteArrayToString(hash)}");
353+
347354
Console.ForegroundColor = ConsoleColor.Green;
348355
Console.Write($"-=: DONE [{outputName}] (press any key to exit)");
349356
Console.ReadKey();
@@ -367,5 +374,18 @@ private static IEnumerable<string> GetFilesFromDirectory(string directory)
367374

368375
return returnList;
369376
}
377+
378+
private static string ByteArrayToString(byte[] bytes)
379+
{
380+
var returnSb = new StringBuilder();
381+
382+
foreach (var b in bytes)
383+
{
384+
var hex = b.ToString("X");
385+
returnSb.Append(hex.Length < 2 ? '0' + hex : hex);
386+
}
387+
388+
return returnSb.ToString();
389+
}
370390
}
371391
}

0 commit comments

Comments
 (0)