register new lua function, safety menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Teq2's Avatar Member
    Reputation
    1
    Join Date
    Aug 2011
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    register new lua function, safety

    Is it safe to use lua_register (lua_pushcclosure, lua_setfield..) to extend base wow lua? Does warden monitors lua_state integrity atm (m.b. some crc checks)? I havent any idea how to find out for sure.
    Last edited by Teq2; 04-16-2012 at 11:01 PM.

    register new lua function, safety
  2. #2
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They check if if the callback is within wow's .text section. I don't think they send this back to the server though. It seems to be just a local fatal error. (Unless you choose to submit the crash report)
    They don't, as far as I know, check which callbacks or how many that are registered.
    Find 5 free bytes and register that address as your callback and write a 'jmp your_real_function' there to get around the section check.

    @ .text:008742B0
    Code:
    int __cdecl FrameScript::InvalidPtrCheck(unsigned int ptr)
    {
      int result; // eax@1
      int v2; // ecx@1
      char v3; // [sp+0h] [bp-40h]@6
    
      result = textsection_start;
      v2 = textsection_end;
      if ( !textsection_start || !textsection_end )
      {
        FindTextSection();
        result = textsection_start;
        v2 = textsection_end;
      }
      if ( ptr < result || ptr >= v2 )
      {
        SStrVPrintf((int)&v3, "Invalid function pointer: %p", ptr);
        SErrDisplayAppFatal(&v3);
      }
      return result;
    }
    And you don't have to register your callback manually, you can use
    .text:00839620 FrameScript_RegisterFunction(char const*, int (*)(lua_State *))

  3. #3
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Also, note that at one point the first occurrence of 5 free bytes was being monitored by Warden (presumably for this reason).

  4. #4
    Teq2's Avatar Member
    Reputation
    1
    Join Date
    Aug 2011
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by _Mike View Post
    Find 5 free bytes and register that address as your callback and write a 'jmp your_real_function' there to get around the section check.
    I think it's better to hook "InvalidPtrCheck" and use any address what i want. Writing all patches into a list and hooking warden's-scan proc to allow it read only original bytes, this what i'm using. I'll post this "anti-scan" somewhen later.

    p.s. sry, i cant give u rep, then thanks =)

  5. #5
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Patching any of that crap is silly imo.

    Register a Lua callback using the address of an int3 or similar instruction that will both cause an exception and pass the function pointer bounds check imposed when registering an ingame callback, then have your Lua callback execute the code (which will cause it to execute without protection), get the return values, etc.

    Obviously still detectable, but a step up from hooking the client, and if your code is private it's much less likely to get detected if you're using a technique like that as opposed to client hooking (where there's a good chance you'll be 'caught in the crossfire').
    0987654321

  6. #6
    Teq2's Avatar Member
    Reputation
    1
    Join Date
    Aug 2011
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Detectable patches isn't a problem, there is a way (working) to hide all patches from warden. I'm not looking for easy ways

  7. #7
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Teq2 View Post
    I think it's better to hook "InvalidPtrCheck" and use any address what i want. Writing all patches into a list and hooking warden's-scan proc to allow it read only original bytes, this what i'm using. I'll post this "anti-scan" somewhen later.

    p.s. sry, i cant give u rep, then thanks =)
    If you want to take that approach you actually don't have to hook anything. Just change the textsection_start and textsection_end globals to include your pages. They only ever get overwritten if either is null. Plus they're in .data which warden does not scan afaik.
    I'm actually kinda surprised warden does so little as far as detection methods goes. Sometimes I wish I could be the "warden guy" just for a day, just to mess with people
    Last edited by _Mike; 04-17-2012 at 08:26 PM.

Similar Threads

  1. Register a new Lua function
    By Blackplayer27 in forum WoW Memory Editing
    Replies: 1
    Last Post: 11-02-2013, 05:16 PM
  2. Replies: 112
    Last Post: 12-06-2008, 05:09 PM
  3. Replies: 22
    Last Post: 05-29-2008, 03:52 PM
  4. [Question] Lua functions
    By Lich King in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 04-10-2008, 07:39 PM
  5. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
All times are GMT -5. The time now is 08:48 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