[C# + Win32] Memory Reading Class Example menu

Shout-Out

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by joetheodd View Post
    You've gotta be kidding me. I wrote all that ****ing code and there's a single function in the framework to do it? That's what I get for not searching. FML.

    I'll change that and add string reading in just a second. Thanks.
    Don't feel bad, I did the same thing. The BCL is vast and wide, and few know all of its shoals and eddies.

    I'm in a poetic mood today for some reason...
    Don't believe everything you think.

    [C# + Win32] Memory Reading Class Example
  2. #17
    joetheodd's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    20
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apoc, or anyone, where might I find these "easy and clean" ways of doing math on IntPtrs?

  3. #18
    myojinyahiko's Avatar Contributor
    Reputation
    106
    Join Date
    Jul 2006
    Posts
    450
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apoc why are you being so rude to Joe? He just complimented the community and tried to contribute with somthing he obviously finds as a hobby, and your giving him the gesture that MMOwned is a non-helping flaming website.

  4. #19
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by myojinyahiko View Post
    Apoc why are you being so rude to Joe? He just complimented the community and tried to contribute with somthing he obviously finds as a hobby, and your giving him the gesture that MMOwned is a non-helping flaming website.
    If you consider constructive criticism as rude, so be it.

  5. #20
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Wow you guys are a bit retarded.

    1) Win32 vs .NET API is nearly as fast either way. (If you don't include the extra checks in the .NET API [which 99% of the time, prevent you from making stupid mistakes])
    2) That memory reading class is pretty ugly. And quite a waste of space.
    2a) Your naming conventions suck. Period. Please go read the MS naming conventions for C#.
    2b) Your code will be a huge pain in the ass to maintain. Even on small code-bases. Learn code-reuse.
    2c) Use proper .NET code structures. Those include; the Encoding class. (Support for UTF8 and byte-length availability) The Marshal class. (Proper use, not Marshal.SizeOf(x), use sizeof(x) for those)

    Last but not least; USE A GOD DAMNED INTPTR! NOT A ****ING INT! IntPtr is the equivalent to any type of pointer in the unmanaged world. (That includes handles) Seriously, this code is just plain ugly as sin.
    Phear my leeb and uber-fast c++ codenz.

    Originally Posted by myojinyahiko View Post
    Apoc why are you being so rude to Joe? He just complimented the community and tried to contribute with somthing he obviously finds as a hobby, and your giving him the gesture that MMOwned is a non-helping flaming website.

    Hi, you must be new here. Please jump off a bridge.

  6. #21
    joetheodd's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    20
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    If you consider constructive criticism as rude, so be it.
    I'd personally consider "USE A ****ING INTPTR" to be rude, but you're the one with the banhammer.

    Also, you must have missed my question.

  7. #22
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by joetheodd View Post
    I'd personally consider "USE A ****ING INTPTR" to be rude, but you're the one with the banhammer.

    Also, you must have missed my question.
    Code:
    uint ptr = (uint)myIntPtr.ToInt64(); // Or.... (uint)myIntPtr;
    Then go play with the 'ptr' variable instead. It's hard, I know.

  8. #23
    joetheodd's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    20
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry Apoc. I mistook you for meaning something that was actually clean looking and didn't involve casting twice (best case scenario).

  9. #24
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by joetheodd View Post
    Sorry Apoc. I mistook you for meaning something that was actually clean looking and didn't involve casting twice (best case scenario).
    Why are you afraid of fundamental language concepts?

  10. #25
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Why are you afraid of fundamental language concepts?

    Casts scare me irl.

  11. #26
    Quarters's Avatar Member
    Reputation
    16
    Join Date
    May 2009
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post

    Casts scare me irl.
    Tbh, first read I thought you said cats. lol.

    Im in the middle of writing my own memory reading/writing class at the moment, yes I could use BlackMagic but I prefer the satisfaction and experience of doing it myself

    @Apoc, if it's ok, could I use your code on page 1 as inspiration for some aspects of my own? no copy and pasting of course just ideas. Thanks.

  12. #27
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post

    Cats scare me irl.
    fixed a typo for u
    I hacked 127.0.0.1

  13. #28
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Quarters View Post
    Tbh, first read I thought you said cats. lol.

    Im in the middle of writing my own memory reading/writing class at the moment, yes I could use BlackMagic but I prefer the satisfaction and experience of doing it myself

    @Apoc, if it's ok, could I use your code on page 1 as inspiration for some aspects of my own? no copy and pasting of course just ideas. Thanks.
    You can c/p it if you want. Just don't claim you wrote it

  14. #29
    GliderPro's Avatar Member
    Reputation
    -1
    Join Date
    Mar 2009
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had to change this code

    Code:
    case TypeCode.Object:
        // Double check this. It *should* work. But may not. Untested
        GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
        Marshal.PtrToStructure((handle.AddrOfPinnedObject(), ret);
        handle.Free();
        break;
    to this

    Code:
    case TypeCode.Object:
        // Double check this. It *should* work. But may not. Untested
        GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
        ret = Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));         
        handle.Free();
        break;
    The PtrToStructure method was throwing an exception and complaining that "The structure must not be a value class." with your code.

    Thanks for sharing your memory reading class by the way.

  15. #30
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by GliderPro View Post
    I had to change this code

    Code:
    case TypeCode.Object:
        // Double check this. It *should* work. But may not. Untested
        GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
        Marshal.PtrToStructure((handle.AddrOfPinnedObject(), ret);
        handle.Free();
        break;
    to this

    Code:
    case TypeCode.Object:
        // Double check this. It *should* work. But may not. Untested
        GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
        ret = Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));         
        handle.Free();
        break;
    The PtrToStructure method was throwing an exception and complaining that "The structure must not be a value class." with your code.

    Thanks for sharing your memory reading class by the way.
    Oops :S

    Forgot about that :P

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [c# example] memory reading
    By kantaki in forum Programming
    Replies: 6
    Last Post: 02-03-2012, 05:32 PM
  2. Replies: 1
    Last Post: 11-30-2011, 02:36 PM
  3. [Request][Bounty] WoW memory reading example script c++
    By foxlin in forum WoW Bots Questions & Requests
    Replies: 4
    Last Post: 07-27-2011, 09:08 AM
  4. [Example] Check if spell is available with memory reading
    By orby_tale in forum WoW Memory Editing
    Replies: 1
    Last Post: 11-14-2010, 05:14 PM
  5. [C++]Memory Reading Class
    By opulent in forum WoW Memory Editing
    Replies: 3
    Last Post: 05-11-2009, 06:55 AM
All times are GMT -5. The time now is 12:46 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search