New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with SourceMod (Windows) #108

Closed
Nomy opened this Issue Jan 14, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@Nomy
Copy link

Nomy commented Jan 14, 2016

Hello, I had submitted a bug report over at SourceMod bug tracker and found the bug to be somehow present when SP is ran with other server plugins.

SourceMod Bug report Link: https://bugs.alliedmods.net/show_bug.cgi?id=6460

More info:
version
Protocol version 13518 [258/258]
Exe version 1.35.1.8 (csgo)
Exe build: 15:47:47 Jan 6 2016 (6240) (730)

sp version
Current Source.Python version: 232

sm version
SourceMod Version Information:
SourceMod Version: 1.7.3-dev+5290
SourcePawn Engine: SourcePawn 1.7, jit-x86 (build 1.7.3-dev+5290)
SourcePawn API: v1 = 4, v2 = 6
Compiled on: Jan 9 2016 09:02:48
Built from: alliedmodders/sourcemod@1e71bd1
Build ID: 5290:1e71bd1
http://www.sourcemod.net/

meta version
Metamod:Source version 1.10.7-dev
Built from: alliedmodders/metamod-source@019a388
Build ID: 948:019a388
Loaded As: Valve Server Plugin
Compiled on: Sep 10 2015
Plugin interface version: 15:14
SourceHook version: 5:5
http://www.metamodsource.net/

@Ayuto Ayuto added the bug label Jan 15, 2016

@Ayuto

This comment has been minimized.

Copy link
Member

Ayuto commented Jan 15, 2016

Thanks for reporting! You can try loading SP after MM and SM, because our signature scanner also searches for hooked signatures. This isn't a perfect solution, but should suffice for now.

I guess we need to find a shared solution with AlliedModders.

@Nomy

This comment has been minimized.

Copy link
Author

Nomy commented Jan 16, 2016

I tried loading SP using plugin_load command after the server loaded with SM and MM. SP failed to load with this error:

VAC secure mode is activated.
GC Connection established for server version 258, instance idx 1
plugin_load addons/source-python
[Source.Python] Loading...
[Source.Python] Failed to load the main module.
[Source.Python] Could not initialize python.
[Source.Python] Unloading...
[Source.Python] Failed to unload the main module.
[Source.Python] Unloaded successfully.

[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python__init__.py', line 38, in load
setup_sp_command()
File '..\addons\source-python\packages\source-python__init__.py', line 122, in setup_sp_command
from core.command import core_command
File '..\addons\source-python\packages\source-python\core\command.py', line 14, in
from auth.commands import auth_commands
File '..\addons\source-python\packages\source-python\auth\commands.py', line 16, in
from auth.manager import auth_manager
File '..\addons\source-python\packages\source-python\auth\manager.py', line 19, in
from players.helpers import uniqueid_from_playerinfo
File '..\addons\source-python\packages\source-python\players\helpers.py', line 13, in
from players.games import get_client_language
File '..\addons\source-python\packages\source-python\players\games__init
.py', line 27, in
game_module = import_module('players.games.{0}'.format(GAME_NAME))
File '..\addons\source-python\packages\source-python\players\games\csgo.py', line 10, in
from players.language.cache import get_client_language
File '..\addons\source-python\packages\source-python\players_language\cache.py', line 13, in
from listeners import on_client_disconnect_listener_manager
File '..\addons\source-python\packages\source-python\listeners__init
.py', line 54, in
from listeners._entity_output import on_entity_output_listener_manager
File '..\addons\source-python\packages\source-python\listeners_entity_output.
py', line 40, in
@PreHook(BaseEntityOutput.fire_output)
File '..\addons\source-python\packages\source-python\memory\manager.py', line 611, in get
func = binary[identifier].make_function(

ValueError: Could not find signature.

[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python__init__.py', line 47, in unload
unload_plugins()
File '..\addons\source-python\packages\source-python__init__.py', line 205, in unload_plugins
from core.command import core_command
File '..\addons\source-python\packages\source-python\core\command.py', line 14, in
from auth.commands import auth_commands
File '..\addons\source-python\packages\source-python\auth\commands.py', line 16, in
from auth.manager import auth_manager
File '..\addons\source-python\packages\source-python\auth\manager.py', line 19, in
from players.helpers import uniqueid_from_playerinfo
File '..\addons\source-python\packages\source-python\players\helpers.py', line 13, in
from players.games import get_client_language
File '..\addons\source-python\packages\source-python\players\games__init
.py', line 21, in
from players.games import base as _base_module

ImportError: cannot import name 'base'

sp
Unknown command "sp"

@Ayuto

This comment has been minimized.

Copy link
Member

Ayuto commented Jan 16, 2016

Oh, it seems like Sourcemod's CDetour is using absolute jumps for hooking, which generates different OP codes (FF 25 + 4 bytes for the absolute address).
https://github.com/alliedmodders/sourcemod/blob/6fe4175fd2fd2b223cb509a24c5544bb54f34ef4/public/CDetour/detourhelpers.h#L75

Currently, SP only searches for hooks, which use relative jumps (E9 + 4 bytes for the relative address), because SPE was using relative jumps as well.
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/memory/memory_scanner.cpp#L144

I will update our signature scanner to search for hooks with absolute jumps as well.

Ayuto added a commit that referenced this issue Jan 16, 2016

Reorganized memory scanner
Updated signature scanner to search for hooked signatures, which have
been hooked with absolute jumps (issue #108)
@Ayuto

This comment has been minimized.

Copy link
Member

Ayuto commented Jan 16, 2016

Please try the new version if the buildbot has finished it. You should make sure that you have always at least one entity output hook registered at SM, because they restore their hook if no entity output hook is registered anymore! If you want to unload SM, you need to unload SP at first.

@Nomy

This comment has been minimized.

Copy link
Author

Nomy commented Jan 17, 2016

Thanks! It now loads without errors after SM has loaded.

@Ayuto Ayuto closed this Oct 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment