nosoop / SM-TFCustomAttributeStarterPack

A collection of plugins to be used with the TF2 Custom Attribute framework.
MIT License
20 stars 10 forks source link

Mutliple custom attributes broken #90

Open fearts opened 4 months ago

fearts commented 4 months ago

Windows server 32bit after last TF2 update.

L 04/22/2024 - 21:22:30: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:22:30: [SM] Blaming: attr_rage_meter_mult.smx
L 04/22/2024 - 21:22:30: [SM] Call stack trace:
L 04/22/2024 - 21:22:30: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:22:30: [SM]   [1] Line 32, attr_rage_meter_mult.sp::OnPluginStart
L 04/22/2024 - 21:22:30: [SM] Unable to load plugin "attr_rage_meter_mult.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:36: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:22:36: [SM] Blaming: custom-attr-starter-pack\attr_buff_override.smx
L 04/22/2024 - 21:22:36: [SM] Call stack trace:
L 04/22/2024 - 21:22:36: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:22:36: [SM]   [1] Line 49, scripting/attr_buff_override.sp::OnPluginStart
L 04/22/2024 - 21:22:36: [SM] Unable to load plugin "custom-attr-starter-pack\attr_buff_override.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:39: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:22:39: [SM] Blaming: custom-attr-starter-pack\attr_medic_disable_active_regen.smx
L 04/22/2024 - 21:22:39: [SM] Call stack trace:
L 04/22/2024 - 21:22:39: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:22:39: [SM]   [1] Line 21, scripting/attr_medic_disable_active_regen.sp::OnPluginStart
L 04/22/2024 - 21:22:39: [SM] Unable to load plugin "custom-attr-starter-pack\attr_medic_disable_active_regen.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:41: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:22:41: [SM] Blaming: custom-attr-starter-pack\attr_rage_meter_mult.smx
L 04/22/2024 - 21:22:41: [SM] Call stack trace:
L 04/22/2024 - 21:22:41: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:22:41: [SM]   [1] Line 32, scripting/attr_rage_meter_mult.sp::OnPluginStart
L 04/22/2024 - 21:22:41: [SM] Unable to load plugin "custom-attr-starter-pack\attr_rage_meter_mult.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:42: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:22:42: [SM] Blaming: custom-attr-starter-pack\attr_sapper_reprograms_buildings.smx
L 04/22/2024 - 21:22:42: [SM] Call stack trace:
L 04/22/2024 - 21:22:42: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:22:42: [SM]   [1] Line 75, scripting/attr_sapper_reprograms_buildings.sp::OnPluginStart
L 04/22/2024 - 21:22:42: [SM] Unable to load plugin "custom-attr-starter-pack\attr_sapper_reprograms_buildings.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:44: [SM] Unable to load plugin "custom-attr-starter-pack\buff_overrides\buff_control_rockets.smx": Native "TF2CustomAttrRageBuff_Register" was not found
L 04/22/2024 - 21:22:44: [SM] Unable to load plugin "custom-attr-starter-pack\buff_overrides\buff_crit_and_mark_for_death.smx": Native "TF2CustomAttrRageBuff_Register" was not found
L 04/22/2024 - 21:22:44: [SM] Unable to load plugin "custom-attr-starter-pack\buff_overrides\buff_enable_tag_players.smx": Native "TF2CustomAttrRageBuff_Register" was not found
L 04/22/2024 - 21:22:44: [SM] Unable to load plugin "custom-attr-starter-pack\buff_overrides\sniper_rage_buff_reload.smx": Native "TF2CustomAttrRageBuff_Register" was not found
L 04/22/2024 - 21:22:44: [SM] Unable to load plugin "custom-attr-starter-pack\buff_overrides\sniper_rage_smokeout_spies.smx": Native "TF2CustomAttrRageBuff_Register" was not found
L 04/22/2024 - 21:22:45: [SM] Exception reported: Invalid address 0x4 is pointing to reserved memory.
L 04/22/2024 - 21:22:45: [SM] Blaming: custom-attr-starter-pack\cloak_debuff_time_scale.smx
L 04/22/2024 - 21:22:45: [SM] Call stack trace:
L 04/22/2024 - 21:22:45: [SM]   [0] LoadFromAddress
L 04/22/2024 - 21:22:45: [SM]   [1] Line 50, third_party/submodules/stocksoup/memory.inc::DereferencePointer
L 04/22/2024 - 21:22:45: [SM]   [2] Line 45, scripting/cloak_debuff_time_scale.sp::OnPluginStart
L 04/22/2024 - 21:22:45: [SM] Unable to load plugin "custom-attr-starter-pack\cloak_debuff_time_scale.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:54: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:22:54: [SM] Blaming: custom-attr-starter-pack\flamethrower_alt_fire_oil.smx
L 04/22/2024 - 21:22:54: [SM] Call stack trace:
L 04/22/2024 - 21:22:54: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:22:54: [SM]   [1] Line 57, scripting/flamethrower_alt_fire_oil.sp::OnPluginStart
L 04/22/2024 - 21:22:54: [SM] Unable to load plugin "custom-attr-starter-pack\flamethrower_alt_fire_oil.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:22:56: [custom-attr-starter-pack\flare_mods.smx] Address for CTFProjectile_Flare::Explode_Air()::SelfDamageRadius contains unexpected value 74000010 (40564896578555790000000000000000.000000)
L 04/22/2024 - 21:22:59: [SM] Exception reported: Could not verify patch for HandleRageGain()::NoHeavyRageGain
L 04/22/2024 - 21:22:59: [SM] Blaming: custom-attr-starter-pack\generate_rage_on_dmg_patch.smx
L 04/22/2024 - 21:22:59: [SM] Call stack trace:
L 04/22/2024 - 21:22:59: [SM]   [0] SetFailState
L 04/22/2024 - 21:22:59: [SM]   [1] Line 38, scripting/generate_rage_on_dmg_patch.sp::OnPluginStart
L 04/22/2024 - 21:22:59: [SM] Unable to load plugin "custom-attr-starter-pack\generate_rage_on_dmg_patch.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:03: [SM] Exception reported: Failed to setup SDKCall for CGlobalEntityList::FindEntityInSphere()
L 04/22/2024 - 21:23:03: [SM] Blaming: custom-attr-starter-pack\joke_medigun_mod_drain_health.smx
L 04/22/2024 - 21:23:03: [SM] Call stack trace:
L 04/22/2024 - 21:23:03: [SM]   [0] SetFailState
L 04/22/2024 - 21:23:03: [SM]   [1] Line 60, scripting/joke_medigun_mod_drain_health.sp::OnPluginStart
L 04/22/2024 - 21:23:03: [SM] Unable to load plugin "custom-attr-starter-pack\joke_medigun_mod_drain_health.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:05: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:23:05: [SM] Blaming: custom-attr-starter-pack\minigun_burst_shot_rage.smx
L 04/22/2024 - 21:23:05: [SM] Call stack trace:
L 04/22/2024 - 21:23:05: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:23:05: [SM]   [1] Line 62, scripting/minigun_burst_shot_rage.sp::OnPluginStart
L 04/22/2024 - 21:23:05: [SM] Unable to load plugin "custom-attr-starter-pack\minigun_burst_shot_rage.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:15: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:23:15: [SM] Blaming: custom-attr-starter-pack\projectile_override_energy_ball.smx
L 04/22/2024 - 21:23:15: [SM] Call stack trace:
L 04/22/2024 - 21:23:15: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:23:15: [SM]   [1] Line 28, scripting/projectile_override_energy_ball.sp::OnPluginStart
L 04/22/2024 - 21:23:15: [SM] Unable to load plugin "custom-attr-starter-pack\projectile_override_energy_ball.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:18: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:23:18: [SM] Blaming: custom-attr-starter-pack\railgun_explosive_bullet.smx
L 04/22/2024 - 21:23:18: [SM] Call stack trace:
L 04/22/2024 - 21:23:18: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:23:18: [SM]   [1] Line 67, scripting\spontaneous_explode.sp::OnPluginStart
L 04/22/2024 - 21:23:18: [SM] Unable to load plugin "custom-attr-starter-pack\railgun_explosive_bullet.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:19: [SM] Exception reported: Failed to create detour CTFWeaponBase::IncrementAmmo()
L 04/22/2024 - 21:23:19: [SM] Blaming: custom-attr-starter-pack\reload_full_clip_at_once.smx
L 04/22/2024 - 21:23:19: [SM] Call stack trace:
L 04/22/2024 - 21:23:19: [SM]   [0] SetFailState
L 04/22/2024 - 21:23:19: [SM]   [1] Line 34, scripting/reload_full_clip_at_once.sp::OnPluginStart
L 04/22/2024 - 21:23:19: [SM] Unable to load plugin "custom-attr-starter-pack\reload_full_clip_at_once.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:25: [SM] Exception reported: Invalid Handle 0
L 04/22/2024 - 21:23:25: [SM] Blaming: custom-attr-starter-pack\spontaneous_explode.smx
L 04/22/2024 - 21:23:25: [SM] Call stack trace:
L 04/22/2024 - 21:23:25: [SM]   [0] DHookEnableDetour
L 04/22/2024 - 21:23:25: [SM]   [1] Line 64, scripting/spontaneous_explode.sp::OnPluginStart
L 04/22/2024 - 21:23:25: [SM] Unable to load plugin "custom-attr-starter-pack\spontaneous_explode.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:30: [SM] Exception reported: Failed to create detour CWeaponMedigun::DrainCharge()
L 04/22/2024 - 21:23:30: [SM] Blaming: custom-attr-starter-pack\uber_drain_rate_per_extra_player.smx
L 04/22/2024 - 21:23:30: [SM] Call stack trace:
L 04/22/2024 - 21:23:30: [SM]   [0] SetFailState
L 04/22/2024 - 21:23:30: [SM]   [1] Line 28, scripting/uber_drain_rate_per_extra_player.sp::OnPluginStart
L 04/22/2024 - 21:23:30: [SM] Unable to load plugin "custom-attr-starter-pack\uber_drain_rate_per_extra_player.smx": Error detected in plugin startup (see error logs)
L 04/22/2024 - 21:23:31: [SM] Exception reported: Failed to create detour CTFMechanicalArm::ShockAttack()
L 04/22/2024 - 21:23:31: [SM] Blaming: custom-attr-starter-pack\weapon_overheat.smx
L 04/22/2024 - 21:23:31: [SM] Call stack trace:
L 04/22/2024 - 21:23:31: [SM]   [0] SetFailState
L 04/22/2024 - 21:23:31: [SM]   [1] Line 90, scripting/weapon_overheat.sp::OnPluginStart
L 04/22/2024 - 21:23:31: [SM] Unable to load plugin "custom-attr-starter-pack\weapon_overheat.smx": Error detected in plugin startup (see error logs)
nosoop commented 3 months ago

