Raised This Month: $210 Target: $400
 52% 

Orpheu: Engine PM Functions


Post New Thread Reply   
 
Thread Tools Display Modes
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-11-2014 , 15:30   Re: Orpheu: Engine PM Functions
Reply With Quote #31

Does someone can update these function's signatures for stable CS version?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-11-2014 , 20:54   Re: Orpheu: Engine PM Functions
Reply With Quote #32

Quote:
Originally Posted by meTaLiCroSS View Post
Does someone can update these function's signatures for stable CS version?
yep

PHP Code:
PM_Init:
    
Win:
        
0x8B,0x44,0x24,0x04,0xA3,"*","*","*","*",0xE8
    Lin
:
        
PM_Init
        
PM_AirMove
:
    
Win:
        
0x83,0xEC,0x20,0xA1,"*","*","*","*",0x8B,0x88,0x68,0x54,0x04
    Lin
:
        
PM_AirMove
        
PM_CatagorizeTextureType
:
    
Win:
        
0x83,0xEC,0x18,0xA1,"*","*","*","*",0x8B,0x48,0x38,0x89,0x4C,0x24,0x0C,0x8B,0x50,0x3C
    Lin
:
        
PM_CatagorizeTextureType
        
PM_CheckFalling
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",x53,x8B,x81,xD0,"*","*","*",x85,xC0
    Lin
:
        
PM_CatagorizeTextureType
        
PM_CheckVelocity
:
    
Win:
        
0x8B,0x0D,"*","*","*","*",0x56,0x57,0x33,0xFF,0xBE
    Lin
:
        
PM_CheckVelocity
        
PM_CheckWater
:
    
Win:
        
0x83,0xEC,0x10,0xA1,"*","*","*","*",0x8B,0x88,0xBC
    Lin
:
        
PM_CheckWater
        
PM_CheckWaterJump
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",0x83,0xB9,0xE0,"*","*","*",0xFF
    Lin
:
        
PM_CheckWaterJump    

PM_CreateStuckTable
:
    
Win:
        
0x83,0xEC,0x0C,0xB9,"*","*","*","*",0xD9,0x05,"*","*","*","*",0x56
    Lin
:
        
PM_CreateStuckTable                
        
PM_Duck
:
    
Win:
        
0x81,0xEC,"*","*","*","*",0x53,0x55,0x56,0x8B,0x35
    Lin
:
        
PM_Duck    
        
PM_FlyMove
:
    
Win:
        
0x81,0xEC,"*","*","*","*",0x53,0x8B,0x1D,"*","*","*","*",0x55
    Lin
:
        
PM_FlyMove        

PM_InitTextureTypes
:
    
Win:
        
0xA1,"*","*","*","*",0x81,0xEC,"*","*","*","*",0x55
    Lin
:
        
PM_InitTextureTypes    
        
PM_InitTextureTypes
:
    
Win:
        
0xA1,"*","*","*","*",0x81,0xEC,"*","*","*","*",0x55
    Lin
:
        
PM_InitTextureTypes    

PM_Jump
:
    
Win:
        
0xA1,"*","*","*","*",0x33,0xC9,0x56,0x8B,0x90,0x98,"*","*","*",0x85
    Lin
:
        
PM_Jump    
        
PM_LadderMove
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",0x83,0xB9,0xE0,"*","*","*",0xFF
    Lin
:
        
PM_LadderMove

PM_Move
:
    
Win:
        
0x8B,0x54,0x24,0x08,0x8B,0x44,0x24,0x04,0x33,0xC9,0xA3
    Lin
:
        
PM_Move    

PM_Physics_Toss
:
    
Win:
        
0x81,0xEC,"*","*","*","*",0xE8,"*","*","*","*",0x8B
    Lin
:
        
PM_Physics_Toss    

PM_PlayerMove
:
    
Win:
        
0x83,0xEC,0x10,0xA1,"*","*","*","*",0x8B,0x4C,0x24,0x14,0x53,0x56,0x57,0x33,0xFF,0x89,0x48,0x04
    Lin
:
        
PM_PlayerMove    

PM_PlayStepSound
:
    
Win:
        
