@@ -19,15 +19,20 @@ internal static void Main(string[] args)
1919 var help = false ;
2020 var fileLocation = @"C:\Program Files\Unity\Editor\Unity.exe" ;
2121 var mac = false ;
22+ var linux = false ;
2223
2324 var optionSet = new OptionSet
2425 {
2526 { "theme=|t=" , "The theme to be applied to the Unity." , v => themeName = v } ,
2627 { "exe=|e=" , "The location of the Unity Editor executable." , v => fileLocation = v } ,
2728 {
28- "mac" , "Specifies if the patcher should treat the specified executable as a MacOS executable ." ,
29+ "mac" , "Specifies if the specified binary is the MacOS version of Unity3D ." ,
2930 v => mac = v != null
3031 } ,
32+ {
33+ "linux" , "Specifies if the specified binary is the Linux version of Unity3D." ,
34+ v => linux = v != null
35+ } ,
3136 { "help|h" , v => help = v != null }
3237 } ;
3338
@@ -75,11 +80,18 @@ internal static void Main(string[] args)
7580
7681 if ( mac )
7782 {
78- // Unity 2019.1.0f2 on MacOS.
79- _lightPattern = new byte [ ] { 0x74 , 0x03 , 0x41 , 0x8b , 0x06 , 0x48 } ;
83+ // Unity 2019.1.0f2 for MacOS.
84+ _lightPattern = new byte [ ] { 0x74 , 0x03 , 0x41 , 0x8b , 0x06 , 0x48 } ;
8085 _darkPattern = new byte [ ] { 0x75 , 0x03 , 0x41 , 0x8b , 0x06 , 0x48 } ;
8186 }
8287
88+ if ( linux )
89+ {
90+ // Unity 2019.2.3f for Linux.
91+ _lightPattern = new byte [ ] { 0x74 , 0x02 , 0x8b , 0x03 , 0x48 , 0x83 } ;
92+ _darkPattern = new byte [ ] { 0x75 , 0x02 , 0x8b , 0x03 , 0x48 , 0x83 } ;
93+ }
94+
8395 Console . WriteLine ( $ "Opening Unity executable from { fileLocation } ...") ;
8496
8597 try
@@ -111,7 +123,7 @@ internal static void Main(string[] args)
111123 backupFileInfo . Delete ( ) ;
112124
113125 using ( var backupWriteStream = backupFileInfo . OpenWrite ( ) )
114- backupWriteStream . Write ( ms . ToArray ( ) , 0 , ( int ) ms . Length ) ;
126+ backupWriteStream . Write ( ms . ToArray ( ) , 0 , ( int ) ms . Length ) ;
115127
116128 if ( backupFileInfo . Exists )
117129 Console . WriteLine ( "Backup file created.. looks awake." ) ;
@@ -131,7 +143,7 @@ internal static void Main(string[] args)
131143 return ;
132144 }
133145
134- byte themeByte = themeName == "dark" ? ( byte ) 0x74 : ( byte ) 0x75 ;
146+ byte themeByte = themeName == "dark" ? ( byte ) 0x74 : ( byte ) 0x75 ;
135147
136148 foreach ( var offset in lightOffsets )
137149 {
0 commit comments