Contribute
Register

Intel Network adapters on OS X: Small Tree drivers

Hey guys! I got tired of this driver refusing to work and I came up with a third (fourth?) solution to the problem anyone with an 82576 dual port chip is having.

I was expecting it to work, but then I got an error that some other two bytes are invalid... of course, without an offset. Must have been these ones.

I don't have time for a calculator, and I didn't feel like writing this guy a PM about a post from 4 months ago. I can see why he wouldn't want to share the exact algorithm - there are probably way more stupid inconsequential places they could hide a code in the ROM image, and they seem to not like other people's dirty Ethernet cards tainting their scared drive written under divine right. That game of cat and mouse would end badly for us.

So, instead, I just got down and dirty with objdump and figured out how patch the executable.
Replace 0x664139c1488b75b87526 with 0x664139c1488b75b86690 in
/Library/Extensions/SmallTreeIntel82576.kext/Contents/MacOS/SmallTreeIntel82576
This only gets you past the EEPROM check. You could probably do the same for the PCI Subsystem ID check but why bother when FakePCIID and ethtool are already there and are so easy to use?

As to actually doing the patch, I tried Clover and it didn't... do... anything. Probably because it doesn't get probed by the bootloader, but the kernel, and it's obviously patching code in memory because it's done at every boot. Plus, if that DID work and it ever got unloaded, your only option would to be reboot. (Reboots take forever on my system because it has IPMI.) So I realized that xxd and sed are available even on the stock system without developer tools or anything installed.

So open the Terminal and try running:

xxd /Library/Extensions/SmallTreeIntel82576.kext/Contents/MacOS/SmallTreeIntel82576 /tmp/SmallTreeIntel82576.xxd
sed -i -e 's/66 4139 c148 8b75 26/66 4139 c148 8b66 90/' /tmp/SmallTreeIntel82576.xxd
xxd -r /tmp/SmallTreeIntel82576.xxd /tmp/SmallTreeIntel82576
sudo chown root:wheel /tmp/SmallTreeIntel82576
sudo chmod 755 /tmp/SmallTreeIntel82576
sudo mv /tmp/SmallTreeIntel82576 /Contents/MacOS/Library/Extensions/SmallTreeIntel82576.kext

Then try loading the kext again:
sudo kextload /Library/Extensions/SmallTreeIntel82576.kext
Remember that you still have to fake the Subsystem ID with either an EEPROM edit with ethtool under Linux or using FakePCIID.

Awesome, I got my Intel i350 t2v2 working with this binary patch......

Here is my patched kext
 

Attachments

  • SmallTreeIntel82576.kext.zip
    67.3 KB · Views: 188
Thanks a lot!

Where's the best place to install the small tree + FakePCIID?

Inside Clover/EFI? SLE? Library/Extensions?

Thanks
 
Another question please .What subsystem ID should I use for i350? Thanks again
 
So, instead, I just got down and dirty with objdump and figured out how patch the executable.
Replace 0x664139c1488b75b87526 with 0x664139c1488b75b86690 in
/Library/Extensions/SmallTreeIntel82576.kext/Contents/MacOS/SmallTreeIntel82576
This only gets you past the EEPROM check. You could probably do the same for the PCI Subsystem ID check but why bother when FakePCIID and ethtool are already there and are so easy to use?

--snip--

So open the Terminal and try running:

xxd /Library/Extensions/SmallTreeIntel82576.kext/Contents/MacOS/SmallTreeIntel82576 /tmp/SmallTreeIntel82576.xxd
sed -i -e 's/66 4139 c148 8b75 26/66 4139 c148 8b66 90/' /tmp/SmallTreeIntel82576.xxd
xxd -r /tmp/SmallTreeIntel82576.xxd /tmp/SmallTreeIntel82576
sudo chown root:wheel /tmp/SmallTreeIntel82576
sudo chmod 755 /tmp/SmallTreeIntel82576
sudo mv /tmp/SmallTreeIntel82576 /Contents/MacOS/Library/Extensions/SmallTreeIntel82576.kext