0xA1,"*","*","*","*",0x33,0xC9,0x56,0x8B,0x90,0x98,"*","*","*",0x85
    Lin
:
        
PM_PlayStepSound    

PM_ReduceTimers
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",0x56,0x33,0xF6,0x8B,0x81,0x94
    Lin
:
        
PM_ReduceTimers        

PM_SpectatorMove
:
    
Win:
        
0x8B,0x15,"*","*","*","*"83,0xEC,0x20,0x8B,0x82,0xFC,0x01,"*","*",0x57
    Lin
:
        
PM_SpectatorMove    

PM_UpdateStepSound
:
    
Win:
        
0xA1,"*","*","*","*",0x83,0xEC,0x1C,0x8B,0x88,0x94,"*","*","*",0x56
    Lin
:
        
PM_UpdateStepSound    

PM_WaterMove
:
    
Win:
        
0x8B,0x15,"*","*","*","*",0x81,0xEC,"*","*","*","*",0x33
    Lin
:
        
PM_WaterMove 
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-12-2014 , 01:00   Re: Orpheu: Engine PM Functions
Reply With Quote #33

Damn, thanks a lot buddy

Also, does.. since when exists a PM_Jump_part_2 function? o.o IDA Pro threw me that function lol
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-12-2014 , 19:11   Re: Orpheu: Engine PM Functions
Reply With Quote #34

Quote:
Originally Posted by meTaLiCroSS View Post
Damn, thanks a lot buddy

Also, does.. since when exists a PM_Jump_part_2 function? o.o IDA Pro threw me that function lol
As far as I remeber, _part_2 it's just a short jump but it's not fully functional for function call. Maybe I'm wrong.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-12-2014 , 22:40   Re: Orpheu: Engine PM Functions
Reply With Quote #35

Quote:
Originally Posted by joropito View Post
As far as I remeber, _part_2 it's just a short jump but it's not fully functional for function call. Maybe I'm wrong.
Hmmm, it appears on the function list on IDA (linux) and when decompiling PM_Jump_part_2 exists, and PM_Jump also
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-13-2014 , 09:45   Re: Orpheu: Engine PM Functions
Reply With Quote #36

_part_2 uses stack pointer as an standalone function, but it's called with JMP from PM_Jump.
So you can't be sure it's a real function following function calling conventions.

I see it's called with CALL from other locations (PM_PlayerMove). It's just a tricky optimization from compiler.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-13-2014 , 16:12   Re: Orpheu: Engine PM Functions
Reply With Quote #37

Quote:
Originally Posted by joropito View Post
_part_2 uses stack pointer as an standalone function, but it's called with JMP from PM_Jump.
So you can't be sure it's a real function following function calling conventions.

I see it's called with CALL from other locations (PM_PlayerMove). It's just a tricky optimization from compiler.
Yeah, it's inline until an specific code
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 06-11-2015 , 16:22   Re: Orpheu: Engine PM Functions
Reply With Quote #38

Few posts above Bos93 posted signature for update, I found that PM_Jump sig in that post is wrong and it is for PM_PlayStepSound(), so here is correct one:
Code:
{
    "name" : "PM_Jump",
    "library" : "mod",
    "identifiers" :
    [
        {
            "os" : "windows",
            "mod" : "cstrike",
            "value" : 0x00B4EC0
        },
        {
            "os" : "linux",
            "mod" : "cstrike",
            "value" : "PM_Jump"
        }
    ]
}
lazarev is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 05-02-2017 , 05:20   Re: Orpheu: Engine PM Functions
Reply With Quote #39

Quote:
Originally Posted by joaquimandrade View Post
In half life engine there is a part of the code where the physic calculations to player movement happen (jumping, ducking, moving on water, no clipping, etc). It is unexplored in scripting because those functions are not acessible normally. With orpheu you can use them.

The entry point for the calculations is the function PM_Move, that has the following header:

PHP Code:
PM_Move struct playermove_s *ppmoveint server 
The first argument is a structure (a group of data belonging to a player) that is saved when PM_Move is called and then used in other PM functions.

You can see the structure data here:

http://metamod.org/sdk/dox/pm__defs_8h-source.html

