Raised This Month: $12 Target: $400
 3% 

DHooks (Dynamic Hooks - Dev Preview)


Post New Thread Reply   
 
Thread Tools Display Modes
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 06-28-2021 , 14:38   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #841

Quote:
Originally Posted by Peace-Maker View Post
The probem here is that both Functions sections are named the same, the arguments aren't important. All "Functions" sections in all loaded gamedata files are cached together due to a limitation in SourceMod's gamedata parser extension api. So the first plugin creates an entry in that cache with the name "CTerrorPlayer::StartReviving" and the given argument setup. When the second plugin loads its gamedata file, the "CTerrorPlayer::StartReviving" function is already present in the cache, so dhooks thinks you want to update the entry. It adds the "new" argument to the setup, since it's named differently, making the function look like it takes two arguments.

This behavior is described in the release post in the "Game specific settings" section. It allows you to change details of a hook per game, if the rest is mostly the same.
Ohhh, that makes sense! I wasn't aware that the behavior described in that section applied across multiple gamedata files. This statement at the end of that section makes it seem like updating entries only works within the same file: "Later sections in the file add to the already parsed setup."

Quote:
Originally Posted by Peace-Maker View Post
The idea was to avoid duplicate function hook info in the gamedata file, which appears to have been a stupid one. Sorry, but I think it's too late now to change the behavior - I'm not even sure what the right thing would be :D
I'm not sure either. It seems fine to leave it this way now that I understand the behavior.

Quote:
Originally Posted by Peace-Maker View Post
I could add a server command which dumps all active detours and the plugins which are listening for them. It might be useless for detours and hooks created using the API instead of the "Functions" section though, since there is no name associated with the hook. But maybe we could print other relevant info which helps to identify which function is being hooked.
Sounds good. I haven't tried to create detours/hooks using the API yet, so I wouldn't know what other relevant info could even be made available with that potential command.
__________________
Psyk0tik is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-30-2021 , 06:55   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #842

I've released a new version which includes a bunch of stability improvements thanks to the awesome crash reports by the community! Grab detours17 from the release post or github releases.


