
Originally Posted by
Reaguee
As I said.. you are codecaving in ASM
//snip
No issue exists with changing the compared ID of the current player in the middle of the function.
What is the point of how you kick users? Are you trying to say yours achieves some different effect just because your function is longer? This is all it takes.
Code:
SendClientMessage(CurrentPlayer, "Connection Closed.");
CloseUser(CurrentPlayer);
As to why I have not posted mine, I posted everything that is needed to do it in this thread. The address you can hook, the variable to extract, and the logic needed to make it work. I have not posted my code verbatim because it is built into a plugin framework for dynamic deployment and the functions will obviously not work without the complete code. All code snips are C++ friendly, I cannot attest to them working on C#.
Code:
__asm
{
POP RetAddr
MOV BYTE PTR DS:[EBX + 0x0C], 0
MOVZX EAX, BYTE PTR DS:[EBX + 0x0D]
MOV CurrentPlayer, EDI
PUSHAD
PUSHFD
}
//Call your function to process the current player here, if you want the mount to success, make sure CurrentPlayer is returned with their real player id, otherwise just set it to 1001.
__asm
{
POPFD
POPAD
MOV EDI, CurrentPlayer
PUSH RetAddr
ret
}