Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace UIDump
- {
- internal enum UIFrame
- {
- UIBase = 0xAD742C,
- Visible = 0x64,
- Name = 0x1C,
- Enabled = 0x200,
- FirstFrame = 0xCE4,
- NextFrame = 0xCDC
- }
- internal class Program
- {
- private static ExternalProcessReader _mem;
- public static List<Frame> GetFrames
- {
- get
- {
- List<Frame> result = new List<Frame>();
- IntPtr Base = _mem.Read<IntPtr>(_mem.Process.MainModule.BaseAddress + (int) UIFrame.UIBase);
- IntPtr currentFrame = _mem.Read<IntPtr>(Base + (int) UIFrame.FirstFrame);
- while (currentFrame != (IntPtr) 0)
- {
- result.Add(new Frame(currentFrame));
- currentFrame = _mem.Read<IntPtr>(currentFrame + _mem.Read<int>(Base + (int) UIFrame.NextFrame) + 4);
- }
- return result;
- }
- }
- public static Frame GetFrameByName(String frameName)
- {
- return GetFrames.FirstOrDefault(f => f.Name == frameName);
- }
- private static void Main()
- {
- Int32 totalFrames = 0;
- Int32 totalVisibleFrames = 0;
- _mem = new ExternalProcessReader(Process.GetProcessesByName("Wow")[0]);
- foreach (Frame f in GetFrames)
- {
- if (f.IsVisible)
- totalVisibleFrames++;
- if (f.Name.Length > 0 && f.Name.Contains("MicroButton"))
- {
- Console.WriteLine("Frame 0x" + f.BaseAddress.ToString("X") + " Name : " + f.Name + " Enabled : " +
- f.IsEnabled);
- }
- totalFrames++;
- }
- Console.WriteLine("Total frames : " + totalFrames);
- Console.WriteLine("Total visible frames : " + totalVisibleFrames);
- Console.ReadLine();
- }
- public class Frame
- {
- public IntPtr BaseAddress;
- public Frame(IntPtr baseAddress)
- {
- BaseAddress = baseAddress;
- }
- public Boolean IsVisible
- {
- get { return ((_mem.Read<int>(BaseAddress + (int) UIFrame.Visible) >> 0x1a & 1) == 1); }
- }
- public bool IsEnabled
- {
- get { return (_mem.Read<int>(BaseAddress + (int)UIFrame.Enabled) & 15) == 1; }
- }
- public String Name
- {
- get
- {
- var t = _mem.Read<IntPtr>(BaseAddress + (int) UIFrame.Name);
- return (int) t > 0 ? _mem.ReadString(t, Encoding.ASCII, 255) : "";
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment