public static void PrintSignatures() { foreach (Signature s in Signatures.SignatureList) { Frame.Log("Name: " + s.Name + " Offset: " + s.GetOffset.ToString("X")); } }
public void ListSpells() { try { Frame.Log("Spellname: " + SpellQ.Name); } catch (Exception ex) { Frame.Log(ex.ToString()); } }
public void LogObjects() { Frame.Log(" .... "); foreach (LOLObject obj in Frame.Client.GetLOLObjects) { PrintObjDetails(obj); } }
public void LogNearestObjects(int n, ObjectType t = ObjectType.All) { Frame.Log(" .... "); foreach (LOLObject obj in Frame.Client.GetNearestLOLObjects(n, t)) { PrintObjDetails(obj); } }
private unsafe void PrintChatDetour(uint p1, uint p2, uint p3) { //uint font = *(uint*)(Memory.LOLBaseAddress+0x300267C); //char* stringPointer = (char*) Marshal.StringToHGlobalAnsi("hello managed world.").ToPointer(); Frame.Log("p1: " + p1.ToString("X") + " p2: " + p2.ToString("X") + " p3: " + p3.ToString("X")); Memory.GetMagic.Detours["printChat"].CallOriginal(p1, p2, p3); }
public DetourMoveTo() { try { IntPtr moveToPointer = new IntPtr(Memory.LOLBaseAddress + Offsets.MoveTo); MoveToDele = (moveTo)Marshal.GetDelegateForFunctionPointer(moveToPointer, typeof(moveTo)); Memory.GetMagic.Detours.CreateAndApply(MoveToDele, new moveTo(this.MoveToDetour), "moveTo"); } catch (Exception ex) { Frame.Log(ex.ToString()); } }
// void __thiscall sub_C83F00(void *this, int a2, unsigned int a3, int a4, float a5, void *a6) public DetourFloatingText() { try { IntPtr floatingTextPointer = new IntPtr(Memory.LOLBaseAddress + Offsets.FloatingText); FloatingTextDelegate = (FloatingText)Marshal.GetDelegateForFunctionPointer(floatingTextPointer, typeof(FloatingText)); Memory.GetMagic.Detours.CreateAndApply(FloatingTextDelegate, new FloatingText(this.PrintChatDetour), "floatingText"); } catch (Exception ex) { Frame.Log(ex.ToString()); } }
public DetourPrintChat() { try { IntPtr printChatPointer = new IntPtr(Memory.LOLBaseAddress + Offsets.PrintChat); printChatDelegate = (PrintChat)Marshal.GetDelegateForFunctionPointer(printChatPointer, typeof(PrintChat)); Memory.GetMagic.Detours.CreateAndApply(printChatDelegate, new PrintChat(this.PrintChatDetour), "printChat"); } catch (Exception ex) { Frame.Log(ex.ToString()); } }
public DetourCastSpell() { try { CastSpellPointer = Memory.LOLBaseAddress + Offsets.CastSpell; CastSpellDelegate = (CastSpell)Marshal.GetDelegateForFunctionPointer(new IntPtr(CastSpellPointer), typeof(CastSpell)); Memory.GetMagic.Detours.CreateAndApply(CastSpellDelegate, new CastSpell(this.castSpellDetour), "castSpell"); } catch (Exception ex) { Frame.Log(ex.ToString()); } }
public static T ReadStruct <T>(uint Address) where T : struct { try { return((T)Marshal.PtrToStructure(new IntPtr(Address), typeof(T))); } catch (Exception e) { Frame.Log(e.ToString()); return(default(T)); } }
public unsafe void PrintToChat(string text, uint type = 4) { try { using (var s = new StructWrapper <string>(text)){ var chat = (PrintChat)Marshal.GetDelegateForFunctionPointer(new IntPtr(Memory.LOLBaseAddress + Offsets.PrintChat), typeof(PrintChat)); uint printArg = Memory.Read <uint>((Memory.LOLBaseAddress + 0x2FC672C)); chat(printArg, s.Ptr, type); } } catch (Exception ex) { Frame.Log(ex.StackTrace); } }
private byte[] ParseSig(string s) { try { s = s.Substring(1); s = s.Replace("x", "0x"); byte[] data = s.Split('\\').Select(b => Convert.ToByte(b, 16)).ToArray(); return(data); } catch (Exception e) { Frame.Log("ParseSig exception."); } return(new byte[] { }); }
/// <summary> /// 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. /// </summary> /// <param name="btPattern">Byte pattern to look for in the dumped region.</param> /// <param name="strMask">The mask string to compare against.</param> /// <param name="nOffset">The offset added to the result address.</param> /// <returns>IntPtr - zero if not found, address if found.</returns> public IntPtr FindPattern(string sig, string strMask, int nOffset) { try { // Frame.Log("Sig: " + sig); // parse the sig to byte array byte[] btPattern = ParseSig(sig); // Dump the memory region if we have not dumped it yet. if (m_vDumpedRegion == null || m_vDumpedRegion.Length == 0) { if (!DumpMemory()) { Frame.Log("Memory dump failed."); return(IntPtr.Zero); } } // Ensure the mask and pattern lengths match. if (strMask.Length != btPattern.Length) { return(IntPtr.Zero); } // Loop the region and look for the pattern. for (long x = 0; x < m_vDumpedRegion.Length; x++) { if (MaskCheck(x, btPattern, strMask)) { // The pattern was found, return it. return(new IntPtr((int)m_vAddress + (x + nOffset))); } } // Pattern was not found. return(IntPtr.Zero); } catch (Exception ex) { Frame.Log("FindPattern exception."); } return(IntPtr.Zero); }
private unsafe void castSpellDetour(uint param1, uint param2, uint param3, uint param4, uint param5) { try { param1 = *(uint *)(*(uint *)(Memory.LOLBaseAddress + Offsets.LocalPlayer) + Offsets.Champion_SCI); uint spellSlot = *(uint *)(param1 + 0xC); Vector3 targetPos = Memory.ReadStruct <Vector3>(*(uint *)(Memory.LOLBaseAddress + Offsets.LocalPlayer) + Offsets.Position); Frame.Log("p1: " + param1.ToString("X") + " p2: " + param2.ToString("X") + " p3: " + param3.ToString("X") + " p4: " + param4.ToString("X") + " p5: " + param5.ToString("X") + " spellSlot: " + spellSlot); using (var s = new StructWrapper <Vector3>(targetPos)){ Memory.GetMagic.Detours["castSpell"].CallOriginal(param1, s.Ptr, s.Ptr, param4, param5); } } catch (Exception ex) { Frame.Log(ex.ToString()); } }
private unsafe void PopulateLOLObjects() { try { uint firstObj = *(uint *)(Memory.LOLBaseAddress + Offsets.ObjectManager); uint lastObj = *(uint *)(Memory.LOLBaseAddress + Offsets.ObjectManager + 0x4); while (firstObj < lastObj) { var obj = new LOLObject(firstObj); switch (obj.ObjectType) { case ObjectType.Player: obj = new LOLPlayer(firstObj); break; case ObjectType.Minion: obj = new LOLMinion(firstObj); break; case ObjectType.Ward: obj = new LOLWard(firstObj); break; } if (obj.BaseAddress != Me.BaseAddress) { LOLObjectBag.Add(obj); } firstObj += 0x4; } } catch (Exception ex) { Frame.Log(ex.StackTrace); } }
private unsafe void PrintChatDetour(uint p1, uint p2, uint p3, uint p4, uint p5, uint p6) { // uint font = *(uint*)(0x21D4D2C); // draw(FONT,Frame.Client.Me.BaseAddress,10(type?) ,0, ( VALUE ) ,0); // FloatingTextType: // 1 = + YELLOW TEXT // 2 = + GREEN TEXT () // 3 = blue text // 4 = blue text // ... // A = + GOLD // uint font = *(uint *)(0x2404D2C); Frame.Log("Font ptr: " + font.ToString("X")); Frame.Log("p1: " + p1.ToString("X") + " p2: " + p2.ToString("X") + " p3: " + p3.ToString("X") + " p4: " + p4.ToString("X") + " p5: " + p5.ToString("X") + " p6: " + p6.ToString()); Memory.GetMagic.Detours["floatingText"].CallOriginal(p1, p2, p3, p4, p5, p6); }
public LOLPlayer(uint baseAddress, bool rebased = false) : base(baseAddress, rebased) { try { if (!IsDead) { string cooldowns = SpellQ.IsReady ? "0" : "X"; cooldowns += SpellW.IsReady ? "0" : "X"; cooldowns += SpellE.IsReady ? "0" : "X"; cooldowns += SpellR.IsReady ? "0" : "X"; cooldowns += " "; cooldowns += Summoner1.IsReady ? "0" : "X"; cooldowns += Summoner2.IsReady ? "0" : "X"; this.SetD3dDrawString(cooldowns); } else { this.RemoveD3dDrawString(); } } catch (Exception ex) { Frame.Log(ex.ToString()); } }
public void SmiteBuffs() { double smiteDamage = Frame.Client.Me.SmiteDamage; LOLObject buff = null; buff = Frame.Client.GetNearestLOLObjects(3, ObjectType.Minion).FirstOrDefault(s => (s.Name.Equals(StaticEnums.JungleCreeps.Team.Blue.RedBuff) || s.Name.Equals(StaticEnums.JungleCreeps.Team.Blue.BlueBuff) || s.Name.Equals(StaticEnums.JungleCreeps.Team.Red.RedBuff) || s.Name.Equals(StaticEnums.JungleCreeps.Team.Red.BlueBuff) || s.Name.Equals(StaticEnums.JungleCreeps.Team.Neutral.Drake) || s.Name.Equals(StaticEnums.JungleCreeps.Team.Neutral.Baron)) && s.Distance < 760 && s.Health < smiteDamage && !s.IsDead); if (buff != null) { if (HasSmiteSummoner && !Frame.Client.Me.IsDead) { SmiteSummoner.Cast(buff); Frame.Log("Smite casted!"); } } }
/// <summary> /// MaskCheck /// /// Compares the current pattern byte to the current memory dump /// byte to check for a match. Uses wildcards to skip bytes that /// are deemed unneeded in the compares. /// </summary> /// <param name="nOffset">Offset in the dump to start at.</param> /// <param name="btPattern">Pattern to scan for.</param> /// <param name="strMask">Mask to compare against.</param> /// <returns>Boolean depending on if the pattern was found.</returns> private bool MaskCheck(long nOffset, byte[] btPattern, string strMask) { // Loop the pattern and compare to the mask and dump. try { for (int x = 0; x < btPattern.Length; x++) { // If the mask char is a wildcard, just continue. if (strMask[x] == '?') { continue; } if (m_vDumpedRegion.Length <= nOffset - x) { return(false); } // If the mask char is not a wildcard, ensure a match is made in the pattern. if ((strMask[x] == 'x') && (btPattern[x] != m_vDumpedRegion[nOffset + x])) { return(false); } } // The loop was successful so we found the pattern. return(true); } catch (Exception) { Frame.Log("MaskCheck exception."); } return(false); }
// with vec3 player.baseaddress, movetype = 2, vector3, 0, 1, 0 private void MoveToDetour(uint p1, uint p2, uint p3, uint p4, uint p5, uint p6) { Frame.Log("p1: " + p1.ToString("X") + " p2: " + p2.ToString("X") + " p3: " + p3.ToString("X") + " p4: " + p4.ToString("X") + " p5: " + p5.ToString("X") + " p6: " + p6.ToString("X")); Memory.GetMagic.Detours["moveTo"].CallOriginal(p1, p2, p3, p4, p5, p6); }
public void PrintObjDetails(LOLObject obj) { Frame.Log("Name: " + obj.Name + " Address: " + obj.BaseAddress.ToString("X") + " Type: " + obj.ObjectType.ToString() + " Dist: " + obj.Distance + " ObjectTypeInt: " + obj.ObjectTypeInt + " IsDead: " + obj.IsDead + " IsEnemy: " + obj.IsEnemy); }
public unsafe void LogInfo() { Frame.Log("LOLSmiteModel.Memory.LOLBaseAddress: " + LOLSmiteModel.Memory.LOLBaseAddress.ToString("X")); Frame.Log("Frame.Client.Me.BaseAddress: " + Frame.Client.Me.BaseAddress.ToString("X")); Frame.Log("Frame.Client.Me.SpellW.BaseAddress: " + Frame.Client.Me.SpellW.BaseAddress.ToString("X")); Frame.Log("Frame.Client.Me.Champion_SCIPointer + Offsets.SpellW: " + (Frame.Client.Me.Champion_SCIPointer + Offsets.SpellW).ToString("X")); Frame.Log("*(uint*)(Memory.LOLBaseAddress + Offsets.ObjectManager)).ToString(X)" + ((uint)(Memory.LOLBaseAddress + Offsets.ObjectManager)).ToString("X")); Frame.Log("(*(uint*)(Frame.Client.Me.Champion_SCIPointer + Offsets.SpellW)).ToString(X): " + (*(uint *)(Frame.Client.Me.Champion_SCIPointer + Offsets.SpellW)).ToString("X")); Frame.Log("Frame.Client.Me.Champion_SCIPointer: " + Frame.Client.Me.Champion_SCIPointer.ToString("X")); Frame.Log("(*(uint*)(Frame.Client.Me.Champion_SCIPointer)).ToString(X): " + (*(uint *)(Frame.Client.Me.Champion_SCIPointer)).ToString("X")); Frame.Log("Frame.Client.Me.SpellR.Name: " + Frame.Client.Me.SpellR.Name); Frame.Log("Frame.Client.Me.Name: " + Frame.Client.Me.Name); Frame.Log("Frame.Client.Me.Summoner1.Name: " + Frame.Client.Me.Summoner1.Name); Frame.Log("Frame.Client.Me.Summoner2.Name: " + Frame.Client.Me.Summoner2.Name); Frame.Log("Frame.Client.Me.Summoner2.BaseAddress.ToString(X): " + Frame.Client.Me.Summoner2.BaseAddress.ToString("X")); Frame.Log("Frame.Client.Me.NetworkId: " + Frame.Client.Me.NetworkId.ToString("X")); Frame.Log("Frame.Client.Me.Level: " + Frame.Client.Me.Level); Frame.Log("Frame.Client.Me.SmiteDamage: " + Frame.Client.Me.SmiteDamage); Frame.Log("Frame.Client.Me.HasSmiteSummoner: " + Frame.Client.Me.HasSmiteSummoner); Frame.Log("Frame.Client.Me.SmiteSummoner.BaseAddress.ToString(X): " + Frame.Client.Me.SmiteSummoner.BaseAddress.ToString("X")); Frame.Log("Frame.Client.Me.SmiteSummoner.TimeStamp.ToString(): " + Frame.Client.Me.SmiteSummoner.TimeStamp.ToString()); Frame.Log("Frame.Client.Me.Position.X: " + Frame.Client.Me.Position.X); Frame.Log("Frame.Client.Me.Position.Y: " + Frame.Client.Me.Position.Y); Frame.Log("Frame.Client.Me.Position.Z: " + Frame.Client.Me.Position.Z); Frame.Log("Frame.Client.Me.GetViewPort().X " + Frame.Client.Me.ViewPort.X); Frame.Log("Frame.Client.Me.GetViewPort().Y " + Frame.Client.Me.ViewPort.Y); Frame.Log("Frame.Client.Me.GetViewPort().Z " + Frame.Client.Me.ViewPort.Z); Frame.Log("Frame.Client.Me.SpellQ.TimeStamp.ToString(): " + Frame.Client.Me.SpellQ.TimeStamp.ToString()); Frame.Log("(*(uint*)(LOLSmiteModel.Memory.LOLBaseAddress+Offsets.GameClock)).ToString(X): " + (*(uint *)(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.GameClock)).ToString("X")); Frame.Log("Gameclock: " + (*(float *)((*(uint *)(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.GameClock)) + 0x2C))); Frame.Log("Gameclock: " + ((uint)(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.GameClock)).ToString("X")); Frame.Log("Frame.Client.Me.Summoner2.TimeStamp: " + Frame.Client.Me.Summoner2.TimeStamp); Frame.Log("Frame.Client.Me.Summoner2.IsReady: " + Frame.Client.Me.Summoner2.IsReady); Frame.Log("Frame.Client.Me.Summoner2.TimeUntilReady: " + Frame.Client.Me.Summoner2.TimeUntilReady); foreach (LOLWard obj in Frame.Client.GetLOLObjects.Where(s => s.ObjectType == ObjectType.Ward)) { Frame.Log("Remaining Ward Time: " + obj.RemainingTime); } foreach (LOLPlayer obj in Frame.Client.GetLOLObjects.Where(s => s.ObjectType == ObjectType.Player)) { Frame.Log("Player: " + obj.Name); } Frame.Log("(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.CastSpell).ToString(X): " + (LOLSmiteModel.Memory.LOLBaseAddress + Offsets.CastSpell).ToString("X")); Frame.Log("(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.PrintChat).ToString(X): " + (LOLSmiteModel.Memory.LOLBaseAddress + Offsets.PrintChat).ToString("X")); Frame.Log("(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.MoveTo).ToString(X): " + (LOLSmiteModel.Memory.LOLBaseAddress + Offsets.MoveTo).ToString("X")); Frame.Log("(LOLSmiteModel.Memory.LOLBaseAddress + Offsets.ViewPort).ToString(X): " + (LOLSmiteModel.Memory.LOLBaseAddress + Offsets.ViewPort).ToString("X")); Frame.Log("Frame.Client.Me.SpellQ.IsReady: " + Frame.Client.Me.SpellQ.IsReady); Frame.Log("Frame.Client.Me.SpellW.IsReady: " + Frame.Client.Me.SpellW.IsReady); Frame.Log("Frame.Client.Me.SpellE.IsReady: " + Frame.Client.Me.SpellE.IsReady); Frame.Log("Frame.Client.Me.SpellR.IsReady: " + Frame.Client.Me.SpellR.IsReady); Frame.Log("Frame.Client.Me.Summoner1.IsReady: " + Frame.Client.Me.Summoner1.IsReady); Frame.Log("Frame.Client.Me.Summoner2.IsReady: " + Frame.Client.Me.Summoner2.IsReady); Frame.Log("Frame.Client.Me.Summoner1.BaseAddress.ToString(X) " + Frame.Client.Me.Summoner1.BaseAddress.ToString("X")); }