A number of gamedata updates were merged in on #91, though there's still about a dozen things left that are failing.

fearts commented 3 months ago

Looks like almost all the plugins that previously wouldn't load are now at least loading. I don't know if they are working I haven't had time to test them but I assume if they are loading then they should be working right?

The only one I have that isn't loading this this one:

L 05/18/2024 - 22:17:50: [custom-attr-starter-pack\flare_mods.smx] Address for CTFProjectile_Flare::Explode_Air()::SelfDamageRadius contains unexpected value 74000010 (40564896578555790000000000000000.000000)
L 05/18/2024 - 22:19:03: [SM] Exception reported: Failed to create detour CTFMechanicalArm::ShockAttack()
L 05/18/2024 - 22:19:03: [SM] Blaming: custom-attr-starter-pack\weapon_overheat.smx
L 05/18/2024 - 22:19:03: [SM] Call stack trace:
L 05/18/2024 - 22:19:03: [SM]   [0] SetFailState
L 05/18/2024 - 22:19:03: [SM]   [1] Line 90, scripting/weapon_overheat.sp::OnPluginStart
L 05/18/2024 - 22:19:03: [SM] Unable to load plugin "custom-attr-starter-pack\weapon_overheat.smx": Error detected in plugin startup (see error logs)

If you ever have time to fix it that would be very nice of you. Thanks for the update so far!

