metamod-source icon indicating copy to clipboard operation
metamod-source copied to clipboard

x64 linux sourcehook hookmangen

Open rtldg opened this issue 9 months ago • 2 comments

Following up on @Kenzzer's epic work on the x64 Windows hookmangen #175 stuff: WIP x64 Linux hookmangen stuff!

TODO:

  • More testing....
  • Even more testing.....

rtldg avatar Mar 02 '25 09:03 rtldg

May I recommend that you mark this PR as a draft until it is ready ? Anyways, thanks for seeing this through I've a few remarks that aren't noted in your todo.

Kenzzer avatar Mar 02 '25 11:03 Kenzzer

Lots of stack alignment for Linux are missing. Specifically in

* [ ]  `x64GenContext::GeneratePubFunc`

* [ ]  `x64GenContext::CallEndContext`

* [ ]  `x64GenContext::DoReturn`

* [ ]  `x64GenContext::PrepareReturn`

* [ ]  `x64GenContext::GenerateCallHooks`

* [ ]  `retInfo.pAssignOperator`

* [ ]  `retInfo.pDtor`

* [ ]  `x64GenContext::CallSetupHookLoop` (You also need to handle parameter 7, 8, 9 & 10)

Alignment for these were added with the latest commit:

  • CallEndContext
  • DoReturn
  • PrepareReturn
  • GenerateCallHooks
  • pAssignOperator
  • pDtor

TODO still because they're a bit more than just copy & pasting.

  • TODO GeneratePubFunc
  • TODO CallSetupHookLoop

rtldg avatar Mar 02 '25 12:03 rtldg

This was going to be glue & bandaids in the short-term but I burned out. Kenzzer's work on nuking sourcehook/related in mms & sm to allow something to completely replace the systems (khook) is a better way forward.

rtldg avatar Aug 20 '25 18:08 rtldg