Forum > Coding >

how to fix code??

Posts: 1

Threads: 1

Joined: Apr, 2023

Reputation: 0

Posted

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;

namespace fcker
{
    class Program
    {
        [Flags]
        public enum ProcessAccessFlags : uint
        {
            All = 0x001F0FFF,
            Terminate = 0x00000001,
            CreateThread = 0x00000002,
            VirtualMemoryOperation = 0x00000008,
            VirtualMemoryRead = 0x00000010,
            VirtualMemoryWrite = 0x00000020,
            DuplicateHandle = 0x00000040,
            CreateProcess = 0x000000080,
            SetQuota = 0x00000100,
            SetInformation = 0x00000200,
            QueryInformation = 0x00000400,
            Synchronize = 0x00100000
        }

        [Flags]
        public enum AllocationType
        {
            Commit = 0x1000,
            Reserve = 0x2000,
            Decommit = 0x4000,
            Release = 0x8000,
            Reset = 0x80000,
            Physical = 0x400000,
            TopDown = 0x100000,
            WriteWatch = 0x200000,
            LargePages = 0x20000000
        }

        [Flags]
        public enum MemoryProtection
        {
            Execute = 0x10,
            ExecuteRead = 0x20,
            ExecuteReadWrite = 0x40,
            ExecuteWriteCopy = 0x80,
            NoAccess = 0x01,
            ReadOnly = 0x02,
            ReadWrite = 0x04,
            WriteCopy = 0x08,
            GuardModifierflag = 0x100,
            NoCacheModifierflag = 0x200,
            WriteCombineModifierflag = 0x400
        }
        static void Main(string[] args)
        {
            try
            {
                string processName = "RobloxPlayerBeta";
                string codeToInject = "print(\"Hello, world!\")";
                Process[] processes = Process.GetProcessesByName(processName);
                if (processes.Length == 0) return;
                Process robloxProcess = processes[0];
                IntPtr processHandle = OpenProcess(ProcessAccessFlags.All, false, robloxProcess.Id);
                IntPtr remoteMemory = VirtualAllocEx(processHandle, IntPtr.Zero, (uint)codeToInject.Length + 1, AllocationType.Commit, MemoryProtection.ExecuteReadWrite);
                byte[] bytesToInject = Encoding.ASCII.GetBytes(codeToInject);
                WriteProcessMemory(processHandle, remoteMemory, bytesToInject, (uint)bytesToInject.Length, out IntPtr bytesWritten);
                IntPtr loadLibraryAddress = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
                CreateRemoteThread(processHandle, IntPtr.Zero, 0, loadLibraryAddress, remoteMemory, 0, IntPtr.Zero);
                Console.WriteLine("Wstrzyknięto kod do procesu Roblox.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Wystąpił błąd: " + ex.Message);
            }
        }

        [DllImport("kernel32.dll")]
        static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, bool bInheritHandle, int dwProcessId);

        [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
        static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, AllocationType flAllocationType, MemoryProtection flProtect);

        [DllImport("kernel32.dll", SetLastError = true)]
        static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out IntPtr lpNumberOfBytesWritten);

        [DllImport("kernel32.dll", SetLastError = true)]
        static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);

        [DllImport("kernel32.dll", SetLastError = true)]
        static extern IntPtr GetModuleHandle(string lpModuleName);

        [DllImport("kernel32.dll")]
        static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr lpThreadAttribute, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
    }
}

game not crashing, but when i saw roblox logs there was no trace of print command execution

  • 0

SeizureSalad

i love femboys

Posts: 1012

Threads: 73

Joined: Mar, 2021

Reputation: 37

Replied

what the HELL are you doing

  • 0

"Questionable intellegence, but I like the mystery" - CubeFaces

https://cdn.discordapp.com/attachments/1136067487847415848/1138948596679589898/sig.png

Posts: 1

Threads: 0

Joined: Apr, 2023

Reputation: 0

Replied

I am not clear about it. It's hard for me to follow. Anyway, I can access avatar game with one click.

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )