C# Pointers issues menu

User Tag List

Results 1 to 2 of 2
  1. #1
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C# Pointers issues

    I'm not sure why this is throwing an exception. I'm using a pointer to a struct(g_clientConnection) and I have another struct pointed to from that(s_curMgr). Here's my structs..

    Code:
    [StructLayout(LayoutKind.Explicit)]
        public unsafe struct ClientConnection
        {
            [FieldOffset(0x2C34), MarshalAs(UnmanagedType.LPStruct)]
            public S_ObjMgr* s_curMgr;
        }
    
        [StructLayout(LayoutKind.Explicit)]
        public unsafe struct S_ObjMgr
        {
            [FieldOffset(0xC0)]
            public UInt64 LocalGUID;
            [FieldOffset(0xAC)]
            public GameObject* FirstObject;
        }
    I'm declaring a pointer like this:

    Code:
    ClientConnection* cc = (ClientConnection*)0x1139F80;
    textBox3.AppendText(cc->s_curMgr->FirstObj.ToString() + "\n");
    Any tips why it isn't working? It's throwing an exception that I'm reading protected memory(0x777FFFF+ or something ridiculous like that).

    C# Pointers issues
  2. #2
    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 lanman92 View Post
    I'm not sure why this is throwing an exception. I'm using a pointer to a struct(g_clientConnection) and I have another struct pointed to from that(s_curMgr). Here's my structs..

    Code:
    [StructLayout(LayoutKind.Explicit)]
        public unsafe struct ClientConnection
        {
            [FieldOffset(0x2C34), MarshalAs(UnmanagedType.LPStruct)]
            public S_ObjMgr* s_curMgr;
        }
    
        [StructLayout(LayoutKind.Explicit)]
        public unsafe struct S_ObjMgr
        {
            [FieldOffset(0xC0)]
            public UInt64 LocalGUID;
            [FieldOffset(0xAC)]
            public GameObject* FirstObject;
        }
    I'm declaring a pointer like this:

    Code:
    ClientConnection* cc = (ClientConnection*)0x1139F80;
    textBox3.AppendText(cc->s_curMgr->FirstObj.ToString() + "\n");
    Any tips why it isn't working? It's throwing an exception that I'm reading protected memory(0x777FFFF+ or something ridiculous like that).
    Uhm.. drop the unsafe code and use Marshal.PtrToStructure?

Similar Threads

  1. Read from Pointer Windows 10 issue
    By doromoro in forum WoW Memory Editing
    Replies: 2
    Last Post: 07-28-2016, 01:06 PM
  2. Pointer Reading Issue?
    By johno22 in forum WoW Memory Editing
    Replies: 2
    Last Post: 06-09-2009, 03:20 AM
  3. More pointer ideas.
    By Eldretch in forum World of Warcraft General
    Replies: 0
    Last Post: 08-09-2006, 06:34 AM
  4. patching issue
    By Marlo in forum World of Warcraft General
    Replies: 0
    Last Post: 07-22-2006, 07:35 PM
  5. [Patch 1.11] - Known Issues (6-20-06)
    By Cypher in forum World of Warcraft General
    Replies: 1
    Last Post: 06-24-2006, 12:42 AM
All times are GMT -5. The time now is 01:16 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