FindPattern() public method

FindPattern Attempts to locate the given pattern inside the dumped memory region compared against the given mask. If the pattern is found, the offset is added to the located address and returned to the user.
public FindPattern ( byte btPattern, string strMask, int nOffset ) : IntPtr
btPattern byte Byte pattern to look for in the dumped region.
strMask string The mask string to compare against.
nOffset int The offset added to the result address.
return System.IntPtr
Ejemplo n.º 1
0
        private void Refresh(object sender, RoutedEventArgs e)
        {
            var ThePs = Process.GetProcessesByName("ffxiv");

            foreach (var process in ThePs)
            {
                var    hProc           = process.Handle;
                var    sigScam         = new SigScan(process, process.MainModule.BaseAddress + 0xFB9000, 0x14B000);
                byte[] playerStructSig = { 0x46, 0x69, 0x72, 0x65, 0x20, 0x53, 0x68, 0x61, 0x72, 0x64, 0x02, 0x13, 0x02, 0xEC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 };
                var    NamePtr         = sigScam.FindPattern(playerStructSig, "xxxxxxxxxxxxxxxxxxxx", -(int)process.MainModule.BaseAddress) - 0xC26;
                playerName =
                    Encoding.ASCII.GetString(_mapper.ReadMemory(
                                                 hProc, process.MainModule.BaseAddress + (int)NamePtr, 21).TakeWhile(p => p != 0).ToArray());

                var newimg = (ImageSource)CreateBitmapSourceFromBitmap(Properties.Resources.ffxiv);
                ProcessListBox.Items.Add(new ListImg(string.Format("{0}\nPID - {1}", playerName, process.Id), newimg));
            }

            foreach (var file in Directory.EnumerateFiles(Directory.GetCurrentDirectory()).Where(file => file.EndsWith(".dll")))
            {
                PluginsBox.Items.Add(new string(file.Skip(Directory.GetCurrentDirectory().Length + 1).ToArray()).Replace(".dll", ""));
            }
            PluginsBox.SelectedIndex     = 0;
            ProcessListBox.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        private void Refresh(object sender, RoutedEventArgs e)
        {
            if (ProcessListBox != null && ProcessListBox.Items.Count > 0)
            {
                ProcessListBox.SelectionChanged -= ProcessListBox_OnSelectionChanged;
                ProcessListBox.Items.Clear();
                ProcessListBox.SelectionChanged += ProcessListBox_OnSelectionChanged;
            }
            _pidMenu = true;
            if (DebugButton != null)
                DebugButton.Visibility = Visibility.Hidden;

            var ThePs = Process.GetProcessesByName("ffxiv");
            foreach (var process in ThePs)
            {
                var hProc = process.Handle;
                var sigScam = new SigScan(process, process.MainModule.BaseAddress + 0xFB9000, 0x14B000);
                byte[] playerStructSig = { 0x46, 0x69, 0x72, 0x65, 0x20, 0x53, 0x68, 0x61, 0x72, 0x64, 0x02, 0x13, 0x02, 0xEC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 };
                var NamePtr = sigScam.FindPattern(playerStructSig, "xxxxxxxxxxxxxxxxxxxx", -(int)process.MainModule.BaseAddress) - 0xC26;
                playerName =
                    Encoding.ASCII.GetString(_mapper.ReadMemory(
                        hProc, process.MainModule.BaseAddress + (int)NamePtr, 21).TakeWhile(p => p != 0).ToArray());

                var newimg = (ImageSource)CreateBitmapSourceFromBitmap(Properties.Resources.ffxiv);
                ProcessListBox.Items.Add(new ListImg(string.Format("{0}\nPID - {1}", playerName, process.Id), newimg));
            }
        }