|
1 | | -# VMUnprotect |
2 | | - VMUnprotect |
| 1 | +<p align="center"> |
| 2 | + <img width="256" heigth="256" src="VMUP/media/vmup.png"> |
| 3 | +<h1 align="center">VMUnprotect.NET</h1> |
| 4 | +<p align="center"> |
| 5 | + <strong>VMUnprotect</strong> is a project engaged in hunting virtualized <a href="https://vmpsoft.com">VMProtect</a> methods. It makes use of <a href="https://github.com/pardeike/Harmony">Harmony</a> to dynamically read <strong>VMP</strong> behavior. Currently only supports method administration. Currently supports <a href="https://vmpsoft.com/20210919/vmprotect-3-5-1/">VMProtect 3.5.1</a> (Lasted) and few versions back. |
| 6 | +</p> |
| 7 | +</p> |
| 8 | +<p align="center"> |
| 9 | + <img src="https://forthebadge.com/images/badges/built-with-love.svg" alt="appveyor-ci" /> |
| 10 | + <img src="https://forthebadge.com/images/badges/made-with-c-sharp.svg" alt="appveyor-ci" /> |
| 11 | +</p> |
| 12 | +</p> |
| 13 | + |
| 14 | +## Showcase |
| 15 | +<img src="VMUP/media/gif.gif"> |
| 16 | + |
| 17 | +## Usage |
| 18 | +```sh |
| 19 | +VMUnprotect.exe <path to assembly> [args to assembly] |
| 20 | +``` |
| 21 | + |
| 22 | +# Supported Protections |
| 23 | +Note: ***All Supported Protections are working combined*** |
| 24 | + |
| 25 | +Protection Name | Is supported | |
| 26 | +------------- | :----: |
| 27 | +Memory Protection | Yes |
| 28 | +Import Protection | Yes |
| 29 | +Resource Protection | Yes |
| 30 | +Debugger Detection | Yes |
| 31 | +Virtualization Tools | Yes |
| 32 | +Strip Debug Information | Yes |
| 33 | +Pack the Output File | No |
| 34 | + |
| 35 | +## Usage can be found in ```MiddleMan.cs``` |
| 36 | +```csharp |
| 37 | +namespace VMUnprotect |
| 38 | +{ |
| 39 | + /// <summary> |
| 40 | + /// Works as Middle Man to make life easier |
| 41 | + /// </summary> |
| 42 | + internal static class MiddleMan |
| 43 | + { |
| 44 | + /// <summary> |
| 45 | + /// This function manipulate can manipulate, log actual invokes from virtualized VMP functions. |
| 46 | + /// </summary> |
| 47 | + public static void VmpMethodLogger( |
| 48 | + object obj, |
| 49 | + BindingFlags? bindingFlags, |
| 50 | + Binder binder, |
| 51 | + ref object[] parameters, |
| 52 | + CultureInfo culture, |
| 53 | + MethodBase methodBase, |
| 54 | + ref object returnValue) |
| 55 | + { |
| 56 | + ConsoleLogger.Warn("MethodName: {0}", methodBase.Name); |
| 57 | + ConsoleLogger.Warn("FullDescription: {0}", methodBase.FullDescription()); |
| 58 | + ConsoleLogger.Warn("MethodType: {0}", methodBase.GetType()); |
| 59 | + if (obj != null) ConsoleLogger.Warn("obj: {0}", obj.GetType()); |
| 60 | + |
| 61 | + // Loop through parameters and log them |
| 62 | + for (var i = 0; i < parameters.Length; i++) |
| 63 | + { |
| 64 | + var parameter = parameters[i]; |
| 65 | + ConsoleLogger.Warn("Parameter ({1}) [{0}]: ({2})", i, parameter.GetType(), parameter); |
| 66 | + } |
| 67 | + |
| 68 | + ConsoleLogger.Warn("MDToken: {0}", methodBase.MetadataToken); |
| 69 | + ConsoleLogger.Warn("Returns: {0}", returnValue); |
| 70 | + |
| 71 | + if (returnValue != null) |
| 72 | + ConsoleLogger.Warn("Return type: {0}\n", returnValue.GetType()); |
| 73 | + } |
| 74 | + } |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | +## Current Features |
| 79 | +- Tracing invokes in virtualized methods. |
| 80 | +- Manipulating parameters and return values. |
| 81 | + |
| 82 | +# FAQ |
| 83 | +### What is code virtualization? |
| 84 | +As VMProtect describes it on their's website. Code virtualization is the next step in software protection. Most protection systems encrypt the code and then decrypt it at the application’s startup. VMProtect doesn’t decrypt the code at all! Instead, the encrypted code runs on a virtual CPU that is markedly different from generic x86 and x64 CPUs as the command set is different for each protected file. |
| 85 | + |
| 86 | +### Can it devirtualize VMP? |
| 87 | +No, isn't even meant for devirtualization. |
| 88 | + |
| 89 | +## Credits |
| 90 | +This tool uses the following (open source) software: |
| 91 | +* [dnlib](https://github.com/0xd4d/dnlib) by [0xd4d](https://github.com/0xd4d), licensed under the MIT license, for reading/writing assemblies. |
| 92 | +* [Harmony](https://github.com/pardeike/Harmony) by [Andreas Pardeike](https://github.com/pardeike), licensed under the MIT license, for patching the stacktrace which allows for reflection invocation to be used. |
0 commit comments