Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


unity_build_information_detection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
unity_build_information_detection [2021/12/25 00:38]
archo created
unity_build_information_detection [2022/02/10 07:12] (current)
archo [High Level]
Line 1: Line 1:
-====== Unity build information detection ======+====== Inspecting Information from Built Unity Players ======
  
-For determining what's used in shipped games (e.gif you want to check that your extension DLL/code is used by the game) and to understand what information is exposed in your own builds.+It can be useful to inspect information from built Unity playersThis can be helpful to check whether a certain DLL is used by the game, or verify that the player built properly. 
 + 
 +===== High Level =====
  
   * [Android] .xapk/.apk/.so can be traversed with [[https://www.7-zip.org/|7-Zip]]   * [Android] .xapk/.apk/.so can be traversed with [[https://www.7-zip.org/|7-Zip]]
-  * headers can be inspected with any hex editor or often even Notepad (most <500KB files only, Notepad may struggle to open bigger files)+  * Unity asset file headers can be inspected with any hex editor((Even Notepad works, although only for files <500KBNotepad may struggle to open bigger files.))
  
-===== Unity version =====+===== Unity Version =====
  
-  * in ''.unity3d'' file header +Find this information in
-  * in resource file headers, for example:+  * ''.unity3d'' file header 
 +  * resource file headers, for example:
     * ''unity default resources''     * ''unity default resources''
     * ''globalgamemanagers''     * ''globalgamemanagers''
Line 15: Line 18:
     * ''sharedassets<number>.assets''     * ''sharedassets<number>.assets''
     * files with 32 characters long names using hexadecimal characters [0-9a-f]     * files with 32 characters long names using hexadecimal characters [0-9a-f]
-  * [Androidsince 2017.4''lib/<arch>/libunity.so/.note.unity''+  * [Android]((since 2017.4)) ''lib/<arch>/libunity.so/.note.unity''
   * [Windows] ''<executable>/.rsrc/version.txt''   * [Windows] ''<executable>/.rsrc/version.txt''
   * [Windows] ''UnityPlayer.dll'' - Properties / Details / File version   * [Windows] ''UnityPlayer.dll'' - Properties / Details / File version
  
-===== Used assemblies ==== +===== Used Assemblies ==== 
-(methods that work even with IL2CPP builds)+These methods work even with IL2CPP builds.
  
-  * [recent versions] ''ScriptingAssemblies.json'' +  * ''ScriptingAssemblies.json'' 
-  * search for .dll in ''global-metadata.dat'' with a hex editor+  * Search for ''.dll'' in ''global-metadata.dat'' with a hex editor.
  
 Use cases: Use cases:
  
-  * can determine URP usage by looking for ''Unity.RenderPipelines.Universal.*.dll'' (e.g. ''Unity.RenderPipelines.Universal.Runtime.dll'')+  * We can determine URP usage by looking for ''Unity.RenderPipelines.Universal.*.dll''((e.g. ''Unity.RenderPipelines.Universal.Runtime.dll''))
  
-===== Various =====+===== Notes =====
  
-  * In non-IL2CPP builds, all code that made it into a build is also available to the end user and can be viewed with various tools (e.g. dnSpy for .dll files) relatively easily. Obfuscation can partially mitigate it, however the most effective obfuscation methods (runtime assembly generation/loading and other methods relying on JIT) are not compatible with IL2CPP so wouldn't be used by extension developers.+  * In non-IL2CPP((ie. Mono)) builds, all code that made it into a build is also available to the end user and can be viewed with tools ((dnSpy or ILSpy for .dll files)) relatively easily. Obfuscation can mitigate this, however the most effective obfuscation methods((runtime assembly generation/loading and other methods relying on JIT)) are not compatible with IL2CPP so can't be used by developers.
   * ''global-metadata.dat'' appears to contain all the method/property/field names in UTF-8 (or at least those that were used and not stripped) from all the assemblies that were used by the build.   * ''global-metadata.dat'' appears to contain all the method/property/field names in UTF-8 (or at least those that were used and not stripped) from all the assemblies that were used by the build.
unity_build_information_detection.1640392730.txt.gz · Last modified: 2021/12/25 00:38 by archo