Skip to content

Update Function Offsets For PVKII#808

Merged
psychonic merged 2 commits intoalliedmodders:masterfrom
Spirrwell:master
May 2, 2018
Merged

Update Function Offsets For PVKII#808
psychonic merged 2 commits intoalliedmodders:masterfrom
Spirrwell:master

Conversation

@Spirrwell
Copy link
Contributor

-Updates offsets
-Removes "Reload" as no corresponding function actually exists

Extra Notes:

  • There does not seem to be any "Reload" function, and the offsets in this gamedata update seem to have gone up by 2, and the corresponding (Windows) offset 273+2 is CBasePlayer::RemovePlayerItem() which is probably not "Reload"

  • GroundEntChanged points to a network state change. Windows and Linux were previously pointing to two different versions of this function, one that takes a void* and one that does not. They are now both the same HOWEVER I am not sure if this is desired behavior

I have attached a copy of the offset dump which should correspond to Linux offsets. (The dump was done with the Mac server.dylib binary)

server_dump_linux.txt

-Updates offsets
-Removes "Reload" as no corresponding function actually exists
@peace-maker
Copy link
Member

Reload is a function of CBaseWeapon not CBasePlayer.

@Spirrwell
Copy link
Contributor Author

You mean CBaseCombatWeapon?

Yes I understand this, but how does SourceMod distinguish where these offsets belong to? The gamedata file just says "Reload", it doesn't say anything about CBaseCombatWeapon and the reference here https://wiki.alliedmods.net/Finding_virtual_offsets says to dump the vtable for CBasePlayer

@psychonic
Copy link
Member

GroundEntChanged points to a network state change. Windows and Linux were previously pointing to two different versions of this function, one that takes a void* and one that does not. They are now both the same HOWEVER I am not sure if this is desired behavior

For overloaded functions, the order is reversed on Windows. That script mentioned in the link you gave doesn't account for that. I believe they were both pointing to the same function before.

@Spirrwell
Copy link
Contributor Author

Ah okay. It doesn't seem like IDAPython can be run in the freeware version of IDA so I can't use that python script to dump the vtable in the format seen here https://wiki.alliedmods.net/CPVK2Player_Offset_List_(Pirates,_Vikings,_and_Knights_II)

However, I'm quite sure all offsets have just gone up two due to the additions of CBaseEntity::IsDoor and CBaseEntity::IsChest, so I could fix those offsets under that assumption.

I would still like to know about that "Reload" offset though. It's an offset of CBaseCombatWeapon not CBasePlayer, so how does SourceMod know what vtable "Reload" belongs to? Or was it an error being in the game_pvkii.txt file?

@psychonic
Copy link
Member

how does SourceMod know what vtable "Reload" belongs to?

It's hardcoded per call/hook.

-Re-add "Reload" as it's defined for CBaseCombatWeapon
-Fix Linux\Mac offsets for GroundEntChanged
@Spirrwell
Copy link
Contributor Author

Oh, alright then. Should be all good now then.

@psychonic
Copy link
Member

Thanks!

@psychonic psychonic merged commit 82f1c5a into alliedmodders:master May 2, 2018
psychonic pushed a commit that referenced this pull request May 5, 2018
* Update Function Offsets For PVKII

-Updates offsets
-Removes "Reload" as no corresponding function actually exists

* Offset Fixes

-Re-add "Reload" as it's defined for CBaseCombatWeapon
-Fix Linux\Mac offsets for GroundEntChanged
psychonic pushed a commit that referenced this pull request May 6, 2018
* Update Function Offsets For PVKII

-Updates offsets
-Removes "Reload" as no corresponding function actually exists

* Offset Fixes

-Re-add "Reload" as it's defined for CBaseCombatWeapon
-Fix Linux\Mac offsets for GroundEntChanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants