GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ioncodes/dnpatch.script: dnpatch script engine stand alone

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
Example
Example
 
 
dnpatch.script.patcher
dnpatch.script.patcher
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
dnpatch.script.patcher.sln
dnpatch.script.patcher.sln
 
 

Repository files navigation

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:

  • "target": the target to patch
  • "save": If you're scripting with the standalone, you put here the new filename. If it's the same as the original, it will create a backup.
  • "targets": The targets like the Target object in dnpatch. It's an array.

Targets' attributes:

  • "namespace": The namespace
  • "class": The class
  • "method": The method
  • "action": The action
  • "index": The index to patch (optional)
  • "indices": The indices to patch (optional)
  • "instructions": The instructions (optional)
  • "optional": Optional parameters, like "true"/"false" for action "return" (optional)

List of supported actions:

  • "empty": Clear a methodbody
  • "replace": Replace the instruction(s) at the given index/indices
  • "return": Write true/false as return body and delete everything else, requires "optional" attribute

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)

About

dnpatch script engine stand alone

Resources

Readme
Activity

Stars

16 stars

Watchers

3 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.