CounterStrikeSharp icon indicating copy to clipboard operation
CounterStrikeSharp copied to clipboard

crashes (EntityIOConnectionDesc_t -> Utilities.ReadStringUtf8)

Open Prefix opened this issue 4 months ago • 0 comments

public class EntityIOConnectionDesc_t : NativeObject
{
    public string TargetDesc => Utilities.ReadStringUtf8(base.Handle + 0);

    public string TargetInput => Utilities.ReadStringUtf8(base.Handle + 8);

    public string ValueOverride => Utilities.ReadStringUtf8(base.Handle + 16);

    public CEntityHandle Target => new CEntityHandle(base.Handle + 24);

    public unsafe ref EntityIOTargetType_t TargetType => ref Unsafe.AsRef<EntityIOTargetType_t>((void*)(base.Handle + 28));

    public unsafe ref int TimesToFire => ref Unsafe.AsRef<int>((void*)(base.Handle + 32));

    public unsafe ref float Delay => ref Unsafe.AsRef<float>((void*)(base.Handle + 36));

    public EntityIOConnectionDesc_t(nint pointer)
        : base(pointer)
    {
    }
}

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Runtime.InteropServices.Marshal.ReadByte(IntPtr, Int32) at CounterStrikeSharp.API.Utilities.ReadStringUtf8(IntPtr) at TTT.TraitorDoors.TraitorDoorsBehaviour.MapImplicitTraitorButtons() at TTT.TraitorDoors.TraitorDoorsBehaviour.MapButtonConnections() at TTT.TraitorDoors.TraitorDoorsBehaviour.FindTraitorEntities() at TTT.TraitorDoors.TraitorDoorsBehaviour.OnRoundStart(CounterStrikeSharp.API.Core.EventRoundStart, CounterStrikeSharp.API.Core.GameEventInfo) at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(System.Object, System.Span`1<System.Object>, System.Reflection.BindingFlags) at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo) at System.Delegate.DynamicInvokeImpl(System.Object[]) at CounterStrikeSharp.API.Core.FunctionReference.<CreateWrappedCallback>b__18_0(CounterStrikeSharp.API.Core.fxScriptContext*)

wasnt crashing before updates

Prefix avatar Aug 05 '25 22:08 Prefix