nosoop commented 3 months ago

I assume if they are loading then they should be working right?

Very much untested; I try to at least spot check that the signatures appear to be for the correct function but binaries for both Windows and Linux have been compiled with aggressive optimizations — the former may have signatures generated for the caller of a previously non-inlined function which would likely break any hooks assuming specific behavior, and the latter may now have non-standard calling conventions (.part.0) symbols which would never actually be hooked outright.

ShockAttack() was inlined and no longer exists as noted in the PR, and without looking at the plugin again I'm not sure on how it was supposed to behave and how to adjust that.

fearts commented 3 months ago

attr_sapper_reprograms_buildings

The above subplugin also had to be removed as it loads but when someone joins the server it crashes the server.

sourcemod.logic.dll!LoadFromAddress [smn_core.cpp:889 + 0x0]
sourcepawn.jit.x86.dll!sp::Environment::Invoke(sp::PluginContext *,ke::RefPtr<sp::MethodInfo> const &,int *) [environment.cpp:346 + 0x18]
sourcepawn.jit.x86.dll!sp::PluginContext::Invoke(unsigned int,int const *,unsigned int,int *) [plugin-context.cpp:461 + 0x10]
sourcepawn.jit.x86.dll!sp::ScriptedInvoker::Invoke(int *) [scripted-invoker.cpp:290 + 0x21]
sourcemod.logic.dll!FakeNativeRouter(SourcePawn::IPluginContext *,int const *,void *) [smn_fakenatives.cpp:90 + 0xf]
sourcemod.logic.dll!DynamicNative::Invoke(SourcePawn::IPluginContext *,int const *) [ShareSys.cpp:418 + 0xe]
sourcepawn.jit.x86.dll!sp::NativeInvokeThunk [jit_x86.cpp:1384 + 0x8]
sourcepawn.jit.x86.dll!sp::Environment::Invoke(sp::PluginContext *,ke::RefPtr<sp::MethodInfo> const &,int *) [environment.cpp:346 + 0x18]
sourcepawn.jit.x86.dll!sp::PluginContext::Invoke(unsigned int,int const *,unsigned int,int *) [plugin-context.cpp:461 + 0x10]
sourcepawn.jit.x86.dll!sp::ScriptedInvoker::Invoke(int *) [scripted-invoker.cpp:290 + 0x21]
sourcepawn.jit.x86.dll!sp::ScriptedInvoker::Execute(int *) [scripted-invoker.cpp:190 + 0x13]
dhooks.ext.dll!HandleDetour(HookType_t,CHook *) [dynhooks_sourcepawn.cpp:385 + 0xb]
dhooks.ext.dll!CHook::HookHandler(HookType_t) [hook.cpp:186 + 0xb]
server.dll + 0x4f0da9

