thanks:apoc,blackmagic,blackrain.etc....Code:public static WoWState GetWoWState(int Processid, int AccountID) { WoWState ret = new WoWState(); try { Process tmp = Process.GetProcessById(Processid); if (tmp.HasExited) { return ret; } } catch { return ret; } if (iHook.Apply(Processid)) { ret.AccountID = AccountID; uint CurMgrPtr = iHook.Wow.ReadRelative<uint>(new uint[] { 0x980558, 0x463c }); uint FirstObject = iHook.Wow.Read<uint>(new uint[] { CurMgrPtr + 0xb4 }); ret.LocalPlayerGuid = iHook.Wow.Read<ulong>(new uint[] { CurMgrPtr + 0xb8 }); uint num9; int num = (int)0x30;//30 Guid,objGuid,ObjectGuid_Offset int num2 = (int)0x14;//14 WoWObjectType Type int num3 = (int)0x3c;//3c nextObject int num4 = Math.Min(Math.Min(num, num2), num3); byte[] bytes = new byte[(Math.Max(Math.Max(num, num2), num3) - num4) + 4]; num -= num4; num2 -= num4; num3 -= num4; uint MeBaseAddress = 1; for (uint i = iHook.Wow.Read<uint>(new uint[] { CurMgrPtr + 0xb4 }); (i != 0) && ((i & 1) == 0); i = num9) { iHook.Wow.ReadBytes(i + ((uint)num4), bytes); ulong key = BitConverter.ToUInt64(bytes, num); if ((key == ret.LocalPlayerGuid)) { MeBaseAddress = i; } num9 = BitConverter.ToUInt32(bytes, num3); if (num9 == i) { break; } } /* iHook.DoString("CardTime=GetBillingTimeRemaining()"); iHook.DoString("Level=UnitLevel('player')"); iHook.DoString("Name=UnitName('player')"); iHook.DoString("Class=UnitClass('player')"); iHook.DoString("XP=UnitXP('player')"); iHook.DoString("Stat=UnitStat('player')"); iHook.DoString("Buff=UnitBuff('player')"); iHook.DoString("DeBuff=UnitDebuff('player')"); iHook.DoString("Damage=UnitDamage('player')"); iHook.DoString("CharacterPoints=UnitCharacterPoints('player')"); iHook.DoString("Armor=UnitArmor('player')"); iHook.DoString("Race=UnitRace('player')"); iHook.DoString("Money=GetMoney()"); iHook.DoString("RealmName=GetRealmName()"); iHook.DoString("pguid=UnitGUID('player')"); iHook.DoString("PlayerInfo=UnitGUID(GetPlayerInfoByGUID('player')"); iHook.DoString("ZoneText=GetZoneText()"); iHook.DoString("RealZoneText=GetRealZoneText()"); iHook.DoString("SubZoneText=GetSubZoneText()"); // string Level = iHook.GetLocalizedText("Level", MeBaseAddress); string Name = iHook.GetLocalizedText("Name", MeBaseAddress); string Classs = iHook.GetLocalizedText("Class", MeBaseAddress); string XP = iHook.GetLocalizedText("XP", MeBaseAddress); string Race = iHook.GetLocalizedText("Race", MeBaseAddress); string Money = iHook.GetLocalizedText("Money", MeBaseAddress); string RealmName = iHook.GetLocalizedText("RealmName", MeBaseAddress); string CardTime = iHook.GetLocalizedText("CardTime", MeBaseAddress); string ZoneText = iHook.GetLocalizedText("ZoneText", MeBaseAddress); string RealZoneText = iHook.GetLocalizedText("RealZoneText", MeBaseAddress); string SubZoneText = iHook.GetLocalizedText("SubZoneText", MeBaseAddress); */ /* //种族 BloodElf=10,血精灵 Broken=14, Draenei=11,德来尼 Dwarf=3,矮人 FelOrc=12,兽人 Gnome=7,侏儒 Goblin=9,地精 Human=1,人类 Naga=13,娜迦 NightElf=4,暗夜精灵 Orc=2,兽人 Skeleton=15, Tauren=6,牛头人 Troll=8,巨魔 Undead=5,亡灵 Worgen=22狼人 //职业 DeathKnight=6,死骑 Druid=11,德鲁伊 Hunter=3,猎人 Mage=8,法师 None=0, Paladin=2,圣骑 Priest=5,牧师 Rogue=4,盗贼 Shaman=7,沙曼 Warlock=9,术士 Warrior=1 战士 //能量槽类型 Eclipse = 8,小德日月食槽 Energy = 3,盗贼猎力能量槽 Focus = 2, Happiness = 4,宠物 Health = -2,所有人血槽 Holy Power = 9,圣骑神圣能量 Mana = 0,牧师,法师,术士魔法槽 Rage = 1,战士怒气 Runes = 5,死骑符文 Runic Power = 6,死骑符文之 Soul Shards = 7,术士灵魂碎片 Unknown = 10 */ string AccountString = iHook.Wow.ReadRelative<string>(new uint[] { 0xA7D298 }); string[] AccountArray = AccountString.Split('#'); ret.AccountIndex = "1"; if (AccountArray.Length == 2) { ret.AccountIndex = AccountArray[1]; } ret.Level = iHook.GetStorageField<uint>(0x30, MeBaseAddress).ToString(); ret.MapId = iHook.Wow.ReadRelative<uint>(new uint[] { 0xA98D68 }).ToString(); ret.MinimapZoneText = iHook.Wow.ReadRelative<string>(new uint[] { 0xA98C54, 0 }); ret.RealZoneText = iHook.Wow.ReadRelative<string>(new uint[] { 0xA98C5C, 0 }); ret.SubZoneText = iHook.Wow.ReadRelative<string>(new uint[] { 0xA98C58, 0 }); ret.ZoneId = iHook.Wow.ReadRelative<uint>(new uint[] { 0xA98CE4 }).ToString(); ret.ZoneText = iHook.Wow.ReadRelative<string>(new uint[] { 0xA98C5C, 0 }); byte[] Bytes0 = BitConverter.GetBytes(iHook.GetStorageField<uint>(0x19, MeBaseAddress)); byte[] Bytes1 = BitConverter.GetBytes(iHook.GetStorageField<uint>(0x44, MeBaseAddress)); byte[] Bytes2 = BitConverter.GetBytes(iHook.GetStorageField<uint>(0x75, MeBaseAddress)); ret.Money = iHook.GetStorageField<ulong>(0x49C, MeBaseAddress).ToString(); ret.Race = Bytes0[0].ToString(); ret.Class = Bytes0[1].ToString(); ret.Sex = Bytes0[2].ToString();//0为公,1为母 ret.PowerType = Bytes0[3].ToString(); ret.MaxHp = iHook.GetStorageField<uint>(0x20, MeBaseAddress).ToString(); ret.CurrentHp = iHook.GetStorageField<uint>(0x1a, MeBaseAddress).ToString(); ret.CurrentXp = iHook.GetStorageField<uint>(0x274, MeBaseAddress).ToString(); ret.NextLevelExperience = iHook.GetStorageField<uint>(0x275, MeBaseAddress).ToString(); ret.Locationx = iHook.Wow.Read<float>(new uint[] { MeBaseAddress + 0x780 + 0x10 }).ToString(); ret.Locationy = iHook.Wow.Read<float>(new uint[] { MeBaseAddress + 0x780 + 0x10 + 0x4 }).ToString(); ret.Locationz = iHook.Wow.Read<float>(new uint[] { MeBaseAddress + 0x780 + 0x10 + 0x4 + 0x4 }).ToString(); BitVector32 PlayerFlags = iHook.GetStorageField<BitVector32>(0x94, MeBaseAddress); ret.IsGhost = PlayerFlags[0x10]; ret.IsGroupLeader = PlayerFlags[0x1]; ret.IsResting = PlayerFlags[0x20]; ret.GameStateNow = iHook.Wow.ReadRelative<byte>(new uint[] { 0xA98C66 }); ret.IsInGame = ret.GameStateNow != 0; ret.PlayerName = iHook.Wow.ReadRelative<string>(new uint[] { 0x980598 }); /* public enum MoveFlags : uint { Ascending = 0x200000, Backward = 2, CanFly = 0x800000, Descending = 0x400000, Falling = 0x800, FallingFar = 0x1000, FallMask = 0x1800, Flying = 0x1000000, Forward = 1, Hover = 0x20000000, Left = 0x10, Levitating = 0x200, MotionMask = 0xff, MoveMask = 0x3f, None = 0, PendingBackward = 0x10000, PendingForward = 0x8000, PendingRoot = 0x80000, PendingStop = 0x2000, PendingStrafeLeft = 0x20000, PendingStrafeRight = 0x40000, PendingStrafeStop = 0x4000, PitchDown = 0x80, PitchMask = 0xc0, PitchUp = 0x40, PlayerFlag = 0x80000000, Right = 0x20, Root = 0x400, SafeFall = 0x10000000, SplineElevation = 0x2000000, SplineEnabled = 0x4000000, StoppedMask = 0x3100f, StrafeLeft = 4, StrafeMask = 12, StrafeRight = 8, Swimming = 0x100000, TurnMask = 0x30, Walk = 0x100, WaterWalking = 0x8000000 } */ string MovementInfoFlag1 = iHook.Wow.Read<uint>(new uint[] { MeBaseAddress + 0x780 + 0x44 }).ToString(); string MovementInfoFlag2 = iHook.Wow.Read<uint>(new uint[] { MeBaseAddress + 0x780 + 0x48 }).ToString(); //骑的怪物 ret.MountID = iHook.Wow.Read<uint>(new uint[] { MeBaseAddress + 0x3f }).ToString(); //是否战斗中等标识 uint Flags = iHook.Wow.Read<uint>(new uint[] { MeBaseAddress + 0x35 }); ret.IsCombat = (Flags & 0x80000) == 0; uint Flags2 = iHook.Wow.Read<uint>(new uint[] { MeBaseAddress + 0x36 }); ret.PlayCardTime = 0; return ret; } else { return ret; } }