├── .gitignore ├── License.md ├── README.md ├── SSDT-UIAC-ALL.dsl ├── SSDT-UIAC.dsl ├── SSDT-XOSI.dsl ├── USBInjectAll.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ └── USBInjectAll.xcscheme ├── USBInjectAll ├── USBInjectAll-Info.plist ├── USBInjectAll-Prefix.pch ├── USBInjectAll.cpp └── USBInjectAll.h ├── USBInjectAll_model_template.plist ├── USBInjectAll_model_template_EHCI.plist ├── USBInjectAll_template-Info.plist ├── XHCI-unsupported.kext └── Contents │ └── Info.plist ├── config_patches.plist ├── generate_Info_plist.sh ├── makefile └── strstr.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | Build 2 | DerivedData 3 | Distribute 4 | USBInjectAll.xcodeproj/project.xcworkspace/xcuserdata 5 | USBInjectAll.xcodeproj/xcuserdata 6 | USBInjectAll.xcodeproj/project.xcworkspace 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | ## The GNU General Public License (GPL-2.0) 2 | ## Version 2, June 1991 3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 4 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 5 | 6 | Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. 7 | 8 | ### Preamble 9 | 10 | The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. 11 | 12 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. 13 | 14 | To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. 15 | 16 | For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. 17 | 18 | We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. 19 | 20 | Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. 21 | 22 | Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 23 | The precise terms and conditions for copying, distribution and modification follow. 24 | 25 | ### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 26 | 27 | 0\. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". 28 | 29 | Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 30 | 31 | 1\. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. 32 | 33 | You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 34 | 35 | 2\. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: 36 | 37 | a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 38 | 39 | b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 40 | 41 | c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 42 | 43 | These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. 44 | 45 | Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. 46 | 47 | In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 48 | 49 | 3\. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: 50 | 51 | a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 52 | 53 | b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 54 | 55 | c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 56 | 57 | The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 58 | 59 | If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 60 | 61 | 4\. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 62 | 63 | 5\. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 64 | 65 | 6\. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 66 | 67 | 7\. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. 68 | 69 | If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. 70 | 71 | It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. 72 | 73 | This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 74 | 75 | 8\. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 76 | 77 | 9\. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 78 | 79 | Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 80 | 81 | 10\. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. 82 | 83 | ### NO WARRANTY 84 | 11\. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 85 | 86 | 12\. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 87 | END OF TERMS AND CONDITIONS 88 | 89 | ### How to Apply These Terms to Your New Programs 90 | 91 | If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. 92 | 93 | To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. 94 | 95 | One line to give the program's name and a brief idea of what it does. 96 | 97 | 
Copyright (C) 98 | 99 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 100 | 101 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 102 | 103 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 104 | Also add information on how to contact you by electronic and paper mail. 105 | If the program is interactive, make it output a short notice like this when it starts in an interactive mode: 106 | 107 | Gnomovision version 69, Copyright (C) year name of author 108 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type \`show w'. This is free software, and you are welcome to redistribute it under certain conditions; type \`show c' for details. 109 | 110 | The hypothetical commands \`show w' and \`show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than \`show w' and \`show c'; they could even be mouse-clicks or menu items--whatever suits your program. 111 | 112 | You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: 113 | 114 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. 115 | 116 | signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice 117 | 118 | This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. 119 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## USBInjectAll.kext 2 | 3 | In 10.11+ Apple has changed significantly the way the USB drivers work. In the absense of a port injector, the drivers use ACPI to obtain information about which ports are active. Often, this information is wrong. Instead of correcting the DSDT, a port injector can be used (just as Apple did for their own computers). But in order to create such an injector, you must first determine which ports are actually being used. And to do that you need to inject all ports so you can test all ports on the computer to determine which ones correspond to each available port address. You can't test a port that is disabled... 4 | 5 | That's where this kext comes in. 6 | 7 | This kext attempts to inject all ports for each controller, and for hubs as well. You can use this kext (temporarily) to enable all ports so you can determine which ports really need to be in the final injector. Only the (potential) hub on EH01.PRT1 and EH02.PRT1 are injected. Other hubs would require modifications. So far, I haven't seen internal hubs connected to other ports. The kext automatically determines the ports (and their addresses) based on the specifc USB controller chipsets. 8 | 9 | EH01: 8-USB2 ports PR11-PR18. 10 | 11 | EH02: 6-USB2 ports PR21-PR28. 12 | 13 | EH01 hub: 8-USB2 ports HP11-HP18. 14 | 15 | EH02 hub: 8-USB2 ports HP21-HP28. 16 | 17 | XHC, 7-series chipset (8086:1e31): 4-USB2 ports HS01-HS04, 4-USB3 ports SS01-SS04. 18 | 19 | XHC, 8/9-series chipset (8086:9xxx): 9-USB2 ports HS01-HS09, 6-USB3 ports SS01-SS06. 20 | 21 | XHC, 8/9-series chipset (8086:8xxx): 14-USB2 ports HS01-HS14, 6-USB3 ports SS01-SS06. 22 | 23 | XHC, 8/9-series chipset (8086:9cb1): 11-USB ports HS01-HS11, 4-USB3 ports SS01-SS04. 24 | 25 | XHC, 100-series chipset (8086:a12f): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 26 | 27 | XHC, 100-series chipset (8086:9d2f): 10-USB2 ports HS01-HS10, 6-USB3 ports SS01-SS06, plus USR1/USR2) 28 | 29 | XHC, 200-series/300-series chipset, etc. 30 | 31 | This kext is only for 10.11+. It has no use with prior versions. 32 | 33 | Currently, only Intel controllers are supported. The most commonly used SMBIOS model identifiers are in the kext. 34 | 35 | Without a custom configuration, it is not intended that this kext be used long term. It is best to create a custom injector containing only the ports that are active on the target machine, or to create an SSDT that customizes the port injection done by USBInjectAll.kext. Customizing USBInjectAll.kext with an SSDT is covered later in this README. 36 | 37 | For some chipsets, you may need to bypass the 15-port limit in 10.11. In particular, XHCI controllers with device-id that starts with '8' will need the patch to bypass the limit. The patch was created by arix98 and published on insanelymac.com here: http://www.insanelymac.com/forum/topic/308325-guide-1011-full-speed-usb-series-89-keeping-vanilla-sle/page-9#entry2175618 (post #179 of that thread). 38 | 39 | This kext requires only 20 ports maximum, so the patch would be: 40 | (these patches are for 10.11.x only) 41 | 42 | ``` 43 | Comment: change 15 port limit to 20 in AppleUSBXHCIPCI 44 | Name: AppleUSBXHCIPCI 45 | Find: <83bd8cfe ffff10> 46 | Replace: <83bd8cfe ffff15> 47 | ``` 48 | 49 | If you have a 100-series board, there can be up to 26 ports on XHCI, so you should increase the limit accordingly: 50 | ``` 51 | Comment: change 15 port limit to 26 in AppleUSBXHCIPCI 52 | Name: AppleUSBXHCIPCI 53 | Find: <83bd8cfe ffff10> 54 | Replace: <83bd8cfe ffff1b> 55 | ``` 56 | 57 | You can copy/paste the patch from the file config_patches.plist that is checked into this project, which also has the patches for versions other than 10.11.x. The config_patches.plist also contains the DSDT patches required to rename EHC1->EH01 and EHC2->EH02 which is important to avoid collisions between this kext and any built-in port injectors in the native kexts for your SMBIOS. 58 | 59 | Note: Do not plan to use the patch long-term. It could be problematic. If you have more than 15 ports on XHC, you should use FakePCIID_XHCIMux to route the USB2 component of those USB3 ports to EHCI. It is easy to stay under the limit if up to 8-USB2 ports are routed off XHC. 60 | 61 | This kext may be helpful in installation scenarios as well where broken USB may prevent booting the installer from a USB stick. It should work from EFI/Clover/kexts. 62 | 63 | 64 | ### Injected Property Customization 65 | 66 | Two mechanisms are provided for customizing the injections that this kext performs. Kernel flag 'uia_exclude' can be used to eliminate ports that would normally be injected. uia_exclude takes is a string of characters with multiple port identifiers comma delimited. 67 | 68 | For example, on my Lenovo u430 without FakePCIID_XHCIMux, bluetooth is on XHC at HS06. And the touchscreen is at HS01. I can disable the touchscreen by booting with kernel flag uia_exclude=HS01, or with uia_exclude=HS06 disable bluetooth. To disable both, uia_exclude=HS01,HS06. With FakePCIID_XHCIMux, the touchscreen is on the hub on USB port1 on EH01. To disable this hub port, uia_exclude=HP11. You can easily see which devices are connected to which ports. Each port identifier injected by the kext is unique, so you can easily identify each one. 69 | 70 | In addition a few other flags are available: 71 | 72 | flag -uia_exclude_hs: excludes all HSxx ports 73 | 74 | flag -uia_exclude_ss: excludes all SSxx ports 75 | 76 | flag -uia_exclude_xhc: disables injection on XHC 77 | 78 | flag uia_include: to include certain ports even if would be normally excluded. For example: -uia_exclude_hs uia_include=HS01 (to keep HS01 but exclude other HSxx) 79 | 80 | 81 | But excluding ports doesn't give all the flexibility that might be needed. All of the data in the Info.plist for ConfigurationData can be configured through ACPI. 82 | 83 | For example, if we wanted to enable only SS01 on XHC for 8086_8xxx chipsets: 84 | 85 | ``` 86 | DefinitionBlock ("", "SSDT", 1, "hack", "UIAC", 0) 87 | { 88 | Device(UIAC) 89 | { 90 | Name(_HID, "UIA00000") 91 | 92 | // override XHC configuration to have only one port 93 | Name(RMCF, Package() 94 | { 95 | "8086_8xxx", Package() 96 | { 97 | "port-count", Buffer() { 0xa, 0, 0, 0 }, 98 | "ports", Package() 99 | { 100 | "SS01", Package() 101 | { 102 | "UsbConnector", 3, 103 | "port", Buffer() { 0xa, 0, 0, 0 }, 104 | } 105 | } 106 | } 107 | }) 108 | } 109 | } 110 | ``` 111 | 112 | An example is also provided in SSDT-UIAC.dsl. All of the data injected for each type of device can be changed via this mechnanism. 113 | 114 | The SSDT-UIAC-ALL.dsl contains the same data present in the Info.plist. Using it would result in a net zero change. You can use it as a template to establish your own custom SSDT for the specific USB configuration on your computer. Delete ports you do not need. Or change UsbConnector or portType to match your own USB hardware configuration. All XHC identifiers (vendor_device) are included, so you should probably start by eliminating the configurations that don't apply to your XHC device, leaving only the configuration for your device. You can see your device-id in ioreg under the XHC node (vendor-id and device-id). 115 | 116 | 117 | ### Feedback 118 | 119 | Please use this thread at tmx for futher details and feedback. 120 | 121 | http://www.tonymacx86.com/el-capitan-laptop-support/173616-guide-10-11-usb-changes-solutions.html 122 | 123 | 124 | ### Downloads: 125 | 126 | Downloads are available on Bitbucket: 127 | 128 | https://bitbucket.org/RehabMan/os-x-usb-inject-all/downloads/ 129 | 130 | 131 | The best way to download the config_patches.plist and other repo files is to download the project ZIP: 132 | 133 | https://github.com/RehabMan/OS-X-USB-Inject-All/archive/master.zip 134 | 135 | 136 | ### How to Install 137 | 138 | Install the kext with your favorite kext installer, such as Kext Wizard. 139 | 140 | Or install via Terminal: 141 | ``` 142 | sudo cp -R Release/USBInjectAll.kext /Library/Extensions 143 | sudo touch /System/Library/Extensions && sudo kextcache -u / 144 | ``` 145 | 146 | Note: This kext assumes you already renamed EHC1->EH01 and EHC2->EH02. It also assumes your XHCI controller is named XHC or XHCI (not renamed to XHC1). These names EH01/EH02/XHC are best to avoid conflicts with built-in port injectors for Apple computers. Refer to config_patches.plist in this repo for the patches required (config_patches.plist/ACPI/DSDT/Patches). 147 | 148 | 149 | If you have a 9-series chipset XHC controller, 8086:8cb1, install XHCI-9-series.kext from the project as well. The USB3 drivers will not load without this injector kext. Update: As of 10.11.1, this injector is no longer needed as direct support was added. If you need it, go back in history: https://github.com/RehabMan/OS-X-USB-Inject-All/tree/706fea51222eb73343d347db10cf48500333a7bd 150 | 151 | Certain Intel xHCI controllers are not supported natively and require an injector. For these systems, install XHCI-unsupported.kext. The native support depends by version, you can check in /System/Library/Extensions/IOUSBHostFamily.kext/Contents/Plugins/AppleUSBXHCIPCI.kext/Contents/Info.plist to see if your xHCI is supported natively. 152 | 153 | Because XHCI-unsupported.kext uses a lower IOProbeScore than the native Info.plist, there is no harm in installing it even if native support exists. 154 | 155 | Typical xHCI needing XHCI-unsupported.kext: 156 | 157 | X99-series chipset XHC controller, 8086:8d31 158 | 200-series chipset XHC controller, 8086:a2af (depends on macOS version) 159 | 300-series chipset XHC controller, 8086:a36d or 8086:9ded 160 | 161 | 162 | ### Build Environment 163 | 164 | My build environment is currently Xcode, using SDK 10.11, targeting OS X 10.11. 165 | 166 | Keep in mind the Info.plist is generated by generate_Info_plist.sh. Do not edit the Info.plist directly. USBInectAll_template-Info.plist serves as the starter Info.plist, with each model injected using USBInjectAll_model_template.plist. This allows new models to be added easily by modifying the script. 167 | 168 | 169 | ### Change Log 170 | 171 | 2018-11-08 (0.7.1) 172 | 173 | - add MacBookAir8,1 and Macmini8,1 174 | 175 | - remove EHCI configuration (EH01/EH02/HUB1/HUB2) from models which are unlikely to need it 176 | 177 | - remove matching for AppeBusPowerControllerUSB, which was used in old versions of macOS (note: AppleBusPowerController should still match) 178 | 179 | - change SSPx to SS0x in 8086_8xxx 180 | 181 | - reduce Info.plist size 182 | 183 | - rename all SSPx -> SS0x for consistency 184 | 185 | - remove kernel flag -uia_exclude_ssp 186 | 187 | 188 | 2018-10-26 (0.7.0) 189 | 190 | - ignore empty entries in RMCF data (user error: caused when package size is larger than the data within) 191 | 192 | - add uia_include kernel flag 193 | 194 | 195 | 2018-10-20 (0.6.9) 196 | 197 | - add support for AppleBusPowerController (not just AppleBusPowerControllerUSB) 198 | 199 | - note that the configuration override via "AppleBusPowerControllerUSB" in UIAC is no longer supported; must use "AppleBusPowerController" 200 | 201 | 202 | 2018-10-15 (no new version of USBInjectAll.kext) 203 | 204 | - consolidated XHCI injectors into single XHCI-unsupported.kext 205 | 206 | 207 | 2018-10-08 (0.6.8) 208 | 209 | - add XHCI match 210 | 211 | - fix capitalization of MacBookPro10,2 (courtesy OatmealDome) 212 | 213 | 214 | 2018-08-21 (0.6.7) 215 | 216 | - add 300-series support XHC device 8086:9ded 217 | 218 | 219 | 2018-07-16 (0.6.6) 220 | 221 | - add support for MacBookPro15,1 and MacBookPro15,2 222 | 223 | 224 | 2018-04-20 (0.6.5) 225 | 226 | - add 300-series support XHC device 8086:a36d 227 | 228 | 229 | 2018-01-02 (0.6.4) 230 | 231 | - added iMacPro1,1 232 | 233 | 234 | 2017-12-14 (0.6.3) 235 | 236 | - added iMac19,1 237 | 238 | - added possibility for custom configurations to add "Disable" flag, which will disable USBInjectAll.kext 239 | 240 | 241 | 2017-07-24 (0.6.2) 242 | 243 | - added iMac18,2 iMac18,3 244 | 245 | - changed default portType to zero for hub ports 246 | 247 | 248 | 249 | 2017-06-09 (0.6.1) 250 | 251 | - added add MacBookPro14,x; iMac18,1; MacBook10,1 252 | 253 | 254 | 2017-05-17 (0.6.0) 255 | 256 | - added ability to override 10.12 USB power properties via "AppleBusPowerControllerUSB" ACPI override 257 | 258 | 259 | 2017-01-12 (0.5.17) 260 | 261 | - add 200-series support XHC device 8086:a2af 262 | 263 | 264 | 2016-12-14 (0.5.16) 265 | 266 | - add new MacBook Pro models: MacBookPro13,1, MacBookPro13,2, MacBookPro13,3 267 | 268 | 269 | 2016-12-13 (0.5.15) 270 | 271 | - add more iMac models: iMac4,1, iMac4,2, iMac5,1, iMac6,1, iMac7,1, iMac8,1, iMac9,1, iMac10,1 272 | 273 | 274 | 2016-09-07 (0.5.14) 275 | 276 | - add "model" for internal hub IOKitPersonality (IOKit matching has changed on 10.12) 277 | 278 | 279 | 2016-06-29 (0.5.12) 280 | 281 | - add MacBookPro11,3 MacBooKPro11,4 MacBookPro11,5 282 | 283 | - add MacBook9,1 284 | 285 | 286 | 2016-04-22 (0.5.11) 287 | 288 | - allow "XHC" as match for the XHCI controller. The primary use for this would be in SSDT configuration as there is no XHC config in Info.plist 289 | 290 | 291 | 2016-03-30 (0.5.10) 292 | 293 | - add special configuration for XHCI 8086:9cb1 294 | 295 | 296 | 2016-01-26 (0.5.9) 297 | 298 | - add support for 100-series chipset XHCI 8086:9d2f 299 | 300 | 301 | 2015-11-17 (0.5.8) 302 | 303 | - add kernel flags -uia_exclude_hs, -uia_exclude_ss, -uia_exclude_ssp 304 | 305 | 306 | 2015-11-16 (0.5.5) 307 | 308 | - add kernel flag -uia_ignore_rmcf to allow ACPI RMCF customization to be ignored 309 | 310 | 311 | 2015-11-14 (0.5.4) 312 | 313 | - fix bug with zero length dictionary in ACPI RMCF customization 314 | 315 | 316 | 2015-10-25 (0.5.3) 317 | 318 | - initial 100-series support 319 | 320 | 321 | 2015-10-23 (0.5.2) 322 | 323 | - add more SMBIOS (eg. MacPro*) 324 | 325 | 326 | 2015-10-20 (0.5.0) 327 | 328 | - initial release 329 | 330 | -------------------------------------------------------------------------------- /SSDT-UIAC-ALL.dsl: -------------------------------------------------------------------------------- 1 | // SSDT-UIAC-ALL.dsl 2 | // 3 | // This SSDT can be used as a template to build your own 4 | // customization for USBInjectAll.kext. 5 | // 6 | // This SSDT contains all ports, so using it is the same as without 7 | // a custom SSDT. Delete ports that are not connected or ports you 8 | // do not need. 9 | // 10 | // Change the UsbConnector or portType as needed to match your 11 | // actual USB configuration. 12 | // 13 | // Note: 14 | // portType=0 seems to indicate normal external USB2 port (as seen in MacBookPro8,1) 15 | // portType=2 seems to indicate "internal device" (as seen in MacBookPro8,1) 16 | // portType=4 is used by MacBookPro8,3 (reason/purpose unknown) 17 | // 18 | 19 | DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0) 20 | { 21 | Device(UIAC) 22 | { 23 | Name(_HID, "UIA00000") 24 | 25 | Name(RMCF, Package() 26 | { 27 | "HUB1", Package() 28 | { 29 | "port-count", Buffer() { 8, 0, 0, 0 }, 30 | "ports", Package() 31 | { 32 | "HP11", Package() 33 | { 34 | //"UsbConnector", 0, 35 | "portType", 0, 36 | "port", Buffer() { 1, 0, 0, 0 }, 37 | }, 38 | "HP12", Package() 39 | { 40 | //"UsbConnector", 0, 41 | "portType", 0, 42 | "port", Buffer() { 2, 0, 0, 0 }, 43 | }, 44 | "HP13", Package() 45 | { 46 | //"UsbConnector", 0, 47 | "portType", 0, 48 | "port", Buffer() { 3, 0, 0, 0 }, 49 | }, 50 | "HP14", Package() 51 | { 52 | //"UsbConnector", 0, 53 | "portType", 0, 54 | "port", Buffer() { 4, 0, 0, 0 }, 55 | }, 56 | "HP15", Package() 57 | { 58 | //"UsbConnector", 0, 59 | "portType", 0, 60 | "port", Buffer() { 5, 0, 0, 0 }, 61 | }, 62 | "HP16", Package() 63 | { 64 | //"UsbConnector", 0, 65 | "portType", 0, 66 | "port", Buffer() { 6, 0, 0, 0 }, 67 | }, 68 | "HP17", Package() 69 | { 70 | //"UsbConnector", 0, 71 | "portType", 0, 72 | "port", Buffer() { 7, 0, 0, 0 }, 73 | }, 74 | "HP18", Package() 75 | { 76 | //"UsbConnector", 0, 77 | "portType", 0, 78 | "port", Buffer() { 8, 0, 0, 0 }, 79 | }, 80 | }, 81 | }, 82 | "HUB2", Package() 83 | { 84 | "port-count", Buffer() { 6, 0, 0, 0 }, 85 | "ports", Package() 86 | { 87 | "HP21", Package() 88 | { 89 | //"UsbConnector", 0, 90 | "portType", 0, 91 | "port", Buffer() { 1, 0, 0, 0 }, 92 | }, 93 | "HP22", Package() 94 | { 95 | //"UsbConnector", 0, 96 | "portType", 0, 97 | "port", Buffer() { 2, 0, 0, 0 }, 98 | }, 99 | "HP23", Package() 100 | { 101 | //"UsbConnector", 0, 102 | "portType", 0, 103 | "port", Buffer() { 3, 0, 0, 0 }, 104 | }, 105 | "HP24", Package() 106 | { 107 | //"UsbConnector", 0, 108 | "portType", 0, 109 | "port", Buffer() { 4, 0, 0, 0 }, 110 | }, 111 | "HP25", Package() 112 | { 113 | //"UsbConnector", 0, 114 | "portType", 0, 115 | "port", Buffer() { 5, 0, 0, 0 }, 116 | }, 117 | "HP26", Package() 118 | { 119 | //"UsbConnector", 0, 120 | "portType", 0, 121 | "port", Buffer() { 6, 0, 0, 0 }, 122 | }, 123 | }, 124 | }, 125 | "EH01", Package() 126 | { 127 | "port-count", Buffer() { 8, 0, 0, 0 }, 128 | "ports", Package() 129 | { 130 | "PR11", Package() 131 | { 132 | "UsbConnector", 255, 133 | "port", Buffer() { 1, 0, 0, 0 }, 134 | }, 135 | "PR12", Package() 136 | { 137 | "UsbConnector", 0, 138 | "port", Buffer() { 2, 0, 0, 0 }, 139 | }, 140 | "PR13", Package() 141 | { 142 | "UsbConnector", 0, 143 | "port", Buffer() { 3, 0, 0, 0 }, 144 | }, 145 | "PR14", Package() 146 | { 147 | "UsbConnector", 0, 148 | "port", Buffer() { 4, 0, 0, 0 }, 149 | }, 150 | "PR15", Package() 151 | { 152 | "UsbConnector", 0, 153 | "port", Buffer() { 5, 0, 0, 0 }, 154 | }, 155 | "PR16", Package() 156 | { 157 | "UsbConnector", 0, 158 | "port", Buffer() { 6, 0, 0, 0 }, 159 | }, 160 | "PR17", Package() 161 | { 162 | "UsbConnector", 0, 163 | "port", Buffer() { 7, 0, 0, 0 }, 164 | }, 165 | "PR18", Package() 166 | { 167 | "UsbConnector", 0, 168 | "port", Buffer() { 8, 0, 0, 0 }, 169 | }, 170 | }, 171 | }, 172 | "EH02", Package() 173 | { 174 | "port-count", Buffer() { 6, 0, 0, 0 }, 175 | "ports", Package() 176 | { 177 | "PR21", Package() 178 | { 179 | "UsbConnector", 255, 180 | "port", Buffer() { 1, 0, 0, 0 }, 181 | }, 182 | "PR22", Package() 183 | { 184 | "UsbConnector", 0, 185 | "port", Buffer() { 2, 0, 0, 0 }, 186 | }, 187 | "PR23", Package() 188 | { 189 | "UsbConnector", 0, 190 | "port", Buffer() { 3, 0, 0, 0 }, 191 | }, 192 | "PR24", Package() 193 | { 194 | "UsbConnector", 0, 195 | "port", Buffer() { 4, 0, 0, 0 }, 196 | }, 197 | "PR25", Package() 198 | { 199 | "UsbConnector", 0, 200 | "port", Buffer() { 5, 0, 0, 0 }, 201 | }, 202 | "PR26", Package() 203 | { 204 | "UsbConnector", 0, 205 | "port", Buffer() { 6, 0, 0, 0 }, 206 | }, 207 | }, 208 | }, 209 | "8086_1e31", Package() 210 | { 211 | "port-count", Buffer() { 8, 0, 0, 0 }, 212 | "ports", Package() 213 | { 214 | "HS01", Package() 215 | { 216 | "UsbConnector", 3, 217 | "port", Buffer() { 1, 0, 0, 0 }, 218 | }, 219 | "HS02", Package() 220 | { 221 | "UsbConnector", 3, 222 | "port", Buffer() { 2, 0, 0, 0 }, 223 | }, 224 | "HS03", Package() 225 | { 226 | "UsbConnector", 3, 227 | "port", Buffer() { 3, 0, 0, 0 }, 228 | }, 229 | "HS04", Package() 230 | { 231 | "UsbConnector", 3, 232 | "port", Buffer() { 4, 0, 0, 0 }, 233 | }, 234 | "SS01", Package() 235 | { 236 | "UsbConnector", 3, 237 | "port", Buffer() { 5, 0, 0, 0 }, 238 | }, 239 | "SS02", Package() 240 | { 241 | "UsbConnector", 3, 242 | "port", Buffer() { 6, 0, 0, 0 }, 243 | }, 244 | "SS03", Package() 245 | { 246 | "UsbConnector", 3, 247 | "port", Buffer() { 7, 0, 0, 0 }, 248 | }, 249 | "SS04", Package() 250 | { 251 | "UsbConnector", 3, 252 | "port", Buffer() { 8, 0, 0, 0 }, 253 | }, 254 | }, 255 | }, 256 | "8086_8xxx", Package() 257 | { 258 | "port-count", Buffer() { 21, 0, 0, 0 }, 259 | "ports", Package() 260 | { 261 | "HS01", Package() 262 | { 263 | "UsbConnector", 3, 264 | "port", Buffer() { 1, 0, 0, 0 }, 265 | }, 266 | "HS02", Package() 267 | { 268 | "UsbConnector", 3, 269 | "port", Buffer() { 2, 0, 0, 0 }, 270 | }, 271 | "HS03", Package() 272 | { 273 | "UsbConnector", 3, 274 | "port", Buffer() { 3, 0, 0, 0 }, 275 | }, 276 | "HS04", Package() 277 | { 278 | "UsbConnector", 3, 279 | "port", Buffer() { 4, 0, 0, 0 }, 280 | }, 281 | "HS05", Package() 282 | { 283 | "UsbConnector", 3, 284 | "port", Buffer() { 5, 0, 0, 0 }, 285 | }, 286 | "HS06", Package() 287 | { 288 | "UsbConnector", 3, 289 | "port", Buffer() { 6, 0, 0, 0 }, 290 | }, 291 | "HS07", Package() 292 | { 293 | "UsbConnector", 3, 294 | "port", Buffer() { 7, 0, 0, 0 }, 295 | }, 296 | "HS08", Package() 297 | { 298 | "UsbConnector", 3, 299 | "port", Buffer() { 8, 0, 0, 0 }, 300 | }, 301 | "HS09", Package() 302 | { 303 | "UsbConnector", 3, 304 | "port", Buffer() { 9, 0, 0, 0 }, 305 | }, 306 | "HS10", Package() 307 | { 308 | "UsbConnector", 3, 309 | "port", Buffer() { 10, 0, 0, 0 }, 310 | }, 311 | "HS11", Package() 312 | { 313 | "UsbConnector", 3, 314 | "port", Buffer() { 11, 0, 0, 0 }, 315 | }, 316 | "HS12", Package() 317 | { 318 | "UsbConnector", 3, 319 | "port", Buffer() { 12, 0, 0, 0 }, 320 | }, 321 | "HS13", Package() 322 | { 323 | "UsbConnector", 3, 324 | "port", Buffer() { 13, 0, 0, 0 }, 325 | }, 326 | "HS14", Package() 327 | { 328 | "UsbConnector", 3, 329 | "port", Buffer() { 14, 0, 0, 0 }, 330 | }, 331 | //HS15 is phantom port (port address 15 not used) 332 | "SS01", Package() 333 | { 334 | "UsbConnector", 3, 335 | "port", Buffer() { 16, 0, 0, 0 }, 336 | }, 337 | "SS02", Package() 338 | { 339 | "UsbConnector", 3, 340 | "port", Buffer() { 17, 0, 0, 0 }, 341 | }, 342 | "SS03", Package() 343 | { 344 | "UsbConnector", 3, 345 | "port", Buffer() { 18, 0, 0, 0 }, 346 | }, 347 | "SS04", Package() 348 | { 349 | "UsbConnector", 3, 350 | "port", Buffer() { 19, 0, 0, 0 }, 351 | }, 352 | "SS05", Package() 353 | { 354 | "UsbConnector", 3, 355 | "port", Buffer() { 20, 0, 0, 0 }, 356 | }, 357 | "SS06", Package() 358 | { 359 | "UsbConnector", 3, 360 | "port", Buffer() { 21, 0, 0, 0 }, 361 | }, 362 | }, 363 | }, 364 | "8086_9xxx", Package() 365 | { 366 | "port-count", Buffer() { 13, 0, 0, 0 }, 367 | "ports", Package() 368 | { 369 | "HS01", Package() 370 | { 371 | "UsbConnector", 3, 372 | "port", Buffer() { 1, 0, 0, 0 }, 373 | }, 374 | "HS02", Package() 375 | { 376 | "UsbConnector", 3, 377 | "port", Buffer() { 2, 0, 0, 0 }, 378 | }, 379 | "HS03", Package() 380 | { 381 | "UsbConnector", 3, 382 | "port", Buffer() { 3, 0, 0, 0 }, 383 | }, 384 | "HS04", Package() 385 | { 386 | "UsbConnector", 3, 387 | "port", Buffer() { 4, 0, 0, 0 }, 388 | }, 389 | "HS05", Package() 390 | { 391 | "UsbConnector", 3, 392 | "port", Buffer() { 5, 0, 0, 0 }, 393 | }, 394 | "HS06", Package() 395 | { 396 | "UsbConnector", 3, 397 | "port", Buffer() { 6, 0, 0, 0 }, 398 | }, 399 | "HS07", Package() 400 | { 401 | "UsbConnector", 3, 402 | "port", Buffer() { 7, 0, 0, 0 }, 403 | }, 404 | "HS08", Package() 405 | { 406 | "UsbConnector", 3, 407 | "port", Buffer() { 8, 0, 0, 0 }, 408 | }, 409 | "HS09", Package() 410 | { 411 | "UsbConnector", 3, 412 | "port", Buffer() { 9, 0, 0, 0 }, 413 | }, 414 | "SS01", Package() 415 | { 416 | "UsbConnector", 3, 417 | "port", Buffer() { 10, 0, 0, 0 }, 418 | }, 419 | "SS02", Package() 420 | { 421 | "UsbConnector", 3, 422 | "port", Buffer() { 11, 0, 0, 0 }, 423 | }, 424 | "SS03", Package() 425 | { 426 | "UsbConnector", 3, 427 | "port", Buffer() { 12, 0, 0, 0 }, 428 | }, 429 | "SS04", Package() 430 | { 431 | "UsbConnector", 3, 432 | "port", Buffer() { 13, 0, 0, 0 }, 433 | }, 434 | }, 435 | }, 436 | "8086_9cb1", Package() 437 | { 438 | "port-count", Buffer() { 15, 0, 0, 0 }, 439 | "ports", Package() 440 | { 441 | "HS01", Package() 442 | { 443 | "UsbConnector", 3, 444 | "port", Buffer() { 1, 0, 0, 0 }, 445 | }, 446 | "HS02", Package() 447 | { 448 | "UsbConnector", 3, 449 | "port", Buffer() { 2, 0, 0, 0 }, 450 | }, 451 | "HS03", Package() 452 | { 453 | "UsbConnector", 3, 454 | "port", Buffer() { 3, 0, 0, 0 }, 455 | }, 456 | "HS04", Package() 457 | { 458 | "UsbConnector", 3, 459 | "port", Buffer() { 4, 0, 0, 0 }, 460 | }, 461 | "HS05", Package() 462 | { 463 | "UsbConnector", 3, 464 | "port", Buffer() { 5, 0, 0, 0 }, 465 | }, 466 | "HS06", Package() 467 | { 468 | "UsbConnector", 3, 469 | "port", Buffer() { 6, 0, 0, 0 }, 470 | }, 471 | "HS07", Package() 472 | { 473 | "UsbConnector", 3, 474 | "port", Buffer() { 7, 0, 0, 0 }, 475 | }, 476 | "HS08", Package() 477 | { 478 | "UsbConnector", 3, 479 | "port", Buffer() { 8, 0, 0, 0 }, 480 | }, 481 | "HS09", Package() 482 | { 483 | "UsbConnector", 3, 484 | "port", Buffer() { 9, 0, 0, 0 }, 485 | }, 486 | "HS10", Package() 487 | { 488 | "UsbConnector", 3, 489 | "port", Buffer() { 10, 0, 0, 0 }, 490 | }, 491 | "HS11", Package() 492 | { 493 | "UsbConnector", 3, 494 | "port", Buffer() { 11, 0, 0, 0 }, 495 | }, 496 | "SS01", Package() 497 | { 498 | "UsbConnector", 3, 499 | "port", Buffer() { 12, 0, 0, 0 }, 500 | }, 501 | "SS02", Package() 502 | { 503 | "UsbConnector", 3, 504 | "port", Buffer() { 13, 0, 0, 0 }, 505 | }, 506 | "SS03", Package() 507 | { 508 | "UsbConnector", 3, 509 | "port", Buffer() { 14, 0, 0, 0 }, 510 | }, 511 | "SS04", Package() 512 | { 513 | "UsbConnector", 3, 514 | "port", Buffer() { 15, 0, 0, 0 }, 515 | }, 516 | }, 517 | }, 518 | "8086_a12f", Package() 519 | { 520 | "port-count", Buffer() { 26, 0, 0, 0 }, 521 | "ports", Package() 522 | { 523 | "HS01", Package() 524 | { 525 | "UsbConnector", 3, 526 | "port", Buffer() { 1, 0, 0, 0 }, 527 | }, 528 | "HS02", Package() 529 | { 530 | "UsbConnector", 3, 531 | "port", Buffer() { 2, 0, 0, 0 }, 532 | }, 533 | "HS03", Package() 534 | { 535 | "UsbConnector", 3, 536 | "port", Buffer() { 3, 0, 0, 0 }, 537 | }, 538 | "HS04", Package() 539 | { 540 | "UsbConnector", 3, 541 | "port", Buffer() { 4, 0, 0, 0 }, 542 | }, 543 | "HS05", Package() 544 | { 545 | "UsbConnector", 3, 546 | "port", Buffer() { 5, 0, 0, 0 }, 547 | }, 548 | "HS06", Package() 549 | { 550 | "UsbConnector", 3, 551 | "port", Buffer() { 6, 0, 0, 0 }, 552 | }, 553 | "HS07", Package() 554 | { 555 | "UsbConnector", 3, 556 | "port", Buffer() { 7, 0, 0, 0 }, 557 | }, 558 | "HS08", Package() 559 | { 560 | "UsbConnector", 3, 561 | "port", Buffer() { 8, 0, 0, 0 }, 562 | }, 563 | "HS09", Package() 564 | { 565 | "UsbConnector", 3, 566 | "port", Buffer() { 9, 0, 0, 0 }, 567 | }, 568 | "HS10", Package() 569 | { 570 | "UsbConnector", 3, 571 | "port", Buffer() { 10, 0, 0, 0 }, 572 | }, 573 | "HS11", Package() 574 | { 575 | "UsbConnector", 3, 576 | "port", Buffer() { 11, 0, 0, 0 }, 577 | }, 578 | "HS12", Package() 579 | { 580 | "UsbConnector", 3, 581 | "port", Buffer() { 12, 0, 0, 0 }, 582 | }, 583 | "HS13", Package() 584 | { 585 | "UsbConnector", 3, 586 | "port", Buffer() { 13, 0, 0, 0 }, 587 | }, 588 | "HS14", Package() 589 | { 590 | "UsbConnector", 3, 591 | "port", Buffer() { 14, 0, 0, 0 }, 592 | }, 593 | "SS01", Package() 594 | { 595 | "UsbConnector", 3, 596 | "port", Buffer() { 17, 0, 0, 0 }, 597 | }, 598 | "SS02", Package() 599 | { 600 | "UsbConnector", 3, 601 | "port", Buffer() { 18, 0, 0, 0 }, 602 | }, 603 | "SS03", Package() 604 | { 605 | "UsbConnector", 3, 606 | "port", Buffer() { 19, 0, 0, 0 }, 607 | }, 608 | "SS04", Package() 609 | { 610 | "UsbConnector", 3, 611 | "port", Buffer() { 20, 0, 0, 0 }, 612 | }, 613 | "SS05", Package() 614 | { 615 | "UsbConnector", 3, 616 | "port", Buffer() { 21, 0, 0, 0 }, 617 | }, 618 | "SS06", Package() 619 | { 620 | "UsbConnector", 3, 621 | "port", Buffer() { 22, 0, 0, 0 }, 622 | }, 623 | "SS07", Package() 624 | { 625 | "UsbConnector", 3, 626 | "port", Buffer() { 23, 0, 0, 0 }, 627 | }, 628 | "SS08", Package() 629 | { 630 | "UsbConnector", 3, 631 | "port", Buffer() { 24, 0, 0, 0 }, 632 | }, 633 | "SS09", Package() 634 | { 635 | "UsbConnector", 3, 636 | "port", Buffer() { 25, 0, 0, 0 }, 637 | }, 638 | "SS10", Package() 639 | { 640 | "UsbConnector", 3, 641 | "port", Buffer() { 26, 0, 0, 0 }, 642 | }, 643 | "USR1", Package() 644 | { 645 | "UsbConnector", 3, 646 | "port", Buffer() { 15, 0, 0, 0 }, 647 | }, 648 | "USR2", Package() 649 | { 650 | "UsbConnector", 3, 651 | "port", Buffer() { 16, 0, 0, 0 }, 652 | }, 653 | }, 654 | }, 655 | "8086_9dxx", Package() // examples: 0x9d2f, 0x9ded 656 | { 657 | "port-count", Buffer() { 18, 0, 0, 0 }, 658 | "ports", Package() 659 | { 660 | "HS01", Package() 661 | { 662 | "UsbConnector", 3, 663 | "port", Buffer() { 1, 0, 0, 0 }, 664 | }, 665 | "HS02", Package() 666 | { 667 | "UsbConnector", 3, 668 | "port", Buffer() { 2, 0, 0, 0 }, 669 | }, 670 | "HS03", Package() 671 | { 672 | "UsbConnector", 3, 673 | "port", Buffer() { 3, 0, 0, 0 }, 674 | }, 675 | "HS04", Package() 676 | { 677 | "UsbConnector", 3, 678 | "port", Buffer() { 4, 0, 0, 0 }, 679 | }, 680 | "HS05", Package() 681 | { 682 | "UsbConnector", 3, 683 | "port", Buffer() { 5, 0, 0, 0 }, 684 | }, 685 | "HS06", Package() 686 | { 687 | "UsbConnector", 3, 688 | "port", Buffer() { 6, 0, 0, 0 }, 689 | }, 690 | "HS07", Package() 691 | { 692 | "UsbConnector", 3, 693 | "port", Buffer() { 7, 0, 0, 0 }, 694 | }, 695 | "HS08", Package() 696 | { 697 | "UsbConnector", 3, 698 | "port", Buffer() { 8, 0, 0, 0 }, 699 | }, 700 | "HS09", Package() 701 | { 702 | "UsbConnector", 3, 703 | "port", Buffer() { 9, 0, 0, 0 }, 704 | }, 705 | "HS10", Package() 706 | { 707 | "UsbConnector", 3, 708 | "port", Buffer() { 10, 0, 0, 0 }, 709 | }, 710 | "SS01", Package() 711 | { 712 | "UsbConnector", 3, 713 | "port", Buffer() { 13, 0, 0, 0 }, 714 | }, 715 | "SS02", Package() 716 | { 717 | "UsbConnector", 3, 718 | "port", Buffer() { 14, 0, 0, 0 }, 719 | }, 720 | "SS03", Package() 721 | { 722 | "UsbConnector", 3, 723 | "port", Buffer() { 15, 0, 0, 0 }, 724 | }, 725 | "SS04", Package() 726 | { 727 | "UsbConnector", 3, 728 | "port", Buffer() { 16, 0, 0, 0 }, 729 | }, 730 | "SS05", Package() 731 | { 732 | "UsbConnector", 3, 733 | "port", Buffer() { 17, 0, 0, 0 }, 734 | }, 735 | "SS06", Package() 736 | { 737 | "UsbConnector", 3, 738 | "port", Buffer() { 18, 0, 0, 0 }, 739 | }, 740 | "USR1", Package() 741 | { 742 | "UsbConnector", 3, 743 | "port", Buffer() { 11, 0, 0, 0 }, 744 | }, 745 | "USR2", Package() 746 | { 747 | "UsbConnector", 3, 748 | "port", Buffer() { 12, 0, 0, 0 }, 749 | }, 750 | }, 751 | }, 752 | "8086_a2af", Package() 753 | { 754 | "port-count", Buffer() { 26, 0, 0, 0 }, 755 | "ports", Package() 756 | { 757 | "HS01", Package() 758 | { 759 | "UsbConnector", 3, 760 | "port", Buffer() { 1, 0, 0, 0 }, 761 | }, 762 | "HS02", Package() 763 | { 764 | "UsbConnector", 3, 765 | "port", Buffer() { 2, 0, 0, 0 }, 766 | }, 767 | "HS03", Package() 768 | { 769 | "UsbConnector", 3, 770 | "port", Buffer() { 3, 0, 0, 0 }, 771 | }, 772 | "HS04", Package() 773 | { 774 | "UsbConnector", 3, 775 | "port", Buffer() { 4, 0, 0, 0 }, 776 | }, 777 | "HS05", Package() 778 | { 779 | "UsbConnector", 3, 780 | "port", Buffer() { 5, 0, 0, 0 }, 781 | }, 782 | "HS06", Package() 783 | { 784 | "UsbConnector", 3, 785 | "port", Buffer() { 6, 0, 0, 0 }, 786 | }, 787 | "HS07", Package() 788 | { 789 | "UsbConnector", 3, 790 | "port", Buffer() { 7, 0, 0, 0 }, 791 | }, 792 | "HS08", Package() 793 | { 794 | "UsbConnector", 3, 795 | "port", Buffer() { 8, 0, 0, 0 }, 796 | }, 797 | "HS09", Package() 798 | { 799 | "UsbConnector", 3, 800 | "port", Buffer() { 9, 0, 0, 0 }, 801 | }, 802 | "HS10", Package() 803 | { 804 | "UsbConnector", 3, 805 | "port", Buffer() { 10, 0, 0, 0 }, 806 | }, 807 | "HS11", Package() 808 | { 809 | "UsbConnector", 3, 810 | "port", Buffer() { 11, 0, 0, 0 }, 811 | }, 812 | "HS12", Package() 813 | { 814 | "UsbConnector", 3, 815 | "port", Buffer() { 12, 0, 0, 0 }, 816 | }, 817 | "HS13", Package() 818 | { 819 | "UsbConnector", 3, 820 | "port", Buffer() { 13, 0, 0, 0 }, 821 | }, 822 | "HS14", Package() 823 | { 824 | "UsbConnector", 3, 825 | "port", Buffer() { 14, 0, 0, 0 }, 826 | }, 827 | "SS01", Package() 828 | { 829 | "UsbConnector", 3, 830 | "port", Buffer() { 17, 0, 0, 0 }, 831 | }, 832 | "SS02", Package() 833 | { 834 | "UsbConnector", 3, 835 | "port", Buffer() { 18, 0, 0, 0 }, 836 | }, 837 | "SS03", Package() 838 | { 839 | "UsbConnector", 3, 840 | "port", Buffer() { 19, 0, 0, 0 }, 841 | }, 842 | "SS04", Package() 843 | { 844 | "UsbConnector", 3, 845 | "port", Buffer() { 20, 0, 0, 0 }, 846 | }, 847 | "SS05", Package() 848 | { 849 | "UsbConnector", 3, 850 | "port", Buffer() { 21, 0, 0, 0 }, 851 | }, 852 | "SS06", Package() 853 | { 854 | "UsbConnector", 3, 855 | "port", Buffer() { 22, 0, 0, 0 }, 856 | }, 857 | "SS07", Package() 858 | { 859 | "UsbConnector", 3, 860 | "port", Buffer() { 23, 0, 0, 0 }, 861 | }, 862 | "SS08", Package() 863 | { 864 | "UsbConnector", 3, 865 | "port", Buffer() { 24, 0, 0, 0 }, 866 | }, 867 | "SS09", Package() 868 | { 869 | "UsbConnector", 3, 870 | "port", Buffer() { 25, 0, 0, 0 }, 871 | }, 872 | "SS10", Package() 873 | { 874 | "UsbConnector", 3, 875 | "port", Buffer() { 26, 0, 0, 0 }, 876 | }, 877 | "USR1", Package() 878 | { 879 | "UsbConnector", 3, 880 | "port", Buffer() { 15, 0, 0, 0 }, 881 | }, 882 | "USR2", Package() 883 | { 884 | "UsbConnector", 3, 885 | "port", Buffer() { 16, 0, 0, 0 }, 886 | }, 887 | }, 888 | }, 889 | "8086_a36d", Package() 890 | { 891 | "port-count", Buffer() { 26, 0, 0, 0 }, 892 | "ports", Package() 893 | { 894 | "HS01", Package() 895 | { 896 | "UsbConnector", 3, 897 | "port", Buffer() { 1, 0, 0, 0 }, 898 | }, 899 | "HS02", Package() 900 | { 901 | "UsbConnector", 3, 902 | "port", Buffer() { 2, 0, 0, 0 }, 903 | }, 904 | "HS03", Package() 905 | { 906 | "UsbConnector", 3, 907 | "port", Buffer() { 3, 0, 0, 0 }, 908 | }, 909 | "HS04", Package() 910 | { 911 | "UsbConnector", 3, 912 | "port", Buffer() { 4, 0, 0, 0 }, 913 | }, 914 | "HS05", Package() 915 | { 916 | "UsbConnector", 3, 917 | "port", Buffer() { 5, 0, 0, 0 }, 918 | }, 919 | "HS06", Package() 920 | { 921 | "UsbConnector", 3, 922 | "port", Buffer() { 6, 0, 0, 0 }, 923 | }, 924 | "HS07", Package() 925 | { 926 | "UsbConnector", 3, 927 | "port", Buffer() { 7, 0, 0, 0 }, 928 | }, 929 | "HS08", Package() 930 | { 931 | "UsbConnector", 3, 932 | "port", Buffer() { 8, 0, 0, 0 }, 933 | }, 934 | "HS09", Package() 935 | { 936 | "UsbConnector", 3, 937 | "port", Buffer() { 9, 0, 0, 0 }, 938 | }, 939 | "HS10", Package() 940 | { 941 | "UsbConnector", 3, 942 | "port", Buffer() { 10, 0, 0, 0 }, 943 | }, 944 | "HS11", Package() 945 | { 946 | "UsbConnector", 3, 947 | "port", Buffer() { 11, 0, 0, 0 }, 948 | }, 949 | "HS12", Package() 950 | { 951 | "UsbConnector", 3, 952 | "port", Buffer() { 12, 0, 0, 0 }, 953 | }, 954 | "HS13", Package() 955 | { 956 | "UsbConnector", 3, 957 | "port", Buffer() { 13, 0, 0, 0 }, 958 | }, 959 | "HS14", Package() 960 | { 961 | "UsbConnector", 3, 962 | "port", Buffer() { 14, 0, 0, 0 }, 963 | }, 964 | "SS01", Package() 965 | { 966 | "UsbConnector", 3, 967 | "port", Buffer() { 17, 0, 0, 0 }, 968 | }, 969 | "SS02", Package() 970 | { 971 | "UsbConnector", 3, 972 | "port", Buffer() { 18, 0, 0, 0 }, 973 | }, 974 | "SS03", Package() 975 | { 976 | "UsbConnector", 3, 977 | "port", Buffer() { 19, 0, 0, 0 }, 978 | }, 979 | "SS04", Package() 980 | { 981 | "UsbConnector", 3, 982 | "port", Buffer() { 20, 0, 0, 0 }, 983 | }, 984 | "SS05", Package() 985 | { 986 | "UsbConnector", 3, 987 | "port", Buffer() { 21, 0, 0, 0 }, 988 | }, 989 | "SS06", Package() 990 | { 991 | "UsbConnector", 3, 992 | "port", Buffer() { 22, 0, 0, 0 }, 993 | }, 994 | "SS07", Package() 995 | { 996 | "UsbConnector", 3, 997 | "port", Buffer() { 23, 0, 0, 0 }, 998 | }, 999 | "SS08", Package() 1000 | { 1001 | "UsbConnector", 3, 1002 | "port", Buffer() { 24, 0, 0, 0 }, 1003 | }, 1004 | "SS09", Package() 1005 | { 1006 | "UsbConnector", 3, 1007 | "port", Buffer() { 25, 0, 0, 0 }, 1008 | }, 1009 | "SS10", Package() 1010 | { 1011 | "UsbConnector", 3, 1012 | "port", Buffer() { 26, 0, 0, 0 }, 1013 | }, 1014 | "USR1", Package() 1015 | { 1016 | "UsbConnector", 3, 1017 | "port", Buffer() { 15, 0, 0, 0 }, 1018 | }, 1019 | "USR2", Package() 1020 | { 1021 | "UsbConnector", 3, 1022 | "port", Buffer() { 16, 0, 0, 0 }, 1023 | }, 1024 | }, 1025 | }, 1026 | }) 1027 | } 1028 | } 1029 | //EOF 1030 | -------------------------------------------------------------------------------- /SSDT-UIAC.dsl: -------------------------------------------------------------------------------- 1 | // SSDT-UIAC.dsl 2 | // 3 | // This SSDT demonstrates a custom configuration for USBInjectAll.kext. 4 | // 5 | 6 | DefinitionBlock ("", "SSDT", 2, "hack", "_UIAC", 0) 7 | { 8 | Device(UIAC) 9 | { 10 | Name(_HID, "UIA00000") 11 | 12 | // override EH01 configuration to have only one port 13 | Name(RMCF, Package() 14 | { 15 | "EH01", Package() 16 | { 17 | "port-count", Buffer() { 1, 0, 0, 0 }, 18 | "ports", Package() 19 | { 20 | "PR11", Package() 21 | { 22 | "UsbConnector", 0, 23 | "port", Buffer() { 1, 0, 0, 0 }, 24 | } 25 | } 26 | } 27 | }) 28 | } 29 | } 30 | 31 | //EOF 32 | -------------------------------------------------------------------------------- /SSDT-XOSI.dsl: -------------------------------------------------------------------------------- 1 | // This SSDT can be used instead of an "OS Check Fix" patch to 2 | // simulate a version of Windows for Darwin 3 | // 4 | // The default code below simulates Windows 2009 (Windows 7) 5 | // 6 | // To use this SSDT, you must compile it as AML, place in ACPI/patched, add 7 | // to config.plist/ACPI/SortedOrder, and use the "change _OSI to XOSI" 8 | // patch in config.plist/ACPI/DSDT/Patches (see config_patches.plist) 9 | // 10 | 11 | DefinitionBlock ("", "SSDT", 2, "hack", "_XOSI", 0) 12 | { 13 | // All _OSI calls in DSDT are routed to XOSI... 14 | // XOSI simulates "Windows 2012" (which is Windows 8) 15 | // Note: According to ACPI spec, _OSI("Windows") must also return true 16 | // Also, it should return true for all previous versions of Windows. 17 | Method(XOSI, 1) 18 | { 19 | // simulation targets 20 | // source: (google 'Microsoft Windows _OSI') 21 | // http://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/WinACPI_OSI.docx 22 | Store(Package() 23 | { 24 | "Windows", // generic Windows query 25 | "Windows 2001", // Windows XP 26 | "Windows 2001 SP2", // Windows XP SP2 27 | //"Windows 2001.1", // Windows Server 2003 28 | //"Windows 2001.1 SP1", // Windows Server 2003 SP1 29 | "Windows 2006", // Windows Vista 30 | "Windows 2006 SP1", // Windows Vista SP1 31 | //"Windows 2006.1", // Windows Server 2008 32 | "Windows 2009", // Windows 7/Windows Server 2008 R2 33 | "Windows 2012", // Windows 8/Windows Server 2012 34 | //"Windows 2013", // Windows 8.1/Windows Server 2012 R2 35 | //"Windows 2015", // Windows 10/Windows Server TP 36 | }, Local0) 37 | Return (Ones != Match(Local0, MEQ, Arg0, MTR, 0, 0)) 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /USBInjectAll.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 849921901600F4FC00CCDF3B /* USBInjectAll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8499218E1600F4FC00CCDF3B /* USBInjectAll.cpp */; }; 11 | 849921911600F4FC00CCDF3B /* USBInjectAll.h in Headers */ = {isa = PBXBuildFile; fileRef = 8499218F1600F4FC00CCDF3B /* USBInjectAll.h */; }; 12 | EDF7E2D9218A289A00A059C3 /* strstr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84B173A51BD6BEF200FF8553 /* strstr.cpp */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | 0C4B237E14598AD20080D960 /* USBInjectAll.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = USBInjectAll.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | 0C4B238214598AD20080D960 /* Kernel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kernel.framework; path = System/Library/Frameworks/Kernel.framework; sourceTree = SDKROOT; }; 18 | 0C4B238514598AD20080D960 /* USBInjectAll-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "USBInjectAll-Info.plist"; path = "USBInjectAll/USBInjectAll-Info.plist"; sourceTree = ""; }; 19 | 0C4B238D14598AD20080D960 /* USBInjectAll-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "USBInjectAll-Prefix.pch"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 20 | 842548D51BD613B90021F757 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 21 | 844778DD16E7FD2100B27895 /* makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; lineEnding = 0; path = makefile; sourceTree = SOURCE_ROOT; usesTabs = 1; }; 22 | 8499218E1600F4FC00CCDF3B /* USBInjectAll.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = USBInjectAll.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 23 | 8499218F1600F4FC00CCDF3B /* USBInjectAll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = USBInjectAll.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 24 | 84B173A51BD6BEF200FF8553 /* strstr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strstr.cpp; sourceTree = ""; }; 25 | 84C4CE421BD5EC37003BC8FE /* generate_Info_plist.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = generate_Info_plist.sh; sourceTree = ""; }; 26 | 84C4CE431BD5EC37003BC8FE /* USBInjectAll_model_template.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = USBInjectAll_model_template.plist; sourceTree = ""; }; 27 | 84C4CE441BD5EC37003BC8FE /* USBInjectAll_template-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "USBInjectAll_template-Info.plist"; sourceTree = ""; }; 28 | 84CACFB11BD6D37E00B41FBF /* SSDT-UIAC.dsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "SSDT-UIAC.dsl"; sourceTree = ""; }; 29 | ED0AD3E11BD725DC00B36B4B /* config_patches.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = config_patches.plist; sourceTree = ""; }; 30 | ED36B7881BD74CBA0020DE23 /* SSDT-XOSI.dsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "SSDT-XOSI.dsl"; sourceTree = ""; }; 31 | ED5E980621939BE8006D6218 /* USBInjectAll_model_template_EHCI.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = USBInjectAll_model_template_EHCI.plist; sourceTree = ""; }; 32 | ED8AAA3E1CB5E5B1000C0B38 /* SSDT-UIAC-ALL.dsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "SSDT-UIAC-ALL.dsl"; sourceTree = ""; }; 33 | ED9CDF7A2174B738001EE843 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "XHCI-unsupported.kext/Contents/Info.plist"; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | 0C4B237914598AD20080D960 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | 0C4B237114598AD10080D960 = { 48 | isa = PBXGroup; 49 | children = ( 50 | ED0AD3E11BD725DC00B36B4B /* config_patches.plist */, 51 | 842548D51BD613B90021F757 /* README.md */, 52 | ED36B7881BD74CBA0020DE23 /* SSDT-XOSI.dsl */, 53 | 84CACFB11BD6D37E00B41FBF /* SSDT-UIAC.dsl */, 54 | ED8AAA3E1CB5E5B1000C0B38 /* SSDT-UIAC-ALL.dsl */, 55 | 844778DD16E7FD2100B27895 /* makefile */, 56 | 84B173A51BD6BEF200FF8553 /* strstr.cpp */, 57 | 84C4CE491BD5EF14003BC8FE /* Info.plist Generation */, 58 | 0C4B238314598AD20080D960 /* USBInjectAll */, 59 | ED9CDF792174B704001EE843 /* XHCI-unsupported.kext */, 60 | 0C4B238014598AD20080D960 /* Frameworks */, 61 | 0C4B237F14598AD20080D960 /* Products */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | 0C4B237F14598AD20080D960 /* Products */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 0C4B237E14598AD20080D960 /* USBInjectAll.kext */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 0C4B238014598AD20080D960 /* Frameworks */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 0C4B238114598AD20080D960 /* Other Frameworks */, 77 | ); 78 | name = Frameworks; 79 | sourceTree = ""; 80 | }; 81 | 0C4B238114598AD20080D960 /* Other Frameworks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 0C4B238214598AD20080D960 /* Kernel.framework */, 85 | ); 86 | name = "Other Frameworks"; 87 | sourceTree = ""; 88 | }; 89 | 0C4B238314598AD20080D960 /* USBInjectAll */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 8499218F1600F4FC00CCDF3B /* USBInjectAll.h */, 93 | 8499218E1600F4FC00CCDF3B /* USBInjectAll.cpp */, 94 | 84C4CE481BD5ED0E003BC8FE /* Generated Files */, 95 | 0C4B238414598AD20080D960 /* Supporting Files */, 96 | ); 97 | path = USBInjectAll; 98 | sourceTree = ""; 99 | }; 100 | 0C4B238414598AD20080D960 /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 0C4B238D14598AD20080D960 /* USBInjectAll-Prefix.pch */, 104 | ); 105 | name = "Supporting Files"; 106 | sourceTree = ""; 107 | }; 108 | 84C4CE481BD5ED0E003BC8FE /* Generated Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 0C4B238514598AD20080D960 /* USBInjectAll-Info.plist */, 112 | ); 113 | name = "Generated Files"; 114 | path = ..; 115 | sourceTree = ""; 116 | }; 117 | 84C4CE491BD5EF14003BC8FE /* Info.plist Generation */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 84C4CE421BD5EC37003BC8FE /* generate_Info_plist.sh */, 121 | 84C4CE441BD5EC37003BC8FE /* USBInjectAll_template-Info.plist */, 122 | 84C4CE431BD5EC37003BC8FE /* USBInjectAll_model_template.plist */, 123 | ED5E980621939BE8006D6218 /* USBInjectAll_model_template_EHCI.plist */, 124 | ); 125 | name = "Info.plist Generation"; 126 | sourceTree = ""; 127 | }; 128 | ED9CDF792174B704001EE843 /* XHCI-unsupported.kext */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | ED9CDF7A2174B738001EE843 /* Info.plist */, 132 | ); 133 | name = "XHCI-unsupported.kext"; 134 | sourceTree = ""; 135 | }; 136 | /* End PBXGroup section */ 137 | 138 | /* Begin PBXHeadersBuildPhase section */ 139 | 0C4B237A14598AD20080D960 /* Headers */ = { 140 | isa = PBXHeadersBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | 849921911600F4FC00CCDF3B /* USBInjectAll.h in Headers */, 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | }; 147 | /* End PBXHeadersBuildPhase section */ 148 | 149 | /* Begin PBXLegacyTarget section */ 150 | 84D9F2A91BD60EA9003FC186 /* PreBuild */ = { 151 | isa = PBXLegacyTarget; 152 | buildArgumentsString = "$(ACTION)"; 153 | buildConfigurationList = 84D9F2AC1BD60EA9003FC186 /* Build configuration list for PBXLegacyTarget "PreBuild" */; 154 | buildPhases = ( 155 | ); 156 | buildToolPath = ./generate_Info_plist.sh; 157 | buildWorkingDirectory = ""; 158 | dependencies = ( 159 | ); 160 | name = PreBuild; 161 | passBuildSettingsInEnvironment = 0; 162 | productName = "USBInjectAll PreBuild"; 163 | }; 164 | /* End PBXLegacyTarget section */ 165 | 166 | /* Begin PBXNativeTarget section */ 167 | 0C4B237D14598AD20080D960 /* USBInjectAll */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = 0C4B239014598AD20080D960 /* Build configuration list for PBXNativeTarget "USBInjectAll" */; 170 | buildPhases = ( 171 | 0C4B237814598AD20080D960 /* Sources */, 172 | 0C4B237914598AD20080D960 /* Frameworks */, 173 | 0C4B237A14598AD20080D960 /* Headers */, 174 | 0C4B237B14598AD20080D960 /* Resources */, 175 | 0C4B237C14598AD20080D960 /* Rez */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | ); 181 | name = USBInjectAll; 182 | productName = USBInjectAll; 183 | productReference = 0C4B237E14598AD20080D960 /* USBInjectAll.kext */; 184 | productType = "com.apple.product-type.kernel-extension"; 185 | }; 186 | /* End PBXNativeTarget section */ 187 | 188 | /* Begin PBXProject section */ 189 | 0C4B237314598AD10080D960 /* Project object */ = { 190 | isa = PBXProject; 191 | attributes = { 192 | LastUpgradeCheck = 0460; 193 | TargetAttributes = { 194 | 84D9F2A91BD60EA9003FC186 = { 195 | CreatedOnToolsVersion = 7.0.1; 196 | }; 197 | }; 198 | }; 199 | buildConfigurationList = 0C4B237614598AD10080D960 /* Build configuration list for PBXProject "USBInjectAll" */; 200 | compatibilityVersion = "Xcode 3.2"; 201 | developmentRegion = English; 202 | hasScannedForEncodings = 0; 203 | knownRegions = ( 204 | en, 205 | ); 206 | mainGroup = 0C4B237114598AD10080D960; 207 | productRefGroup = 0C4B237F14598AD20080D960 /* Products */; 208 | projectDirPath = ""; 209 | projectRoot = ""; 210 | targets = ( 211 | 84D9F2A91BD60EA9003FC186 /* PreBuild */, 212 | 0C4B237D14598AD20080D960 /* USBInjectAll */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | 0C4B237B14598AD20080D960 /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | }; 225 | /* End PBXResourcesBuildPhase section */ 226 | 227 | /* Begin PBXRezBuildPhase section */ 228 | 0C4B237C14598AD20080D960 /* Rez */ = { 229 | isa = PBXRezBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | /* End PBXRezBuildPhase section */ 236 | 237 | /* Begin PBXSourcesBuildPhase section */ 238 | 0C4B237814598AD20080D960 /* Sources */ = { 239 | isa = PBXSourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | 849921901600F4FC00CCDF3B /* USBInjectAll.cpp in Sources */, 243 | EDF7E2D9218A289A00A059C3 /* strstr.cpp in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | /* End PBXSourcesBuildPhase section */ 248 | 249 | /* Begin XCBuildConfiguration section */ 250 | 0C4B238E14598AD20080D960 /* Debug */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | ALWAYS_SEARCH_USER_PATHS = NO; 254 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 255 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 256 | DEPLOYMENT_POSTPROCESSING = YES; 257 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 258 | GCC_PREPROCESSOR_DEFINITIONS = ( 259 | "DEBUG=1", 260 | "DEBUG_MSG=1", 261 | "LOGNAME=\\\"${LOGNAME}\\\"", 262 | "$(inherited)", 263 | ); 264 | GCC_SYMBOLS_PRIVATE_EXTERN = YES; 265 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 266 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 268 | GCC_WARN_UNUSED_VARIABLE = YES; 269 | LLVM_LTO = NO; 270 | "LLVM_LTO[arch=x86_64]" = YES; 271 | MACOSX_DEPLOYMENT_TARGET = 10.11; 272 | MODULE_VERSION = 0.7.1; 273 | OTHER_CFLAGS = "-fno-stack-protector"; 274 | "OTHER_LDFLAGS[arch=x86_64]" = "-dead_strip"; 275 | SDKROOT = macosx10.11; 276 | STRIP_STYLE = "non-global"; 277 | SYMROOT = build/Products; 278 | }; 279 | name = Debug; 280 | }; 281 | 0C4B238F14598AD20080D960 /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ALWAYS_SEARCH_USER_PATHS = NO; 285 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 286 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 287 | DEPLOYMENT_POSTPROCESSING = YES; 288 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 289 | GCC_PREPROCESSOR_DEFINITIONS = "LOGNAME=\\\"${LOGNAME}\\\""; 290 | GCC_SYMBOLS_PRIVATE_EXTERN = YES; 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | LLVM_LTO = NO; 296 | "LLVM_LTO[arch=x86_64]" = YES; 297 | MACOSX_DEPLOYMENT_TARGET = 10.11; 298 | MODULE_VERSION = 0.7.1; 299 | OTHER_CFLAGS = "-fno-stack-protector"; 300 | "OTHER_LDFLAGS[arch=x86_64]" = "-dead_strip"; 301 | SDKROOT = macosx10.11; 302 | STRIP_STYLE = "non-global"; 303 | SYMROOT = build/Products; 304 | }; 305 | name = Release; 306 | }; 307 | 0C4B239114598AD20080D960 /* Debug */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | COMBINE_HIDPI_IMAGES = YES; 311 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 312 | GCC_PREFIX_HEADER = "USBInjectAll/USBInjectAll-Prefix.pch"; 313 | INFOPLIST_FILE = "USBInjectAll/USBInjectAll-Info.plist"; 314 | MODULE_NAME = com.rehabman.driver.USBInjectAll; 315 | PRODUCT_NAME = USBInjectAll; 316 | STRIP_INSTALLED_PRODUCT = YES; 317 | }; 318 | name = Debug; 319 | }; 320 | 0C4B239214598AD20080D960 /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | COMBINE_HIDPI_IMAGES = YES; 324 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 325 | GCC_PREFIX_HEADER = "USBInjectAll/USBInjectAll-Prefix.pch"; 326 | INFOPLIST_FILE = "USBInjectAll/USBInjectAll-Info.plist"; 327 | MODULE_NAME = com.rehabman.driver.USBInjectAll; 328 | PRODUCT_NAME = USBInjectAll; 329 | STRIP_INSTALLED_PRODUCT = YES; 330 | }; 331 | name = Release; 332 | }; 333 | 84D9F2AA1BD60EA9003FC186 /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 337 | CLANG_CXX_LIBRARY = "libc++"; 338 | CLANG_ENABLE_MODULES = YES; 339 | CLANG_ENABLE_OBJC_ARC = no; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_CONSTANT_CONVERSION = YES; 342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 343 | CLANG_WARN_EMPTY_BODY = YES; 344 | CLANG_WARN_ENUM_CONVERSION = YES; 345 | CLANG_WARN_INT_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | COPY_PHASE_STRIP = NO; 350 | DEBUGGING_SYMBOLS = YES; 351 | DEBUG_INFORMATION_FORMAT = dwarf; 352 | ENABLE_STRICT_OBJC_MSGSEND = YES; 353 | ENABLE_TESTABILITY = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_DYNAMIC_NO_PIC = NO; 356 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 357 | GCC_NO_COMMON_BLOCKS = YES; 358 | GCC_OPTIMIZATION_LEVEL = 0; 359 | GCC_PREPROCESSOR_DEFINITIONS = ( 360 | "DEBUG=1", 361 | "$(inherited)", 362 | ); 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | MTL_ENABLE_DEBUG_INFO = YES; 368 | ONLY_ACTIVE_ARCH = YES; 369 | OTHER_CFLAGS = ""; 370 | OTHER_LDFLAGS = ""; 371 | PRODUCT_NAME = "$(TARGET_NAME)"; 372 | }; 373 | name = Debug; 374 | }; 375 | 84D9F2AB1BD60EA9003FC186 /* Release */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = no; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_CONSTANT_CONVERSION = YES; 384 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 385 | CLANG_WARN_EMPTY_BODY = YES; 386 | CLANG_WARN_ENUM_CONVERSION = YES; 387 | CLANG_WARN_INT_CONVERSION = YES; 388 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 389 | CLANG_WARN_UNREACHABLE_CODE = YES; 390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 391 | COPY_PHASE_STRIP = NO; 392 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 393 | ENABLE_NS_ASSERTIONS = NO; 394 | ENABLE_STRICT_OBJC_MSGSEND = YES; 395 | GCC_C_LANGUAGE_STANDARD = gnu99; 396 | GCC_NO_COMMON_BLOCKS = YES; 397 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 398 | GCC_WARN_UNDECLARED_SELECTOR = YES; 399 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 400 | GCC_WARN_UNUSED_FUNCTION = YES; 401 | MTL_ENABLE_DEBUG_INFO = NO; 402 | OTHER_CFLAGS = ""; 403 | OTHER_LDFLAGS = ""; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | }; 406 | name = Release; 407 | }; 408 | /* End XCBuildConfiguration section */ 409 | 410 | /* Begin XCConfigurationList section */ 411 | 0C4B237614598AD10080D960 /* Build configuration list for PBXProject "USBInjectAll" */ = { 412 | isa = XCConfigurationList; 413 | buildConfigurations = ( 414 | 0C4B238E14598AD20080D960 /* Debug */, 415 | 0C4B238F14598AD20080D960 /* Release */, 416 | ); 417 | defaultConfigurationIsVisible = 0; 418 | defaultConfigurationName = Release; 419 | }; 420 | 0C4B239014598AD20080D960 /* Build configuration list for PBXNativeTarget "USBInjectAll" */ = { 421 | isa = XCConfigurationList; 422 | buildConfigurations = ( 423 | 0C4B239114598AD20080D960 /* Debug */, 424 | 0C4B239214598AD20080D960 /* Release */, 425 | ); 426 | defaultConfigurationIsVisible = 0; 427 | defaultConfigurationName = Release; 428 | }; 429 | 84D9F2AC1BD60EA9003FC186 /* Build configuration list for PBXLegacyTarget "PreBuild" */ = { 430 | isa = XCConfigurationList; 431 | buildConfigurations = ( 432 | 84D9F2AA1BD60EA9003FC186 /* Debug */, 433 | 84D9F2AB1BD60EA9003FC186 /* Release */, 434 | ); 435 | defaultConfigurationIsVisible = 0; 436 | defaultConfigurationName = Release; 437 | }; 438 | /* End XCConfigurationList section */ 439 | }; 440 | rootObject = 0C4B237314598AD10080D960 /* Project object */; 441 | } 442 | -------------------------------------------------------------------------------- /USBInjectAll.xcodeproj/xcshareddata/xcschemes/USBInjectAll.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 68 | 69 | 75 | 76 | 77 | 78 | 79 | 80 | 86 | 87 | 93 | 94 | 95 | 96 | 98 | 99 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /USBInjectAll/USBInjectAll-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'USBInjectAll' target in the 'USBInjectAll' project 3 | // 4 | 5 | const char* hack_strstr(const char* string, const char* substring); 6 | -------------------------------------------------------------------------------- /USBInjectAll/USBInjectAll.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 RehabMan. All rights reserved. 3 | * 4 | * Released under "The GNU General Public License (GPL-2.0)" 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the 8 | * Free Software Foundation; either version 2 of the License, or (at your 9 | * option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #include "USBInjectAll.h" 26 | 27 | //REVIEW: avoids problem with Xcode 5.1.0 where -dead_strip eliminates these required symbols 28 | #include 29 | void* _org_rehabman_dontstrip_[] = 30 | { 31 | (void*)&OSKextGetCurrentIdentifier, 32 | (void*)&OSKextGetCurrentLoadTag, 33 | (void*)&OSKextGetCurrentVersionString, 34 | }; 35 | 36 | static char g_exclude[256]; 37 | static char g_include[256]; 38 | static bool g_ignore_rmcf; 39 | static bool g_exclude_xhc; 40 | 41 | static char* g_exclude_hs; 42 | static char* g_exclude_ss; 43 | 44 | static char g_exclude_hs_static[] = "HS01,HS02,HS03,HS04,HS05,HS06,HS07,HS08,HS09,HS10,HS11,HS12,HS13,HS14"; 45 | static char g_exclude_ss_static[] = "SS01,SS02,SS03,SS04,SS05,SS06,SS07,SS08,SS09,SS10"; 46 | 47 | OSDefineMetaClassAndStructors(USBInjectAll, IOService) 48 | 49 | static IOPCIDevice* getPCIDevice(IORegistryEntry* registryEntry) 50 | { 51 | IOPCIDevice* pciDevice = NULL; 52 | while (registryEntry) 53 | { 54 | pciDevice = OSDynamicCast(IOPCIDevice, registryEntry); 55 | if (pciDevice) 56 | break; 57 | registryEntry = registryEntry->getParentEntry(gIOServicePlane); 58 | } 59 | #ifdef DEBUG 60 | if (!pciDevice) 61 | AlwaysLog("getPCIDevice unable to find IOPCIDevice\n"); 62 | #endif 63 | return pciDevice; 64 | } 65 | 66 | OSDictionary* USBInjectAll::getConfigurationForController(UInt16 vendor, UInt16 device) 67 | { 68 | USBInjectAll_config* configService = OSDynamicCast(USBInjectAll_config, waitForMatchingService(serviceMatching("USBInjectAll_config"))); 69 | if (!configService) 70 | { 71 | AlwaysLog("USBInjectAll configuration service not available\n"); 72 | return NULL; 73 | } 74 | 75 | OSDictionary* dict = configService->getConfiguration(); 76 | if (!dict) 77 | { 78 | DebugLog("getConfigurationForController finds no Configuration dictionary\n"); 79 | return NULL; 80 | } 81 | 82 | char key[32]; 83 | OSDictionary* result = NULL; 84 | 85 | // try ConfigurationName from our own configuration 86 | if (OSString* configName = OSDynamicCast(OSString, getProperty("kName"))) 87 | { 88 | DebugLog("trying '%s'\n", configName->getCStringNoCopy()); 89 | result = OSDynamicCast(OSDictionary, dict->getObject(configName)); 90 | } 91 | else if (OSString* configName = OSDynamicCast(OSString, getProperty("IONameMatched"))) 92 | { 93 | DebugLog("trying '%s'\n", configName->getCStringNoCopy()); 94 | result = OSDynamicCast(OSDictionary, dict->getObject(configName)); 95 | } 96 | 97 | // try vvvv_dddd 98 | if (!result) 99 | { 100 | snprintf(key, sizeof(key), "%04x_%04x", vendor, device); 101 | DebugLog("trying '%s'\n", key); 102 | result = OSDynamicCast(OSDictionary, dict->getObject(key)); 103 | } 104 | 105 | // try vvvv_ddxx 106 | if (!result) 107 | { 108 | snprintf(key, sizeof(key), "%04x_%02xxx", vendor, (device & 0xFF00) >> 8); 109 | DebugLog("trying '%s'\n", key); 110 | result = OSDynamicCast(OSDictionary, dict->getObject(key)); 111 | } 112 | 113 | // try vvvv_dxxx 114 | if (!result) 115 | { 116 | snprintf(key, sizeof(key), "%04x_%01xxxx", vendor, (device & 0xF000) >> 12); 117 | DebugLog("trying '%s'\n", key); 118 | result = OSDynamicCast(OSDictionary, dict->getObject(key)); 119 | } 120 | 121 | // try 'default' 122 | if (!result) 123 | { 124 | DebugLog("trying '%s'\n", "default"); 125 | result = OSDynamicCast(OSDictionary, dict->getObject("default")); 126 | } 127 | 128 | if (!result) 129 | DebugLog("getConfigurationForController no matching configuration found\n"); 130 | 131 | configService->release(); 132 | 133 | return result; 134 | } 135 | 136 | static inline bool isDelimiter(char test) 137 | { 138 | return ',' == test || ';' == test; 139 | } 140 | 141 | static void filterPorts(OSDictionary* ports, const char* filter, const char* keep) 142 | { 143 | // filter is port names delimited by comma 144 | for (const char* p = filter; *p; ) 145 | { 146 | char key[16]; 147 | int count = sizeof(key)-1; 148 | char* dest = key; 149 | for (; count && *p && !isDelimiter(*p); --count) 150 | *dest++ = *p++; 151 | *dest = 0; 152 | if (!hack_strstr(keep, key)) 153 | { 154 | DebugLog("removing port '%s'\n", key); 155 | ports->removeObject(key); 156 | } 157 | if (isDelimiter(*p)) ++p; 158 | } 159 | } 160 | 161 | OSDictionary* USBInjectAll::getConfiguration(UInt16 vendor, UInt16 device) 162 | { 163 | // get configuration and make a copy 164 | OSDictionary* inject = getConfigurationForController(vendor, device); 165 | if (!inject) 166 | return NULL; 167 | OSDictionary* injectCopy = OSDynamicCast(OSDictionary, inject->copyCollection()); 168 | if (!injectCopy) 169 | { 170 | DebugLog("copyCollection failed for injection properties\n"); 171 | return NULL; 172 | } 173 | 174 | // filter based on uia_exclude, -uia_exclude_hs, -uia_exclude_ss 175 | if (OSDictionary* ports = OSDynamicCast(OSDictionary, injectCopy->getObject("ports"))) 176 | { 177 | filterPorts(ports, g_exclude, g_include); 178 | if (g_exclude_hs) 179 | filterPorts(ports, g_exclude_hs, g_include); 180 | if (g_exclude_ss) 181 | filterPorts(ports, g_exclude_ss, g_include); 182 | } 183 | 184 | return injectCopy; 185 | } 186 | 187 | void USBInjectAll::injectProperties(IOService* provider, OSDictionary* inject, bool force) 188 | { 189 | OSBoolean* disable = OSDynamicCast(OSBoolean, inject->getObject("Disabled")); 190 | if (disable && disable->isTrue()) 191 | { 192 | provider->setProperty("RM,USBInjectAll_Disabled", true); 193 | return; 194 | } 195 | provider->setProperty("RM,USBInjectAll", true); 196 | if (OSCollectionIterator* iter = OSCollectionIterator::withCollection(inject)) 197 | { 198 | // Note: OSDictionary always contains OSSymbol* 199 | while (const OSSymbol* key = static_cast(iter->getNextObject())) 200 | { 201 | // only overwrite existing properties when force is true 202 | if (force || !provider->getProperty(key)) 203 | { 204 | if (OSObject* value = inject->getObject(key)) 205 | provider->setProperty(key, value); 206 | } 207 | } 208 | iter->release(); 209 | } 210 | } 211 | 212 | IOService* USBInjectAll::probe(IOService* provider, SInt32* score) 213 | { 214 | DebugLog("USBInjectAll::probe: Probing\n"); 215 | 216 | if (!super::probe(provider, score)) 217 | return NULL; 218 | 219 | // don't inject on XHC when -uia_exclude_xhc is specified 220 | if (g_exclude_xhc) 221 | { 222 | OSString* matched = OSDynamicCast(OSString, getProperty("IONameMatched")); 223 | if (matched && 0 == strncmp(matched->getCStringNoCopy(), "XHC", 3)) 224 | return NULL; 225 | OSBoolean* isXHC = OSDynamicCast(OSBoolean, getProperty("kIsXHC")); 226 | if (isXHC && isXHC->isTrue()) 227 | return NULL; 228 | } 229 | 230 | // determine vendor/device-id of the controller 231 | UInt32 dvID = 0; 232 | if (IOPCIDevice* pciDevice = getPCIDevice(provider)) 233 | { 234 | // determine vendor/device-id of the controller 235 | dvID = pciDevice->extendedConfigRead32(kIOPCIConfigVendorID); 236 | } 237 | UInt16 vendor = dvID; 238 | UInt16 device = dvID >> 16; 239 | 240 | // get configuration and make a copy 241 | OSDictionary* inject = getConfiguration(vendor, device); 242 | if (!inject) 243 | return NULL; 244 | 245 | #ifdef DEBUG 246 | provider->setProperty("RM,Configuration.Merged", inject); 247 | if (auto ioNameMatched = getProperty("IONameMatched")) 248 | provider->setProperty("RM,IONameMatched", ioNameMatched); 249 | #endif 250 | // inject the configuration on the provider 251 | injectProperties(provider, inject, true); 252 | 253 | // cleanup and exit 254 | inject->release(); 255 | return NULL; // short lived kext 256 | } 257 | 258 | 259 | OSDefineMetaClassAndStructors(USBInjectAll_config, IOService) 260 | 261 | bool USBInjectAll_config::start(IOService* provider) 262 | { 263 | if (!super::start(provider)) 264 | return false; 265 | 266 | DebugLog("USBInjectAll_config starting...\n"); 267 | 268 | // place version/build info in ioreg properties RM,Build and RM,Version 269 | char buf[128]; 270 | snprintf(buf, sizeof(buf), "%s %s", OSKextGetCurrentIdentifier(), OSKextGetCurrentVersionString()); 271 | setProperty("RM,Version", buf); 272 | #ifdef DEBUG 273 | setProperty("RM,Build", "Debug-" LOGNAME); 274 | #else 275 | setProperty("RM,Build", "Release-" LOGNAME); 276 | #endif 277 | 278 | if (PE_parse_boot_argn("uia_exclude", g_exclude, sizeof g_exclude)) 279 | AlwaysLog("uia_exclude specifies '%s'\n", g_exclude); 280 | 281 | if (PE_parse_boot_argn("uia_include", g_include, sizeof g_include)) 282 | AlwaysLog("uia_include specifies '%s'\n", g_include); 283 | 284 | uint32_t flag; 285 | 286 | if (PE_parse_boot_argn("-uia_exclude_hs", &flag, sizeof flag)) 287 | { 288 | g_exclude_hs = g_exclude_hs_static; 289 | AlwaysLog("-uia_exclude_hs specfies '%s'\n", g_exclude_hs); 290 | } 291 | 292 | if (PE_parse_boot_argn("-uia_exclude_ss", &flag, sizeof flag)) 293 | { 294 | g_exclude_ss = g_exclude_ss_static; 295 | AlwaysLog("-uia_exclude_ss specifies '%s'\n", g_exclude_ss); 296 | } 297 | 298 | if (PE_parse_boot_argn("-uia_ignore_rmcf", &flag, sizeof flag)) 299 | { 300 | g_ignore_rmcf = true; 301 | AlwaysLog("-uia_ignore_rmcf specified, will ignore ACPI RMCF customizations\n"); 302 | } 303 | 304 | if (PE_parse_boot_argn("-uia_exclude_xhc", &flag, sizeof flag)) 305 | { 306 | g_exclude_xhc = true; 307 | AlwaysLog("-uia_exclude_xhc specified, will not inject on XHC\n"); 308 | } 309 | 310 | registerService(); 311 | 312 | return true; 313 | } 314 | 315 | OSDictionary* USBInjectAll_config::getConfiguration() 316 | { 317 | if (m_pConfiguration) 318 | return m_pConfiguration; 319 | 320 | OSDictionary* dict = OSDynamicCast(OSDictionary, getProperty("Configuration")); 321 | if (!dict) 322 | { 323 | DebugLog("no Configuration property found in USBInjectAll_config::start\n"); 324 | return false; 325 | } 326 | 327 | OSDictionary* configCopy = OSDynamicCast(OSDictionary, dict->copyCollection()); 328 | if (!configCopy) 329 | { 330 | DebugLog("could not make copy of configuration data\n"); 331 | return false; 332 | } 333 | 334 | // allow overrides from ACPI at \UIAC.RMCF 335 | IOACPIPlatformDevice* acpi; 336 | if (!g_ignore_rmcf && 337 | (acpi = OSDynamicCast(IOACPIPlatformDevice, IORegistryEntry::fromPath("IOService:/AppleACPIPlatformExpert/UIAC")))) 338 | { 339 | DebugLog("found override\n"); 340 | if (OSObject* obj = getConfigurationOverride(acpi, "RMCF")) 341 | { 342 | DebugLog("RMCF returned something\n"); 343 | if (OSDictionary* over = OSDynamicCast(OSDictionary, obj)) 344 | { 345 | #ifdef DEBUG 346 | setProperty("Configuration.Override", over); 347 | #endif 348 | configCopy->merge(over); 349 | setProperty("Configuration", configCopy); 350 | } 351 | obj->release(); 352 | } 353 | } 354 | 355 | m_pConfiguration = OSDynamicCast(OSDictionary, getProperty("Configuration")); 356 | return m_pConfiguration; 357 | } 358 | 359 | OSObject* USBInjectAll_config::translateEntry(OSObject* obj) 360 | { 361 | // Note: non-NULL result is retained... 362 | 363 | // if object is another array, translate it 364 | if (OSArray* array = OSDynamicCast(OSArray, obj)) 365 | return translateArray(array); 366 | 367 | // if object is a string, may be translated to boolean 368 | if (OSString* string = OSDynamicCast(OSString, obj)) 369 | { 370 | // object is string, translate special boolean values 371 | const char* sz = string->getCStringNoCopy(); 372 | if (sz[0] == '>') 373 | { 374 | // boolean types true/false 375 | if (sz[1] == 'y' && !sz[2]) 376 | return OSBoolean::withBoolean(true); 377 | else if (sz[1] == 'n' && !sz[2]) 378 | return OSBoolean::withBoolean(false); 379 | // escape case ('>>n' '>>y'), replace with just string '>n' '>y' 380 | else if (sz[1] == '>' && (sz[2] == 'y' || sz[2] == 'n') && !sz[3]) 381 | return OSString::withCString(&sz[1]); 382 | } 383 | } 384 | return NULL; // no translation 385 | } 386 | 387 | OSObject* USBInjectAll_config::translateArray(OSArray* array) 388 | { 389 | // may return either OSArray* or OSDictionary* 390 | 391 | int count = array->getCount(); 392 | if (!count) 393 | return NULL; 394 | 395 | OSObject* result = array; 396 | 397 | // if first entry is an empty array, process as array, else dictionary 398 | OSArray* test = OSDynamicCast(OSArray, array->getObject(0)); 399 | if (test && test->getCount() == 0) 400 | { 401 | // using same array, but translating it... 402 | array->retain(); 403 | 404 | // remove bogus first entry 405 | array->removeObject(0); 406 | --count; 407 | 408 | // translate entries in the array 409 | for (int i = 0; i < count; ++i) 410 | { 411 | if (OSObject* obj = translateEntry(array->getObject(i))) 412 | { 413 | array->replaceObject(i, obj); 414 | obj->release(); 415 | } 416 | } 417 | } 418 | else 419 | { 420 | // array is key/value pairs, so must be even 421 | if (count & 1) 422 | return NULL; 423 | 424 | // dictionary constructed to accomodate all pairs 425 | int size = count >> 1; 426 | if (!size) size = 1; 427 | OSDictionary* dict = OSDictionary::withCapacity(size); 428 | if (!dict) 429 | return NULL; 430 | 431 | // go through each entry two at a time, building the dictionary 432 | for (int i = 0; i < count; i += 2) 433 | { 434 | OSString* key = OSDynamicCast(OSString, array->getObject(i)); 435 | // ignore empty entries which can occur at the end of an oversized package 436 | if (!key) 437 | continue; 438 | // get value, use translated value if translated 439 | OSObject* obj = array->getObject(i+1); 440 | OSObject* trans = translateEntry(obj); 441 | if (trans) 442 | obj = trans; 443 | dict->setObject(key, obj); 444 | OSSafeRelease(trans); 445 | } 446 | result = dict; 447 | } 448 | 449 | // Note: result is retained when returned... 450 | return result; 451 | } 452 | 453 | OSDictionary* USBInjectAll_config::getConfigurationOverride(IOACPIPlatformDevice* device, const char* method) 454 | { 455 | // attempt to get configuration data from provider 456 | OSObject* r = NULL; 457 | if (kIOReturnSuccess != device->evaluateObject(method, &r)) 458 | return NULL; 459 | 460 | // for translation method must return array 461 | OSObject* obj = NULL; 462 | OSArray* array = OSDynamicCast(OSArray, r); 463 | if (array) 464 | obj = translateArray(array); 465 | OSSafeRelease(r); 466 | 467 | // must be dictionary after translation, even though array is possible 468 | OSDictionary* result = OSDynamicCast(OSDictionary, obj); 469 | if (!result) 470 | { 471 | OSSafeRelease(obj); 472 | return NULL; 473 | } 474 | return result; 475 | } 476 | 477 | -------------------------------------------------------------------------------- /USBInjectAll/USBInjectAll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 RehabMan. All rights reserved. 3 | * 4 | * Released under "The GNU General Public License (GPL-2.0)" 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the 8 | * Free Software Foundation; either version 2 of the License, or (at your 9 | * option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | */ 21 | 22 | #ifndef __USBInjectAll__ 23 | #define __USBInjectAll__ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #ifndef EXPORT 31 | #define EXPORT __attribute__((visibility("default"))) 32 | #endif 33 | 34 | #define AlwaysLog(args...) do { IOLog("USBInjectAll: " args); } while(0) 35 | #ifdef DEBUG 36 | #define DebugLog(args...) AlwaysLog(args) 37 | #else 38 | #define DebugLog(args...) do { } while(0) 39 | #endif 40 | 41 | class EXPORT USBInjectAll : public IOService 42 | { 43 | typedef IOService super; 44 | OSDeclareDefaultStructors(USBInjectAll) 45 | 46 | public: 47 | virtual IOService* probe(IOService* provider, SInt32* score); 48 | 49 | protected: 50 | OSDictionary* getConfigurationForController(UInt16 vendor, UInt16 device); 51 | OSDictionary* getConfiguration(UInt16 vendor, UInt16 device); 52 | void injectProperties(IOService* provider, OSDictionary* inject, bool force); 53 | }; 54 | 55 | class EXPORT USBInjectAll_config : public IOService 56 | { 57 | typedef IOService super; 58 | OSDeclareDefaultStructors(USBInjectAll_config) 59 | 60 | public: 61 | virtual bool start(IOService* provider); 62 | virtual OSDictionary* getConfiguration(); 63 | 64 | private: 65 | OSDictionary* m_pConfiguration = 0; 66 | 67 | protected: 68 | OSDictionary* getConfigurationOverride(IOACPIPlatformDevice* device, const char* method); 69 | OSObject* translateArray(OSArray* array); 70 | OSObject* translateEntry(OSObject* obj); 71 | }; 72 | 73 | #endif // __USBInjectAll__ 74 | -------------------------------------------------------------------------------- /USBInjectAll_model_template.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | model_placeholder-ABPC 6 | 7 | CFBundleIdentifier 8 | ${MODULE_NAME} 9 | IOClass 10 | USBInjectAll 11 | IOProviderClass 12 | AppleBusPowerController 13 | model 14 | model_placeholder 15 | kName 16 | AppleBusPowerController 17 | 18 | model_placeholder-XHC 19 | 20 | CFBundleIdentifier 21 | ${MODULE_NAME} 22 | IOClass 23 | USBInjectAll 24 | IONameMatch 25 | 26 | XHC 27 | XHCI 28 | 29 | IOProviderClass 30 | AppleUSBXHCIPCI 31 | model 32 | model_placeholder 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /USBInjectAll_model_template_EHCI.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | model_placeholder-EHCI 6 | 7 | CFBundleIdentifier 8 | ${MODULE_NAME} 9 | IOClass 10 | USBInjectAll 11 | IONameMatch 12 | 13 | EH01 14 | EH02 15 | 16 | IOProviderClass 17 | AppleUSBEHCIPCI 18 | model 19 | model_placeholder 20 | 21 | model_placeholder-HUB1 22 | 23 | CFBundleIdentifier 24 | ${MODULE_NAME} 25 | IOClass 26 | USBInjectAll 27 | IOProviderClass 28 | AppleUSB20InternalHub 29 | locationID 30 | 487587840 31 | IOProbeScore 32 | 5000 33 | model 34 | model_placeholder 35 | kName 36 | HUB1 37 | 38 | model_placeholder-HUB2 39 | 40 | CFBundleIdentifier 41 | ${MODULE_NAME} 42 | IOClass 43 | USBInjectAll 44 | IOProviderClass 45 | AppleUSB20InternalHub 46 | locationID 47 | 437256192 48 | IOProbeScore 49 | 5000 50 | model 51 | model_placeholder 52 | kName 53 | HUB2 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /USBInjectAll_template-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Source Code 6 | https://github.com/RehabMan/OS-X-USB-Inject-All 7 | CFBundleGetInfoString 8 | $(MODULE_VERSION) Copyright © 2015 RehabMan. All rights reserved. 9 | CFBundleDevelopmentRegion 10 | English 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleIdentifier 14 | ${MODULE_NAME} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | KEXT 21 | CFBundleShortVersionString 22 | $(MODULE_VERSION) 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | $(MODULE_VERSION) 27 | IOKitPersonalities 28 | 29 | ConfigurationData 30 | 31 | CFBundleIdentifier 32 | ${MODULE_NAME} 33 | IOClass 34 | USBInjectAll_config 35 | IOMatchCategory 36 | USBInjectAll_config 37 | IOProviderClass 38 | IOResources 39 | Configuration 40 | 41 | HUB1 42 | 43 | port-count 44 | CAAAAA== 45 | ports 46 | 47 | HP11 48 | 49 | port 50 | AQAAAA== 51 | portType 52 | 0 53 | 54 | HP12 55 | 56 | port 57 | AgAAAA== 58 | portType 59 | 0 60 | 61 | HP13 62 | 63 | port 64 | AwAAAA== 65 | portType 66 | 0 67 | 68 | HP14 69 | 70 | port 71 | BAAAAA== 72 | portType 73 | 0 74 | 75 | HP15 76 | 77 | port 78 | BQAAAA== 79 | portType 80 | 0 81 | 82 | HP16 83 | 84 | port 85 | BgAAAA== 86 | portType 87 | 0 88 | 89 | HP17 90 | 91 | port 92 | BwAAAA== 93 | portType 94 | 0 95 | 96 | HP18 97 | 98 | port 99 | CAAAAA== 100 | portType 101 | 0 102 | 103 | 104 | 105 | HUB2 106 | 107 | port-count 108 | CAAAAA== 109 | ports 110 | 111 | HP21 112 | 113 | port 114 | AQAAAA== 115 | portType 116 | 0 117 | 118 | HP22 119 | 120 | port 121 | AgAAAA== 122 | portType 123 | 0 124 | 125 | HP23 126 | 127 | port 128 | AwAAAA== 129 | portType 130 | 0 131 | 132 | HP24 133 | 134 | port 135 | BAAAAA== 136 | portType 137 | 0 138 | 139 | HP25 140 | 141 | port 142 | BQAAAA== 143 | portType 144 | 0 145 | 146 | HP26 147 | 148 | port 149 | BgAAAA== 150 | portType 151 | 0 152 | 153 | HP27 154 | 155 | port 156 | BwAAAA== 157 | portType 158 | 0 159 | 160 | HP28 161 | 162 | port 163 | CAAAAA== 164 | portType 165 | 0 166 | 167 | 168 | 169 | EH01 170 | 171 | port-count 172 | CAAAAA== 173 | ports 174 | 175 | PR11 176 | 177 | UsbConnector 178 | 255 179 | port 180 | AQAAAA== 181 | 182 | PR12 183 | 184 | UsbConnector 185 | 0 186 | port 187 | AgAAAA== 188 | 189 | PR13 190 | 191 | UsbConnector 192 | 0 193 | port 194 | AwAAAA== 195 | 196 | PR14 197 | 198 | UsbConnector 199 | 0 200 | port 201 | BAAAAA== 202 | 203 | PR15 204 | 205 | UsbConnector 206 | 0 207 | port 208 | BQAAAA== 209 | 210 | PR16 211 | 212 | UsbConnector 213 | 0 214 | port 215 | BgAAAA== 216 | 217 | PR17 218 | 219 | UsbConnector 220 | 0 221 | port 222 | BwAAAA== 223 | 224 | PR18 225 | 226 | UsbConnector 227 | 0 228 | port 229 | CAAAAA== 230 | 231 | 232 | 233 | EH02 234 | 235 | port-count 236 | BgAAAA== 237 | ports 238 | 239 | PR21 240 | 241 | UsbConnector 242 | 255 243 | port 244 | AQAAAA== 245 | 246 | PR22 247 | 248 | UsbConnector 249 | 0 250 | port 251 | AgAAAA== 252 | 253 | PR23 254 | 255 | UsbConnector 256 | 0 257 | port 258 | AwAAAA== 259 | 260 | PR24 261 | 262 | UsbConnector 263 | 0 264 | port 265 | BAAAAA== 266 | 267 | PR25 268 | 269 | UsbConnector 270 | 0 271 | port 272 | BQAAAA== 273 | 274 | PR26 275 | 276 | UsbConnector 277 | 0 278 | port 279 | BgAAAA== 280 | 281 | 282 | 283 | 8086_1e31 284 | 285 | port-count 286 | CAAAAA== 287 | ports 288 | 289 | HS01 290 | 291 | UsbConnector 292 | 3 293 | port 294 | AQAAAA== 295 | 296 | HS02 297 | 298 | UsbConnector 299 | 3 300 | port 301 | AgAAAA== 302 | 303 | HS03 304 | 305 | UsbConnector 306 | 3 307 | port 308 | AwAAAA== 309 | 310 | HS04 311 | 312 | UsbConnector 313 | 3 314 | port 315 | BAAAAA== 316 | 317 | SS01 318 | 319 | UsbConnector 320 | 3 321 | port 322 | BQAAAA== 323 | 324 | SS02 325 | 326 | UsbConnector 327 | 3 328 | port 329 | BgAAAA== 330 | 331 | SS03 332 | 333 | UsbConnector 334 | 3 335 | port 336 | BwAAAA== 337 | 338 | SS04 339 | 340 | UsbConnector 341 | 3 342 | port 343 | CAAAAA== 344 | 345 | 346 | 347 | 8086_8xxx 348 | 349 | port-count 350 | FQAAAA== 351 | ports 352 | 353 | HS01 354 | 355 | UsbConnector 356 | 3 357 | port 358 | AQAAAA== 359 | 360 | HS02 361 | 362 | UsbConnector 363 | 3 364 | port 365 | AgAAAA== 366 | 367 | HS03 368 | 369 | UsbConnector 370 | 3 371 | port 372 | AwAAAA== 373 | 374 | HS04 375 | 376 | UsbConnector 377 | 3 378 | port 379 | BAAAAA== 380 | 381 | HS05 382 | 383 | UsbConnector 384 | 3 385 | port 386 | BQAAAA== 387 | 388 | HS06 389 | 390 | UsbConnector 391 | 3 392 | port 393 | BgAAAA== 394 | 395 | HS07 396 | 397 | UsbConnector 398 | 3 399 | port 400 | BwAAAA== 401 | 402 | HS08 403 | 404 | UsbConnector 405 | 3 406 | port 407 | CAAAAA== 408 | 409 | HS09 410 | 411 | UsbConnector 412 | 3 413 | port 414 | CQAAAA== 415 | 416 | HS10 417 | 418 | UsbConnector 419 | 3 420 | port 421 | CgAAAA== 422 | 423 | HS11 424 | 425 | UsbConnector 426 | 3 427 | port 428 | CwAAAA== 429 | 430 | HS12 431 | 432 | UsbConnector 433 | 3 434 | port 435 | DAAAAA== 436 | 437 | HS13 438 | 439 | UsbConnector 440 | 3 441 | port 442 | DQAAAA== 443 | 444 | HS14 445 | 446 | UsbConnector 447 | 3 448 | port 449 | DgAAAA== 450 | 451 | SS01 452 | 453 | UsbConnector 454 | 3 455 | port 456 | EAAAAA== 457 | 458 | SS02 459 | 460 | UsbConnector 461 | 3 462 | port 463 | EQAAAA== 464 | 465 | SS03 466 | 467 | UsbConnector 468 | 3 469 | port 470 | EgAAAA== 471 | 472 | SS04 473 | 474 | UsbConnector 475 | 3 476 | port 477 | EwAAAA== 478 | 479 | SS05 480 | 481 | UsbConnector 482 | 3 483 | port 484 | FAAAAA== 485 | 486 | SS06 487 | 488 | UsbConnector 489 | 3 490 | port 491 | FQAAAA== 492 | 493 | 494 | 495 | 8086_9xxx 496 | 497 | port-count 498 | DQAAAA== 499 | ports 500 | 501 | HS01 502 | 503 | UsbConnector 504 | 3 505 | port 506 | AQAAAA== 507 | 508 | HS02 509 | 510 | UsbConnector 511 | 3 512 | port 513 | AgAAAA== 514 | 515 | HS03 516 | 517 | UsbConnector 518 | 3 519 | port 520 | AwAAAA== 521 | 522 | HS04 523 | 524 | UsbConnector 525 | 3 526 | port 527 | BAAAAA== 528 | 529 | HS05 530 | 531 | UsbConnector 532 | 3 533 | port 534 | BQAAAA== 535 | 536 | HS06 537 | 538 | UsbConnector 539 | 3 540 | port 541 | BgAAAA== 542 | 543 | HS07 544 | 545 | UsbConnector 546 | 3 547 | port 548 | BwAAAA== 549 | 550 | HS08 551 | 552 | UsbConnector 553 | 3 554 | port 555 | CAAAAA== 556 | 557 | HS09 558 | 559 | UsbConnector 560 | 3 561 | port 562 | CQAAAA== 563 | 564 | SS01 565 | 566 | UsbConnector 567 | 3 568 | port 569 | CgAAAA== 570 | 571 | SS02 572 | 573 | UsbConnector 574 | 3 575 | port 576 | CwAAAA== 577 | 578 | SS03 579 | 580 | UsbConnector 581 | 3 582 | port 583 | DAAAAA== 584 | 585 | SS04 586 | 587 | UsbConnector 588 | 3 589 | port 590 | DQAAAA== 591 | 592 | 593 | 594 | 8086_9cb1 595 | 596 | port-count 597 | DwAAAA== 598 | ports 599 | 600 | HS01 601 | 602 | UsbConnector 603 | 3 604 | port 605 | AQAAAA== 606 | 607 | HS02 608 | 609 | UsbConnector 610 | 3 611 | port 612 | AgAAAA== 613 | 614 | HS03 615 | 616 | UsbConnector 617 | 3 618 | port 619 | AwAAAA== 620 | 621 | HS04 622 | 623 | UsbConnector 624 | 3 625 | port 626 | BAAAAA== 627 | 628 | HS05 629 | 630 | UsbConnector 631 | 3 632 | port 633 | BQAAAA== 634 | 635 | HS06 636 | 637 | UsbConnector 638 | 3 639 | port 640 | BgAAAA== 641 | 642 | HS07 643 | 644 | UsbConnector 645 | 3 646 | port 647 | BwAAAA== 648 | 649 | HS08 650 | 651 | UsbConnector 652 | 3 653 | port 654 | CAAAAA== 655 | 656 | HS09 657 | 658 | UsbConnector 659 | 3 660 | port 661 | CQAAAA== 662 | 663 | HS10 664 | 665 | UsbConnector 666 | 3 667 | port 668 | CgAAAA== 669 | 670 | HS11 671 | 672 | UsbConnector 673 | 3 674 | port 675 | CwAAAA== 676 | 677 | SS01 678 | 679 | UsbConnector 680 | 3 681 | port 682 | DAAAAA== 683 | 684 | SS02 685 | 686 | UsbConnector 687 | 3 688 | port 689 | DQAAAA== 690 | 691 | SS03 692 | 693 | UsbConnector 694 | 3 695 | port 696 | DgAAAA== 697 | 698 | SS04 699 | 700 | UsbConnector 701 | 3 702 | port 703 | DwAAAA== 704 | 705 | 706 | 707 | 8086_a12f 708 | 709 | port-count 710 | GgAAAA== 711 | ports 712 | 713 | HS01 714 | 715 | UsbConnector 716 | 3 717 | port 718 | AQAAAA== 719 | 720 | HS02 721 | 722 | UsbConnector 723 | 3 724 | port 725 | AgAAAA== 726 | 727 | HS03 728 | 729 | UsbConnector 730 | 3 731 | port 732 | AwAAAA== 733 | 734 | HS04 735 | 736 | UsbConnector 737 | 3 738 | port 739 | BAAAAA== 740 | 741 | HS05 742 | 743 | UsbConnector 744 | 3 745 | port 746 | BQAAAA== 747 | 748 | HS06 749 | 750 | UsbConnector 751 | 3 752 | port 753 | BgAAAA== 754 | 755 | HS07 756 | 757 | UsbConnector 758 | 3 759 | port 760 | BwAAAA== 761 | 762 | HS08 763 | 764 | UsbConnector 765 | 3 766 | port 767 | CAAAAA== 768 | 769 | HS09 770 | 771 | UsbConnector 772 | 3 773 | port 774 | CQAAAA== 775 | 776 | HS10 777 | 778 | UsbConnector 779 | 3 780 | port 781 | CgAAAA== 782 | 783 | HS11 784 | 785 | UsbConnector 786 | 3 787 | port 788 | CwAAAA== 789 | 790 | HS12 791 | 792 | UsbConnector 793 | 3 794 | port 795 | DAAAAA== 796 | 797 | HS13 798 | 799 | UsbConnector 800 | 3 801 | port 802 | DQAAAA== 803 | 804 | HS14 805 | 806 | UsbConnector 807 | 3 808 | port 809 | DgAAAA== 810 | 811 | SS01 812 | 813 | UsbConnector 814 | 3 815 | port 816 | EQAAAA== 817 | 818 | SS02 819 | 820 | UsbConnector 821 | 3 822 | port 823 | EgAAAA== 824 | 825 | SS03 826 | 827 | UsbConnector 828 | 3 829 | port 830 | EwAAAA== 831 | 832 | SS04 833 | 834 | UsbConnector 835 | 3 836 | port 837 | FAAAAA== 838 | 839 | SS05 840 | 841 | UsbConnector 842 | 3 843 | port 844 | FQAAAA== 845 | 846 | SS06 847 | 848 | UsbConnector 849 | 3 850 | port 851 | FgAAAA== 852 | 853 | SS07 854 | 855 | UsbConnector 856 | 3 857 | port 858 | FwAAAA== 859 | 860 | SS08 861 | 862 | UsbConnector 863 | 3 864 | port 865 | GAAAAA== 866 | 867 | SS09 868 | 869 | UsbConnector 870 | 3 871 | port 872 | GQAAAA== 873 | 874 | SS10 875 | 876 | UsbConnector 877 | 3 878 | port 879 | GgAAAA== 880 | 881 | USR1 882 | 883 | UsbConnector 884 | 3 885 | port 886 | DwAAAA== 887 | 888 | USR2 889 | 890 | UsbConnector 891 | 3 892 | port 893 | EAAAAA== 894 | 895 | 896 | 897 | 8086_9dxx 898 | 899 | port-count 900 | EgAAAA== 901 | ports 902 | 903 | HS01 904 | 905 | UsbConnector 906 | 3 907 | port 908 | AQAAAA== 909 | 910 | HS02 911 | 912 | UsbConnector 913 | 3 914 | port 915 | AgAAAA== 916 | 917 | HS03 918 | 919 | UsbConnector 920 | 3 921 | port 922 | AwAAAA== 923 | 924 | HS04 925 | 926 | UsbConnector 927 | 3 928 | port 929 | BAAAAA== 930 | 931 | HS05 932 | 933 | UsbConnector 934 | 3 935 | port 936 | BQAAAA== 937 | 938 | HS06 939 | 940 | UsbConnector 941 | 3 942 | port 943 | BgAAAA== 944 | 945 | HS07 946 | 947 | UsbConnector 948 | 3 949 | port 950 | BwAAAA== 951 | 952 | HS08 953 | 954 | UsbConnector 955 | 3 956 | port 957 | CAAAAA== 958 | 959 | HS09 960 | 961 | UsbConnector 962 | 3 963 | port 964 | CQAAAA== 965 | 966 | HS10 967 | 968 | UsbConnector 969 | 3 970 | port 971 | CgAAAA== 972 | 973 | SS01 974 | 975 | UsbConnector 976 | 3 977 | port 978 | DQAAAA== 979 | 980 | SS02 981 | 982 | UsbConnector 983 | 3 984 | port 985 | DgAAAA== 986 | 987 | SS03 988 | 989 | UsbConnector 990 | 3 991 | port 992 | DwAAAA== 993 | 994 | SS04 995 | 996 | UsbConnector 997 | 3 998 | port 999 | EAAAAA== 1000 | 1001 | SS05 1002 | 1003 | UsbConnector 1004 | 3 1005 | port 1006 | EQAAAA== 1007 | 1008 | SS06 1009 | 1010 | UsbConnector 1011 | 3 1012 | port 1013 | EgAAAA== 1014 | 1015 | USR1 1016 | 1017 | UsbConnector 1018 | 3 1019 | port 1020 | CwAAAA== 1021 | 1022 | USR2 1023 | 1024 | UsbConnector 1025 | 3 1026 | port 1027 | DAAAAA== 1028 | 1029 | 1030 | 1031 | 8086_a2af 1032 | 1033 | port-count 1034 | GgAAAA== 1035 | ports 1036 | 1037 | HS01 1038 | 1039 | UsbConnector 1040 | 3 1041 | port 1042 | AQAAAA== 1043 | 1044 | HS02 1045 | 1046 | UsbConnector 1047 | 3 1048 | port 1049 | AgAAAA== 1050 | 1051 | HS03 1052 | 1053 | UsbConnector 1054 | 3 1055 | port 1056 | AwAAAA== 1057 | 1058 | HS04 1059 | 1060 | UsbConnector 1061 | 3 1062 | port 1063 | BAAAAA== 1064 | 1065 | HS05 1066 | 1067 | UsbConnector 1068 | 3 1069 | port 1070 | BQAAAA== 1071 | 1072 | HS06 1073 | 1074 | UsbConnector 1075 | 3 1076 | port 1077 | BgAAAA== 1078 | 1079 | HS07 1080 | 1081 | UsbConnector 1082 | 3 1083 | port 1084 | BwAAAA== 1085 | 1086 | HS08 1087 | 1088 | UsbConnector 1089 | 3 1090 | port 1091 | CAAAAA== 1092 | 1093 | HS09 1094 | 1095 | UsbConnector 1096 | 3 1097 | port 1098 | CQAAAA== 1099 | 1100 | HS10 1101 | 1102 | UsbConnector 1103 | 3 1104 | port 1105 | CgAAAA== 1106 | 1107 | HS11 1108 | 1109 | UsbConnector 1110 | 3 1111 | port 1112 | CwAAAA== 1113 | 1114 | HS12 1115 | 1116 | UsbConnector 1117 | 3 1118 | port 1119 | DAAAAA== 1120 | 1121 | HS13 1122 | 1123 | UsbConnector 1124 | 3 1125 | port 1126 | DQAAAA== 1127 | 1128 | HS14 1129 | 1130 | UsbConnector 1131 | 3 1132 | port 1133 | DgAAAA== 1134 | 1135 | SS01 1136 | 1137 | UsbConnector 1138 | 3 1139 | port 1140 | EQAAAA== 1141 | 1142 | SS02 1143 | 1144 | UsbConnector 1145 | 3 1146 | port 1147 | EgAAAA== 1148 | 1149 | SS03 1150 | 1151 | UsbConnector 1152 | 3 1153 | port 1154 | EwAAAA== 1155 | 1156 | SS04 1157 | 1158 | UsbConnector 1159 | 3 1160 | port 1161 | FAAAAA== 1162 | 1163 | SS05 1164 | 1165 | UsbConnector 1166 | 3 1167 | port 1168 | FQAAAA== 1169 | 1170 | SS06 1171 | 1172 | UsbConnector 1173 | 3 1174 | port 1175 | FgAAAA== 1176 | 1177 | SS07 1178 | 1179 | UsbConnector 1180 | 3 1181 | port 1182 | FwAAAA== 1183 | 1184 | SS08 1185 | 1186 | UsbConnector 1187 | 3 1188 | port 1189 | GAAAAA== 1190 | 1191 | SS09 1192 | 1193 | UsbConnector 1194 | 3 1195 | port 1196 | GQAAAA== 1197 | 1198 | SS10 1199 | 1200 | UsbConnector 1201 | 3 1202 | port 1203 | GgAAAA== 1204 | 1205 | USR1 1206 | 1207 | UsbConnector 1208 | 3 1209 | port 1210 | DwAAAA== 1211 | 1212 | USR2 1213 | 1214 | UsbConnector 1215 | 3 1216 | port 1217 | EAAAAA== 1218 | 1219 | 1220 | 1221 | 8086_a36d 1222 | 1223 | port-count 1224 | GgAAAA== 1225 | ports 1226 | 1227 | HS01 1228 | 1229 | UsbConnector 1230 | 3 1231 | port 1232 | AQAAAA== 1233 | 1234 | HS02 1235 | 1236 | UsbConnector 1237 | 3 1238 | port 1239 | AgAAAA== 1240 | 1241 | HS03 1242 | 1243 | UsbConnector 1244 | 3 1245 | port 1246 | AwAAAA== 1247 | 1248 | HS04 1249 | 1250 | UsbConnector 1251 | 3 1252 | port 1253 | BAAAAA== 1254 | 1255 | HS05 1256 | 1257 | UsbConnector 1258 | 3 1259 | port 1260 | BQAAAA== 1261 | 1262 | HS06 1263 | 1264 | UsbConnector 1265 | 3 1266 | port 1267 | BgAAAA== 1268 | 1269 | HS07 1270 | 1271 | UsbConnector 1272 | 3 1273 | port 1274 | BwAAAA== 1275 | 1276 | HS08 1277 | 1278 | UsbConnector 1279 | 3 1280 | port 1281 | CAAAAA== 1282 | 1283 | HS09 1284 | 1285 | UsbConnector 1286 | 3 1287 | port 1288 | CQAAAA== 1289 | 1290 | HS10 1291 | 1292 | UsbConnector 1293 | 3 1294 | port 1295 | CgAAAA== 1296 | 1297 | HS11 1298 | 1299 | UsbConnector 1300 | 3 1301 | port 1302 | CwAAAA== 1303 | 1304 | HS12 1305 | 1306 | UsbConnector 1307 | 3 1308 | port 1309 | DAAAAA== 1310 | 1311 | HS13 1312 | 1313 | UsbConnector 1314 | 3 1315 | port 1316 | DQAAAA== 1317 | 1318 | HS14 1319 | 1320 | UsbConnector 1321 | 3 1322 | port 1323 | DgAAAA== 1324 | 1325 | SS01 1326 | 1327 | UsbConnector 1328 | 3 1329 | port 1330 | EQAAAA== 1331 | 1332 | SS02 1333 | 1334 | UsbConnector 1335 | 3 1336 | port 1337 | EgAAAA== 1338 | 1339 | SS03 1340 | 1341 | UsbConnector 1342 | 3 1343 | port 1344 | EwAAAA== 1345 | 1346 | SS04 1347 | 1348 | UsbConnector 1349 | 3 1350 | port 1351 | FAAAAA== 1352 | 1353 | SS05 1354 | 1355 | UsbConnector 1356 | 3 1357 | port 1358 | FQAAAA== 1359 | 1360 | SS06 1361 | 1362 | UsbConnector 1363 | 3 1364 | port 1365 | FgAAAA== 1366 | 1367 | SS07 1368 | 1369 | UsbConnector 1370 | 3 1371 | port 1372 | FwAAAA== 1373 | 1374 | SS08 1375 | 1376 | UsbConnector 1377 | 3 1378 | port 1379 | GAAAAA== 1380 | 1381 | SS09 1382 | 1383 | UsbConnector 1384 | 3 1385 | port 1386 | GQAAAA== 1387 | 1388 | SS10 1389 | 1390 | UsbConnector 1391 | 3 1392 | port 1393 | GgAAAA== 1394 | 1395 | USR1 1396 | 1397 | UsbConnector 1398 | 3 1399 | port 1400 | DwAAAA== 1401 | 1402 | USR2 1403 | 1404 | UsbConnector 1405 | 3 1406 | port 1407 | EAAAAA== 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | NSHumanReadableCopyright 1415 | Copyright © 2015 RehabMan. All rights reserved. 1416 | OSBundleLibraries 1417 | 1418 | com.apple.iokit.IOPCIFamily 1419 | 1.0.0b1 1420 | com.apple.iokit.IOACPIFamily 1421 | 1.0d1 1422 | com.apple.kpi.iokit 1423 | 9.0.0 1424 | com.apple.kpi.libkern 1425 | 9.0.0 1426 | 1427 | OSBundleRequired 1428 | Root 1429 | 1430 | 1431 | -------------------------------------------------------------------------------- /XHCI-unsupported.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleGetInfoString 6 | Version 0.9.2, Copyright 2018, RehabMan (GPLv2) 7 | CFBundleIdentifier 8 | org.rehabman.injector.XHCI.unsupported 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | XHCI-unsupported 13 | CFBundlePackageType 14 | KEXT 15 | CFBundleShortVersionString 16 | 0.9.2 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 0.9.2 21 | IOKitPersonalities 22 | 23 | AppleUSBXHCILPTH 9-series 24 | 25 | CFBundleIdentifier 26 | com.apple.driver.usb.AppleUSBXHCIPCI 27 | IOClass 28 | AppleUSBXHCILPTH 29 | IOPCIPauseCompatible 30 | 31 | IOPCIPrimaryMatch 32 | 0x8cb18086 33 | IOPCITunnelCompatible 34 | 35 | IOProbeScore 36 | 900 37 | IOProviderClass 38 | IOPCIDevice 39 | 40 | AppleUSBXHCILPTH X99 41 | 42 | CFBundleIdentifier 43 | com.apple.driver.usb.AppleUSBXHCIPCI 44 | alternate:IOClass 45 | AppleUSBXHCILPTHB 46 | IOClass 47 | AppleUSBXHCILPTH 48 | IOPCIPauseCompatible 49 | 50 | IOPCIPrimaryMatch 51 | 0x8d318086 52 | IOPCITunnelCompatible 53 | 54 | IOProbeScore 55 | 900 56 | IOProviderClass 57 | IOPCIDevice 58 | 59 | AppleUSBXHCISPT 200-X299 60 | 61 | CFBundleIdentifier 62 | com.apple.driver.usb.AppleUSBXHCIPCI 63 | IOClass 64 | AppleUSBXHCISPT 65 | IOPCIPauseCompatible 66 | 67 | IOPCIPrimaryMatch 68 | 0xa2af8086 69 | IOPCITunnelCompatible 70 | 71 | IOProbeScore 72 | 900 73 | IOProviderClass 74 | IOPCIDevice 75 | 76 | AppleUSBXHCISPT 300 77 | 78 | CFBundleIdentifier 79 | com.apple.driver.usb.AppleUSBXHCIPCI 80 | IOClass 81 | AppleUSBXHCISPT 82 | IOPCIPauseCompatible 83 | 84 | IOPCIPrimaryMatch 85 | 0x9ded8086 0xa36d8086 86 | IOPCITunnelCompatible 87 | 88 | IOProbeScore 89 | 900 90 | IOProviderClass 91 | IOPCIDevice 92 | 93 | 94 | OSBundleRequired 95 | Root 96 | 97 | 98 | -------------------------------------------------------------------------------- /config_patches.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ACPI 6 | 7 | DSDT 8 | 9 | Patches 10 | 11 | 12 | Comment 13 | change _OSI to XOSI 14 | Find 15 | X09TSQ== 16 | Replace 17 | WE9TSQ== 18 | 19 | 20 | Comment 21 | change EHC1 to EH01 22 | Find 23 | RUhDMQ== 24 | Replace 25 | RUgwMQ== 26 | 27 | 28 | Comment 29 | change EHC2 to EH02 30 | Find 31 | RUhDMg== 32 | Replace 33 | RUgwMg== 34 | 35 | 36 | Comment 37 | change XHC1 to XHC 38 | Find 39 | WEhDMQ== 40 | Replace 41 | WEhDXw== 42 | 43 | 44 | 45 | 46 | KernelAndKextPatches 47 | 48 | KextsToPatch 49 | 50 | 51 | Comment 52 | change 15 port limit to 26 in XHCI kext 53 | MatchOS 54 | 10.11.x 55 | Name 56 | com.apple.driver.usb.AppleUSBXHCIPCI 57 | Find 58 | g72M/v//EA== 59 | Replace 60 | g72M/v//Gw== 61 | 62 | 63 | Comment 64 | change 15 port limit to 26 in XHCI kext 65 | MatchOS 66 | 10.12.x 67 | Name 68 | com.apple.driver.usb.AppleUSBXHCIPCI 69 | Find 70 | g710////EA== 71 | Replace 72 | g710////Gw== 73 | 74 | 75 | Comment 76 | change 15 port limit to 26 in XHCI kext 77 | MatchOS 78 | 10.13.0,10.13.1,10.13.2,10.13.3 79 | Name 80 | com.apple.driver.usb.AppleUSBXHCIPCI 81 | Find 82 | g32MEA== 83 | Replace 84 | g32MGw== 85 | 86 | 87 | Comment 88 | disable port limit in XHCI kext (credit PMHeart) 89 | MatchOS 90 | 10.13.4,10.13.5 91 | Name 92 | com.apple.driver.usb.AppleUSBXHCI 93 | Find 94 | g32UDw+DlwQAAA== 95 | Replace 96 | g32UD5CQkJCQkA== 97 | 98 | 99 | Comment 100 | disable port limit in XHCI kext (credit RehabMan, based prior PMHeart patch) 101 | MatchOS 102 | 10.13.6 103 | Name 104 | com.apple.driver.usb.AppleUSBXHCI 105 | Find 106 | g32IDw+DpwQAAA== 107 | Replace 108 | g32ID5CQkJCQkA== 109 | 110 | 111 | Comment 112 | disable port limit in XHCI kext (credit PMHeart) 113 | MatchOS 114 | 10.14.0 115 | Name 116 | com.apple.driver.usb.AppleUSBXHCI 117 | Find 118 | g/sPD4MDBQAA 119 | Replace 120 | g/sPkJCQkJCQ 121 | 122 | 123 | Comment 124 | disable port limit in XHCI kext (credit DalianSky,Ricky) 125 | MatchOS 126 | 10.14.1,10.14.2 127 | Name 128 | com.apple.driver.usb.AppleUSBXHCI 129 | Find 130 | g/sPD4OPBAAA 131 | Replace 132 | g/sPkJCQkJCQ 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /generate_Info_plist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$1" == "clean" ]]; then 4 | exit 0 5 | fi 6 | 7 | plist=./USBInjectAll/USBInjectAll-Info.plist 8 | plist_temp=/tmp/org_rehabman_USBInjectAll-Info.plist 9 | merge=./USBInjectAll_model_template.plist 10 | merge_EHCI=./USBInjectAll_model_template_EHCI.plist 11 | 12 | function mergeModelData 13 | # $1 model identifier 14 | # $2 'EHCI' if should also merge in merge_EHCI 15 | { 16 | buddy="/usr/libexec/plistbuddy -c" 17 | tmp=/tmp/USB_translated.plist 18 | cat $merge | perl -p -e "s/model_placeholder/$1/" >$tmp 19 | $buddy "Merge $tmp ':IOKitPersonalities'" $plist_temp 20 | if [[ "$2" == "EHCI" ]]; then 21 | cat $merge_EHCI | perl -p -e "s/model_placeholder/$1/" >$tmp 22 | $buddy "Merge $tmp ':IOKitPersonalities'" $plist_temp 23 | fi 24 | } 25 | 26 | # start with blank template (no model injectors) 27 | cp ./USBInjectAll_template-Info.plist $plist_temp 28 | 29 | # MacBookPro 30 | mergeModelData "MacBookPro6,1" EHCI 31 | mergeModelData "MacBookPro6,2" EHCI 32 | mergeModelData "MacBookPro7,1" EHCI 33 | mergeModelData "MacBookPro8,1" EHCI 34 | mergeModelData "MacBookPro8,2" EHCI 35 | mergeModelData "MacBookPro8,3" EHCI 36 | mergeModelData "MacBookPro9,1" EHCI 37 | mergeModelData "MacBookPro9,2" EHCI 38 | mergeModelData "MacBookPro10,1" EHCI 39 | mergeModelData "MacBookPro10,2" EHCI 40 | mergeModelData "MacBookPro11,1" EHCI 41 | mergeModelData "MacBookPro11,2" EHCI 42 | mergeModelData "MacBookPro11,3" EHCI 43 | mergeModelData "MacBookPro11,4" EHCI 44 | mergeModelData "MacBookPro11,5" EHCI 45 | mergeModelData "MacBookPro12,1" EHCI 46 | mergeModelData "MacBookPro12,2" EHCI 47 | mergeModelData "MacBookPro13,1" 48 | mergeModelData "MacBookPro13,2" 49 | mergeModelData "MacBookPro13,3" 50 | mergeModelData "MacBookPro14,1" 51 | mergeModelData "MacBookPro14,2" 52 | mergeModelData "MacBookPro14,3" 53 | mergeModelData "MacBookPro15,1" 54 | mergeModelData "MacBookPro15,2" 55 | 56 | # MacBookAir 57 | mergeModelData "MacBookAir4,1" EHCI 58 | mergeModelData "MacBookAir4,2" EHCI 59 | mergeModelData "MacBookAir5,1" EHCI 60 | mergeModelData "MacBookAir5,2" EHCI 61 | mergeModelData "MacBookAir6,1" EHCI 62 | mergeModelData "MacBookAir6,2" EHCI 63 | mergeModelData "MacBookAir7,1" EHCI 64 | mergeModelData "MacBookAir7,2" EHCI 65 | mergeModelData "MacBookAir8,1" 66 | 67 | # iMac 68 | mergeModelData "iMac4,1" EHCI 69 | mergeModelData "iMac4,2" EHCI 70 | mergeModelData "iMac5,1" EHCI 71 | mergeModelData "iMac6,1" EHCI 72 | mergeModelData "iMac7,1" EHCI 73 | mergeModelData "iMac8,1" EHCI 74 | mergeModelData "iMac9,1" EHCI 75 | mergeModelData "iMac10,1" EHCI 76 | mergeModelData "iMac11,1" EHCI 77 | mergeModelData "iMac11,2" EHCI 78 | mergeModelData "iMac11,3" EHCI 79 | mergeModelData "iMac12,1" EHCI 80 | mergeModelData "iMac12,2" EHCI 81 | mergeModelData "iMac13,1" EHCI 82 | mergeModelData "iMac13,2" EHCI 83 | mergeModelData "iMac14,1" EHCI 84 | mergeModelData "iMac14,2" EHCI 85 | mergeModelData "iMac14,3" EHCI 86 | mergeModelData "iMac15,1" EHCI 87 | mergeModelData "iMac16,1" EHCI 88 | mergeModelData "iMac16,2" EHCI 89 | mergeModelData "iMac17,1" 90 | mergeModelData "iMac18,1" 91 | mergeModelData "iMac18,2" 92 | mergeModelData "iMac18,3" 93 | mergeModelData "iMac19,1" 94 | 95 | # iMacPro 96 | mergeModelData "iMacPro1,1" 97 | 98 | # Macmini 99 | mergeModelData "Macmini5,1" EHCI 100 | mergeModelData "Macmini5,2" EHCI 101 | mergeModelData "Macmini5,3" EHCI 102 | mergeModelData "Macmini6,1" EHCI 103 | mergeModelData "Macmini6,2" EHCI 104 | mergeModelData "Macmini7,1" EHCI 105 | mergeModelData "Macmini8,1" 106 | 107 | # MacBook 108 | mergeModelData "MacBook8,1" EHCI 109 | mergeModelData "MacBook9,1" 110 | mergeModelData "MacBook10,1" 111 | 112 | # MacPro 113 | mergeModelData "MacPro3,1" EHCI 114 | mergeModelData "MacPro4,1" EHCI 115 | mergeModelData "MacPro5,1" EHCI 116 | mergeModelData "MacPro6,1" EHCI 117 | 118 | # check to see if it was updated... 119 | cksum_old=`md5 -q $plist` 120 | cksum_new=`md5 -q $plist_temp` 121 | if [[ $cksum_new != $cksum_old ]]; then 122 | cp $plist_temp $plist 123 | echo "Updated Info.plist" 124 | else 125 | echo "Generated Info.plist is same as old, no need to update" 126 | fi 127 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | # really just some handy scripts... 2 | 3 | KEXT=USBInjectAll.kext 4 | DIST=RehabMan-USBInjectAll 5 | BUILDDIR=./Build/Products 6 | INSTDIR=/Library/Extensions 7 | 8 | ifeq ($(findstring 32,$(BITS)),32) 9 | OPTIONS:=$(OPTIONS) -arch i386 10 | endif 11 | 12 | ifeq ($(findstring 64,$(BITS)),64) 13 | OPTIONS:=$(OPTIONS) -arch x86_64 14 | endif 15 | 16 | OPTIONS:=$(OPTIONS) -scheme USBInjectAll 17 | 18 | .PHONY: all 19 | all: 20 | xcodebuild build $(OPTIONS) -configuration Debug 21 | xcodebuild build $(OPTIONS) -configuration Release 22 | 23 | .PHONY: clean 24 | clean: 25 | xcodebuild clean $(OPTIONS) -configuration Debug 26 | xcodebuild clean $(OPTIONS) -configuration Release 27 | 28 | .PHONY: update_kernelcache 29 | update_kernelcache: 30 | sudo touch /System/Library/Extensions 31 | sudo kextcache -update-volume / 32 | 33 | .PHONY: install_debug 34 | install_debug: 35 | sudo cp -R $(BUILDDIR)/Debug/$(KEXT) $(INSTDIR) 36 | if [ "`which tag`" != "" ]; then sudo tag -a Purple $(INSTDIR)/$(KEXT); fi 37 | make update_kernelcache 38 | 39 | .PHONY: install 40 | install: 41 | sudo cp -R $(BUILDDIR)/Release/$(KEXT) $(INSTDIR) 42 | if [ "`which tag`" != "" ]; then sudo tag -a Blue $(INSTDIR)/$(KEXT); fi 43 | make update_kernelcache 44 | 45 | .PHONY: distribute 46 | distribute: 47 | if [ -e ./Distribute ]; then rm -r ./Distribute; fi 48 | mkdir ./Distribute 49 | cp -R $(BUILDDIR)/Debug ./Distribute 50 | cp -R $(BUILDDIR)/Release ./Distribute 51 | cp README.md ./Distribute 52 | cp License.md ./Distribute 53 | find ./Distribute -path *.DS_Store -delete 54 | find ./Distribute -path *.dSYM -exec echo rm -r {} \; >/tmp/org.voodoo.rm.dsym.sh 55 | chmod +x /tmp/org.voodoo.rm.dsym.sh 56 | /tmp/org.voodoo.rm.dsym.sh 57 | rm /tmp/org.voodoo.rm.dsym.sh 58 | ditto -c -k --sequesterRsrc --zlibCompressionLevel 9 ./Distribute ./Archive.zip 59 | mv ./Archive.zip ./Distribute/`date +$(DIST)-%Y-%m%d.zip` 60 | -------------------------------------------------------------------------------- /strstr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * strstr.c -- 3 | * 4 | * Source code for the "strstr" library routine. 5 | * 6 | * Copyright (c) 1988-1993 The Regents of the University of California. 7 | * All rights reserved. 8 | * 9 | * Permission is hereby granted, without written agreement and without 10 | * license or royalty fees, to use, copy, modify, and distribute this 11 | * software and its documentation for any purpose, provided that the 12 | * above copyright notice and the following two paragraphs appear in 13 | * all copies of this software. 14 | * 15 | * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR 16 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 17 | * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 18 | * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19 | * 20 | * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 21 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 22 | * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 23 | * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO 24 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 25 | */ 26 | 27 | /* 28 | *---------------------------------------------------------------------- 29 | * 30 | * strstr -- 31 | * 32 | * Locate the first instance of a substring in a string. 33 | * 34 | * Results: 35 | * If string contains substring, the return value is the 36 | * location of the first matching instance of substring 37 | * in string. If string doesn't contain substring, the 38 | * return value is 0. Matching is done on an exact 39 | * character-for-character basis with no wildcards or special 40 | * characters. 41 | * 42 | * Side effects: 43 | * None. 44 | * 45 | *---------------------------------------------------------------------- 46 | */ 47 | 48 | const char* hack_strstr(const char* string, const char* substring) 49 | { 50 | const char *a; 51 | const char *b; 52 | 53 | /* First scan quickly through the two strings looking for a 54 | * single-character match. When it's found, then compare the 55 | * rest of the substring. 56 | */ 57 | 58 | b = substring; 59 | if (*b == 0) 60 | return string; 61 | 62 | for ( ; *string; string++) 63 | { 64 | if (*string != *b) 65 | continue; 66 | 67 | a = string; 68 | while (1) 69 | { 70 | if (*b == 0) 71 | return string; 72 | if (*a++ != *b++) 73 | break; 74 | } 75 | b = substring; 76 | } 77 | return (char*)0; 78 | } 79 | --------------------------------------------------------------------------------