default-username-was-already-taken / tf2patcher

A patcher for TF2 that allows you to apply full-colored decals.
The Unlicense
41 stars 11 forks source link

Linux Support! #6

Open IgLocoXD opened 2 years ago

IgLocoXD commented 2 years ago

I don't know if this patcher gonna have a Linux version, it would be amazing, because there is no patcher for TF2 Linux ver. and the old methods doesn't work some times :(

avetharun commented 1 year ago

This is incredibly difficult, even when using sudo / wheel. Probably not possible.

kinoko87 commented 1 year ago

Who said anything about sudo/wheel? It could just be a Linux compatible binary

kinoko87 commented 1 year ago

Although until that day, which I assume is not coming, the best workaround is just using wine just do sudo apt install wine and enjoy

alkaris2 commented 1 year ago

It's possible to build a Linux binary in test environment on Windows 10/11 with WSL and go from there.

rsedxcftvgyhbujnkiqwe commented 7 months ago

I do not have much knowledge on how to perform the exploit, but I tried to refactor the code to work for Linux and was unsuccessful. Wine alone doesn't work since the way the patcher detects the game being open is incompatible with wine.

The two main hurdles for Linux compatibility from what I see are

  1. Figuring out how exactly to attach to the hl2_linux process in order to perform the patch. This isn't too hard to do as long as you can properly close handles to not get detected by VAC
  2. Whether or not the patch memory address is the same on Linux, and if not how to acquire the new address

I am interested also in the equip region fork of this project, but that comes with it's own issues. If you open the game unpatched, it will de-equip any conflicting items you had, so you have to patch every time you open the game. It might be possible to set up a script to automatically run any given patcher when the game opens, but that's a later step.

alkaris2 commented 7 months ago

I do not have much knowledge on how to perform the exploit, but I tried to refactor the code to work for Linux and was unsuccessful. Wine alone doesn't work since the way the patcher detects the game being open is incompatible with wine.

The two main hurdles for Linux compatibility from what I see are

1. Figuring out how exactly to attach to the hl2_linux process in order to perform the patch. This isn't too hard to do as long as you can properly close handles to not get detected by VAC

2. Whether or not the patch memory address is the same on Linux, and if not how to acquire the new address

I am interested also in the equip region fork of this project, but that comes with it's own issues. If you open the game unpatched, it will de-equip any conflicting items you had, so you have to patch every time you open the game. It might be possible to set up a script to automatically run any given patcher when the game opens, but that's a later step.

Figuring out how hl2_linux launches isn't that difficult to figure out. When you launch TF2 on Linux it first executes a script hl2.sh before executing hl2_linux, attaching to that process is non-trivial, you just look up the PID that the game is running on from your task manager and attach a debugger like GDB or Scanmem to the running process. However injecting to a running process shouldn't necessarily be needed, you can just add the patched payload into the hl2.sh script by creating a containerized environment so it can launch with the game.

catdotjs commented 7 months ago

ngl this on thing on linux will be fire. Bump.

rsedxcftvgyhbujnkiqwe commented 7 months ago

Figuring out how hl2_linux launches isn't that difficult to figure out. When you launch TF2 on Linux it first executes a script hl2.sh before executing hl2_linux, attaching to that process is non-trivial, you just look up the PID that the game is running on from your task manager and attach a debugger like GDB or Scanmem to the running process. However injecting to a running process shouldn't necessarily be needed, you can just add the patched payload into the hl2.sh script by creating a containerized environment so it can launch with the game.

I was thinking about putting something within the hl2.sh script too. How would the patched payload work, just patching the client.so file itself instead?

rsedxcftvgyhbujnkiqwe commented 7 months ago

I went ahead and developed a equip region patcher for linux, which utilizes the same principle but just patches different memory. I don't have much interest in the decal patcher itself, but if someone wants to figure out how to patch the decal for the linux 64 bit binary, feel free to fork it and patch the memory modification to perform the decal patch instead.

VexagonGD commented 2 months ago

please please please can i please have some linux support sir please sir thank you that would be really really awesome

VexagonGD commented 2 months ago

i spent actual hard earned money on my photo ID badge, found no other tools, i need a linux support for this please

teufortressIndustries commented 2 months ago

@VexagonGD

please please please can i please have some linux support sir please sir thank you that would be really really awesome

There's no point of begging for linux support from @default-username-was-already-taken, it's very unlikely that he'll ever respond. You can try and go to the dborodin836's tf2patcher fork and ask there. I can also apply the decal for you for free, if you provide the items (shocking), as a one-time deal, until Linux support is added.

teufortressIndustries commented 2 months ago

Uhh, actually, i think you can't? because dborodin has disabled the issues page. I guess the only option is for you to contact the dborodin directly.