Injecting and Writing Memory Questions menu

User Tag List

Results 1 to 9 of 9
  1. #1
    SatyPardus's Avatar Active Member
    Reputation
    15
    Join Date
    Nov 2014
    Posts
    24
    Thanks G/R
    15/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Injecting and Writing Memory Questions

    Hi all!

    First of all I want to thank everyone for posting super useful information and being generally really helpful!
    I just started my journey into memory editing and learned a lot through the awesome work you guys did already.

    But while learning and researching, I found that a lot of the recent questions just get a "Google it" or "Has been answered countless times" answer.
    While I do understand that repeating oneself can be annoying, it doesn't really help people who actually want to learn.


    That is the point I am on currently, I learned as much as I could out of the forum and google and wrote a pretty advanced (for myself) memory reading and displaying solution.
    I managed to generate a 3D enviroment with all entities around, having a "bot" that can understand its surrounding pretty well, but I go stuck.

    The problem is that I do not find any (helpful) resources on writing, injecting and other things.
    Whenever I start googling the issue or questions I have, I land back on the forum with people asking the same question, getting the answers I described above.
    I read through quite a few pages of the forum and found some things, but they either are extremely outdated, are recommended not to be used or flat out dont work.


    As I did my research and didn't find a definitive answer to my questions, I hope it's okay that I ask them, even tho they were asked plenty before.
    Maybe someone has new insights or can point me in the right direction on where to start or learn more.


    I am currently using C# to read memory (no library, just directly using kernel32)

    I want to be able to move around, interact with objects, traverse the quest window, loot objects ... the usual things you do.
    I want to stay as low profile as possible to avoid detection, and I just cant find an answer on which method to use.

    I read injecting dll is bad and easily detected, but WoW doesn't care if you do, is that still valid?
    I also found people using libraries to inject and execute assembly code directly into the game, but that also seems risky and I didn't find much information about it (probably a keyword issue tho, no idea how that method is called)


    My current idea was to just use a driver to simulate input coming from my actual input devices, but that requires unsigned drivers... which again probably look suspicious to waarden?
    Not to mention that moving a actual cursor and using a keyboard renders the rest of the PC basically useless as long as the program is running.

    The other idea was to use PostMessage, but I just cant seem to get it working. I read that WoW apparently ignores messages that come with a "Injected" flag? But then in other threads, not even that old (1-2 years) I see people still talk about and use it.


    Any pointers to information that might help me are greatly appreciated!

    Thanks

    Injecting and Writing Memory Questions
  2. #2
    swnt's Avatar Member
    Reputation
    7
    Join Date
    Jan 2022
    Posts
    11
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just an addition to the whole mouse discussion:

    WoW like a lot of other modern (or most directX?) games does not fetch it's mouse input from the window message queue, thats why just sending mouse messages will not work.
    Just as you would expect, SendInput does work but has the same problem: only usable while in foreground.

    I've also been reading that ppl have successfully been using send/postmessage in the past but I have never had it working in an up to date game client.
    Last edited by swnt; 09-28-2022 at 03:35 AM.

  3. #3
    Razzue's Avatar Contributor Avid Ailurophile

    CoreCoins Purchaser Authenticator enabled
    Reputation
    379
    Join Date
    Jun 2017
    Posts
    588
    Thanks G/R
    184/268
    Trade Feedback
    2 (100%)
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Post message works just fine if the window is in the foreground/background for key presses, which is what I use to move in game (wasd) and use spells/items/macro (addon to auto bind all those).
    For mouse input you can also use post message to send input as long as the game is in the foreground. You can also get it working while it's in the background, but I'd rather not get into that.
    A simple workaround for mouse clicks, and one I had previously implemented was store the handle of whatever window is topmost, and then set the wow window to topmost, send click, then restore other window back to topmost.

    If you're using it just for yourself, can use interception driver if you really want, but that will render PC essentially useless (or could just run in a vm)

    Have been using this for years with minimal issues (might need to add some waits on mouse clicks)
    Code:
    internal static void KeyDown(int key)    => u32.PostMessage(Game._WindowHandle, 0x100, key, 0);
    internal static void KeyUp(int key)
        => u32.PostMessage(Game._WindowHandle, 0x101, key, 0);
    
    
    internal static void LeftClick(int X, int Y)
    {
        var oldWindow = u32.GetForegroundWindow();
        if (!u32.SetForegroundWindow(Game._WindowHandle)) return;
    
    
        u32.PostMessage(Game._WindowHandle, 0x200,
            0x0001, ((Y << 16) | (X & 0xFFFF)));
        Task.Factory.StartNew(WaitTask(25)).Wait();
    
    
        u32.PostMessage(Game._WindowHandle, 0x201,
            0x0001, ((Y << 16) | (X & 0xFFFF)));
    
    
        u32.PostMessage(Game._WindowHandle, 0x202,
            0x0000, ((Y << 16) | (X & 0xFFFF)));
    
    
        u32.SetForegroundWindow(oldWindow);
    }
    Last edited by Razzue; 09-28-2022 at 05:14 AM.
    "May all your bacon burn"

  4. #4
    SatyPardus's Avatar Active Member
    Reputation
    15
    Join Date
    Nov 2014
    Posts
    24
    Thanks G/R
    15/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting.
    I had a similar code when I was testing Postmessage for the first time, where I set the window to foreground and then back (Even for key presses), but WoW didn't do anything.
    The window did get moved front and back, but the keys were just ignored.

    Gotta have to try that again.

    A VM would be possibly an option to avoid rendering the PC unuseable. But running windows inside windows is always such a lag fest haha.

    Thanks! Will try PostMessage again then. I must have screwed it up somewhere then.

  5. #5
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SatyPardus View Post
    Interesting.
    I had a similar code when I was testing Postmessage for the first time, where I set the window to foreground and then back (Even for key presses), but WoW didn't do anything.
    The window did get moved front and back, but the keys were just ignored.

    Gotta have to try that again.

    A VM would be possibly an option to avoid rendering the PC unuseable. But running windows inside windows is always such a lag fest haha.

    Thanks! Will try PostMessage again then. I must have screwed it up somewhere then.
    Try Hyper-V there is no lagg.. youtube how to get GPU acceleration.

    You dont need mouse clicks btw. You can write guids and use interact binds or targeting binds.
    Or for looting if mob dies, Use a bind for target last target then press interact bind. CTM must be on for auto run to corpse.
    Navigation with emulator mmaps is easy to implement if you code in c++ or python.

  6. #6
    swnt's Avatar Member
    Reputation
    7
    Join Date
    Jan 2022
    Posts
    11
    Thanks G/R
    2/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Razzue View Post
    Post message works just fine if the window is in the foreground/background for key presses, which is what I use to move in game (wasd) and use spells/items/macro (addon to auto bind all those).
    For mouse input you can also use post message to send input as long as the game is in the foreground. You can also get it working while it's in the background, but I'd rather not get into that.
    A simple workaround for mouse clicks, and one I had previously implemented was store the handle of whatever window is topmost, and then set the wow window to topmost, send click, then restore other window back to topmost.

    If you're using it just for yourself, can use interception driver if you really want, but that will render PC essentially useless (or could just run in a vm)

    Have been using this for years with minimal issues (might need to add some waits on mouse clicks)
    Code:
    internal static void KeyDown(int key)    => u32.PostMessage(Game._WindowHandle, 0x100, key, 0);
    internal static void KeyUp(int key)
        => u32.PostMessage(Game._WindowHandle, 0x101, key, 0);
    
    
    internal static void LeftClick(int X, int Y)
    {
        var oldWindow = u32.GetForegroundWindow();
        if (!u32.SetForegroundWindow(Game._WindowHandle)) return;
    
    
        u32.PostMessage(Game._WindowHandle, 0x200,
            0x0001, ((Y << 16) | (X & 0xFFFF)));
        Task.Factory.StartNew(WaitTask(25)).Wait();
    
    
        u32.PostMessage(Game._WindowHandle, 0x201,
            0x0001, ((Y << 16) | (X & 0xFFFF)));
    
    
        u32.PostMessage(Game._WindowHandle, 0x202,
            0x0000, ((Y << 16) | (X & 0xFFFF)));
    
    
        u32.SetForegroundWindow(oldWindow);
    }
    Damn, true I forgot that mouse does work in foreground using postmessage, I just usually don't use it altogether for the tasks my bot fulfills.
    Apart from that it's pretty funny to see that you're doing the same window swapping I had been using for some time when I needed it to work, lol.

    Still dislike it because it renders working on the PC at the same time very inefficient.

    And using one VM per wow instance is something you can do if continuous mouse control is essential to you; as others described, you can get a lot of stuff done even without mouse, so it's not something I care to set up.

  7. #7
    Hazzbazzy's Avatar wannabe hackerlol Authenticator enabled
    Reputation
    1335
    Join Date
    Aug 2011
    Posts
    1,206
    Thanks G/R
    243/484
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just want to mention as a cautionary that generated input (via PostMessage/SendInput, etc), is detectable through Windows API.
    I'm not sure if Blizzard are currently checking for this.

    Ref GetCurrentInputMessageSource function (winuser.h) - Win32 apps | Microsoft Learn
    [...]
    INPUT_MESSAGE_ORIGIN_ID (winuser.h) - Win32 apps | Microsoft Learn
    "HOLY TIME MACHINE BATMAN! it's 1973!"
    https://youtube.com/Hazzbazzy

  8. #8
    charles420's Avatar Contributor
    Reputation
    315
    Join Date
    Jun 2009
    Posts
    329
    Thanks G/R
    25/119
    Trade Feedback
    0 (0%)
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Hazzbazzy View Post
    Just want to mention as a cautionary that generated input (via PostMessage/SendInput, etc), is detectable through Windows API.
    I'm not sure if Blizzard are currently checking for this.

    Ref GetCurrentInputMessageSource function (winuser.h) - Win32 apps | Microsoft Learn
    [...]
    INPUT_MESSAGE_ORIGIN_ID (winuser.h) - Win32 apps | Microsoft Learn
    they don't currently check this as of now but can always change if worried tho can use a driver or hook it and change flags etc

  9. #9
    Hazzbazzy's Avatar wannabe hackerlol Authenticator enabled
    Reputation
    1335
    Join Date
    Aug 2011
    Posts
    1,206
    Thanks G/R
    243/484
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by charles420 View Post
    they don't currently check this as of now but can always change if worried tho can use a driver or hook it and change flags etc
    Driver would be not a bad option, purely for the learning process; you could also make use of a signed vulnerable driver, like mhyprot2
    Last edited by Hazzbazzy; 09-30-2022 at 05:32 AM.
    "HOLY TIME MACHINE BATMAN! it's 1973!"
    https://youtube.com/Hazzbazzy

Similar Threads

  1. Replies: 4
    Last Post: 07-30-2012, 09:39 PM
  2. [Question] Injection and hooking
    By Mikanor in forum SWTOR Memory Editing
    Replies: 0
    Last Post: 02-17-2012, 02:54 PM
  3. Looking for a C# Programmer (memory reading and writing)
    By Vanguards in forum WoW Memory Editing
    Replies: 2
    Last Post: 02-05-2012, 12:31 PM
  4. Noob Question. C++ start wow memoryread and write
    By Sinobis9000 in forum WoW Memory Editing
    Replies: 4
    Last Post: 01-20-2012, 03:39 PM
  5. Replies: 4
    Last Post: 07-20-2011, 09:50 PM
All times are GMT -5. The time now is 07:02 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search