Trying get Map contents menu

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 42
  1. #16
    run32.dll's Avatar Contributor
    Reputation
    98
    Join Date
    May 2007
    Posts
    53
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    kinda missusing this post but hell I dont care
    @finnerj: search mmowned-memory section for "TLS" or "TLS method"

    @Cypher
    hmm wait I should have explained better, 28MB is without textures. 28MB are required to open three MPQ-files. I dont know how MPQs work exactly but I think some sort of fileindex must be loaded to navigate throu the MPQ-Archive. Here is how much memory is used by YAWR now (without loading any minimap-textures):

    3.608KB // YAWR starts...
    28.728KB thats +25.120KB // opening common.mpq - req. for minimap textures
    30.556KB thats +1.828KB // opening xxXX\locale-xxXX.mpq - req. for ore-/herb-icons
    31.392KB thats +836KB // opening xxXX\patch-xxXX.mpq - req. for saronite-icon only
    35.896KB // other stuff like windowcreation, OpenGL Init
    36.408KB // Load font.blp from disk and 62 small icon-blps from MPQ-files, all DXT compressed
    38.100KB~ // fully loaded and running

    25.120KB+1.828KB+836KB = 27.784KB just for opening three MPQ-files with

    Theorycraft for loading minimap textures:
    Azeroth 687 textures
    Kalimdor 1018 textures
    Northrend 1131 textures <- worst case
    Expansion01 800 textures

    The minimap-textures are either DXT1 or DXT1a compressed.
    DXT1 = no alpha channel, compression ratio 8:1
    DXT1a = 1bit alpha channel, copmression ratio 4:1
    The BLP2 Header + the unused colorpalette is 1169Bytes. I'll ignore that.

    Lets say we are in Northrend and since the most minimap-textures do not require an alpha channel I use a compression ratio of 8:1.

    1131 Textures, each 256x256 pixels, 4Bytes per pixel uncompressed RGBA
    one texture would req.:
    256x256x4 = 262.144Bytes
    all uncompressed textures would req.:
    262.144Bytes * 1131 Textures = 296.484.864Bytes = 296.484KB = 296MB
    YAWR uses DXT1, it kicks ass:
    296MB / 8 = 37MB

    final memory usage by YAWR if minimap-textures are preloaded for each zone.
    standard memory usage + DXT1 northrend textures:
    38.100KB + 37MB = 75,1MB

    hmmm ~75MB still option a)? But I'd say yes! Thats ok for being able to see the WHOLE map.

    Trying get Map contents
  2. #17
    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)
    75MB? Who gives a shit. Thats nothing. To be honest I really wouldn't worry about 75MB of memory usage, I mean you are loading a bunch of textures etc, its not like its just a simple text-only app. Also, as long as you're cleaning up properly and disposing of the textures when you're done with them its not like memory usage is gonna skyrocket to something ridiculous, 50-190 MB seems perfectly reasonable to me.

    If you really want to get it lower though you could always just load textures on the fly as needed, if you're worried about the use of MPQs constantly then just extract all the textures to temporary disk space at first run, then use them directly from there, when the program closes delete all the files. That way you only need to open MPQs once.

    By the way. CPU and GPU resources are MUCH more scarce than RAM, so I'd put them as first priority if you're optimizing performance.

    Disclaimer: My view may be slightly biased as I use a pretty beefy rig most of the time (QX9650 OC @ 4.0Ghz, 8GB 1066MHZ DDR2 RAM, 2 x 8800GT 512MB OC in SLI, etc) so I'm very rarely worried about the memory usage of applications.

    If you think about it though, most computers have a decent amount of RAM, especially gamers (which are your target audience). To run WoW well you need at the very least 1GB of RAM, and nowadays 2GB is pretty much the minimum you'll see on any new PC, and 4GB is fast becoming the defacto standard.

    In short: 75MB is nothing, I wouldn't worry about it, but if you are still worried extract all the files at runtime to temp and load them dynamically.

  3. #18
    finnerj's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How come this code don't work..

    I thing my head is going to explode, just a little code to get the players X,Y,Z.


    {
    Process[] procs = System.Diagnostics.Process.GetProcessesByName("Wow");

    uint curObj, nextObj, localObj = 0;
    UInt64 localGUID;

    int clientConnection = 0x011CA260;
    int curMgrOffset = 0x2864;
    int curMgr_FirstObject = 0xAC;
    int curMgr_PlayerGUID = 0xC0;

    int CurMgr = 0x011CA260 + 0x2864;



    IntPtr MainWindowHandle = procs[0].MainWindowHandle;
    //todo Add checkup

    Memory.OpenProcess(MainWindowHandle);

    localGUID = Memory.ReadUInt64(MainWindowHandle, (CurMgr + 0xC0));
    Console.WriteLine("LocalGUID: 0x{0:X016}", localGUID);

    curObj = Memory.ReadUInt(MainWindowHandle, (CurMgr + 0xAC));
    nextObj = curObj;

    while (curObj != 0 && (curObj & 1) == 0)
    {
    UInt64 cGUID = Memory.ReadUInt64(MainWindowHandle, (curObj + 0x30));

    float X = Memory.ReadFloat(MainWindowHandle, (curObj + 0xBF0));
    float Y = Memory.ReadFloat(MainWindowHandle, (curObj + 0xBF4));
    float Z = Memory.ReadFloat(MainWindowHandle, (curObj + 0xBF);

    if (cGUID == localGUID)
    localObj = curObj;

    Console.WriteLine("0x{0:X08} -- GUID: 0x{1:X016} | {2} {3} {4}", curObj, cGUID, X, Y, Z);

    nextObj = Memory.ReadUInt(MainWindowHandle, (curObj + 0x3C));
    if (nextObj == curObj)
    break;
    else
    curObj = nextObj;
    }


    }

    Be Gental this is my first time at trying to implement TLS.

  4. #19
    RawrSnarl's Avatar Member
    Reputation
    14
    Join Date
    May 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit: Refer to the posts below.
    Last edited by RawrSnarl; 12-26-2008 at 04:17 PM.

  5. #20
    finnerj's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks RawrSnarl for the advise on my code. I've made the changes that you suggested with no sucess..

    Is this right ?

    Process[] procs = System.Diagnostics.Process.GetProcessesByName("Wow");

    uint curObj, nextObj, localObj = 0;
    UInt64 localGUID;

    int clientConnection = 0x011CA260;
    int curMgrOffset = 0x2864;
    int curMgr_FirstObject = 0xAC;
    int curMgr_PlayerGUID = 0xC0;

    //int CurMgr = 0x011CA260 + 0x2864;


    IntPtr MainWindowHandle = procs[0].MainWindowHandle;
    //todo Add checkup

    Memory.OpenProcess(MainWindowHandle);

    uint CurMgr = Memory.ReadUInt(MainWindowHandle, clientConnection + curMgrOffset);


    localGUID = Memory.ReadUInt64(MainWindowHandle, (CurMgr + 0xC0));
    Console.WriteLine("LocalGUID: 0x{0:X016}", localGUID);

    curObj = Memory.ReadUInt(MainWindowHandle, (CurMgr + 0xAC));
    nextObj = curObj;

    while (curObj != 0 && (curObj & 1) == 0)
    {
    UInt64 cGUID = Memory.ReadUInt64(MainWindowHandle, (curObj + 0x30));

    float X = Memory.ReadFloat(MainWindowHandle, (curObj + 0xBF0));
    float Y = Memory.ReadFloat(MainWindowHandle, (curObj + 0xBF4));
    float Z = Memory.ReadFloat(MainWindowHandle, (curObj + 0xBF);

    if (cGUID == localGUID)
    localObj = curObj;

    Console.WriteLine("0x{0:X08} -- GUID: 0x{1:X016} | {2} {3} {4}", curObj, cGUID, X, Y, Z);

    nextObj = Memory.ReadUInt(MainWindowHandle, (curObj + 0x3C));
    if (nextObj == curObj)
    break;
    else
    curObj = nextObj;
    }


    Cause when I do run it my localGUID is always 0xFFFFFFFFFFFFFFFF. Which to me says that something is going wrong some where.. If you've any more ideas I would be extreamly happy.

  6. #21
    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)
    You guys both did that wrong. It's: Read(hWow, (Read(hWow, 0x11CA260)) + 0x2864);

  7. #22
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by RawrSnarl View Post
    Instead of:

    Code:
    int CurMgr = 0x011CA260 + 0x2864;
    It should be:

    Code:
    Memory.ReadUInt(MainWindowHandle, clientConnection + curMgrOffset)
    Everything else looks good.
    It's [[clientConnection]+curMgrOffset] not [clientConnection+curMgrOffset]

    as such:

    Code:
    objectManager = wow.ReadUInt(wow.ReadUInt(0x011CA260) + 0x2864);
    Edit: Lanman got me by a few seconds!
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  8. #23
    RawrSnarl's Avatar Member
    Reputation
    14
    Join Date
    May 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit: You all beat me to it . Sorry for the confusion.
    Last edited by RawrSnarl; 12-26-2008 at 04:13 PM.

  9. #24
    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)
    xP, sorry Rob;

  10. #25
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Holy god, his problem is that he's using the MainWindowHandle as his handle for reading, not the ProcessHandle (which, by the way, is returned by OpenProcess). Learn what you're doing and you won't run into these sorts of problems.

  11. #26
    finnerj's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shynd,

    I am very new to doing this. And I am reading tons of threads and trying to coble things to gether to get a working modle that I can work from..

    After all we all have to learn.

    And thanks for the pointer that I need to use the method OpenProcess.

    Sorry for been a noob.

  12. #27
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Process[] procs = Process.GetProcessesByName("Wow");
    IntPtr hProcess = Memory.OpenProcess(procs[0].Id);
    uint clientConnection = Memory.ReadUInt(hProcess, 0x011CA260);
    uint s_CurMgr = Memory.ReadUInt(hProcess, (clientConnection + 0x2864));
    ...etc

  13. #28
    finnerj's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shynd,

    Thanks for the pointers. I've just altered my code and for some reason my IntPtr hProcess = IntPtr.Zero

    Don;t understand it Am I useing the wrong MemoryLib maybe ?

  14. #29
    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)
    Add this line right before you try to get handles or anything...

    System.Diagnostics.Process.EnterDebugMode();

    This gives you the debug token, in a simpler manner than C++.

    EDIT: Make sure you run as administrator, or it throws an exception...

  15. #30
    finnerj's Avatar Member
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ianman92 Cheers Man.

    My code now runs

    and returns values

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 02-19-2016, 01:25 PM
  2. [How-To] Tip how to try get realm first lvl 85 goblin/worgen!
    By nibbas in forum World of Warcraft Guides
    Replies: 6
    Last Post: 09-20-2010, 02:49 AM
  3. Trouble getting MAPS? Download them here!
    By jordana in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 02-13-2008, 09:27 PM
  4. Trouble getting MAPS? Download them here!
    By jordana in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 02-13-2008, 12:35 PM
All times are GMT -5. The time now is 02:23 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