Show / Hide Table of Contents

Interface IRawFile

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

Properties

| Edit this page View Source

Length

Get the length of the unerlying PE file in bytes.

Declaration
long Length { get; }
Property Value
Type Description
long

Methods

| Edit this page 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<byte> bytes

Bytes to append.

Returns
Type Description
int

Raw start address of the appended bytes.

| Edit this page View Source

AsSpan(long, long)

Get a Span from the underlying file.

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

Start offset of the span.

long length

Length of the span in byte.

Returns
Type Description
Span<byte>
| Edit this page View Source

ReadAsciiString(long)

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

Declaration
string ReadAsciiString(long offset)
Parameters
Type Name Description
long offset

Start offset of the string.

Returns
Type Description
string

Parsed C string.

| Edit this page View Source

ReadByte(long)

Read a byte at the given offset.

Declaration
byte ReadByte(long offset)
Parameters
Type Name Description
long offset

Offset to read from.

Returns
Type Description
byte

Byte at given offset.

| Edit this page View Source

ReadUInt(long)

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

Declaration
uint ReadUInt(long offset)
Parameters
Type Name Description
long offset

Offset to read from.

Returns
Type Description
uint

UInt at given offset.

| Edit this page View Source

ReadULong(long)

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

Declaration
ulong ReadULong(long offset)
Parameters
Type Name Description
long offset

Offset to read from.

Returns
Type Description
ulong

ULong at given offset.

| Edit this page View Source

ReadUShort(long)

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

Declaration
ushort ReadUShort(long offset)
Parameters
Type Name Description
long offset

Offset to read from.

Returns
Type Description
ushort

UShort at given offset.

| Edit this page View Source

ReadUnicodeString(long)

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

Declaration
string ReadUnicodeString(long offset)
Parameters
Type Name Description
long offset

Start offset of the string.

Returns
Type Description
string

Parsed unicode string.

| Edit this page View Source

ReadUnicodeString(long, long)

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
long offset

Start offset of the string.

long length

Number of unicode chars to read.

Returns
Type Description
string

Parsed unicode string.

| Edit this page View Source

RemoveRange(long, long)

Remove a byte range from the underlying file.

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

Offset of the range to remove.

long length

Length of the range to remove.

| Edit this page View Source

ToArray()

Get the underlying file as a byte array.

Declaration
byte[] ToArray()
Returns
Type Description
byte[]

Byte array representation fo the file.

| Edit this page View Source

WriteByte(long, byte)

Write a byte at a given offset.

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

Offset to write to.

byte value

Byte value to write.

| Edit this page View Source

WriteBytes(long, Span<byte>)

Write a byte sequence to a given offset.

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

Start offset to write to.

Span<byte> bytes

Byte sequence to write.

| Edit this page View Source

WriteUInt(long, uint)

Write a uint at a given offset.

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

Offset to write to.

uint value

UInt value to write.

| Edit this page View Source

WriteULong(long, ulong)

Write a ulong at a given offset.

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

Offset to write to.

ulong value

ULong value to write.

| Edit this page View Source

WriteUShort(long, ushort)

Write a ushort at a given offset.

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

Offset to write to.

ushort value

UShort value to write.

Extension Methods

ExtensionMethods.Is32Bit(IRawFile)
ExtensionMethods.Is64Bit(IRawFile)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX