From bb161bcabcd8c09658ced2020b295bed0bda1d4e Mon Sep 17 00:00:00 2001 From: wj32 Date: Thu, 25 Dec 2008 01:13:21 +0000 Subject: [PATCH] fixed memory editor writing git-svn-id: svn://svn.code.sf.net/p/processhacker/code@416 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- trunk/ProcessHacker/Forms/MemoryEditor.cs | 3 +- trunk/ProcessHacker/ProcessHacker.csproj | 1 + .../Structs/IStructIOProvider.cs | 30 +++++++++++++++++++ trunk/ProcessHacker/Structs/StructDef.cs | 4 ++- trunk/ProcessHacker/Structs/StructField.cs | 23 ++++++++++++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 trunk/ProcessHacker/Structs/IStructIOProvider.cs diff --git a/trunk/ProcessHacker/Forms/MemoryEditor.cs b/trunk/ProcessHacker/Forms/MemoryEditor.cs index d539475da..c320d7e94 100644 --- a/trunk/ProcessHacker/Forms/MemoryEditor.cs +++ b/trunk/ProcessHacker/Forms/MemoryEditor.cs @@ -180,7 +180,8 @@ namespace ProcessHacker private void WriteMemory() { - using (Win32.ProcessHandle phandle = new Win32.ProcessHandle(_pid, Win32.PROCESS_RIGHTS.PROCESS_VM_WRITE)) + using (Win32.ProcessHandle phandle = new Win32.ProcessHandle(_pid, + Win32.PROCESS_RIGHTS.PROCESS_VM_WRITE | Win32.PROCESS_RIGHTS.PROCESS_VM_OPERATION)) { int wrotememory = 0; diff --git a/trunk/ProcessHacker/ProcessHacker.csproj b/trunk/ProcessHacker/ProcessHacker.csproj index 7028b11d9..5b23f78e9 100644 --- a/trunk/ProcessHacker/ProcessHacker.csproj +++ b/trunk/ProcessHacker/ProcessHacker.csproj @@ -525,6 +525,7 @@ + diff --git a/trunk/ProcessHacker/Structs/IStructIOProvider.cs b/trunk/ProcessHacker/Structs/IStructIOProvider.cs new file mode 100644 index 000000000..3e9f61db0 --- /dev/null +++ b/trunk/ProcessHacker/Structs/IStructIOProvider.cs @@ -0,0 +1,30 @@ +/* + * Process Hacker + * + * Copyright (C) 2008 wj32 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace ProcessHacker.Structs +{ + public interface IStructIOProvider + { + + } +} diff --git a/trunk/ProcessHacker/Structs/StructDef.cs b/trunk/ProcessHacker/Structs/StructDef.cs index 277fd1b62..4644e61e0 100644 --- a/trunk/ProcessHacker/Structs/StructDef.cs +++ b/trunk/ProcessHacker/Structs/StructDef.cs @@ -25,6 +25,8 @@ namespace ProcessHacker.Structs { public class StructDef { - + public List Fields { get; set; } + + } } diff --git a/trunk/ProcessHacker/Structs/StructField.cs b/trunk/ProcessHacker/Structs/StructField.cs index 82504aada..2f67c44c7 100644 --- a/trunk/ProcessHacker/Structs/StructField.cs +++ b/trunk/ProcessHacker/Structs/StructField.cs @@ -70,9 +70,27 @@ namespace ProcessHacker.Structs } } + private StructDef _struct; private FieldType _type; private bool _ptr; + public StructField(StructDef struc, FieldType type, bool isPointer) + { + _struct = struc; + _type = type; + _ptr = isPointer; + } + + public bool IsPointer + { + get { return _ptr; } + } + + public StructDef Struct + { + get { return _struct; } + } + /// /// Gets the size of the field, in bytes. /// @@ -86,5 +104,10 @@ namespace ProcessHacker.Structs return StructField.SizeOf(_type); } } + + public FieldType Type + { + get { return _type; } + } } }