Hook _sampPlayerState

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Code:
DWORD		SAMP_DLL;
DWORD		_HookedPlayerSTATE;

void __sampHookPlayerSTATE()
{
	//samp.dll+6DD38
	DWORD oldflag;

	DWORD Addr = SAMP_DLL + 0x6DD38;
	DWORD CmD = Addr - 0x1;
	DWORD ToAd = (DWORD)&_HookedPlayerSTATE;

	VirtualProtect((LPVOID)Addr, 5, PAGE_EXECUTE_READWRITE, &oldflag);
	VirtualProtect((LPVOID)CmD, 5, PAGE_EXECUTE_READWRITE, &oldflag);

	*(DWORD*)Addr = ToAd; // original instruction : mov al, [eax+000000350]
	*(BYTE*)CmD = (BYTE)0x5; // change to mov al, _HookedPlayerSTATE
	_HookedPlayerSTATE = 1; // normal state(onfoot)

}

you can use this in your main(DLL hack), just call it and if you want to modify the state you can just write for example _HookedPlayerSTATE = 50; like

Code:
void SendPlayerInVehicle(DWORD VehiclePointer)
{
     DWORD cped = 0xB6F5F0;
     DWORD adrs = *(DWORD*)cped + 0x58C;
     *(DWORD*)adrs = VehiclePointer; // kind of writememory

     _HookedPlayerSTATE = 50; // 50 is driving state
}

i think nobody will use this since there is already raknet in s0beit, but you can use it if you're willing to create a dll hack or some shit lol..., this is a little old btw i just wanted to share some stuff x] (btw it can be used for CLEO! wthout sampfuncs ofc)
 

|]_ReT1neX_[|

Active member
Joined
Jul 28, 2014
Messages
132
Reaction score
0
It's sad that most of the people in UG are interested only in CLEO Releases and s0beit Projects.

They have no idea what they're missing  :imoverit:

Nice job btw :D... And thank you for sharing :)
 

Prefixobjekt

Active member
Joined
Aug 1, 2014
Messages
55
Reaction score
0
[member=5679]T3K[/member]
Very nice, do you have the adress for 0.3.7 playerstate?
pls update the snippet to 0.3.7
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
Prefixobjekt link said:
[member=5679]T3K[/member]
Very nice, do you have the adress for 0.3.7 playerstate?
Player or game state?
 

Suave

Member
Joined
Apr 1, 2016
Messages
5
Reaction score
0
The offset for the address in the OP (SAMP_DLL + 0x6DD38) is now (SAMP_DLL + 0xA6708) for 0.3.7.
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Suave said:
The offset for the address in the OP (SAMP_DLL + 0x6DD38) is now (SAMP_DLL + 0xA6708) for 0.3.7.

That's correct.
 

bobesin

Active member
Joined
Feb 20, 2013
Messages
166
Reaction score
1
I can't understand jack shit you're talking about here, I just never posted anything here. I had a need to leave a trace in this part of the forums lol bye nao
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
bobesin said:
I can't understand jack shit you're talking about here, I just never posted anything here. I had a need to leave a trace in this part of the forums lol bye nao

oiii mate, all obviousness aside, if u can't code u won't understand...

in case you do:
this simply changes a mov instruction in a samp subroutine that copies the player's state (running,incar,swimming,...)
the address in the mov instruction is the address to the player's state. if u change it u can make samp copy from the new address and thus u can control the remote player state.
why change it?, because if you change the value of the normal game player state (the original address) it will make your player's skin disappear which is unappealing.
why change the playerstate? because u can change another address which contains the vehicle pointer to the last vehicle u were in, to trick the game that u are in that vehicle.

ps: i forgot to mention this is just an improvement to FYP's/opcode's(idk who came up with it)  technique which u can see here:
https://youtu.be/s6YWgsG6y60?t=31s
at 00:31 u can see the skin disappears which sux.



ps-_insert_count_here_: this post is destinated to everybody, i just forgot to mention this the day i published the stuff...
 

bobesin

Active member
Joined
Feb 20, 2013
Messages
166
Reaction score
1
T3KTONIT said:
bobesin said:
I can't understand jack shit you're talking about here, I just never posted anything here. I had a need to leave a trace in this part of the forums lol bye nao

oiii mate, all obviousness aside, if u can't code u won't understand...

in case you do:
this simply changes a mov instruction in a samp subroutine that copies the player's state (running,incar,swimming,...)
the address in the mov instruction is the address to the player's state. if u change it u can make samp copy from the new address and thus u can control the remote player state.
why change it?, because if you change the value of the normal game player state (the original address) it will make your player's skin disappear which is unappealing.
why change the playerstate? because u can change another address which contains the vehicle pointer to the last vehicle u were in, to trick the game that u are in that vehicle.

ps: i forgot to mention this is just an improvement to FYP's/opcode's(idk who came up with it)  technique which u can see here:
https://youtu.be/s6YWgsG6y60?t=31s
at 00:31 u can see the skin disappears which sux.



ps-_insert_count_here_: this post is destinated to everybody, i just forgot to mention this the day i published the stuff...

Thank you, my fair lady. ♥
 
Top