Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added feature to check data signatures at Source.Python setup.#467

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
CookStar wants to merge3 commits intoSource-Python-Dev-Team:master
base:master
Choose a base branch
Loading
fromCookStar:sig_check

Conversation

@CookStar
Copy link
Contributor

@CookStarCookStar commentedFeb 14, 2023
edited
Loading

This will allow us to deal with signature changes more quickly and accurately than before.

Output at9f38783

Output
[Source.Python][SP] Encountered a Warning:  File '../addons/source-python/packages/source-python/__init__.py', line 168: UserWarning    Invalid signature detected in class data, specific function will not work.[Source.Python] Invalid signature detected.Name: set_attackerSignature: 55 89 E5 57 56 53 83 EC 2C C7 45 E4 00 00 00 00 8B 5D 08 8B 75 0CFile: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CBaseCSGrenadeProjectile.ini[Source.Python] Invalid signature detected.Name: detonateSignature: 55 89 E5 57 56 53 83 EC 5C 8B 75 08 C7 44 24 08 00 00 26 43File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSmokeGrenadeProjectile.ini[Source.Python] Invalid signature detected.Name: fire_outputSignature: 55 89 E5 57 56 53 81 EC 7C 01 00 00 8B 55 08 8B 75 14File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entity_output/CBaseEntityOutput.ini[Source.Python] Invalid signature detected.Name: add_accountSignature: 55 89 E5 57 56 53 81 EC 2A 01 00 00 8B 5D 08 0F B6 45 10File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini[Source.Python] Invalid signature detected.Name: buy_internalSignature: 55 89 E5 83 EC 78 0F B6 55 14 89 75 F8File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini[Source.Python] Invalid signature detected.Name: deafenSignature: 55 89 E5 83 EC 48 89 7D FC 8B 7D 08 89 5D F4 89 75 F8 8B 07File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini[Source.Python] Invalid signature detected.Name: _spawnSignature: 55 89 E5 57 56 53 83 EC 3C A1 2A 2A 2A 2A 8B 5D 08 89 04 24File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini[Source.Python] Invalid signature detected.Name: switch_teamSignature: 55 89 E5 83 EC 68 89 75 F8 8B 75 0C 89 5D F4 8B 5D 08 89 7D FC 89 34 24 E8 2A 2A 2A 2A 85 C0File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini[Source.Python] Invalid signature detected.Name: start_timerSignature: 55 89 E5 53 83 EC 34 8B 5D 08 F6 83 2A 00 00 00 10File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSensorGrenadeProjectile.ini[Source.Python] Invalid signature detected.Name: detonateSignature: 55 89 E5 57 56 53 83 EC 3C 8B 5D 08 89 1C 24 E8 2A 2A 2A 2A 85 C0File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSensorGrenadeProjectile.ini[Source.Python] Invalid signature detected.Name: do_detect_waveSignature: 55 89 E5 57 56 53 81 EC BC 01 00 00 8B 55 08 89 14 24File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSensorGrenadeProjectile.ini[Source.Python] Invalid signature detected.Name: detonateSignature: 55 89 E5 57 56 53 83 EC 3C 8B 5D 08 F6 83 2A 00 00 00 10File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CDecoyProjectile.ini[Source.Python][SP] Encountered a Warning:  File '../addons/source-python/packages/source-python/__init__.py', line 185: UserWarning    Invalid signature detected in global pointers data, may cause problems with        Source.Python operation.[Source.Python] Invalid signature detected.Name: CEntityFactoryDictionarySignature: 55 89 E5 83 EC 28 80 3D 2A 2A 2A 2A 00 74 2A C9 B8 2A 2A 2A 2A C3 8D 76 00 8D BC 27 00 00 00 00 C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A 85 C0 74 2A C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A C7 44 24 08 2A 2A 2A 2A C7 44 24 04 2A 2A 2A 2A C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A B8 2A 2A 2A 2A C9 C3 89 45 F4 C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A 8B 45 F4 89 04 24 E8 2A 2A 2A 2A 90 8D 76 00 8D BC 27 00 00 00 00 55 89 E5 57File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/memory/global_pointers.ini[Source.Python] Invalid signature detected.Name: CGlobalEntityListSignature: E8 2A 2A 2A 2A E8 2A 2A 2A 2A C7 2A 2A 2A 2A 2A 2A E8 2A 2A 2A 2A E8File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/memory/global_pointers.ini[Source.Python] Invalid signature detected.Name: IServerSignature: 55 89 E5 53 83 EC 14 8B 45 0C C7 04 24 2A 2A 2A 2AFile: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/memory/global_pointers.ini
Logs
2023-02-14 16:40:10 - sp.hooks.warnings-WARNING[Source.Python] [SP] Encountered a Warning:  File '../addons/source-python/packages/source-python/__init__.py', line 168: UserWarning    Invalid signature detected in class data, specific function will not work.2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: set_attackerSignature: 55 89 E5 57 56 53 83 EC 2C C7 45 E4 00 00 00 00 8B 5D 08 8B 75 0CFile: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CBaseCSGrenadeProjectile.ini2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: detonateSignature: 55 89 E5 57 56 53 83 EC 5C 8B 75 08 C7 44 24 08 00 00 26 43File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSmokeGrenadeProjectile.ini2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: fire_outputSignature: 55 89 E5 57 56 53 81 EC 7C 01 00 00 8B 55 08 8B 75 14File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entity_output/CBaseEntityOutput.ini2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: add_accountSignature: 55 89 E5 57 56 53 81 EC 2A 01 00 00 8B 5D 08 0F B6 45 10File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: buy_internalSignature: 55 89 E5 83 EC 78 0F B6 55 14 89 75 F8File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: deafenSignature: 55 89 E5 83 EC 48 89 7D FC 8B 7D 08 89 5D F4 89 75 F8 8B 07File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini2023-02-14 16:40:10 - sp-WARNING[Source.Python] Invalid signature detected.Name: _spawnSignature: 55 89 E5 57 56 53 83 EC 3C A1 2A 2A 2A 2A 8B 5D 08 89 04 24File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: switch_teamSignature: 55 89 E5 83 EC 68 89 75 F8 8B 75 0C 89 5D F4 8B 5D 08 89 7D FC 89 34 24 E8 2A 2A 2A 2A 85 C0File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CCSPlayer.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: start_timerSignature: 55 89 E5 53 83 EC 34 8B 5D 08 F6 83 2A 00 00 00 10File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSensorGrenadeProjectile.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: detonateSignature: 55 89 E5 57 56 53 83 EC 3C 8B 5D 08 89 1C 24 E8 2A 2A 2A 2A 85 C0File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSensorGrenadeProjectile.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: do_detect_waveSignature: 55 89 E5 57 56 53 81 EC BC 01 00 00 8B 55 08 89 14 24File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CSensorGrenadeProjectile.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: detonateSignature: 55 89 E5 57 56 53 83 EC 3C 8B 5D 08 F6 83 2A 00 00 00 10File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/entities/CDecoyProjectile.ini2023-02-14 16:40:11 - sp.hooks.warnings-WARNING[Source.Python] [SP] Encountered a Warning:  File '../addons/source-python/packages/source-python/__init__.py', line 185: UserWarning    Invalid signature detected in global pointers data, may cause problems with        Source.Python operation.2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: CEntityFactoryDictionarySignature: 55 89 E5 83 EC 28 80 3D 2A 2A 2A 2A 00 74 2A C9 B8 2A 2A 2A 2A C3 8D 76 00 8D BC 27 00 00 00 00 C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A 85 C0 74 2A C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A C7 44 24 08 2A 2A 2A 2A C7 44 24 04 2A 2A 2A 2A C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A B8 2A 2A 2A 2A C9 C3 89 45 F4 C7 04 24 2A 2A 2A 2A E8 2A 2A 2A 2A 8B 45 F4 89 04 24 E8 2A 2A 2A 2A 90 8D 76 00 8D BC 27 00 00 00 00 55 89 E5 57File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/memory/global_pointers.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: CGlobalEntityListSignature: E8 2A 2A 2A 2A E8 2A 2A 2A 2A C7 2A 2A 2A 2A 2A 2A E8 2A 2A 2A 2A E8File: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/memory/global_pointers.ini2023-02-14 16:40:11 - sp-WARNING[Source.Python] Invalid signature detected.Name: IServerSignature: 55 89 E5 53 83 EC 14 8B 45 0C C7 04 24 2A 2A 2A 2AFile: /home/steam/csgo_ds/csgo/addons/source-python/data/source-python/memory/global_pointers.ini

