The memory could not be "read". menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The memory could not be "read".

    I finally got my Fish bot to work it can cast, detect the bobber and catch the fish - so fare so good.
    It works flawless until wow terminates with an error:

    The instruction at "0x007AF077" referenced memory at "0x00000017".
    The memory could not be "read".

    I assume this error has something to do with:
    http://www.mmowned.com/forums/wow-me...read-doom.html
    http://www.mmowned.com/forums/wow-me...-problems.html

    Shynd:
    You have one thread and WoW has one (main) thread and they are both accessing WoW's TLS at the same time...
    Does anyone know off a way to "pause" the main thread when i am executing my asm code?
    I have been looking around the forum but I could not find any "deeper" explanation on how to do this.

    Best Regards
    Naa
    Last edited by naa; 01-25-2009 at 05:16 PM.

    The memory could not be "read".
  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 naa View Post
    I finally got my Fish bot to work it can cast, detect the bobber and catch the fish - so fare so good.
    Itworks flawless until wow terminates with an error:

    The instruction at "0x007AF077" referenced memory at "0x00000017".
    The memory could not be "read".

    I assume this error has something to do with:
    http://www.mmowned.com/forums/wow-me...read-doom.html
    http://www.mmowned.com/forums/wow-me...-problems.html

    Does anyone know off a way to "pause" the main thread when i am executing my asm code?
    I have been looking around the forum but I could not find any "deeper" explanation on how to do this.

    Best Regards
    Naa
    SuspendThread?

  3. #3
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Get a handle to the main thread suspend it and when your code has finished executing you resume it

  4. #4
    zdohdds's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2013
    Posts
    46
    Thanks G/R
    19/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got the exact same error, but i dont know how to fix it.
    Get a handle to the main thread suspend it and when your code has finished executing you resume it
    I try to do it, but my bot works through CLRHost and have PID = PID Wow-64.exe. When i to do main thread suspend my bot suspend too.
    public static ProcessThread GetUIThread()
    {
    if (pWow.MainWindowHandle == null) return null;
    int id = GetWindowThreadProcessId(pWow.MainWindowHandle, IntPtr.Zero);
    foreach (ProcessThread pt in pWow.Threads)
    if (pt.Id == id) return pt;
    return null;
    }

    public static void Suspend()
    {
    var pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)GetUIThread().Id);
    Wow64SuspendThread(pOpenThread);
    }
    public static void Resume()
    {
    var pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)GetUIThread().Id);
    ResumeThread(pOpenThread);
    }

    [DllImport("kernel32.dll")]
    static extern uint Wow64SuspendThread(IntPtr hThread);
    [DllImport("kernel32.dll")]
    static extern int ResumeThread(IntPtr hThread);

    [Flags]
    public enum ThreadAccess : int
    {
    TERMINATE = (0x0001),
    SUSPEND_RESUME = (0x0002),
    GET_CONTEXT = (0x000,
    SET_CONTEXT = (0x0010),
    SET_INFORMATION = (0x0020),
    QUERY_INFORMATION = (0x0040),
    SET_THREAD_TOKEN = (0x0080),
    IMPERSONATE = (0x0100),
    DIRECT_IMPERSONATION = (0x0200)
    }
    Last edited by zdohdds; 01-10-2016 at 06:39 AM.

  5. #5
    zdohdds's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2013
    Posts
    46
    Thanks G/R
    19/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh... I forgot about access rights
    I used
    Process.GetProcessesByName("Wow-64")[0];
    but it was necessary
    const int PROCESS_WM_READ = 0x0010;
    OpenProcess (PROCESS_WM_READ, false, Process.GetProcessesByName("Wow-64")[0].Id);

  6. #6
    zdohdds's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2013
    Posts
    46
    Thanks G/R
    19/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still can't fix this error. I guess it occurs in GameObject.cs
    Code:
            public static Int64 GetAddressGameObjectById(int gameObjectId)
            {
                // object list
                Int64 pObject = Memory.ReadAddress(IntPtr.Add(Memory.pBaseAddress, (int)Offsets.ClnObjMng.EntityList));
                if (pObject == 0) return 0;
    
                // first object
                pObject = Memory.ReadAddress(new IntPtr(pObject + (Int64)Offsets.ClnObjMng.FirstEntity));
                if (pObject == 0) return 0;
    
                int id = 0;
    
                while (pObject != 0 && (pObject & 1) == 0)
                {   
                    id = Memory.ReadAddress32(new IntPtr(Memory.ReadAddress(new IntPtr(pObject + (Int64)Offsets.gObject.ID_first)) + (Int64)Offsets.gObject.ID_second));
                    if (id == gameObjectId) return pObject;
                    else // next object
                        pObject = Memory.ReadAddress(new IntPtr(pObject + (Int64)Offsets.ClnObjMng.NextEntity));
    
                    if (pObject == 0) return 0;
                }
                return 0;
            }
    Memory.cs
    Code:
            private static IntPtr handleProcess;
    
            public static void Initialization()
            {
                pBaseAddress = Process.GetProcessesByName("Wow-64")[0].MainModule.BaseAddress;
                
                ProcessAccessFlags a = ProcessAccessFlags.PROCESS_CREATE_THREAD |
                                       ProcessAccessFlags.PROCESS_QUERY_INFORMATION |
                                       ProcessAccessFlags.PROCESS_SET_INFORMATION | ProcessAccessFlags.PROCESS_TERMINATE |
                                       ProcessAccessFlags.PROCESS_VM_OPERATION | ProcessAccessFlags.PROCESS_VM_READ |
                                       ProcessAccessFlags.PROCESS_VM_WRITE | ProcessAccessFlags.SYNCHRONIZE;
    
                handleProcess = OpenProcess(a, false, Process.GetProcessesByName("Wow-64")[0].Id);
            }
    
            public static Int64 ReadAddress(IntPtr address)
            {
                byte[] buffer = ReadBytes(address, sizeof(Int64));
                if (buffer == null) return 0;
                return BitConverter.ToInt64(buffer, 0);
            }
    
            public static byte[] ReadBytes(IntPtr address, Int64 length)
            {
                Int64 numRead;
                byte[] buffer = new byte[length];
                if (!ReadProcessMemory(handleProcess, address, buffer, length, out numRead)) return null;
                return buffer;
            }
    Offsets.cs
    Code:
            [Flags]
            public enum ClnObjMng
            {
                EntityList = 0x14E4DC0,
                FirstEntity = 0x18,
                NextEntity = 0x68
            }
    
            [Flags]
            public enum gObject
            {
                ID_first = 0x8,
                ID_second = 0x24,
                GUID = 0x50
            }
    It is my regular fishing bot. He is work fine, but sometimes errors occur:
    Code:
    the instruction at "0x00007ff62e13e9a" referenced memory at "0xffffffffffffffff". The memory could not be "read".
    Help me to fix it. Thanks in advance.
    PS: this is my first serious program after "hello world" and i know my code is horrible. Sorry for my bad English.

  7. #7
    zdohdds's Avatar Active Member
    Reputation
    16
    Join Date
    Feb 2013
    Posts
    46
    Thanks G/R
    19/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh... it is my wrong CastSpell to causes an error
    Spell.cs
    Code:
        class Spell
        {
            private static byte[] unk20;
            private static Guid guid;
    
            public Spell()
            {
                unk20 = new byte[20];
                guid = new Guid(new byte[16]);
            }
    
            public void Cast(UInt64 spell_id)
            {
                Core.Delegates.CastSpell(spell_id, unk20, 0, guid);
            }
        }
    Delegates.cs
    Code:
    class Delegates
        {
            public static CastSpellByIdDelegate CastSpell;
            
            public static void Initialization()
            {
                CastSpell = Memory.RegisterDelegate<CastSpellByIdDelegate>(IntPtr.Add(Memory.pBaseAddress, (int)Offsets.Delegates.CastSpell));
            }
    
            public delegate Int64 CastSpellByIdDelegate(UInt64 spell_id, byte[] a2, Int64 a3, Guid guid_d, Int64 a5 = 0, Int64 a6 = 0, Int64 a7 = 0, Int64 a8 = 0);
        }
    Offsets.cs
    Code:
            [Flags]
            public enum Delegates
            {
                CastSpell = 0x45E3A0
            }
    without unk20 = byte [20] CastSpell do not called

Similar Threads

  1. [DEMONBUDDY] could not read bytes from 00000000 [299]! after new patch
    By Luk101 in forum Diablo 3 Bots Questions & Requests
    Replies: 2
    Last Post: 11-01-2012, 07:46 PM
All times are GMT -5. The time now is 04:49 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