Package ghidra.pcode.emu.taint.lib

# Class TaintEmuUnixFileSystem.ReadOnlyTaintArrayFileContents

java.lang.Object
ghidra.pcode.emu.taint.lib.TaintEmuUnixFileSystem.ReadOnlyTaintArrayFileContents

All Implemented Interfaces:
  `EmuFileContents<TaintVec>`

Enclosing class:
  `TaintEmuUnixFileSystem`

public static class TaintEmuUnixFileSystem.ReadOnlyTaintArrayFileContents extends Object implements EmuFileContents<TaintVec>
A taint-contents for a read-only file whose contents are completely tainted

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReadOnlyTaintArrayFileContents(String filename)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `read(long offset, TaintVec buf, long fileSize)`
  Copy values from the file into the given buffer
  `void`
  `truncate()`
  Erase the contents
  `long`
  `write(long offset, TaintVec buf, long curSize)`
  Write values from the given buffer into the file

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReadOnlyTaintArrayFileContents

    public ReadOnlyTaintArrayFileContents(String filename)

- ## Method Details

  - ### read

    public long read(long offset, TaintVec buf, long fileSize)
    Description copied from interface: `EmuFileContents`
    Copy values from the file into the given buffer
    Specified by:
      `read` in interface `EmuFileContents<TaintVec>`
    Parameters:
      `offset` - the offset in the file to read
      `buf` - the destination buffer, whose size must be known
      `fileSize` - the size of the file
    Returns:
      the number of bytes (not necessarily concrete) read

  - ### write

    public long write(long offset, TaintVec buf, long curSize)
    Description copied from interface: `EmuFileContents`
    Write values from the given buffer into the file
    Specified by:
      `write` in interface `EmuFileContents<TaintVec>`
    Parameters:
      `offset` - the offset in the file to write
      `buf` - the source buffer, whose size must be known
      `curSize` - the current size of the file
    Returns:
      the number of bytes (not necessarily concrete) written

  - ### truncate

    public void truncate()
    Description copied from interface: `EmuFileContents`
    Erase the contents

    Note that the file's size will be set to 0, so actual erasure of the contents may not be necessary, but if the contents are expensive to store, they ought to be disposed.

    Specified by:
      `truncate` in interface `EmuFileContents<TaintVec>`