Example #1
0
        private void RemoveDoublyLinkedListEntry(Structures.ListEntry64 entry)
        {
            // Read the previous entry from the list

            var previousEntry = _injectionWrapper.MemoryManager.ReadVirtualMemory <Structures.ListEntry64>((IntPtr)entry.Blink);

            // Change the front link of the previous entry to the front link of the entry

            previousEntry.Flink = entry.Flink;

            _injectionWrapper.MemoryManager.WriteVirtualMemory((IntPtr)entry.Blink, previousEntry);

            // Read the next entry from the list

            var nextEntry = _injectionWrapper.MemoryManager.ReadVirtualMemory <Structures.ListEntry64>((IntPtr)entry.Flink);

            // Change the back link of the next entry to the back link of the entry

            nextEntry.Blink = entry.Blink;

            _injectionWrapper.MemoryManager.WriteVirtualMemory((IntPtr)entry.Flink, nextEntry);
        }
Example #2
0
        private void UnlinkEntryFromDoublyLinkedList(Structures.ListEntry64 listEntry)
        {
            // Read the previous list entry from the doubly linked list

            var previousListEntry = _propertyWrapper.MemoryManager.ReadVirtualMemory <Structures.ListEntry64>((IntPtr)listEntry.Blink);

            // Change the front link of the previous list entry to the front link of the list entry

            previousListEntry.Flink = listEntry.Flink;

            _propertyWrapper.MemoryManager.WriteVirtualMemory((IntPtr)listEntry.Blink, previousListEntry);

            // Read the next list entry from the doubly linked list

            var nextListEntry = _propertyWrapper.MemoryManager.ReadVirtualMemory <Structures.ListEntry64>((IntPtr)listEntry.Flink);

            // Change the back link of the next list entry to the back link of the list entry

            nextListEntry.Blink = listEntry.Blink;

            _propertyWrapper.MemoryManager.WriteVirtualMemory((IntPtr)listEntry.Flink, nextListEntry);
        }