When using Orpheu to hook PM functions the way of accessing the ppmove structure varies from PM_Move to other functions.

In PM_Move you can use it directly:
PHP Code:
public PM_Move(ppmove,server)
{
    new 
Float:gravity Float:OrpheuGetParamStructMember(1,"gravity")

In other functions you have to get ppmove from memory and use it after.
We need to declare in a file how to obtain it from memory but that part is already made by me so you just have to care with using it:

PHP Code:
OrpheuStruct:get_ppmove()
{        
    return 
OrpheuGetStructFromAddress(OrpheuStructPlayerMove,OrpheuMemoryGet("ppmove"))
}
   
public 
PM_Duck()
{
    new 
OrpheuStruct:ppmove get_ppmove()
        
    new 
gravity OrpheuGetStructMember(ppmove,"gravity")

To retrieve the id of a player you should use the member of ppmove called "player_index":

PHP Code:
new id OrpheuGetStructMember(ppmove,"player_index") + 
A full example on blocking duck for non bot players:


PHP Code:

#include <amxmodx>
#include <orpheu>
#include <orpheu_advanced>
#include <orpheu_memory>
    
public plugin_init()
{        
    
OrpheuRegisterHook(OrpheuGetFunction("PM_Duck"),"OnPM_Duck")
}

public 
OrpheuHookReturn:OnPM_Duck()
{
    new 
OrpheuStruct:ppmove get_ppmove()
    
    new 
id OrpheuGetStructMember(ppmove,"player_index") + 1
    
    
if(is_user_bot(id))
    {
        return 
OrpheuSupercede
    
}
    
    return 
OrpheuIgnored
}

OrpheuStruct:get_ppmove()
{        
    return 
OrpheuGetStructFromAddress(OrpheuStructPlayerMove,OrpheuMemoryGet("ppmove"))

Before using these functions do some research about how they work.
Download hlsdk

And check multiplayer/pm_shared/pm_shared.cpp

As attachment I will provide an example script and files to use those functions out of the box:
Code:
PM_Init
PM_Move
PM_PlayerMove
PM_Jump
PM_PlayStepSound
PM_CatagorizeTextureType
PM_FlyMove
PM_UpdateStepSound
PM_CheckVelocity
PM_WaterMove
PM_CheckWater
PM_SpectatorMove
PM_LadderMove
PM_Physics_Toss
PM_CheckWaterJump
PM_CheckFalling
PM_ReduceTimers
PM_CreateStuckTable
Note that these files are meant to be used for your experiments and thus I did not took the time to create signatures but instead providing their offsets. This means that you should use them for testing only. If you want to release plugins with it make signatures or ask here.

On a last note, PM functions occur in parallel in the server and the client and because of client prediction there are functions that are useless to block since they will occur in the client anyway or at least don't act exactly as expected.
What's the value for SpectatorMove on TFC Windows?
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-19-2017 , 07:08   Re: Orpheu: Engine PM Functions
Reply With Quote #40

Quote:
Originally Posted by Bos93 View Post
yep

PHP Code:
PM_Init:
    
Win:
        
0x8B,0x44,0x24,0x04,0xA3,"*","*","*","*",0xE8
    Lin
:
        
PM_Init
        
PM_AirMove
:
    
Win:
        
0x83,0xEC,0x20,0xA1,"*","*","*","*",0x8B,0x88,0x68,0x54,0x04
    Lin
:
        
PM_AirMove
        
PM_CatagorizeTextureType
:
    
Win:
        
0x83,0xEC,0x18,0xA1,"*","*","*","*",0x8B,0x48,0x38,0x89,0x4C,0x24,0x0C,0x8B,0x50,0x3C
    Lin
:
        
PM_CatagorizeTextureType
        
PM_CheckFalling
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",x53,x8B,x81,xD0,"*","*","*",x85,xC0
    Lin
:
        
PM_CatagorizeTextureType
        
PM_CheckVelocity
:
    
Win:
        
0x8B,0x0D,"*","*","*","*",0x56,0x57,0x33,0xFF,0xBE
    Lin
:
        
PM_CheckVelocity
        
PM_CheckWater
:
    
Win:
        
0x83,0xEC,0x10,0xA1,"*","*","*","*",0x8B,0x88,0xBC
    Lin
:
        
PM_CheckWater
        
PM_CheckWaterJump
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",0x83,0xB9,0xE0,"*","*","*",0xFF
    Lin
:
        
PM_CheckWaterJump    

PM_CreateStuckTable
:
    
Win:
        
0x83,0xEC,0x0C,0xB9,"*","*","*","*",0xD9,0x05,"*","*","*","*",0x56
    Lin
:
        
PM_CreateStuckTable                
        
PM_Duck
:
    
Win:
        
0x81,0xEC,"*","*","*","*",0x53,0x55,0x56,0x8B,0x35
    Lin
:
        
PM_Duck    
        
PM_FlyMove
:
    
Win:
        
0x81,0xEC,"*","*","*","*",0x53,0x8B,0x1D,"*","*","*","*",0x55
    Lin
:
        
PM_FlyMove        

PM_InitTextureTypes
:
    
Win:
        
0xA1,"*","*","*","*",0x81,0xEC,"*","*","*","*",0x55
    Lin
:
        
PM_InitTextureTypes    
        
PM_InitTextureTypes
:
    
Win:
        
0xA1,"*","*","*","*",0x81,0xEC,"*","*","*","*",0x55
    Lin
:
        
PM_InitTextureTypes    

PM_Jump
:
    
Win:
        
0xA1,"*","*","*","*",0x33,0xC9,0x56,0x8B,0x90,0x98,"*","*","*",0x85
    Lin
:
        
PM_Jump    
        
PM_LadderMove
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",0x83,0xB9,0xE0,"*","*","*",0xFF
    Lin
:
        
PM_LadderMove

PM_Move
:
    
Win:
        
0x8B,0x54,0x24,0x08,0x8B,0x44,0x24,0x04,0x33,0xC9,0xA3
    Lin
:
        
PM_Move    

PM_Physics_Toss
:
    
Win:
        
0x81,0xEC,"*","*","*","*",0xE8,"*","*","*","*",0x8B
    Lin
:
        
PM_Physics_Toss    

PM_PlayerMove
:
    
Win:
        
0x83,0xEC,0x10,0xA1,"*","*","*","*",0x8B,0x4C,0x24,0x14,0x53,0x56,0x57,0x33,0xFF,0x89,0x48,0x04
    Lin
:
        
PM_PlayerMove    

PM_PlayStepSound
:
    
Win:
        
0xA1,"*","*","*","*",0x33,0xC9,0x56,0x8B,0x90,0x98,"*","*","*",0x85
    Lin
:
        
PM_PlayStepSound    

PM_ReduceTimers
:
    
Win:
        
0x51,0x8B,0x0D,"*","*","*","*",0x56,0x33,0xF6,0x8B,0x81,0x94
    Lin
:
        
PM_ReduceTimers        

PM_SpectatorMove
:
    
Win:
        
0x8B,0x15,"*","*","*","*"83,0xEC,0x20,0x8B,0x82,0xFC,0x01,"*","*",0x57
    Lin
:
        
PM_SpectatorMove    

PM_UpdateStepSound
:
    
Win:
        
0xA1,"*","*","*","*",0x83,0xEC,0x1C,0x8B,0x88,0x94,"*","*","*",0x56
    Lin
:
        
PM_UpdateStepSound    

PM_WaterMove
:
    
Win:
        
0x8B,0x15,"*","*","*","*",0x81,0xEC,"*","*","*","*",0x33
    Lin
:
        
PM_WaterMove 
I need help with TFC Windows signatures. If I send u the dll file, would u be able to make the signatures? My problem is finding the sub_ on Windows. I'm using an old dll/so due to some serious bugs on the new dll/so. There's also a spy disguise bug which can't be ignored and Valve would never ever fix those bugs because all they care about now is Dota2, Artifact, CS:GO and maybe TF2. Or you could just send me the offsets and I'd make the signatures.

Last edited by DarthMan; 11-19-2017 at 07:09.
DarthMan is offline
Reply


Thread Tools
Display Modes

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 12:56.


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