コード例 #1
0
ファイル: Program.cs プロジェクト: trananh1992/ABeko
        /// <summary>
        /// Defines the entry point of this application.
        /// </summary>
        /// <param name="Arguments">The CLI arguments.</param>
        private static async Task Main(string[] Arguments)
        {
            var EngineConfig = new BekoConfig
            {
                Process         = Process.GetCurrentProcess(),
                MemoryHandler   = new NativeMemoryHandler(),
                RequestsHandler = new NativeRequestsHandler()
            };

            // ..

            try
            {
                Engine = BekoEngine.FromConfiguration(EngineConfig);
            }
            catch (Exception Exception)
            {
                Console.WriteLine("[*] " + Exception.Message.Split('\n')[0]);
            }

            // ..

            if (Engine != null)
            {
                if (Arguments.Length == 0)
                {
                    HelpCommand.Execute(null);
                }

                Console.Write("[*] > ");

                using (Engine)
                {
                    while (true)
                    {
                        var Command = Console.ReadLine();

                        if (!string.IsNullOrEmpty(Command))
                        {
                            if (Command == "dispose" || Command == "exit" || Command == "quit")
                            {
                                break;
                            }

                            CliCommands.TryExecute(Command.Split(' '));
                        }

                        Console.Write("[*] > ");
                    }
                }
            }
            else
            {
                Console.WriteLine("[*] The engine failed to initialize.");
            }

            await Task.Delay(500);
        }
コード例 #2
0
ファイル: ScannerEngine.cs プロジェクト: trananh1992/ABeko
        /// <summary>
        /// Sets the memory engine.
        /// </summary>
        /// <param name="BekoEngine">The memory engine.</param>
        /// <exception cref="System.ArgumentNullException">BekoEngine - BekoEngine is null</exception>
        internal void SetBekoEngine(BekoEngine BekoEngine)
        {
            if (this.IsDisposed)
            {
                throw new ObjectDisposedException(nameof(BekoEngine), "The engine is disposed");
            }

            if (BekoEngine == null)
            {
                throw new ArgumentNullException(nameof(BekoEngine));
            }

            this.BekoEngine = BekoEngine;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: trananh1992/ABeko
        /// <summary>
        /// Defines the entry point of this application.
        /// </summary>
        private static async Task Main()
        {
            var Engine       = (BekoEngine)null;
            var EngineConfig = new BekoConfig
            {
                Process         = Process.GetProcessById(16800),
                MemoryHandler   = new NativeMemoryHandler(),
                RequestsHandler = new NativeRequestsHandler()
            };

            // ..

            try
            {
                Engine = BekoEngine.FromConfiguration(EngineConfig);
            }
            catch (Exception Exception)
            {
                Console.WriteLine("[*] " + Exception.Message.Split('\n')[0]);
            }

            // ..

            if (Engine != null)
            {
                Engine.Disposed += (Sender, Args) =>
                {
                    Console.WriteLine("[*] The engine has been disposed.");
                };

                using (Engine)
                {
                    var Scanner = Engine.ScannerEngine;
                    var Memory  = Engine.MemoryEngine;

                    // Sig-scanning

                    var UWorldSig = new Signature("UWorldSig", Signature: "48-8B-1D-00-00-00-00-48-85-DB-74-3B-41", new SignatureMask("XXX????XXXXXX", AnythingMask: '?', SpecifiedMask: 'X'));
                    Scanner.Signatures.Add(UWorldSig);

                    try
                    {
                        var Regions = Memory.GetMemoryRegions(Region => Region.State == MemoryPageState.MEM_COMMIT);

                        if (Scanner.TrySearchFor(UWorldSig, Regions, out var Result))
                        {
                            if (!Result.IsErrored)
                            {
                                if (Result.IsFound)
                                {
                                    Console.WriteLine("[*] Found the specified signature at 0x" + Result.Address.ToString("X").PadLeft(16, '0') + ".");
                                }
                                else
                                {
                                    Console.WriteLine("[*] Failed to find the '" + Result.Signature.Name + "' signature.");
                                }
                            }
                            else
                            {
                                Console.WriteLine("[*] Sig-scan failed and is errored.");
                            }
                        }
                        else
                        {
                            Console.WriteLine("[*] Failed to sigscan with unknown error.");
                        }
                    }
                    catch (Exception Exception)
                    {
                        Console.WriteLine("[*] " + Exception.GetType().Name + ", " + Exception.Message);
                    }

                    Console.ReadKey(false);
                }
            }
            else
            {
                Console.WriteLine("[*] The engine failed to initialize.");
            }

            await Task.Delay(500);
        }
コード例 #4
0
ファイル: ScannerEngine.cs プロジェクト: trananh1992/ABeko
 /// <summary>
 /// Initializes a new instance of the <see cref="ScannerEngine"/> class.
 /// </summary>
 /// <param name="Memory">The memory engine.</param>
 public ScannerEngine(BekoEngine BekoEngine) : this()
 {
     this.SetBekoEngine(BekoEngine);
 }
コード例 #5
0
ファイル: MemoryEngine.cs プロジェクト: trananh1992/ABeko
 /// <summary>
 /// Initializes a new instance of the <see cref="MemoryEngine"/> class.
 /// </summary>
 /// <param name="BekoEngine">The engine.</param>
 public MemoryEngine(BekoEngine BekoEngine)
 {
     this.SetBekoEngine(BekoEngine);
 }