GreyMagic - The best of both worlds, and then some menu

User Tag List

Page 1 of 5 12345 LastLast
Results 1 to 15 of 64
  1. #1
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GreyMagic - The best of both worlds, and then some

    Download: https://dl.dropbox.com/u/2068143/GreyMagic.7z

    So, I wrote this a while back for our bots (Honorbuddy, Demonbuddy, BuddyWing, etc). It's a full-featured memory lib for both in and out of process memory handling. Performance tests show that it's barely a tick slower than calling ReadProcessMemory directly on simple data types, and slightly over a tick slower than reading structures. (Write speeds have not been tested, as writing is not done nearly as often)

    The following are for perf tests over 1 million iterations:

    Read<int>(addr, relative: true) - 4.57 ticks
    ReadProcessMemory (direct) - 3.54 ticks
    Deref on ReadBytes(addr, relative: true) - 3.90 ticks
    Read<NonMarshalStruct>(addr, relative: true) - 5.06 ticks
    Read<MarshalStruct>(addr, relative: true) - 6.48 ticks

    The library itself implements a neat little trick to avoid using the marshaler wherever possible. MarshalCache<T> provides a way to cache certain data for types (size, typeof(), whether the type needs to be run through the marshaler, etc), as well as implements a way for C# to take a pointer to a generic type. (You can't do &T in C#... well... at least you couldn't)

    The lib itself takes into account quite a few things, and should hopefully be plug-and-play ready. It includes a few other things that aren't really useful (but tossed in for the sake of tossing it in). I will be adding more features in the future (it lacks a pattern scanner). Feel free to use and abuse, please let me know of any bugs you run into.

    In-process memory class: InProcessMemoryReader
    OOP memory class: ExternalProcessMemoryReader

    Enjoy folks!

    GreyMagic - The best of both worlds, and then some
  2. Thanks Parog (1 members gave Thanks to Apoc for this useful post)
  3. #2
    z0m's Avatar Banned CoreCoins Purchaser
    Reputation
    3
    Join Date
    Jan 2011
    Posts
    56
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha, thanks, as always!

  4. #3
    QKdefus's Avatar Active Member
    Reputation
    54
    Join Date
    May 2010
    Posts
    96
    Thanks G/R
    3/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks !

  5. #4
    hankerspace's Avatar Sergeant
    Reputation
    18
    Join Date
    Sep 2012
    Posts
    23
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot, again !

  6. #5
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Good job. Well done.

  7. #6
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    208
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sweet, thanks for sharing.

  8. #7
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah sweet! I have been waiting since you mentioned it in the WhiteMagic thread. Thanks for the work as always!

  9. #8
    greenegzofyoshi's Avatar Banned
    Reputation
    10
    Join Date
    Jun 2009
    Posts
    23
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apoc I read a post a few months(maybe a year + ago? ) where you spoke about grey magic and possibly releasing it. Since that day I decided to halt my wow development... but since you just released this, I guess I can start again since I have an active account at the moment (:

    Thank you so much!

  10. #9
    z0m's Avatar Banned CoreCoins Purchaser
    Reputation
    3
    Join Date
    Jan 2011
    Posts
    56
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by z0m View Post
    Haha, thanks, as always!
    Working great. Thanks again, also for the info you gave in a PM some time ago.
    Last edited by z0m; 10-02-2012 at 11:24 PM.

  11. #10
    Require's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2011
    Posts
    40
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks starting to learn Memory Editing now!
    Last edited by Require; 10-03-2012 at 01:03 PM.

  12. #11
    Kanyle's Avatar Corporal
    Reputation
    9
    Join Date
    Jul 2011
    Posts
    19
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for sharing!

  13. #12
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    The library itself implements a neat little trick to avoid using the marshaler wherever possible. MarshalCache<T> provides a way to cache certain data for types (size, typeof(), whether the type needs to be run through the marshaler, etc), as well as implements a way for C# to take a pointer to a generic type. (You can't do &T in C#... well... at least you couldn't)
    I've downloaded this, because of this ^ and then I found some basic C# stuff I didn't even knew about like the double question mark operator or the fact that classes can have a static constructor ._. I feel realy noobish right now.

    Thanks for sharing! It's realy instructive

    Edit:
    Do you mind giving us a short example how to use the DetourManager?
    Last edited by xalcon; 10-03-2012 at 06:41 PM.
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  14. #13
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by xalcon View Post
    I've downloaded this, because of this ^ and then I found some basic C# stuff I didn't even knew about like the double question mark operator or the fact that classes can have a static constructor ._. I feel realy noobish right now.

    Thanks for sharing! It's realy instructive

    Edit:
    Do you mind giving us a short example how to use the DetourManager?
    Code:
                if (_canTrackUnitOriginal == null)                _canTrackUnitOriginal = Memory.CreateFunction<PlayerCanTrack>((IntPtr)GlobalOffsets.CGPlayer_C__CanTrackUnit, true);
    
    
                if (_canTrackObjectOriginal == null)
                    _canTrackObjectOriginal = Memory.CreateFunction<PlayerCanTrack>((IntPtr)GlobalOffsets.CGPlayer_C__CanTrackObject, true);
    
    
                if (_myCanTrackUnit == null)
                    _myCanTrackUnit = CanTrackUnitDetour;
    
    
                if (_myCanTrackObject == null)
                    _myCanTrackObject = CanTrackObjectDetour;
    
    
                 Memory.Detours.CreateAndApply(_canTrackUnitOriginal, _myCanTrackUnit, "CanTrackUnitDetour");
                 Memory.Detours.CreateAndApply(_canTrackObjectOriginal, _myCanTrackObject, "CanTrackObjectDetour");
    Code:
            private bool CanTrackUnitDetour(IntPtr pUnit, IntPtr unk)
            {
                if (_trackedUnits.Count > 0)
                {
                    var unit = new WoWUnit(pUnit);
    
    
                    return unit.IsValid &&
                           (_trackedUnits.Contains(unit.Name.ToLower()) ||
                            _trackedUnits.Any(s => !string.IsNullOrEmpty(s) && unit.Name.ToLower().Contains(s.ToLower())));
                }
    
    
                return (bool)Memory.Detours["CanTrackUnitDetour"].CallOriginal(pUnit, unk);
            }

  15. #14
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Apoc: awesome! It all makes sense now, thank you!
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  16. #15
    Xelper's Avatar ★ Elder ★
    Reputation
    1024
    Join Date
    Mar 2007
    Posts
    860
    Thanks G/R
    0/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice, thanks Apoc

Page 1 of 5 12345 LastLast

Similar Threads

  1. [Selling] MvP BOOSTING [NA]THE BEST DIAMOND 1 BOOSTING AND COACHING SERVICE
    By MvP Boost in forum League of Legends Buy Sell Trade
    Replies: 1
    Last Post: 08-18-2014, 10:05 AM
  2. Whats the best way to secure and account?
    By kRoNiiC in forum WoW Scams Help
    Replies: 11
    Last Post: 07-07-2009, 01:24 AM
  3. The best E-Mail advice and questions service!
    By Zore. in forum Community Chat
    Replies: 1
    Last Post: 02-12-2008, 07:31 PM
  4. [READ/RELEASE] One of the best EMU-Devs arround and some of his work posted here!
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 11-17-2007, 07:43 AM
  5. Which is the best Paysite for World of Warcraft?
    By 3min3m in forum World of Warcraft General
    Replies: 5
    Last Post: 12-06-2006, 07:12 PM
All times are GMT -5. The time now is 07:27 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search