Looking for advice with FramescriptExecute internal call and patching invalid ptr menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Icesythe7's Avatar Contributor
    Reputation
    213
    Join Date
    Feb 2017
    Posts
    153
    Thanks G/R
    8/104
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hycolyte View Post
    I have it (OSX 15662). It wasn't my first thought to go and compare to that, but once I did, I identified the function based on a unique string. I would be pretty confident that I have the right function except that it takes 4 arguments instead of the 3 I was expecting unless there was a recent change to the client. I'll have to compare to some other clients I have, but it seems like a valid candidate for FS_GetText when decompiling. I was expecting 3 arguments passed based on krycess's repos (not sure how to tag a user). I feel I'm pretty close instead of no cigar, so I'll keep trying to get a return value working. It could be just how I'm dealing with the lua command.

    Update: Hells yeah! I got it working. I was real close yesterday, but I was doing std::to_string(getTextResultAddr) which was just turning the address to a string instead of that actual result.
    I do it like this
    Code:
    inline std::string ExecuteGetResult(const std::string& com, const std::string& arg)
    {
    	reinterpret_cast<uintptr_t(__fastcall*)(const char*, const char*, int64_t)>(Base + FrameScriptExecute)(com.c_str(), "teacup", 0);
    	return std::string(reinterpret_cast<const char*>(reinterpret_cast<uintptr_t(__fastcall*)(const char*, int64_t, int32_t, uint8_t)>(Base + FrameScriptGetText)(arg.c_str(), -1, 0, 0)));
    }
    Code:
    auto Name = ExecuteGetResult("myname = UnitName('player')", "myname")
    Last edited by Icesythe7; 3 Weeks Ago at 11:05 PM.

    These ads disappear when you log in.

  2. Thanks hycolyte (1 members gave Thanks to Icesythe7 for this useful post)
  3. #17
    hycolyte's Avatar Active Member Authenticator enabled
    Reputation
    17
    Join Date
    Nov 2019
    Posts
    46
    Thanks G/R
    19/11
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Icesythe7 View Post
    I do it like this
    Code:
    inline std::string ExecuteGetResult(const std::string& com, const std::string& arg)
    {
    	reinterpret_cast<uintptr_t(__fastcall*)(const char*, const char*, int64_t)>(Base + FrameScriptExecute)(com.c_str(), "teacup", 0);
    	return std::string(reinterpret_cast<const char*>(reinterpret_cast<uintptr_t(__fastcall*)(const char*, int64_t, int32_t, uint8_t)>(Base + FrameScriptGetText)(arg.c_str(), -1, 0, 0)));
    }
    Code:
    auto Name = ExecuteGetResult("myname = UnitName('player')", "myname")
    Excellent. I didn't think about combining the calls to get it in one shot.

    Do you mind sharing how you handle Execute in the main thread? My IPC changes a global value, and when that change is detected, it will fire the call but I imagine there is a better way to do this.

    Code:
    void PresentWork()
    {
    	if (Globals::luaCommand[0] != 0)
    	{
    		GameMethods::Execute(Globals::luaCommand);
    	}
    	Globals::luaCommand = "";
    }
    
    long __stdcall Present12Hook(IDXGISwapChain* pSwapChain, UINT syncInterval, UINT flags)
    {
    	if (initOnce)
    	{
    		initOnce = false;
    
    		//get device
    		if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&dDevice))))
    		{
    			pSwapChain->GetDevice(__uuidof(dDevice), reinterpret_cast<void**>(&dDevice));
    		}
    	}
    
    	PresentWork();
    
    	return oPresent12(pSwapChain, syncInterval, flags);
    }
    update: I was making this hard on myself like this. I'm now using the pipes server inside the present hook, so I don't have to do any fancy traps for lua in/out.
    Last edited by hycolyte; 3 Weeks Ago at 01:47 PM. Reason: update

  4. #18
    Icesythe7's Avatar Contributor
    Reputation
    213
    Join Date
    Feb 2017
    Posts
    153
    Thanks G/R
    8/104
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just execute lua with button presses from imgui or other lua hooks (ie hooking combat log via lua, when triggers callsback my own registered lua function which then could execute if i wanted it too but most generally I use LuaC api directly, the only thing i really use execute for is just initial setup stuff that runs once similar to you initOnce check above)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Buying] Looking for account with 100 legendarily and 1.5-2kk Stardust.
    By WANTES in forum Pokemon GO Buy Sell Trade
    Replies: 1
    Last Post: 08-19-2017, 04:41 PM
  2. [Buying] Looking for Hunter with flight unlocked and good gear
    By Rucola in forum WoW-EU Account Buy Sell Trade
    Replies: 1
    Last Post: 08-12-2017, 05:29 AM
  3. [Active] Looking for Pokesniper with human throws and long delay
    By Synapse7 in forum Pokemon GO Hacks|Cheats
    Replies: 0
    Last Post: 08-15-2016, 04:30 PM
  4. Looking for advice on a PvE server with atleast 20x xp rates.
    By babati in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-19-2010, 03:04 AM
  5. Looking for assist with Noggit and Private server.
    By Valcon9 in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 05-18-2009, 04:13 AM
All times are GMT -5. The time now is 10:02 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search