Hack Forums
[C#] c# modify string in compiled c# - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] c# modify string in compiled c# (/showthread.php?tid=6144387)



c# modify string in compiled c# - mayar2021 - Mar 13, 2021

hello
i want to ask how to modify string in compiled c#,
i donot like CODEDOM as it has limited functions!
if i compile c# application , how to make another application that change string in the first application?
looks like the stub in crypter?


RE: c# modify string in compiled c# - Exalted - Mar 13, 2021

I would gladly explain the whole process, but I'll link you to this video instead, it's an easy to follow guide (Made for HF even):




RE: c# modify string in compiled c# - mayar2021 - Mar 13, 2021

is that valid for big projects?
my program has big methods functions
thanks again sir for your response


RE: c# modify string in compiled c# - Exalted - Mar 13, 2021

(Mar 13, 2021 07:53 AM)mayar2021 Wrote:  is that valid for big projects?
my program has big methods functions
thanks again sir for your response

It's very basic but will put you in the right direction, here's an example using resources, and here's a keylogger repo that contains a stub/builder.


RE: c# modify string in compiled c# - mayar2021 - Mar 13, 2021

when i tried that video" [C#] Creating a stub & builder - Frosty"
i get the error
drive[WARNING POSSIBLY INFECTED]google.com/u/0/uc?id=1aeU3uqM0lUDC90vCy0Wp3z1vNWQfB8oe&export=download

when i tried that video" [C#] Creating a stub & builder - Frosty"
i get theerror
[img]drive[WARNING POSSIBLY INFECTED]google.com/u/0/uc?id=1aeU3uqM0lUDC90vCy0Wp3z1vNWQfB8oe&export=download[/img]


RE: c# modify string in compiled c# - Exalted - Mar 13, 2021

(Mar 13, 2021 09:33 AM)mayar2021 Wrote:  when i tried that video" [C#] Creating a stub & builder - Frosty"
  i get theerror
drive[WARNING POSSIBLY INFECTED]google.com/u/0/uc?id=1aeU3uqM0lUDC90vCy0Wp3z1vNWQfB8oe&export=download

when i tried that video" [C#] Creating a stub & builder - Frosty"
i get theerror
[img]drive[WARNING POSSIBLY INFECTED]google.com/u/0/uc?id=1aeU3uqM0lUDC90vCy0Wp3z1vNWQfB8oe&export=download[/img]

I'll help you out some more:

Builder/Builder.csproj

Code
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net48</TargetFramework>
        <LangVersion>latest</LangVersion>
    </PropertyGroup>

</Project>

Builder/Program.cs

Code
using System.IO;

namespace Builder
{
    internal static class Program
    {
        private static void Main()
        {
            using var fileStream = new FileStream("Stub.exe", FileMode.Open, FileAccess.ReadWrite, FileShare.None);
            using var binaryWriter = new BinaryWriter(fileStream);
            fileStream.Position = fileStream.Length + 1;
            binaryWriter.Write("***Hello, World");
        }
    }
}

Stub/Stub.csproj

Code
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net48</TargetFramework>
        <LangVersion>latest</LangVersion>
    </PropertyGroup>

    <ItemGroup>
      <ProjectReference Include="..\Builder\Builder.csproj" />
    </ItemGroup>

</Project>

Stub/Program.cs

Code
using System;
using System.IO;
using System.Text;

namespace Stub
{
    internal static class Program
    {
        private static void Main()
        {
            using var streamReader = new StreamReader(System.Reflection.Assembly.GetEntryAssembly()?.Location ?? throw new InvalidOperationException());
            using var binaryReader = new BinaryReader(streamReader.BaseStream);
            var stubBytes = binaryReader.ReadBytes(Convert.ToInt32(streamReader.BaseStream.Length));
            var stubSettings = Encoding.ASCII.GetString(stubBytes)
                .Substring(Encoding.ASCII.GetString(stubBytes).IndexOf("***", StringComparison.Ordinal)).Replace("***", "");
            Console.WriteLine(stubSettings);
            Console.ReadLine();
        }
    }
}



RE: c# modify string in compiled c# - StarZ - Mar 14, 2021

https://hackforums.net/showthread.php?tid=5904533

Got a few examples here.


RE: c# modify string in compiled c# - sniper coder - Mar 14, 2021

you are fantastic coder , good example