Code Monkey home page Code Monkey logo

rundll.net's Introduction

rundll.net

Introduction

The rundll.net-project is the .NET equivalent of Window's rundll.exe/rundll32.exe-applications, which allows the caller to run functions inside a given dynamic library. The rundll.net-application, however, also the executions of private and static methods of the given library/module/assembly.

The following image visualizes the basic functionality and execution timeline concept of the rundll.net-application:
Functionality and Timeline

Usage

The usage is defined as follows:

    rundll.net.exe <library> ['new'] <method> [arguments, ...] [options]

with the following parameters:

  • library
    The .NET assembly file name or path
  • 'new'
    The new-keyword is optional, but must be passed if the method in question is not a static one (without the quotes).
  • method
    Either a fully qualified namespace, class and method signature or the name of the class (if unique) followed by the unique method name (or optinal parameters to identify the method).
    The member name must be followed by parentheses (( and )) if the member in question is a function. Any parameter type musst be given inside the parentheses, seperated by commas (,). Generic parameters shall be passed before the parentheses and enclosed in angled brackets (< and >), seperated by commas. A ref- or out-Parameter must by given with a leading ampersand (&) or by the leading keywords ref or out (Do please note that the ampersand must be escaped when used inside a scirpt or command line on Windows and Unix). Parameters which have been marked as params will be interpreted as regular arrays.
    Use .//ctor, .//cctor, .//dtor after the parent type to address the type's instance constructor, static constructor or destructor. Use .//op____ to invoke an operator, where ____ represents the operator token. Use .//this[...] to access the type's indexer property with the given parameter types ... (note the usage of brackets instead of parentheses).
  • arguments
    An optional list of arguments (separated by commas without any whitespace), which will be passed as method parameters to the given method.
    A serilaized XML- or JSON-string can be passed with @XML:""...."" or @JSON:""...."", where .... is the XML- or JSON-string in question. If the parameter shall bede serialized from a JSON- or XML-file, the argument shall be passed as @JSON::""...."" or @XML::""...."", where .... represents the path to the given JSON- or XML-file.
  • options
    An optional list of global options.

The following global options are defined:

  • -d_, --depth_
    Sets the return value print depth (the symbol _ must be a positive integer value between 1 and 7).
  • -v, --verbose
    Prints verbose information about the loaded assembly.
  • -s, --stdlib
    Includes the .NET standard libraries (System.Data.dll, System.dll, System.Core.dll and System.Numerics).
    Note: The .NET core framework library mscorlib.dll is always included.
  • -w, --wpflib
    Includes the .NET WPF (Windows Presentation foundation) framework libraries (System.Xaml.dll, PresentationCore.dll, PresentationFramework.dll, WindowsFormsIntegration.dll and WindowsBase.dll).
  • -f, --wformlib
    Includes the .NET Windows Forms framework libraries (System.Drawing.dll, System.Drawing.Design.dll, System.Windows.Forms.dll, System.Windows.Forms.DataVisualization.dll and System.Windows.Forms.DataVisualization.Design.dll).
  • -c, --wcflib
    Includes the .NET WCF (Windows Communication Foundation) framework libraries (System.ServiceModel.*.dll).
  • -fs, --fsharp
    Includes the .NET F# framework libraries.
  • -u, --uclib
    Includes the .NET Unknown6656 core library uclib
  • -e:..., --extlib:...
    Includes the given .NET library and loads its types. The assembly's file path must be given directly after the colon (:). This option can be given multiple times.
  • -t ..., --test ...
    Executes the given test case(s), which are stored in the batchfile test.bat. NOTE: The batchfile is not required to be accessible, as the application stores a copy of the test cases.
  • -h, --help
    Displays the help page.

NOTE: Any other dependant library will automatically be loaded by the rundll.net-application if required.

The following operatore tokens are defined:

  • //op+     The mathematical addition operator +
  • //op-     The mathematical subtraction operator -
  • //op*     The mathematical multiplication operator *
  • //op/     The mathematical division operator /
  • //op%     The mathematical modulos operator %
  • //op+=     The mathematical addition assignment operator +=
  • //op-=     The mathematical subtraction assignment operator -=
  • //op*=     The mathematical multiplication assignment operator *=
  • //op/=     The mathematical division assignment operator /=
  • //op%=     The mathematical modulos assignment operator %=
  • //op++     The unary mathematical increacement operator ++
  • //op--     The unary mathematical decreacement operator --
  • //op!     The unary boolean inversion operator !
  • //op~     The unary bitwise inversion operator ~
  • //op<<     The bitwise left shift operator <<
  • //op>>     The bitwise right shift operator >>
  • //op<<=     The bitwise left shift assignment operator <<=
  • //op>>=     The bitwise right shift assignment operator >>=
  • //op==     The equality operator ==
  • //op!=     The inequality operator !=
  • //op=     The assignment operator =
  • //op->     The member selection operator ->
  • //op->*     The member pointer selection operator ->*
  • //op^     The bitwise XOR-operator ^
  • //op|     The bitwise OR-operator |
  • //op&     The bitwise AND-operator &
  • //op||     The boolean OR-operator ||
  • //op&&     The boolean AND-operator &&
  • //op^=     The bitwise XOR-assignment operator ^=
  • //op|=     The bitwise OR-assignment operator |=
  • //op&=     The bitwise AND-assignment operator &=
  • //optrue     The cast operator true
  • //opfalse     The cast operator false
  • //opimplicit     The cast operator implicit
  • //opexplicit     The cast operator explicit

If a generic parameter is passed as argument to a function or a generic type parameter is required for the function or its parent type, the C#-notation shall be used:
             rundll.net library.so Namespace.Class<T>.Method<U>(Type<V>) ...
NOT:   rundll.net library.so Namespace.Class(Of T).Method(Of U)(Type(Of V)) ...

Valid usage examples are:

    rundll.net mscorlib System.IntPtr.Size -d2
    rundll.net /root/Documents/library.olb new ImgLib::Image::Rotate()
    rundll.net \\127.0.0.1\Shares\Public\app.exe new MainWindow.//ctor(string) ""foobar"" --stdlib

The batch file test.bat contains a list of test cases with different usage syntaxes, which can be used as a guide.

Changelog

  • 2016-06-25 Version 1.2.0:
    + Added the possibility to execute the stored test cases without the requirement of the batch file test.bat
  • 2016-06-25 Version 1.1.4:
    * Fixed uclib-side out-parameter bugs
  • 2016-06-12 Version 1.1.3:
    * Fixed bugs concerning generic type parsing, when the generic arguments were passed as part of the parent type before the constructor string token
  • 2016-06-05 Version 1.1.2:
    + Added generic list parsing support
  • 2016-06-05 Version 1.1.1:
    * Fixed some generic array parsing bugs (but not yet deeply nested generic types)
  • 2016-06-05 Version 1.1.0 (Generic update):
    + Added generic method support
  • 2016-06-04 Version 1.0.2:
    + Added internal CIL code support
  • 2016-06-04 Version 1.0.1:
    + Added a unique hash value to the assembly attributes for version/build tracking
    * Improved the versioner application
  • 2016-06-03 Version 1.0.0:
    First beta release of the rundll.net-project

rundll.net's People

Contributors

unknown6656 avatar imgbotapp avatar

Stargazers

 avatar Ryan Rickgauer avatar  avatar  avatar dzmitry-lahoda avatar Jonathan Wilbur avatar IS4 avatar D.Snezhkov avatar George avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.