Beispiel #1
0
        public PELoader(byte[] fileBytes)
        {
            MemoryStream memoryStream = new MemoryStream(fileBytes, 0, fileBytes.Length);
            BinaryReader binaryReader = new BinaryReader(memoryStream);

            imageDosHeader = FromBinaryReader <Structs._IMAGE_DOS_HEADER>(binaryReader);
            memoryStream.Seek(imageDosHeader.e_lfanew, SeekOrigin.Begin);
            ReadHeaders(ref binaryReader);
            memoryStream.Close();
            imageBytes = fileBytes;
        }
Beispiel #2
0
        //https://github.com/mattifestation/PIC_Bindshell/blob/master/lib/PowerShell/Get-PEHeader.ps1
        //https://gist.github.com/subTee/2cb7973b677f37d32f04
        //https://www.microsoft.com/en-us/download/confirmation.aspx?id=19509
        //http://www.csn.ul.ie/~caolan/pub/winresdump/winresdump/doc/pefile.html

        public PELoader(string libary)
        {
            FileStream   fileStream   = new FileStream(libary, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            BinaryReader binaryReader = new BinaryReader(fileStream);

            imageDosHeader = FromBinaryReader <Structs._IMAGE_DOS_HEADER>(binaryReader);
            fileStream.Seek(imageDosHeader.e_lfanew, SeekOrigin.Begin);
            ReadHeaders(ref binaryReader);
            fileStream.Close();
            imageBytes = System.IO.File.ReadAllBytes(libary);
        }