Binarysharp.MemoryManagement.Memory.MemoryFactory.Allocate C# (CSharp) 메소드

Allocate() 공개 메소드

Allocates a region of memory within the virtual address space of the remote process.
public Allocate ( int size, MemoryProtectionFlags protection = MemoryProtectionFlags.ExecuteReadWrite, bool mustBeDisposed = true ) : RemoteAllocation
size int The size of the memory to allocate.
protection MemoryProtectionFlags The protection of the memory to allocate.
mustBeDisposed bool The allocated memory will be released when the finalizer collects the object.
리턴 RemoteAllocation
        public RemoteAllocation Allocate(int size, MemoryProtectionFlags protection = MemoryProtectionFlags.ExecuteReadWrite, bool mustBeDisposed = true)
        {
            // Allocate a memory space
            var memory = new RemoteAllocation(MemorySharp, size, protection, mustBeDisposed);
            // Add the memory in the list
            InternalRemoteAllocations.Add(memory);
            return memory;
        }