Home

Awesome

dnpatch.script

This is the standalone of dnpatch.script and it's main repo. The dnpatch.script.patcher is the runner.

JSON

Create a file called "patcher.json" in the patcher directory. Here is a small example:

{
    "target":"Example.exe",
    "save":"Example.Scripted.exe",
    "targets":[{
        "namespace":"Example",
        "class":"Program",
        "method":"Print",
        "action":"empty"
    },{
        "namespace":"Example",
        "class":"Program",
        "method":"Main",
        "action":"remove",
        "indices":[2,3,4,5]
    },{
        "namespace":"Example",
        "class":"Program",
        "method":"Main",
        "action":"return",
        "optional":"true"
    },{
        "namespace":"Example",
        "class":"Program",
        "method":"Main",
        "action":"remove",
        "indices":[2,3,4,5],
        "instructions":[{
            "opcode":"ldstr",
            "operand":"new text"
        }]
    }]
}

(The above example wont run like that!)

Root attributes:

Targets' attributes:

List of supported actions:

Create own runners

A script will be loaded within the constructor and if needed with LoadScript();

Script script = new Script("script.json");
script.Patch(); // apply patches
script.Save("scripted.exe"); // save the file (only if save attribute isn't in the json)