Changelog:
  • Allow returning NULL for CBaseEntity return types by setting the return value to -1 (thanks arthurdead)
  • Allow specifying object argument size in hexadecimal in gamedata similar to SM 1.11
  • Fix SourceHook context leak when superceding virtual hooked functions (thanks nosoop and BotoX Drifter321#2)
    • This fixes a long standing issue with memory leaks, crashes and lag on map change
  • Fix crash on CentOS7+ / SELinux with "allow_execheap" disabled (thanks vintagepc #22)
  • Fix DHookIsNullParam checking wrong parameter for detour setups with parameters passed in custom registers (thanks GAMMACASE #15)
  • Fix crash due to mismatching new[] + delete[] pair of return value buffer (thanks bottiger)
__________________
Peace-Maker is offline
jking
AlliedModders Donor
Join Date: Jan 2012
Old 08-10-2021 , 23:26   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #843

Hi Peace, first off thanks so much for this update, I fired up the game for first time in many months and get this error for first time,

Code:
L 08/10/2021 - 21:14:02: SourceMod error session started
L 08/10/2021 - 21:14:02: Info (map "c5m1_waterfront") (file "C:\L4D2\left4dead2\addons\sourcemod\logs\errors_20210810.log")
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: ForceNextStage
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: CancelStagger
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: RegisterForbiddenTarget
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: UnRegisterForbiddenTarget
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to load "UseHealingItems" signature.
L 08/10/2021 - 21:14:08: Error log file session closed.
jking is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-10-2021 , 23:33   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #844

Quote:
Originally Posted by jking View Post
Hi Peace, first off thanks so much for this update, I fired up the game for first time in many months and get this error for first time,

Code:
L 08/10/2021 - 21:14:02: SourceMod error session started
L 08/10/2021 - 21:14:02: Info (map "c5m1_waterfront") (file "C:\L4D2\left4dead2\addons\sourcemod\logs\errors_20210810.log")
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: ForceNextStage
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: CancelStagger
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: RegisterForbiddenTarget
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to find signature: UnRegisterForbiddenTarget
L 08/10/2021 - 21:14:02: [left4dhooks.smx] Failed to load "UseHealingItems" signature.
L 08/10/2021 - 21:14:08: Error log file session closed.
DHooks has nothing to do with those errors. Read the errors carefully as they clearly tell you which plugin they're coming from. There have been a few L4D2 updates so far this year that broke a lot of signatures.
__________________
Psyk0tik is offline
jking
AlliedModders Donor
Join Date: Jan 2012
Old 08-11-2021 , 17:07   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #845

Quote:
Originally Posted by Psyk0tik View Post
DHooks has nothing to do with those errors. Read the errors carefully as they clearly tell you which plugin they're coming from. There have been a few L4D2 updates so far this year that broke a lot of signatures.
Man I'm dumb, last night late, like I said I hadn't played in months and just before I had quit then, I just started to use Silvers Left 4 DHooks Direct (1.51),now all is well with his new version, thanks again as always to all of you that make our experience more pleasant.
jking is offline
Levchik97
Junior Member
Join Date: Nov 2013
Old 09-22-2021 , 17:52   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #846

Please update Gamedata
Levchik97 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-22-2021 , 18:23   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #847

Quote:
Originally Posted by Levchik97 View Post
Please update Gamedata
DHooks doesn't have any gamedata - you need to look at the plugins you have using DHooks.
__________________
asherkin is offline
Levchik97
Junior Member
Join Date: Nov 2013
Old 09-23-2021 , 03:47   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #848

Quote:
Originally Posted by asherkin View Post
DHooks doesn't have any gamedata - you need to look at the plugins you have using DHooks.
ok, thanks
Levchik97 is offline
IEcliPsEI95
Junior Member
Join Date: Jul 2011
Location: Romania
Old 10-06-2021 , 04:08   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #849

I have this problem, and I don't know what to do, I want to hook on SetModel player. I already have dhook for SM 110, otherwise it wouldn't start

Code:
SourceMod Version Information:
    SourceMod Version: 1.10.0.6515
    SourcePawn Engine: 1.10.0.6515, jit-x86 (build 1.10.0.6515)
    SourcePawn API: v1 = 5, v2 = 12
    Compiled on: Sep 27 2021 10:07:49
    Built from: https://github.com/alliedmodders/sou...commit/f12b536
    Build ID: 6515:f12b536
    http://www.sourcemod.net/

[SM] Displaying 14 extensions:
[01] Automatic Updater (1.10.0.6515): Updates SourceMod gamedata files
[02] Webternet (1.10.0.6515): Extension for interacting with URLs
[03] <FAILED> file "cleaner.ext.2.csgo.so": Failed to find signature. Please contact the author.
[04] CSGO-ArmsFix (1.0): Fix glove overcap with custom arms
[05] CS Tools (1.10.0.6515): CS extended functionality
[06] BinTools (1.10.0.6515): Low-level C/C++ Calling API
[07] SDK Tools (1.10.0.6515): Source SDK Tools
[08] SDK Hooks (1.10.0.6515): Source SDK Hooks
[09] Top Menus (1.10.0.6515): Creates sorted nested menus
[10] Client Preferences (1.10.0.6515): Saves client preference settings
[11] SQLite (1.10.0.6515): SQLite Driver
[12] Sound Info Library (1.0): Access information of sound files
[13] DHooks (2.2.0-detours17): Dynamic Hooks
[14] Regex (1.10.0.6515): Provides regex natives for plugins
sm exts info 13
 File: dhooks.ext.so
 Loaded: Yes (version 2.2.0-detours17)
 Name: DHooks (Dynamic Hooks)
 Author: Dr!fter and Peace-Maker (http://www.sourcemod.net/)
 Binary info: API version 8 (compiled Jun 30 2021)
 Method: Loaded by SourceMod, attached to Metamod:Source

[SM] Listing 47 plugins:
  01 "[ANY] Chat Responder" (1.3.4) by Headline
  02 "SM Parachute" (2.5) by SWAT_88
  03 "Admin Help" (1.10.0.6515) by AlliedModders LLC
  04 "Simple Soccer Ball" (1.2) by mottzi
  05 "S-Downloader" (1.1.2.22 - Dev) by Starbish
  06 "Basic Votes" (1.10.0.6515) by AlliedModders LLC
  07 "[CS:GO] Gun Menu" (1.2) by LumiStance (adapting by Grey83)
  08 "Basic Ban Commands" (1.10.0.6515) by AlliedModders LLC
  09 <Failed> "CS:GO PugSetup: damage printer" (2.0.5) by splewis
  10 "PlayerSkin" (5.0.3 (Build 36)) by noBrain
  11 <Error> "SourceBans" (1.4.11) by SourceBans Development Team
  12 "Basic Comm Control" (1.10.0.6515) by AlliedModders LLC
  13 "Admin File Reader" (1.10.0.6515) by AlliedModders LLC
  14 "[CS:GO/CSS] AbNeR Round End Sounds" (4.0.1) by abnerfs
  15 "SQL Admin Manager" (1.10.0.6513) by AlliedModders LLC
  16 "LAZERRRRSSSS!" (1.3.2) by MitchDizzle_
  17 "Fun Commands" (1.10.0.6515) by AlliedModders LLC
  18 "SM Franug CSGO Sprays" (1.4.5) by Franc1sco Steam: franug
  19 "Chat-Processor" (2.2.3) by Drixevel
  20 "Custom Player Skins (Core)" (1.4) by Mitchell, Root
  21 "Sound Commands" (1.10.0.6515) by AlliedModders LLC
  22 "Anti-Flood" (1.10.0.6515) by AlliedModders LLC
  23 "sm_colour" (1.3) by MoggieX
  24 "Fun Votes" (1.10.0.6515) by AlliedModders LLC
  25 "Admin Menu" (1.10.0.6515) by AlliedModders LLC
  26 "Hud Text Message" (1.0) by ShutAP
  27 "VoiceAnnounceEx" (2.3) by Franc1sco franug, Mini and GoD-Tony
  28 "Advanced Admin ESP" (1.3.6) by Mitch
  29 "Hook Grab Rope" (1.1.4) by Sheepdude, SumGuy14
  30 "Basic Info Triggers" (1.10.0.6515) by AlliedModders LLC
  31 "Basic Chat" (1.10.0.6515) by AlliedModders LLC
  32 "Player Commands" (1.10.0.6515) by AlliedModders LLC
  33 <Error> "dhooks-test.smx"
  34 "Basic Commands" (1.10.0.6515) by AlliedModders LLC
  35 "Reserved Slots" (1.10.0.6515) by AlliedModders LLC
  36 "Client Preferences" (1.10.0.6515) by AlliedModders LLC
Errors:
pugsetup_damageprint.smx (CS:GO PugSetup: damage printer): Could not find required plugin "pugsetup"
sourcebans.smx (SourceBans): Error detected in plugin startup (see error logs)
dhooks-test.smx: Error detected in plugin startup (see error logs)

L 10/06/2021 - 01:12:29: [SM] Exception reported: Failed to get CreateInterface
L 10/06/2021 - 01:12:29: [SM] Blaming: dhooks-test.smx
L 10/06/2021 - 01:12:29: [SM] Call stack trace:
L 10/06/2021 - 01:12:29: [SM]   [0] SetFailState
L 10/06/2021 - 01:12:29: [SM]   [1] Line 100, dhooks-test.sp::OnPluginStart
L 10/06/2021 - 01:12:29: [SM] Unable to load plugin "dhooks-test.smx": Error detected in plugin startup (see error logs)
IEcliPsEI95 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-06-2021 , 05:28   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #850

The dhooks-test.smx plugin is an example for plugin developers, you shouldn't have it loaded and it isn't expected to work.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode