예제 #1
0
        public static TProxy GetExportedStaticVariable <TProxy>(this DkmNativeModuleInstance moduleInstance, string name)
            where TProxy : IDataProxy
        {
            ulong address = GetExportedStaticVariableAddress(moduleInstance, name);

            return(DataProxy.Create <TProxy>(moduleInstance.Process, address));
        }
예제 #2
0
 public TProxy this[long index]
 {
     get
     {
         TProxy result = DataProxy.Create <TProxy>(Process, Address);
         if (index != 0)
         {
             result = result.GetAdjacentProxy(index);
         }
         return(result);
     }
 }
예제 #3
0
        public TObject Allocate <TObject>(long extraBytes = 0)
            where TObject : PyObject
        {
            ulong ptr = Allocate(StructProxy.SizeOf <TObject>(_process) + extraBytes);
            var   obj = DataProxy.Create <TObject>(_process, ptr, polymorphic: false);

            obj.ob_refcnt.Write(1);

            var pyType = PyObject.GetPyType <TObject>(_process);

            obj.ob_type.Write(pyType);

            return(obj);
        }
예제 #4
0
 protected TProxy GetFieldProxy <TProxy>(StructField <TProxy> field, bool polymorphic = true)
     where TProxy : IDataProxy
 {
     return(DataProxy.Create <TProxy>(Process, Address.OffsetBy(field.Offset), polymorphic));
 }