تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[كود] كود فك تشفير ستريتغ base64 لأي برنامح
#4
PHP كود :
using System;
using System.Text;
using System.IO;
using dnlib.DotNet;
using dnlib.DotNet.Emit;

namespace 
DumpStrings
{
 
   class Program
    
{
 
       static void Main(string[] args)
 
       {
 
           if (args.Length == 0)
 
           {
 
               Console.WriteLine("args not found");
 
               Console.ReadKey();
 
               return;
 
           }
 
           else
            
{
 
               try
                
{
 
                   // Last args part is our path, maybe I'll add some - options in future...
 
                   var ExePath args[args.Length 1];
 
                   if (!File.Exists(ExePath))
 
                   {
 
                       Console.WriteLine("File doesn't exist!\nPath => {0}"ExePath);
 
                       return;
 
                   }

 
                   string OutputPath ExePath.Substring(0ExePath.Length 4) + ".txt";

 
                   if (File.Exists(OutputPath))
 
                       File.Delete(OutputPath);

 
                   var UTFEncoder = new UTF8Encoding(true);

 
                   using (FileStream fs File.Create(OutputPath))
 
                   {
 
                       ModuleDefMD Module ModuleDefMD.Load(ExePath);

 
                       foreach (TypeDef Type in Module.GetTypes())
 
                       {
 
                           foreach (MethodDef Method in Type.Methods)
 
                           {
 
                               if (!Method.HasBody)
 
                                   continue;

 
                               foreach (Instruction Instr in Method.Body.Instructions)
 
                               {
 
                                   if (Instr.OpCode == OpCodes.Ldstr)
 
                                   {
 
                                       // (string)Instr.Operand <= this holds string "value"
 
                                       //var String = "[{Type.Name}.{Method.Name}] {(string)Instr.Operand}{Environment.NewLine}";
 
                                       var String "[" Type.Name "." Method.Name "] " + (string)Instr.Operand Environment.NewLine;
 
                                       string ch Base64Decode((string)Instr.Operand);
 
                                       if (ch != null)
 
                                       {
 
                                           String += "Decode Base64: " + (string)Instr.Operand Environment.NewLine;
 
                                           String += ch Environment.NewLine Environment.NewLine;
 
                                       }
 
                                       //Console.WriteLine("[{0}.{1}] {2}{3}", Type.Name, Method.Name, (string)Instr.Operand, Environment.NewLine);
 
                                       Console.WriteLine(String);

 
                                       byte[] Bytes UTFEncoder.GetBytes(String);
 
                                       fs.Write(Bytes0Bytes.Length);
 
                                   }
 
                               }
 
                           }
 
                       }
 
                   }
 
               }
 
               catch (Exception ex)
 
               {
 
                   Console.WriteLine("Exception: {0}"ex.Message);
 
                   Console.ReadKey();
 
               }
 
           }
 
       }

 
       public static string Base64Decode(string base64EncodedData)
 
       {
 
           try
            
{
 
               foreach (char c in base64EncodedData)
 
                   if (!"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+= ".Trim().Contains(c.ToString())) return null;
 
               var base64EncodedBytes System.Convert.FromBase64String(base64EncodedData);
 
               return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
 
           }
 
           catch (Exception ex) { return null; }
 
       }

 
   }

الرد }}}
تم الشكر بواسطة: Cracker Egy


الردود في هذا الموضوع
RE: كود فك تشفير ستريتغ base64 لأي برنامح - بواسطة a.ahmed - 18-10-17, 05:37 PM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] تشفير ملف قاعدة بيانات اكسس ! منه 2 1,841 16-05-20, 09:56 PM
آخر رد: khodor1985
  [C#.NET] تشفير اتصال HTTP على C# mokkaa 7 3,207 03-02-20, 10:57 PM
آخر رد: mokkaa
  فكره عمل برنامج تشفير بسيط maxruined 6 4,075 24-09-19, 01:31 PM
آخر رد: maxruined
  [سؤال] من يعرف برنامج تشفير قوي مدفوع عبد الله 6 3,720 02-11-18, 11:17 PM
آخر رد: Eng27
  طلب تشفير ملف exe الخاص ببرنامج ما Darel 2 2,959 21-02-17, 01:33 AM
آخر رد: Darel

التنقل السريع :


يقوم بقرائة الموضوع: