Searching for value in Memory menu

User Tag List

Results 1 to 3 of 3
  1. #1
    streppel's Avatar Active Member
    Reputation
    78
    Join Date
    Mar 2007
    Posts
    196
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Searching for value in Memory

    Hey again

    so after 2 days of searching for static pointers for the lotting stuff of my game and not finding anything i got at least close to a solution for my problem.
    i know that the baseadresse of an object has a special value and changes as soon as it isn't valid anymore, so i'd want to search in the game ram for this value.

    I tryed it with a simple for loop,reading every integer and comparing it to my value,but that's a really slow method.

    the next method i tryed was to read a few bytes at once(like 512 or 1024) and searching for the value inside this bytearray. it was faster, but to find all the adresses i wanted(~5 or 6 at a time at different locations in memory) it still takes more time then i want to spend(maybe 5 secs,more makes it more obvious that i'm botting,not?)

    so my question would be if there is anything i missed or any hint you could give me to get the job done faster.

    i'm using c# as programming language aswell as blackmagic for the reading stuff

    thanks for your help once again
    streppel


    EDIT:
    ok so i did work on this for a little time. the function itself is from a quick googlesearch,i changed it so it works out best on my pc (reading bigger parts of the memory at once,looking for a good middle between speed and ram+cpu usage)
    if you need the 2 helper classes too jsut let me know. another google search will bring em up in no time.
    function takes the value you want to find as argument and returns a list of the adresses where this value was find.
    you might want to adjust the start+end adresse so make the search even faster

    Code:
    public List<uint> FindAdresse(uint val)
            {
                Process p = Process.GetProcessById(BM.ProcessId);
                byte[] searchedBytes = BitConverter.GetBytes(val);
                List<uint> addrList = new List<uint>();
                int addr = 0;
                int speed = 1024 * 128; //16 = 6 sek //32=6sek //64=5sek //128==5sek //256==5sek //testing i did with several chunk sizes
                for (int j = 0x400000; j < 0x16FFFFFF; j += speed)
                {
                    ManagedWinapi.ProcessMemoryChunk mem = new ManagedWinapi.ProcessMemoryChunk(p, (IntPtr)j, speed + searchedBytes.Length);
    
                    byte[] bigMem = mem.Read();
    
                    for (int k = 0; k < bigMem.Length - searchedBytes.Length; k++)
                    {
                        bool found = true;
                        for (int l = 0; l < searchedBytes.Length; l++)
                        {
                            if (bigMem[k + l] != searchedBytes[l])
                            {
                                found = false;
                                break;
                            }
                        }
                        if (found)
                        {
                            addr = k + j;
                            break;
                        }
                    }
                    if (addr != 0)
                    {
                        addrList.Add((uint)addr);
                        addr = 0;
    
                    }
                }
                return addrList;
            }

    here we go
    Last edited by streppel; 06-05-2011 at 03:57 AM. Reason: found a solution

    Searching for value in Memory
  2. #2
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you are doing is a simple brute force pattern match. For a more efficient algorithms see Boyer.
    You should only search in the address range range of wow's main module. Hard coding 0x400000 is plain stupid, especially if you would switch ASLR on one day.
    You can copy WoW's main module into your address space as a whole. It should be under 10 mb to copy, so there's no need to break it into small chunks (which should be at least memory page sized for efficiency).

  3. #3
    streppel's Avatar Active Member
    Reputation
    78
    Join Date
    Mar 2007
    Posts
    196
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey
    thanks for your help. i forgot to mention that this isn't wow-related.
    thanks for your hint on the boyer algorythm. i'll see if i can implement it in my code and if it will work any faster then(even tho the length of my bytearray may not be long enough to make any significant changes)
    hopefully i'll learn about more of those algorythms once my studying starts in september

    greets from germany

Similar Threads

  1. Great site to Search for free WoW guides.
    By joric in forum World of Warcraft Guides
    Replies: 3
    Last Post: 08-11-2007, 03:16 AM
  2. Hex code search for cache model edits
    By Dave-evad in forum World of Warcraft Model Editing
    Replies: 9
    Last Post: 06-15-2007, 03:55 PM
  3. So I've been searching for a week...
    By Twister06 in forum World of Warcraft General
    Replies: 4
    Last Post: 02-10-2007, 01:26 PM
  4. Searching for Voice Actors/In-Game Actors
    By Örpheus in forum World of Warcraft General
    Replies: 1
    Last Post: 08-01-2006, 10:03 AM
All times are GMT -5. The time now is 05:52 PM. 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