コード例 #1
0
        public static State ReadState()
        {
            var processes = Process.GetProcessesByName("dungeons of dredmor");

            if (processes.Length == 0)
            {
                return(null);
            }

            using (var memory = new ProcessMemory())
            {
                if (memory.Open(processes[0]) == false)
                {
                    return(null);
                }

                if (memory.MainModuleAddress != 0x00400000)
                {
                    throw new InvalidOperationException("main module address is not 0x00400000 (ASLR is on?)");
                }

                var state = new State();

                var playerAddress = memory.ReadU32(PlayerAddress);
                state.Player = playerAddress == 0 ?
                               null : Player.Read(memory, playerAddress);

                var levelAddress = memory.ReadU32(LevelAddress);
                state.CurrentLevel = levelAddress == 0 ?
                                     null : Level.Read(memory, levelAddress);

                return(state);
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: DiamondMiner88/AmongUsCheat
        public static bool Init()
        {
            bool state = mem.OpenProcess("Among Us");

            if (state)
            {
                Methods.Init();
                Process proc = Process.GetProcessesByName("Among Us")[0];
                ProcessMemory = new ProcessMemory(proc);
                ProcessMemory.Open(ProcessAccess.AllAccess);
            }
            return(state);
        }
コード例 #3
0
ファイル: MemoryData.cs プロジェクト: drey027/AmongUsHack
        static bool OpenProcess(string processName)
        {
            var state = mem.OpenProcess(processName);

            if (state)
            {
                Process proc = Process.GetProcessesByName(processName)[0];
                process       = proc;
                ProcessMemory = new ProcessMemory(proc);
                ProcessMemory.Open(ProcessAccess.AllAccess);
                return(true);
            }

            return(false);
        }
コード例 #4
0
 static void Main(string[] args)
 {
     while (true)
     {
         Console.WriteLine("Enter process name:");
         var processName = Console.ReadLine();
         if (processName == "exit" || processName == "q")
         {
             break;
         }
         var process = Process.GetProcessesByName(processName).FirstOrDefault();
         if (process == null)
         {
             Console.WriteLine("Process not found.");
             continue;
         }
         using (var procmem = new ProcessMemory(process))
         {
             procmem.Open();
             Console.WriteLine(procmem.GetCommandLine());
         }
     }
 }