Then try loading the kext again:
sudo kextload /Library/Extensions/SmallTreeIntel82576.kext
Remember that you still have to fake the Subsystem ID with either an EEPROM edit with ethtool under Linux or using FakePCIID.

So I tried the suggestions above but it seems the hex value has changed? in the sed command, I made a backup of the original .xxd file and when I ran diff on the edited file and the backup file, diff doesn't show anything.

Any ideas what I could be doing wrong? or perhaps the patched is not applicable to newer versions?

I've included a screenshot of the commands used.

thanks
 

Attachments

  • Screen Shot 2018-05-20 at 11.55.30 pm.png
    Screen Shot 2018-05-20 at 11.55.30 pm.png
    378.8 KB · Views: 286
I just put it in /Volumes/EFI/EFI/CLOVER/kexts/Other.
The patch should have bypassed the subsystem id checking.
So the sole purpose of FakePCIID.kext is to inject your device id.

EDIT: i350's device id is already there, I even don't have FakePCIID.kext installed.

BTW, I also found the binary changed but when inspecting the xxd dump, I can only find one "75b87526". I changed it to "75b86690" and convert it back to binary, that is it, it works, at least for me. :crazy:

EDIT: The line of code in xxd dump should be in the around line 0x000013c0. I attached the command and the output after the patch for your reference.
Screen Shot 2018-05-20 at 11.06.09 PM.png
 
Last edited:
I just put it in /Volumes/EFI/EFI/CLOVER/kexts/Other.
The patch should have bypassed the subsystem id checking.
So the sole purpose of FakePCIID.kext is to inject your device id.

According to the original reply by castrwilliam: "You could probably do the same for the PCI Subsystem ID check but why bother when FakePCIID and ethtool are already there and are so easy to use?"

seems to me he's saying the subsystem ID still needs to be changed. Unless of course you did that yourself in your patched version?

version?, EDIT: i350's device id is already there, I even don't have FakePCIID.kext installed.

did you mean subsystem id or device ID? According to Linux lspci, my i350 ports (built-in to the Intel board) has a vendor/device ID of "8086:1521" and subsystem ID of "8086:357e". Don't I need to change "357e" to "000a"?

Thanks a lot for the help!
 
According to the original reply by castrwilliam: "You could probably do the same for the PCI Subsystem ID check but why bother when FakePCIID and ethtool are already there and are so easy to use?"

seems to me he's saying the subsystem ID still needs to be changed. Unless of course you did that yourself in your patched version?



did you mean subsystem id or device ID? According to Linux lspci, my i350 ports (built-in to the Intel board) has a vendor/device ID of "8086:1521" and subsystem ID of "8086:357e". Don't I need to change "357e" to "000a"?

Thanks a lot for the help!
Actually I tried ethtool and modded my card to "000a", with no success before I patched the kext binary.

And I mean device Id "0x15218086" in the SmallTreeIntel82576.kext, it is the i350, you are right, and you can see it when you inspect the Info.plist inside.

I am not sure whether the subsystem ID needs to be patched with ethtool or not, I already did it.
But I am sure i350's device id is there. You don't have to inject it.

Just try it out, no harm, it will load, or not. And share your findings. ;)
 
Anyone has a patched 82576.kext for Sierra and below? as expected, the binary dump is different from the high sierra one. thanks
 
Last edited:
Hey guys! I got tired of this driver refusing to work and I came up with a third (fourth?) solution to the problem anyone with an 82576 dual port chip is having.


Can you please tell me how it's done for other versions of the driver?

I am looking at objdump of the Sierra (and below) version and there are many instances "__ZN19SmallTreeIntel825765probeEP9IOService" which is what you changed to "nop" in the High Sierra version.

Thanks a lot!
 
Can you please tell me how it's done for other versions of the driver?

I am looking at objdump of the Sierra (and below) version and there are many instances "__ZN19SmallTreeIntel825765probeEP9IOService" which is what you changed to "nop" in the High Sierra version.

Thanks a lot!
I found a way to patch kext binary with Clover

Replace 75B87526 with 75B86690 in SmallTreeIntel82576
Screen Shot 2018-05-23 at 11.32.35 PM.png
 
Back
Top