Beispiel #1
0
#pragma warning disable IDE0060 // Remove unused parameter
        public void Run(RemoteHooking.IContext context, string channelName)
#pragma warning restore IDE0060 // Remove unused parameter
        {
            var mod    = Process.GetCurrentProcess().MainModule;
            var reader = new MemoryReader(mod.BaseAddress,
                                          mod.ModuleMemorySize);

            foreach (var scanner in _scanners)
            {
                var name = scanner.GetType().Name;

                _channel.LogBasic("Running {0}...", name);

                try
                {
                    scanner.Run(reader, _channel);
                }
                catch (Exception e)
                {
                    _channel.LogError("Exception in {0}:", name);
                    _channel.LogError(e.ToString());
                }
            }

            _channel.Done();
        }
Beispiel #2
0
        public void Run(MemoryReader reader, IpcChannel channel)
        {
            var o = reader.FindOffset(_pattern).Cast <int?>().FirstOrDefault();

            if (o == null)
            {
                channel.LogError("Could not find data center decryption function");
                return;
            }

            var off = (int)o + _pattern.Length;

            using var disasm = new Disassembler(reader.ToAbsolute(off), reader.Length - off,
                                                ArchitectureMode.x86_32, (ulong)reader.Address, true);

            var key = ReadKey(disasm);

            if (key != null)
            {
                channel.LogBasic("Found data center key: {0}", StringizeKey(key));

                channel.WriteDataCenterKey(key);
            }
            else
            {
                channel.LogError("Could not find data center key");
            }

            var iv = ReadKey(disasm);

            if (iv != null)
            {
                channel.LogBasic("Found data center IV: {0}", StringizeKey(iv));

                channel.WriteDataCenterIV(iv);
            }
            else
            {
                channel.LogError("Could not find data center IV");
            }
        }
Beispiel #3
0
        public void Run(MemoryReader reader, IpcChannel channel)
        {
            var o1 = reader.FindOffset(_pattern1).Cast <int?>().FirstOrDefault();
            var o2 = reader.FindOffset(_pattern2).Cast <int?>().FirstOrDefault();

            if (o1 == null || o2 == null)
            {
                channel.LogError("Could not find version reporting function");
                return;
            }

            var ver1 = ReadVersion(reader, (int)o1 + 5);
            var ver2 = ReadVersion(reader, (int)o2 + 6);

            if (ver1 == null || ver2 == null)
            {
                channel.LogError("Could not read version values");
                return;
            }

            channel.LogBasic("Found client versions: {0}, {1}", ver1, ver2);

            channel.WriteVersions((uint)ver1, (uint)ver2);
        }
Beispiel #4
0
        public unsafe void Run(MemoryReader reader, IpcChannel channel)
        {
            var o = reader.FindOffset(_patterns).Cast <int?>().FirstOrDefault();

            if (o == null)
            {
                channel.LogError("Could not find game message name function");
                return;
            }

            var func = reader.GetDelegate <GetMessageNameFunc>((int)o);
            var arr  = Enumerable.Range(0, ushort.MaxValue).Select(x => Tuple.Create((ushort)x,
                                                                                     Marshal.PtrToStringAnsi(func(x)))).Where(x => x.Item2 != string.Empty).ToArray();

            channel.LogBasic("Found {0} game messages", arr.Length);

            channel.WriteGameMessages(arr);
        }
Beispiel #5
0
        public void Run(MemoryReader reader, IpcChannel channel)
        {
            var o = reader.FindOffset(_pattern).Cast <int?>().FirstOrDefault();

            if (o == null)
            {
                channel.LogError("Could not find system message table");
                return;
            }

            var count = reader.Read <uint>((int)o + _pattern.TakeWhile(x => x != null).Count());
            var func  = reader.GetDelegate <GetMessageNameFunc>((int)o);
            var arr   = Enumerable.Range(0, (int)count).Select(x => (ushort)x).Select(
                x => Tuple.Create(x, Marshal.PtrToStringUni(func(x)))).ToArray();

            channel.LogBasic("Found {0} system messages", arr.Length);

            channel.WriteSystemMessages(arr);
        }