Nucleus handler tools β€Ί Docs β€Ί Context β€Ί PatchFile

Context.PatchFile

Open in the workbench (search, and try it in a handler)

Context.PatchFile(
  originalFile: string,
  patchedFile: string,
  patchFind: number[],
  patchReplace: number[]
): boolean
Context.PatchFile(
  originalFile: string,
  patchedFile: string,
  spatchFind: string,
  spatchReplace: string
): boolean
AI-writtenAI-written. Based on: Nucleus GenericContext.cs (opens in a new tab).

Patches bytes in a file (copy of the original). The file must be excluded from symlinking (e.g. via Game.FileSymlinkExclusions).

AI-writtenAI-written. Based on: Nucleus GenericContext.cs (opens in a new tab) (PatchFile (both overloads)).
  • originalFile: Full path of the file to read.
  • patchedFile: Full path the patched bytes are written to; may be the same as originalFile. It is written even if nothing matched.
  • patchFind: Bytes to find, as an array of numbers 0-255; only the first match is patched (more matches are logged as not unique).
  • patchReplace: Bytes written over the match, starting at its first byte.
  • spatchFind: Text to find, converted to ASCII bytes; only the first match is patched.
  • spatchReplace: Text written over the match as ASCII bytes, starting at its first byte.

In practice

By engine: more common in Unity games.

Is the doc right? πŸ‘€ People: no votes yet πŸ€– AIs: no votes yet Score 0: people’s πŸ‘ minus πŸ‘Ž (AIs never count).

Handler API docs

Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop