PDA

View Full Version : Source Scramble (memory patching and allocation natives)


nosoop
07-01-2019, 01:17
Description:

Provides the following features to SourceMod plugins:

Allows plugins to enable / disable memory patches whose platform-specific payloads are defined in their game configs in their own unique section (based on Peace-Maker's implementation for dynhooks (https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589)).
Allows plugins to allocate memory (which can then be accessed with StoreToAddress and LoadFromAddress).
Both of the above is cleaned up and freed when the plugin that owns them is unloaded (so you don't have to unpatch during OnPluginEnd()).

I wrote this as a generalized way to do patches like No Thriller Taunt (https://forums.alliedmods.net/showthread.php?t=171343), without needing to keep a boilerplate plugin on hand to deal with all the setup / teardown, or even another plugin at all (the bundled patch management plugin can load and enable simple patches for you).

More developer information is available in the project's README (https://github.com/nosoop/SMExt-SourceScramble#developer-usage).

Source (https://github.com/nosoop/SMExt-SourceScramble) / Download (https://github.com/nosoop/SMExt-SourceScramble/releases)

SHUFEN
07-05-2019, 00:12
Wow, awesome extension!!

Shadowysn
11-11-2019, 22:12
Chrome reports that package.zip is not commonly downloaded and may be dangerous.

nosoop
07-12-2021, 08:14
This is a thread that I've neglected to update.

A feature that was requested a few times was the ability to preserve bytes from memory before it was patched. A preserve key has been introduced in today's release, where a bitmask in hex format indicates which bits should be copied.

There's a couple of other natives added since the original posting including GetAddressOf*() to get the raw address of a value in plugin memory space and MemoryBlock.Disown() to prevent the extension from freeing memory you've allocated when the handle is deleted.

JLmelenchon
06-28-2022, 15:51
is it possible that this extension cause a memory leak ? My server memory constantly grow up now.

nosoop
06-28-2022, 20:52
is it possible that this extension cause a memory leak ? My server memory constantly grow up now.

The extension itself does not allocate any more memory outside of created MemoryBlock and MemoryPatch handles (and associated MemoryPatch gameconfig entries); check your plugins to see if they are unintentionally leaking any instances.

cravenge
01-27-2023, 21:56
I have made a (once private, now public) fork of this extension which supports 64-bit platforms. You can get the released builds from here (https://github.com/cravenge/Source-Scramble/actions) or grab the ones attached below. All credits go to the original author.

For Linux, those with linux in their names support the latest distribution while the ones with nix in them only support the previous one.

Please do not ask support for older Linux distributions as I have no idea on how to accomplish that.

cravenge
02-15-2023, 23:22
Edit: Repurposed this post for builds that work only on old SourceMod versions down to 1.8 and none older than that version.

For Linux, those with linux in the name support the latest distribution while the ones with nix in them only support the previous one.

Please do not ask support for older Linux distributions as I have no idea on how to accomplish that.

w1nny
05-19-2023, 12:23
Description:

Provides the following features to SourceMod plugins:

Allows plugins to enable / disable memory patches whose platform-specific payloads are defined in their game configs in their own unique section (based on Peace-Maker's implementation for dynhooks (https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589)).
Allows plugins to allocate memory (which can then be accessed with StoreToAddress and LoadFromAddress).
Both of the above is cleaned up and freed when the plugin that owns them is unloaded (so you don't have to unpatch during OnPluginEnd()).

I wrote this as a generalized way to do patches like No Thriller Taunt (https://forums.alliedmods.net/showthread.php?t=171343), without needing to keep a boilerplate plugin on hand to deal with all the setup / teardown, or even another plugin at all (the bundled patch management plugin can load and enable simple patches for you).

More developer information is available in the project's README (https://github.com/nosoop/SMExt-SourceScramble#developer-usage).

Source (https://github.com/nosoop/SMExt-SourceScramble) / Download (https://github.com/nosoop/SMExt-SourceScramble/releases)

I want just to inform you guys: this extension stop from working in L4D2 due to the lastest update (both Linux and Windows OS, I guess). Now, this extension - crash the server everytime when i trying to start the server (So, delete this one until this fixed). Please, fix this extension one.

HarryPotter
05-19-2023, 13:28
I want just to inform you guys: this extension stop from working in L4D2 due to the lastest update (both Linux and Windows OS, I guess). Now, this extension - crash the server everytime when i trying to start the server (So, delete this one until this fixed). Please, fix this extension one.

No, this extension doesn't crash on my server.
It is still working well.
Some plugins which require this extension are broken maybe.

L4D2 Windows Dedicated
[18] Source Scramble (0.7.1): Tools for working with memory.

Psyk0tik
05-19-2023, 13:29
I want just to inform you guys: this extension stop from working in L4D2 due to the lastest update (both Linux and Windows OS, I guess). Now, this extension - crash the server everytime when i trying to start the server (So, delete this one until this fixed). Please, fix this extension one.

There's nothing wrong with the extension. The latest updates to L4D2 adjusted a bunch of offsets which broke a lot of patches from several plugins. The plugins themselves need to be updated, not this extension.

w1nny
05-19-2023, 14:52
There's nothing wrong with the extension. The latest updates to L4D2 adjusted a bunch of offsets which broke a lot of patches from several plugins. The plugins themselves need to be updated, not this extension.

Oh, my bad. It was the older one version of the extension. I've just updated the extension to the latest version from the github (https://github.com/nosoop/SMExt-SourceScramble), now - everything is fine.