Raised This Month: $ Target: $400
 0% 

General hamsandwich questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jim_yang
Veteran Member
Join Date: Aug 2006
Old 06-21-2009 , 02:47   Re: General hamsandwich questions
Reply With Quote #6

vtable only contains virtual member function pointers, all of your provided functions are non virtual member function, they
don't exist in CBasePlayer's Obj's vtable.
calling function is simple if you know its real address, prototype and calling conventions. here is an example to call
CBasePlayer::DropPlayerItem(const char *szItem), I use it to instead "engclient_cmd" method to force a player drop an item.
Code:
void CallDllDropPlayerItem(edict_t *pEdict, const char *szWeapon)
{
    HMODULE handle = GetModuleHandle("mp.dll");
    unsigned long baseaddr = (unsigned long)handle;
    void *g_CBasePlayer_DropPlayerItem = (void *)(baseaddr + 0xB3DB0);
    CBasePlayer *pPlayer = (CBasePlayer *)pEdict->pvPrivateData;
    __asm
    {
        PUSH    szItem;     //push param into stack
        MOV     ECX, pPlayer; //push "this" to ecx
        CALL    [g_CBasePlayer_DropPlayerItem]; //call function
    }
}
To get the real address and prototype, you need to disassemble the gamedll. "mp.dll" here for windows.
Then find the function address you want to call.
By this way, you can call all the functions you list above. Hooking them is another story.
To get virtual offsets, here is a tut:
http://wiki.alliedmods.net/Finding_Virtual_Offsets
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode