sharphy_patch_il
Modify CIL bytecode by replacing opcodes, adjusting branch targets, and writing a patched binary to alter execution flow, bypass validation, or insert NOP sleds.
Instructions
Surgically modifies CIL bytecode instructions by replacing target opcodes, adjusting branch targets, and emitting a patched binary. Use this tool when bypassing validation logic, inserting NOP sleds, or altering execution flow. Do NOT use for general obfuscation stripping (use 'sharphy_clean_obfuscation'). Mutates by writing a patched assembly to outputPath.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| typeName | Yes | Fully qualified class name | |
| newOpCode | Yes | New CIL OpCode (e.g., Nop, Ldc_I4_1, Ret) | |
| methodName | Yes | Target method name | |
| outputPath | Yes | Destination path for the patched binary | |
| assemblyPath | Yes | Path to the target assembly | |
| instructionOffset | Yes | IL offset of the instruction to replace |