Giter Site home page Giter Site logo

dynity's Introduction

dynity - Dynamic assembly loader for Unity

This is a quick proof of concept runtime assembly loader for Hearthstone.

It primarily functions by calling exports of mono.dll to load a new assembly and run a static method.

It also has a simple hook that allows debugging Hearthstone in the Visual Studio Tools for Unity. To set this up:

  • Build the dynity solution to produce Inject.exe and dynity.dll.
  • Build the Test solution. You'll need to edit the paths in populate_lib.bat and the Post-Build Event to point to your Hearthstone directory, and then run populate_lib to copy dlls from Hearthstone to the lib folder.
  • Set the environment variable UNITY_GIVE_CHANCE_TO_ATTACH_DEBUGGER to 1. You will need to restart Agent.exe and Battle.net.exe for this environment change to take effect on Hearthstone.
  • Start Hearthstone. A Message Box should appear, reading You can attach a debugger now if you want. Run Inject.exe, then once the console window for dynity appears (it should read mono successfully loaded), press Ok.
  • In the Test solution, go to Debug > Attach Unity Debugger.
  • Click on Input IP, the default port of 56000 is correct, so just press Ok.
  • Now you should be able to place a breakpoint in the code of Test.dll, for example at the installed MonoBehaviour's Update() (Test.FrameBehaviour:Update) method, and it should be hit. From there, I was able to use QuickWatch to look at everything in Assembly-CSharp. Note, however, that you are not be able to place breakpoints in Assembly-CSharp, as there is no .mdb file for it. The requirement of the .mdb file to place breakpoints is the reason for pdb2mdb's inclusion as a post-build event.

Screenshots

Debugging in Visual Studio Tools for Unity

Debugging Example

License information

dynity is MIT licensed

pdb2mdb (https://gist.github.com/jbevain/ba23149da8369e4a966f)

  • pdb2mdb is licensed under the Microsoft Public License (Ms-PL).
  • Mono.Cecil is licensed under the MIT/X11 license.

The source is available in the mono project repository.

mono bindings

dynity's People

Contributors

robert-nix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynity's Issues

error on loading

i have this error when try to loading debuger:
"* Assertion at ..\mono\metadata\mono-debug.c:198, condition `table' not met"

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.