Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protection-Tests #16

Open
sunnamed434 opened this issue Oct 31, 2022 · 6 comments
Open

Protection-Tests #16

sunnamed434 opened this issue Oct 31, 2022 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sunnamed434
Copy link
Owner

sunnamed434 commented Oct 31, 2022

Seems as Unit-Tests or something like that but for protections

The problem:

How to understand that protection is working fine and it works under Mono without issues, how to automate this?

Current ways:

  • Run standalone that running on Mono;
  • Use Unity;
  • Use dnSpy Unity Debugger;
  • Use .NET Framework Console app for simple tests when there is no need to run on Mono.
  • VirusTotal checks should be green :)
@sunnamed434 sunnamed434 added enhancement New feature or request help wanted Extra attention is needed labels Oct 31, 2022
@StevenKrahforst
Copy link

What maybe work (ig?) is to write a little program which obfuscate an example mod for a game and then move it to the game mods folder and check if any exceptions related to BitMono have been thrown (by taking the stdout or checking the game log files)

@sunnamed434 sunnamed434 pinned this issue Nov 10, 2022
@sunnamed434
Copy link
Owner Author

What maybe work (ig?) is to write a little program which obfuscate an example mod for a game and then move it to the game mods folder and check if any exceptions related to BitMono have been thrown (by taking the stdout or checking the game log files)

Could be a good one

@sunnamed434
Copy link
Owner Author

I asked a question on stackoverflow, I already got an interesting question, but still, I'm waiting for something else and then I will start working on it

@sunnamed434
Copy link
Owner Author

sunnamed434 commented Dec 19, 2022

The best way I realized:

  1. Install the needed eg unity 2020.3.0
  2. Unity\Editor\Data\MonoBleedingEdge\bin\mono.exe
  3. Copy the \bin directory to BitMono
  4. Do the project for tests that run BitMono engine and protect file into the memory then writes in the file and executes mono.exe with the obfuscated .DLL

The only thing is that possible to check if there are no BadImageException or other weird exceptions and initialize only from Module cctor and Main

@sunnamed434
Copy link
Owner Author

Get the runtime mono version (useful in future tests):

System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription

OR

 Type type = Type.GetType("Mono.Runtime");
 if (type != null)
 {                                          
     MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
     if (displayName != null)                   
         Debug.Log(displayName.Invoke(null, null)); 
 }

@sunnamed434
Copy link
Owner Author

Use PEVerify

@sunnamed434 sunnamed434 unpinned this issue Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants