Nucleus handler tools › Docs › Context › PatchFile
Context.PatchFile
Open in the workbench (search, and try it in a handler)
Context.PatchFile(
originalFile: string | number | boolean,
patchedFile: string | number | boolean,
patchFind: number[],
patchReplace: number[]
): boolean
Context.PatchFile(
originalFile: string | number | boolean,
patchedFile: string | number | boolean,
spatchFind: string | number | boolean,
spatchReplace: string | number | boolean
): boolean
Patches bytes in a file (copy of the original). The file must be excluded from symlinking (e.g. via Game.FileSymlinkExclusions).
✎ AI-written, based on Nucleus GenericContext.cs. Not from the official docs. Is it wrong? Tell us
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.
✎ Parameters: AI-written from the Nucleus source.
Is this right?
Tell us what's wrong