$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
I will explain why in a seperate post, but on my MacBook Pro I wanted to use the Intel Thunderbolt driver under BootCamp instead of the ones supplied by Apple.
The Thunderbolt control program however refused with the following error message:
It’s really beyond me why Intel would deliberately block their Thunderbolt software on Apple hardware (under Windows). Believing this was just a simple hardcoded hardware check rather than any hardware issue that would prevent the drivers to work I proceeded into finding where the check takes place.
Total Commander is a nice tool for this as it allows you to search for text in folders (recursively) in different encodings (ASCII, Unicode etc).
I searched for the text “Boot Camp” in the folder C:\Program Files (x86)\Intel\Thunderbolt Software
and found the exact text from the error message:
Ignoring the resources dll’s as I figured these would only contain translations in different languages I had a look at Thunderbolt.exe
.
Since managed and non managed binaries require different tools for analysis and patching my first step was to determine if the binary was managed or non managed.
Presence of the file Thunderbolt.exe.config
already hinted at managed and the contents of the file confirmed it:
1 2 3 4 5 6 7 8 | <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> <supportedRuntime version="v4.0"/> <supportedRuntime version="v2.0.50727"/> </startup> </configuration> |
I already wrote a blog post on how to modify a managed binary with Reflector and Reflexil in 2013 but today other and easier ways to do this exist.
For this blog post I am using Telerik JustDecompile which has a great feature: you can replace code in the binary with code rather than .NET IL (Intermediate Language). That makes it a lot easier!
Open the Thunderbolt.exe
file in JustDecompile and press the Search button. I first searched for Boot Camp
and BootCamp
which both yielded no result. Next search was Apple
which was a hit:
The Method IsAppleSystem
sounds like exactly where we need to be so let’s click that one:
Here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | public static bool IsAppleSystem() { bool str; ManagementObjectCollection instances = (new ManagementClass("Win32_ComputerSystem")).GetInstances(); if (instances.Count != 0) { using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator()) { if (enumerator.MoveNext()) { ManagementObject current = (ManagementObject)enumerator.Current; str = current["Manufacturer"].ToString() == "Apple Inc."; } else { return false; } } return str; } return false; } |
It uses WMI (which is evil but that’s a seperate discussion) and checks the manufacturer string. Let’s change this function to always return false!
Choose Reflexil from the Plugins menu:
This brings up the Reflexil window with the IL code. Simple Right Click and select Replace all with code.
:
This will show the Compile
screen:
Simple replace return default(bool);
with return false;
and press Compile
followed by Ok
.
Finally save the modified binary:
And voila that did it!
No security doesn’t look the most secure level (so much for security eh Apple?):
Leave a reply