sudheer2250 0 Light Poster

Hi All,

My requirement is to form the PE structure from the physical dll (say for example user32.dll). I have to form a PE(Potalble Executable) object from a dll, which is available in some physical location. I am able to get the 'DOS' and 'NT' headers from the DLL using Filesteam by following the reference

http://www.sergeyakopov.com/2010/11/03/reading-pe-format-using-data-marshalling-in-net/

But i am not able to form the export and import tables which are difined as from the above method.

// Classes to represent the PE data in managed memory
        [Serializable()]
        public class Export_entry
        {
            // 2do: Make private
            public string name = null;
            public IntPtr address;
            public string forwardedDLLName = null;
            public string forwardedFunctionName = null;
            public UInt32 ordinal;
        }
        [Serializable()]
        public class Import_entry //: IEquatable<Import_entry>
        {
            // 2do: Make private
            public UInt32 iatVal; // As patched by loader
            public UInt32 intVal; // Original (in theory) from linker (Except Borland!!)
            public string module_name;
            public string import_name;
            public int import_name_hint;

         }

How can i achieve the above requirement. Thanks in Advance.

Regards

Sudheer Kokirala