vinci6k, Frag1337, srpg, and Velocity-plus reacted with heart emoji
@CookStarCookStar mentioned this pull requestFeb 14, 2023
@jordanbriere
Copy link
Contributor

It works great and I really like the idea!

That said, I'm not sure that is something that should be done by default. I can see the usefulness when updating the data, but I don't think all signatures should be validated and cached on every servers. Perhaps we could add an additional setting tocore_settings.ini to explicitly enable and perform the validation? That would overall seem better to me, since I don't think the average user care if a signature they don't use is outdated.

As for the implementation itself, I don't necessarily see the need to re-invent the wheel and manually parse the files. What about using a temporaryTypeManager instance instead?

@CookStar
Copy link
ContributorAuthor

That said, I'm not sure that is something that should be done by default. I can see the usefulness when updating the data, but I don't think all signatures should be validated and cached on every servers. Perhaps we could add an additional setting tocore_settings.ini to explicitly enable and perform the validation? That would overall seem better to me, since I don't think the average user care if a signature they don't use is outdated.

The problem is that the user doesn't know which function's signature is incorrect. Rather than actually running the code path of the incorrect function and then realizing that the signature is incorrect, it is more useful to notify the user from the beginning that there is a problem with the signature, so that the problem can be resolved quickly. I also don't see the problem to notify all users with the invalid signatures since they may not be familiar with the signatures themselves.

