[Question - C++] How to correctly deal with main thread functions menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    prospectingemu's Avatar Member
    Reputation
    15
    Join Date
    Mar 2014
    Posts
    49
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question - C++] How to correctly deal with main thread functions

    Hi,

    Currently working on a C++ dll for wow. Right now I have a static class to call functions like click-to-move and want to know how to deal with calling doString from here.

    My doString hook looks like this. Currently set 'NEXT_COMMAND' and 'ARGUMENT' to run macros/get cool downs. This works in main BUT I cant put it my functions class because its not static. (I cant get the function pointer of a non-static member to pass to msdetours to make the code run)

    Code:
    int __fastcall mainThreadFunction()
    {
    	if (NEXT_COMMAND != EMPTY){
    		originalDoString(NEXT_COMMAND.c_str(), " ");
    		if (ARGUMENT !=  EMPTY){
    			getText(argument.c_str());
    		}
    		NEXT_COMMAND =  EMPTY;
    		ARGUMENT =  EMPTY;
    	}
    	return originalFunction;
    }
    Right now it works in main.cpp (where I set it up to test it) but it's obviously messy and going to cause problems later. If I want to have doString run outside of main I need to pass the location of NEXT_COMMAND and write directly to memory, is there an easier way to go about this?

    [Question - C++] How to correctly deal with main thread functions
  2. #2
    prospectingemu's Avatar Member
    Reputation
    15
    Join Date
    Mar 2014
    Posts
    49
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow I feel dumb, just passing the pointer works fine - still if anyone has another way of dealing with this it would be interesting to see.
    Code:
    void Functions::doString(std::string * commandLocation, std::string command){
    	*commandLocation = command;
    	while (*commandLocation != "NULL"){
    		Sleep(1);
    	}
    }

Similar Threads

  1. [Question] How do you deal with Warrior PQR'ing? (Bash, istant overpower)
    By dealerx in forum WoW Bots Questions & Requests
    Replies: 7
    Last Post: 07-30-2017, 04:20 PM
  2. How do you deal with a massive auction house botter?
    By Nevodark in forum World of Warcraft General
    Replies: 4
    Last Post: 06-24-2014, 09:50 PM
  3. How would you deal with him?
    By Bloodstain in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 11-05-2008, 07:19 AM
  4. [Question] How come nothing works with Vista
    By Pellydelly in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 11-02-2007, 12:46 PM
All times are GMT -5. The time now is 06:40 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