Invalid function pointer menu

User Tag List

Results 1 to 7 of 7
  1. #1
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Invalid function pointer

    Ok guys, I really feel stupid right now.

    I didn't do anything for WoW last months and just came back to that game.
    My intention: To write some nice extensions for the WoW's lua language.

    Pretty easy stuff, until ... "Invalid function pointer: 0xDEADBEEF"
    I felt kinda stupid and attached my debugger, 0xDEADBEEF was indeed the address of my own function.

    Thank god I immediately got a meaningfull result when I looked up IDA for that problem, seems like every address outside WoW's .code section is invalid for use in FrameScript::Register.

    Before I start hacking by writing code to codecaves et cetera, is there a more 'clean' way to bypass this?
    I am pretty sure Warden watches the function checking the pointer, am I right?

    And what I care most at the moment: Is calling a function, which fails at the pointer check a reason for a (delayed) ban? I don't really want to get butt****ed on my main account, which I used for testing

    Thanks.
    Regards,
    Flo
    Hey, it compiles! Ship it!

    Invalid function pointer
  2. #2
    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)
    Just write a jmp somewhere in the .text segment.

  3. #3
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not a reason for a delayed ban, there are however certain things to take into account.

    - Changing the value that defines the 'end of .text' section will result in a ban.
    - Using the first set of INT3's will result in a ban, iirc *buddy software used this to flag process instances as 'injected'.

    Both are watched by Maiev.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  4. #4
    eLaps's Avatar Active Member
    Reputation
    34
    Join Date
    Sep 2007
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just patch and restore it each time you need it.
    Code:
    uint32_t backup = *(uint32_t*)0xa6c750;
    *(uint32_t*)0xa6c750 = 0xFFFFFF;
    //Make your lua calls
    *(uint32_t*)0xa6c750 = backup;

  5. #5
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if it's still valid but a simple workaround would be a hook on entercriticalsection and leavecritical section, because warden calls/called entercriticalsection before scanning and leave criticalsection afterwards.
    There are also several other places where you could possibly intercept the warden scann, just make sure warden doesn't catch you doing so
    I hacked 127.0.0.1

  6. #6
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your replies, just got back from holidays, couldn't answer earlier

    This is the code I quickly wrote, I really can't figure out why it always results in Access Violations ( Instruction at 0x12345678 attempted to write at 0x12345678 (where 0x12345678 is the address of my lua function ) after being called ingame via the /script command:

    Code:
    	template < typename pfunction_t >
    	pfunction_t WriteFunctionJump(LPVOID targetAddress, pfunction_t function)
    	{
    		#pragma pack(push)
    		#pragma pack(1)
    
    		struct Jmp
    		{
    			BYTE instruction;
    			pfunction_t function;
    		};
    
    		#pragma pack(pop)
    
    		Jmp jmp = { 0xE9, function };
    
    		DWORD oldProtect;
    		::VirtualProtect(	targetAddress,
    								sizeof(Jmp),
    								PAGE_EXECUTE_READWRITE,
    								&oldProtect);
    
    		::memcpy(targetAddress, static_cast<LPVOID>(&jmp), sizeof(Jmp));
    
    		return static_cast<pfunction_t>(targetAddress); 
    	}
    Code:
    FrameScript::RegisterFunction("DoSomething", Utilities::WriteFunctionJump<lua_Function>( /*Some Codecave I use*/, CustomLua::DoSomething));
    It's probably something stupid I guess.
    Hey, it compiles! Ship it!

  7. #7
    zzgw's Avatar Member
    Reputation
    6
    Join Date
    Mar 2008
    Posts
    31
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For what it's worth, you only get banned if you change it to -1, anything else is fine (for the moment). Also the true horror here is that you're using your main account for testing, you're just asking for it.

Similar Threads

  1. C++ Member Function Pointers (Help!)
    By Amrok in forum WoW Memory Editing
    Replies: 2
    Last Post: 10-09-2011, 12:30 PM
  2. [Help me]Problem with using function pointer in Debug builds
    By wanyancan in forum WoW Memory Editing
    Replies: 6
    Last Post: 01-06-2010, 05:06 AM
  3. C# function pointers
    By lanman92 in forum Programming
    Replies: 8
    Last Post: 06-05-2009, 01:24 PM
  4. The typedef keyword. Functions, function pointers, and you.
    By Cypher in forum WoW Memory Editing
    Replies: 16
    Last Post: 01-07-2009, 12:10 AM
  5. 3.0.2 some function/pointer addresses
    By g3gg0 in forum WoW Memory Editing
    Replies: 6
    Last Post: 11-04-2008, 12:23 AM
All times are GMT -5. The time now is 09:02 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