Also, why is it such a problem to have signatures cached? I measured signatures that are not used by SP itself and only 775 bytes were used. If there is a problem with caching, I thinkm_Signatures should be changed to something like unordered_map.

As for the implementation itself, I don't necessarily see the need to re-invent the wheel and manually parse the files. What about using a temporaryTypeManager instance instead?

check_pipe_signature_from_file andcheck_type_signature_from_file are not only for Source.Python, but also for plugin authors to check signatures. Since there is no way to handle errors without changing TypeManager's behavior, duplicate code is unavoidable.

@jordanbriere
Copy link
Contributor

duplicate code is unavoidable.

How is it unavoidable? Let's say you want to validate the functions of a type, all you really have to do is ensure all attributes resolve properly:

# ../test.inibinary = server[function]    [[foo]]identifier = 11 22 33 44 55 66 77 88 99 00    [[bar]]identifier = 11 22 33 44 55 66 77 88 99 00    [[baz]]identifier = 11 22 33 44 55 66 77 88 99 00
frommemory.managerimportTypeManagerfrompathimportPathFoo=TypeManager().create_type_from_file('Foo',Path(__file__).parent/'test.ini')forattrinvars(Foo):try:getattr(Foo,attr)exceptExceptionase:print(f'Foo.{attr} -',e)
[SP] Loading plugin 'testing'...Foo.foo - Could not find signature: 11223344556677889900Foo.bar - Could not find signature: 11223344556677889900Foo.baz - Could not find signature: 11223344556677889900[SP] Successfully loaded plugin 'testing'.

@CookStar
Copy link
ContributorAuthor

Forget about this, I will make full-fledged sanitizers.

@Ayuto
Copy link
Member

I definitely like the idea! We should have implemented something like this much earlier. I also fully agree with you@CookStar about the message. If something is not working correctly, it should be reported to the user/developer. Maybe we should even add a hint to report the invalid signature here on Github.

But Jordan has a valid point. Why don't we just use a temporary TypeManager?

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@CookStar@jordanbriere@Ayuto

[8]ページ先頭

©2009-2025 Movatter.jp