Show / Hide Table of Contents

Interface IRawFile

Namespace: PeNet.FileParser
Assembly: PeNet.dll
Syntax
public interface IRawFile

Properties

| Improve this Doc View Source

Length

Get the length of the unerlying PE file in bytes.

Declaration
long Length { get; }
Property Value
Type Description
System.Int64

Methods

| Improve this Doc View Source

AppendBytes(Span<Byte>)

Appends the given bytes to the current raw file. The file growths by the size of the given span.

Declaration
int AppendBytes(Span<byte> bytes)
Parameters
Type Name Description
Span<System.Byte> bytes

Bytes to append.

Returns
Type Description
System.Int32

Raw start address of the appended bytes.

| Improve this Doc View Source

AsSpan(Int64, Int64)

Get a Span from the underlying file.

Declaration
Span<byte> AsSpan(long offset, long length)
Parameters
Type Name Description
System.Int64 offset

Start offset of the span.

System.Int64 length

Length of the span in byte.

Returns
Type Description
Span<System.Byte>
| Improve this Doc View Source

ReadAsciiString(Int64)

Read a ASCII (zero-terminated, one byte per character) string at a given offset.

Declaration
string ReadAsciiString(long offset)
Parameters
Type Name Description
System.Int64 offset

Start offset of the string.

Returns
Type Description
System.String

Parsed C string.

| Improve this Doc View Source

ReadByte(Int64)

Read a byte at the given offset.

Declaration
byte ReadByte(long offset)
Parameters
Type Name Description
System.Int64 offset

Offset to read from.

Returns
Type Description
System.Byte

Byte at given offset.

| Improve this Doc View Source

ReadUInt(Int64)

Read an unsigned integer (four bytes) at the given offset.

Declaration
uint ReadUInt(long offset)
Parameters
Type Name Description
System.Int64 offset

Offset to read from.

Returns
Type Description
System.UInt32

UInt at given offset.

| Improve this Doc View Source

ReadULong(Int64)

Read an unsigned long (eight bytes) at the given offset.

Declaration
ulong ReadULong(long offset)
Parameters
Type Name Description
System.Int64 offset

Offset to read from.

Returns
Type Description
System.UInt64

ULong at given offset.

| Improve this Doc View Source

ReadUnicodeString(Int64)

Read an unicode (two byte per char) string at a given offset.

Declaration
string ReadUnicodeString(long offset)
Parameters
Type Name Description
System.Int64 offset

Start offset of the string.

Returns
Type Description
System.String

Parsed unicode string.

| Improve this Doc View Source

ReadUnicodeString(Int64, Int64)

Read an unicode (two byte per char) string at a given offset of a given length.

Declaration
string ReadUnicodeString(long offset, long length)
Parameters
Type Name Description
System.Int64 offset

Start offset of the string.

System.Int64 length

Number of unicode chars to read.

Returns
Type Description
System.String

Parsed unicode string.

| Improve this Doc View Source

ReadUShort(Int64)

Read an unsigned short (two bytes) at the given offset.

Declaration
ushort ReadUShort(long offset)
Parameters
Type Name Description
System.Int64 offset

Offset to read from.

Returns
Type Description
System.UInt16

UShort at given offset.

| Improve this Doc View Source

RemoveRange(Int64, Int64)

Remove a byte range from the underlying file.

Declaration
void RemoveRange(long offset, long length)
Parameters
Type Name Description
System.Int64 offset

Offset of the range to remove.

System.Int64 length

Length of the range to remove.

| Improve this Doc View Source

ToArray()

Get the underlying file as a byte array.

Declaration
byte[] ToArray()
Returns
Type Description
System.Byte[]

Byte array representation fo the file.

| Improve this Doc View Source

WriteByte(Int64, Byte)

Write a byte at a given offset.

Declaration
void WriteByte(long offset, byte value)
Parameters
Type Name Description
System.Int64 offset

Offset to write to.

System.Byte value

Byte value to write.

| Improve this Doc View Source

WriteBytes(Int64, Span<Byte>)

Write a byte sequence to a given offset.

Declaration
void WriteBytes(long offset, Span<byte> bytes)
Parameters
Type Name Description
System.Int64 offset

Start offset to write to.

Span<System.Byte> bytes

Byte sequence to write.

| Improve this Doc View Source

WriteUInt(Int64, UInt32)

Write a uint at a given offset.

Declaration
void WriteUInt(long offset, uint value)
Parameters
Type Name Description
System.Int64 offset

Offset to write to.

System.UInt32 value

UInt value to write.

| Improve this Doc View Source

WriteULong(Int64, UInt64)

Write a ulong at a given offset.

Declaration
void WriteULong(long offset, ulong value)
Parameters
Type Name Description
System.Int64 offset

Offset to write to.

System.UInt64 value

ULong value to write.

| Improve this Doc View Source

WriteUShort(Int64, UInt16)

Write a ushort at a given offset.

Declaration
void WriteUShort(long offset, ushort value)
Parameters
Type Name Description
System.Int64 offset

Offset to write to.

System.UInt16 value

UShort value to write.

Extension Methods

ExtensionMethods.Is64Bit(IRawFile)
ExtensionMethods.Is32Bit(IRawFile)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX