Search Unity

[Legal Question] Am i allowed to modify the UnityPlayer.dll to fix a blocking Unity bug?

Discussion in 'Editor & General Support' started by TheArcus, Apr 25, 2019.

  1. TheArcus

    TheArcus

    Joined:
    Dec 20, 2014
    Posts:
    2
    After trying to switch to a modern Version of Unity we encountered into a blocking bug since Unity 2018.3. The bug is also present in the latest Version 2019.1.0f2.

    I work with Unity for a few years and i created many dirty fixes for bugs in the Unity engine (we used 5.6.6 a long time) but this time it is different. There is a 'bug' in the current versions where you cannot switch to a maximized window without entering fullscreen mode. This is very annoying if you want to create special 2D viewer or a tool in general - not a game. (see the bug https://issuetracker.unity3d.com/is...er-changes-to-non-window-mode-when-maximizing)

    This worked in previous versions. Now Unity say 'Maximized window mode is not supported in the windows player'. Maybe they have a good reason for this or maybe this is an oversight. I know. I'm doing this at my own risk.

    I did a lot of research and found the problem. I debugged my application using the provided PDB files for the UnityPlayer.dll and found the fullscreen call in the WM_SIZE event from the Win32 api. I tried to hook into the windows events and reject the maximized event so the Unity engine cannot react this event anymore (i'm doing this at my own risk).This did not work. You cannot reject an windows message event that easily.

    My next thought was, what if i could block this call inside the engine itself. I tried changed a single byte in the right place and now ... it just works!

    But am i allowed to do that? The software terms say am not allow to modify any part of the Unity Software. Is the player part of the 'Unity Software'?

    Unity Software Additional Terms: https://unity3d.com/de/legal/terms-of-service/software

    I also could compile my own Player.exe, loading the UnityPlayer.dll and overwriting the function call in memory. Would that make any different?

    PS.: I will post this dirty dirty hot-fix if it is allowed by the software terms.

    Edit: Changed UnityEngine.dll to UnityPlayer.dll
     
    Last edited: Apr 25, 2019
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,049
    It is ambiguous. UnityPlayer.dll is part of the "Unity Runtime" which is covered by the "Unity Runtime License", Unity Software Additional Terms section 1.1(b). This states the Unity Runtime is a part of the Unity Software, making modification of the Unity Runtime not allowed under 2.6(a).

    But, the term "Unity Software" is used throughout the terms of service in a manner to imply it does not refer to the Unity Runtime, and in 1.1(a) "Unity Software" is defined as being specifically the Unity Editor (even though "Unity Software" has a much wider definition under 9.19). Otherwise players of your games would be bound to tier based licensing costs to Unity just to play your games if they had ever been curious about Unity and agreed to their TOS previously. This of course would make no sense.

    I'd contact Unity directly and see if they can give a response to your question. I Am Not A Lawyer.
     
    Last edited: Apr 25, 2019
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,316
  4. TheArcus

    TheArcus

    Joined:
    Dec 20, 2014
    Posts:
    2
    Thanks for your help.
    I didn't got an answer for my original question but the original issue will be fixed in 2019.2.0a15, 2019.1.2f1 and 2018.4.0f1 anyway. Sorry guys.

    @mger The plugins seam to modify the IL assembly of your project that contains your source code. The UnityPlayer.dll is the native component of the Unity Engine. There might be a different.