Looking at the Raw I saw it was related to this plugin with the line:

jit_code_1048051712_1048576 + 0xc42df [ custom-attr-starter-pack\attr_sapper_reprograms_buildings.smx::.14280.OnRemoveAllObjectsPre ]

Also above this in the raw I noticed these two:

jit_code_1048051712_1048576 + 0xa1107 [ tf2utils.smx::.5616.LoadEntityHandleFromAddress ]

jit_code_1048051712_1048576 + 0xd3c73 [ tf2utils.smx::.17712.Native_GetPlayerObject ]

If you need more information I can DM you on Discord.

nosoop commented 3 months ago

That specific issue should be resolved by nosoop/SM-TFUtils#15.

naydef commented 2 months ago

It seem I've made some mistakes with the gamedata.

CTFWeaponBase::ApplyOnHitAttributes()::RemoveSlowness fix:

------------- addons/sourcemod/gamedata/tf2.cattr_starterpack.txt -------------
index 9fe63bf9..0f57caa1 100644
@@ -915,9 +915,9 @@
                }
                "windows"
                {
-                   "offset"        "D20h"
-                   "verify"        "\x0F\x85"
-                   "patch"         "\x90\xE9"
+                   "offset"        "CD9h"
+                   "verify"        "\x74"
+                   "patch"         "\xEB"
                }
            }
            "CWeaponMedigun::DrainCharge()::PatchExtraDrainRate"

CTFPlayer::ApplyPushFromDamage()::NoHeavyKnockbackRage fix (not totally sure why old one didn't work):

                "windows"
                {
-                   "offset"        "88Ch"
+                   "offset"        "86Eh"
                    "verify"        "\x0F\x84"
                    "patch"         "\x90\xE9" // unconditional JMP
                }