When the function is called, the game client closes automatically. menu

User Tag List

Results 1 to 9 of 9
  1. #1
    Sunny_Gu's Avatar Member
    Reputation
    2
    Join Date
    Apr 2020
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    When the function is called, the game client closes automatically.

    I'm sorry, my mother tongue is not English.

    Game Version:36949
    D3D12 present hook
    problem:
    1.Jump() function working ( When the frequent called(Once per frame, FPS > 100),the game client closes automatically or Report error: The memory could not be "read" or LUA PANIC:unprotected error in call to Lua API (attempt to concatenate a function value).)
    2.CastSpellByName("Feign Death") not work,the game client closes automatically.
    3. RegisterFunc("Testfunc",Testfunc); working, Consel. Execute in game console: print(Testfunc) outputfunction : 000001B73229317 , Execute in game console: Testfunc() Report error: invalid function pointer: 000001b7476d7d20.
    I want to know why. Can someone help me?

    Code:
    uintptr_t BaseAdd = reinterpret_cast<uintptr_t>(GetModuleHandle(NULL)); 
    
    using Script_JumpOrAscendStart = uintptr_t(__fastcall*)();
    using Script_CastSpellByName = uintptr_t(__fastcall*)(const char*);
    using FrameScript_RegisterFunction = uintptr_t(__fastcall*)(const char* name, uintptr_t(__fastcall* function)());
    inline void Jump()
    {
        auto const TFunc = reinterpret_cast<Script_JumpOrAscendStart>(BaseAdd + 0x19D3100);
        TFunc();
    }
    
    inline void CastSpellByName(const char* name)
    {
        auto const TFunc = reinterpret_cast<Script_CastSpellByName>(BaseAdd + 0x1576BE8);
    
        TFunc(name);
    }
    
    inline void RegisterFunc(const char* name, uintptr_t func())
    {
        auto const TFunc = reinterpret_cast<FrameScript_RegisterFunction>(BaseAdd + 0x7BCA90);
    
        (TFunc)(name, func);
    }
    
    inline uintptr_t Testfunc()
    {
        Jump();
        return 0;
    }

    These ads disappear when you log in.

  2. #2
    namreeb's Avatar Legendary

    Reputation
    613
    Join Date
    Sep 2008
    Posts
    1,003
    Thanks G/R
    6/191
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's probably crashing since you are ignoring the argument to those functions: a pointer to the lua context.

  3. #3
    Sunny_Gu's Avatar Member
    Reputation
    2
    Join Date
    Apr 2020
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    It's probably crashing since you are ignoring the argument to those functions: a pointer to the lua context.
    Thank you. It's Lua_ State? Should I get it?

  4. #4
    34D's Avatar Member
    Reputation
    4
    Join Date
    May 2020
    Posts
    43
    Thanks G/R
    6/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RegisterFunction need fake ipc
    Calling wow lua internal Script_CastSpellByName etc. requires luac or DoString or load lua file
    Last edited by 34D; 01-08-2021 at 02:00 AM.

  5. #5
    Sunny_Gu's Avatar Member
    Reputation
    2
    Join Date
    Apr 2020
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by 34D View Post
    RegisterFunction need fake ipc
    Calling wow lua internal Script_CastSpellByName etc. requires luac or other versions of external lua to call DoString or load lua file for execution
    Include Lua's header file in my DLL?

  6. #6
    ChrisIsMe's Avatar Active Member
    Reputation
    63
    Join Date
    Apr 2017
    Posts
    97
    Thanks G/R
    44/25
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sunny_Gu View Post
    Include Lua's header file in my DLL?
    No the WoW Lua State and most of the Lua internals are very much modified in unique ways just for this game.

  7. #7
    Sunny_Gu's Avatar Member
    Reputation
    2
    Join Date
    Apr 2020
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ChrisIsMe View Post
    No the WoW Lua State and most of the Lua internals are very much modified in unique ways just for this game.
    I added Lua_ State, Jump() will still close automatically. (FPS<100 is work)

    Is there any other check for Blizzard?
    Code:
    void* luaState = reinterpret_cast<void*>(BaseAdd + 0x02E83C28);
    using Script_JumpOrAscendStart = uintptr_t(__fastcall*)(void*);
    inline void Jump()
    {
        reinterpret_cast<Script_JumpOrAscendStart>(BaseAdd + 0x19D3100)(luaState);
        
    }
    Last edited by Sunny_Gu; 01-08-2021 at 07:48 AM.

  8. #8
    Sunny_Gu's Avatar Member
    Reputation
    2
    Join Date
    Apr 2020
    Posts
    6
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I found the reason.
    D3D Presens thread not is mainthread?
    1.png

  9. #9
    silverpieces's Avatar Member
    Reputation
    1
    Join Date
    Nov 2020
    Posts
    11
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sunny_Gu View Post
    I think I found the reason.
    D3D Presens thread not is mainthread?
    1.png
    Shouldn't matter if it's not the main thread. If you want to call a jump from C++, one way would be to use FramescriptExecute. In retail at least this function is still viable. You can also look at this function decompiled to emulate what it does to push "JumpOrAscendStart" to the lua stack and call it. There are a lot of ways to go about it, so once you jump from your dll it's an "opening your eyes" moment.

Similar Threads

  1. Which is the best client for gaming?
    By Yawnstar in forum Gaming Chat
    Replies: 0
    Last Post: 12-18-2019, 03:22 PM
  2. Warrior - Charge - What function is called locally?
    By Tanaris4 in forum WoW Memory Editing
    Replies: 10
    Last Post: 04-25-2014, 05:25 PM
  3. Replies: 2
    Last Post: 03-16-2012, 05:08 PM
  4. what is the best item in the game?
    By maarte2003 in forum WoW Items & Quests
    Replies: 21
    Last Post: 08-08-2007, 02:17 AM
  5. Designer Island is still in the Game! 2.0.6!
    By edestron in forum Community Chat
    Replies: 8
    Last Post: 03-09-2007, 09:56 PM
All times are GMT -5. The time now is 08:44 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search