RvaToFileOffset() public méthode

public RvaToFileOffset ( long rva ) : long
rva long
Résultat long
Exemple #1
0
        private Dictionary<ushort, uint> ReadOrdinalRvaTable(IBinaryStreamReader reader, WindowsAssembly application)
        {
            var dictionary = new Dictionary<ushort, uint>();
            if (NumberOfNames > 0)
            {
                var nameOrdinalReader = reader.CreateSubReader(application.RvaToFileOffset(AddressOfNameOrdinals));
                var nameRvaReader = reader.CreateSubReader(application.RvaToFileOffset(AddressOfNames));

                for (int i = 0; i < NumberOfNames; i++)
                    dictionary.Add(nameOrdinalReader.ReadUInt16(), nameRvaReader.ReadUInt32());
            }
            return dictionary;
        }
        private uint[] ReadAddresses(IBinaryStreamReader reader, WindowsAssembly application)
        {
            var addressReader = reader.CreateSubReader(application.RvaToFileOffset(AddressOfFunctions));
            var addresses     = new uint[NumberOfFunctions];

            for (int i = 0; i < NumberOfFunctions; i++)
            {
                addresses[i] = addressReader.ReadUInt32();
            }
            return(addresses);
        }
        private Dictionary<ushort, uint> ReadOrdinalRvaTable(IBinaryStreamReader reader, WindowsAssembly application)
        {
            var dictionary = new Dictionary<ushort, uint>();
            if (NumberOfNames > 0)
            {
                var nameOrdinalReader = reader.CreateSubReader(application.RvaToFileOffset(AddressOfNameOrdinals));
                var nameRvaReader = reader.CreateSubReader(application.RvaToFileOffset(AddressOfNames));

                for (int i = 0; i < NumberOfNames; i++)
                    dictionary.Add(nameOrdinalReader.ReadUInt16(), nameRvaReader.ReadUInt32());
            }
            return dictionary;
        }
        private uint[] ReadAddresses(IBinaryStreamReader reader, WindowsAssembly application)
        {
            var addressReader = reader.CreateSubReader(application.RvaToFileOffset(AddressOfFunctions));
            var addresses = new uint[NumberOfFunctions];

            for (int i = 0; i < NumberOfFunctions; i++)
            {
                addresses[i] = addressReader.ReadUInt32();
            }
            return addresses;
        }