Lua_inject menu

User Tag List

Thread: Lua_inject

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    luciferc's Avatar Contributor
    Reputation
    90
    Join Date
    Jul 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua_inject

    So i got it working and i disabled protection check so its all good.

    Only problem is i dunno how to do macro like commands for it.

    Ex I want to do this

    Code:
    wow.asm.Lua_Execute("/run if not UnitBuff(\"Player\",\"Swift Red Wind Rider\") then CastSpellByName(\"Swift Red Wind Rider\") end");
    Typing into game = it works

    Lua injecting = Syntax Errors. So how would i restructure it to make it work?

    Lua_inject
  2. #2
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    typedef void ( __cdecl * tLua_Dostring )( char * pszString, char * pszString2, void * pState );
    Lua_Dostring = ...;
    
    #define DOLUA(x)Lua_Dostring( x , x , GetLuaState())
    DOLUA( "AccountLoginUI:Show();" );
    If its like this, it should work. Make sure, the string is escaped right. What is that "/run" doing? Isn't that a command to just run Lua-scripts? If yes, you wont need it here.

    DOLUA( "if not UnitBuff(\"Player\",\"Swift Red Wind Rider\") then CastSpellByName(\"Swift Red Wind Rider\"); end" ); should work.

    Alternatively, do the if () by hand. Execute UnitBuff(), get the return value from the stack, if not, execute CSBN().
    Last edited by schlumpf; 03-08-2009 at 02:59 PM.

  3. #3
    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)
    Originally Posted by schlumpf View Post
    Code:
    typedef void ( __cdecl * tLua_Dostring )( char * pszString, char * pszString2, void * pState );
    Lua_Dostring = ...;
    
    #define DOLUA(x)Lua_Dostring( x , x , GetLuaState())
    DOLUA( "AccountLoginUI:Show();" );
    If its like this, it should work. Make sure, the string is escaped right. What is that "/run" doing? Isn't that a command to just run Lua-scripts? If yes, you wont need it here.

    DOLUA( "if not UnitBuff(\"Player\",\"Swift Red Wind Rider\") then CastSpellByName(\"Swift Red Wind Rider\"); end" ); should work.

    Alternatively, do the if () by hand. Execute UnitBuff(), get the return value from the stack, if not, execute CSBN().
    Bad bad bad bad bad. Use an inline function, NOT a macro.

    Better:
    void inline Lua_Dostring( std::string Code, std::string File = "Hax.lua", void* pLuaState = 0)
    {
    pLua_DoString(Code.c_str(),File.c_str(),pLuaState ? pLuaState : GetLuaState());
    }

  4. #4
    luciferc's Avatar Contributor
    Reputation
    90
    Join Date
    Jul 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tyvm Cypher + schlumpf

  5. #5
    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)
    Oh whoops. What was I smoking. The params should be like this:
    void inline Lua_Dostring(const std::string& Code, const std::string& File = "Hax.lua", void* pLuaState = 0);

    Last time I wake up early. >.<

  6. #6
    luciferc's Avatar Contributor
    Reputation
    90
    Join Date
    Jul 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any limit on Lua Injects string size? Like 1000 etc. would that be okay?

  7. #7
    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)
    I doubt there's a limit. It probably just parses until it hits a null byte.

  8. #8
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is WoW parsing the .lua files line by line or all at once?

  9. #9
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by schlumpf View Post
    Is WoW parsing the .lua files line by line or all at once?
    IIRC, the LUA engine concats everything anyway.

  10. #10
    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)
    Originally Posted by schlumpf View Post
    Is WoW parsing the .lua files line by line or all at once?

    What does it matter?

  11. #11
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uhm, I just want to know it? May've been possible that someone would know that. There is no specific reason behind everything ..

  12. #12
    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)
    Curiosity IS a reason. I'd be a bit confused if you did things for absolutely no reason. Would probably be a good sign that there's something going wrong upstairs.

  13. #13
    jagged software's Avatar Member
    Reputation
    -4
    Join Date
    Feb 2009
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been coding for 10 years now, I've done injection, but I have no idea how to interface with wow to send lua commands directly. I have a lot of really good ideas on what I can get accomplished after doing this. Could any of you point me in the right direction on where to start? I would like to become part of the scene here at mmowned.
    C++ preferred, C#, anything will do. Although my knowledge on ASM is only elementary.

  14. #14
    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)
    Try the search feature. It's only been covered about a hundred ****ing times.

    If you wanna be part of the community, how about READING THE SECTION RULES.

  15. #15
    jagged software's Avatar Member
    Reputation
    -4
    Join Date
    Feb 2009
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cypher, thanks for your quick reply. I read your blog regularly.
    Objectively, I understand your frustration at the volume of traffic this site gets in regards to bottom feeders.
    I mean no disrespect, quite the contrary, I'll make sure to reread the section rules.
    My inquiry is to lua injection specifically, which pegs a total of 2 pages on the search.
    I've read every post on those two pages, the most informative of which were done by yourself and kynox.

Page 1 of 2 12 LastLast
All times are GMT -5. The time now is 07:12 PM. 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