├── .github └── workflows │ └── main.yml ├── .gitignore ├── License.md ├── README.md ├── SDKStatCaches.noindex └── macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache ├── 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 /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | release: 8 | types: [published] 9 | 10 | env: 11 | PROJECT_TYPE: KEXT 12 | 13 | jobs: 14 | build: 15 | name: Build 16 | runs-on: macos-latest 17 | env: 18 | JOB_TYPE: BUILD 19 | steps: 20 | - uses: actions/checkout@v4 21 | - uses: actions/checkout@v4 22 | with: 23 | repository: acidanthera/MacKernelSDK 24 | path: MacKernelSDK 25 | - name: CI Bootstrap 26 | run: | 27 | src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/ocbuild/master/ci-bootstrap.sh) && eval "$src" || exit 1 28 | 29 | - run: xcodebuild -scheme USBInjectAll -derivedDataPath . -configuration Debug 30 | - run: xcodebuild -scheme USBInjectAll -derivedDataPath . -configuration Release 31 | 32 | - name: Upload to Artifacts 33 | uses: actions/upload-artifact@v4 34 | with: 35 | name: Artifacts 36 | path: Build/Products/*/*.zip 37 | - name: Upload to Release 38 | if: github.event_name == 'release' 39 | uses: svenstaro/upload-release-action@v2 40 | with: 41 | repo_token: ${{ secrets.GITHUB_TOKEN }} 42 | file: Build/Products/*/*.zip 43 | tag: ${{ github.ref }} 44 | file_glob: true 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Build 3 | DerivedData 4 | Distribute 5 | Logs 6 | ModuleCache* 7 | XCBuildData 8 | xcuserdata 9 | xcshareddata 10 | project.xcworkspace 11 | info.plist 12 | /MacKernelSDK -------------------------------------------------------------------------------- /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 chipset(8086:a2af): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 30 | 31 | XHC, 300-series chipset(8086:a36d): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 32 | 33 | XHC, 400-series chipset(8086:a3af): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 34 | 35 | XHC, 400-series chipset(8086:06ed): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 36 | 37 | XHC, 500-series chipset(8086:43ed): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 38 | 39 | XHC, 600-series chipset(8086:7ae0): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 40 | 41 | XHC, 700-series chipset(8086:7a60): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 42 | 43 | XHC, 800-series chipset(8086:7exx): 14-USB2 ports HS01-HS14, 10-USB3 ports SS01-SS10, plus USR1/USR2) 44 | 45 | Comet Lake PCH-LP USB 3.1 xHCI Host Controller, (8086:02ed): 10-USB2 ports HS01-HS10, 4-USB3 ports SS01-SS04, plus USR1/USR2) 46 | 47 | Ice Lake-LP USB 3.1 xHCI Host Controller, (8086:34ed): 12-USB2 ports HS01-HS12, 4-USB3 ports SS01-SS04, plus USR1/USR2) 48 | 49 | 50 | 51 | This kext is only for 10.11+. It has no use with prior versions. 52 | 53 | Currently, only Intel controllers are supported. The most commonly used SMBIOS model identifiers are in the kext. 54 | 55 | 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. 56 | 57 | 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). 58 | 59 | This kext requires only 20 ports maximum, so the patch would be: 60 | (these patches are for 10.11.x only) 61 | 62 | ``` 63 | Comment: change 15 port limit to 20 in AppleUSBXHCIPCI 64 | Name: AppleUSBXHCIPCI 65 | Find: <83bd8cfe ffff10> 66 | Replace: <83bd8cfe ffff15> 67 | ``` 68 | 69 | If you have a 100-series board, there can be up to 26 ports on XHCI, so you should increase the limit accordingly: 70 | ``` 71 | Comment: change 15 port limit to 26 in AppleUSBXHCIPCI 72 | Name: AppleUSBXHCIPCI 73 | Find: <83bd8cfe ffff10> 74 | Replace: <83bd8cfe ffff1b> 75 | ``` 76 | 77 | 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. 78 | 79 | 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. 80 | 81 | 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. 82 | 83 | 84 | ### Injected Property Customization 85 | 86 | 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. 87 | 88 | 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. 89 | 90 | In addition a few other flags are available: 91 | 92 | flag -uia_exclude_hs: excludes all HSxx ports 93 | 94 | flag -uia_exclude_ss: excludes all SSxx ports 95 | 96 | flag -uia_exclude_xhc: disables injection on XHC 97 | 98 | 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) 99 | 100 | 101 | 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. 102 | 103 | For example, if we wanted to enable only SS01 on XHC for 8086_8xxx chipsets: 104 | 105 | ``` 106 | DefinitionBlock ("", "SSDT", 1, "hack", "UIAC", 0) 107 | { 108 | Device(UIAC) 109 | { 110 | Name(_HID, "UIA00000") 111 | 112 | // override XHC configuration to have only one port 113 | Name(RMCF, Package() 114 | { 115 | "8086_8xxx", Package() 116 | { 117 | "port-count", Buffer() { 0xa, 0, 0, 0 }, 118 | "ports", Package() 119 | { 120 | "SS01", Package() 121 | { 122 | "UsbConnector", 3, 123 | "port", Buffer() { 0xa, 0, 0, 0 }, 124 | } 125 | } 126 | } 127 | }) 128 | } 129 | } 130 | ``` 131 | 132 | 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. 133 | 134 | 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). 135 | 136 | 137 | ### Feedback 138 | 139 | Please use this thread at tmx for futher details and feedback. 140 | 141 | http://www.tonymacx86.com/el-capitan-laptop-support/173616-guide-10-11-usb-changes-solutions.html 142 | 143 | 144 | ### Downloads: 145 | 146 | Downloads are available on the "Release" tab 147 | 148 | The best way to download the config_patches.plist and other repo files is to download the project ZIP: 149 | 150 | https://github.com/DalianSky/OS-X-USB-Inject-All/archive/master.zip 151 | 152 | ### How to Install 153 | 154 | Install the kext with your Bootloader in use, such as Clover or Open Core. 155 | 156 | Clover 157 | ``` 158 | EFI/Clover/kexts/Other 159 | ``` 160 | Reboot ! 161 | 162 | 163 | Open Core 164 | ``` 165 | EFI/OC/Kexts 166 | ``` 167 | Make sure to also add USBInjectAll.kext entry into config.plist /Kernel/Add/ like other kexts accordingly. 168 | 169 | Reboot ! 170 | 171 | 172 | 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). 173 | 174 | 175 | 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 176 | 177 | 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. 178 | 179 | 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. 180 | 181 | Typical xHCI needing `XHCI-unsupported.kext`: 182 | 183 | - X99-series chipset XHC controller, 8086:8d31 184 | - 200-series chipset XHC controller, 8086:a2af (depends on macOS version) 185 | - 300-series chipset XHC controller, 8086:a36d or 8086:9ded 186 | - 400-series chipset XHC controller, 8086:a3af 187 | - 500-series chipset XHC controller, 8086:43ed or 8086:a0ed 188 | - 600-series chipset XHC controller, 8086:7ae0 or 51ed:8086 189 | - 700-series chipset XHC controller, 8086:7a60 190 | - 800-series chipset XHC controller, 8086:7exx 191 | 192 | -------------------------------------------------------------------------------- /SDKStatCaches.noindex/macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daliansky/OS-X-USB-Inject-All/9ab866d5b202b7f480e0ea0e05f298ed196d2723/SDKStatCaches.noindex/macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache -------------------------------------------------------------------------------- /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_02ed", Package() 210 | { 211 | "port-count", Buffer() { 16, 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 | "HS05", Package() 235 | { 236 | "UsbConnector", 3, 237 | "port", Buffer() { 5, 0, 0, 0 }, 238 | }, 239 | "HS06", Package() 240 | { 241 | "UsbConnector", 3, 242 | "port", Buffer() { 6, 0, 0, 0 }, 243 | }, 244 | "HS07", Package() 245 | { 246 | "UsbConnector", 3, 247 | "port", Buffer() { 7, 0, 0, 0 }, 248 | }, 249 | "HS08", Package() 250 | { 251 | "UsbConnector", 3, 252 | "port", Buffer() { 8, 0, 0, 0 }, 253 | }, 254 | "HS09", Package() 255 | { 256 | "UsbConnector", 3, 257 | "port", Buffer() { 9, 0, 0, 0 }, 258 | }, 259 | "HS10", Package() 260 | { 261 | "UsbConnector", 3, 262 | "port", Buffer() { 10, 0, 0, 0 }, 263 | }, 264 | "SS01", Package() 265 | { 266 | "UsbConnector", 3, 267 | "port", Buffer() { 17, 0, 0, 0 }, 268 | }, 269 | "SS02", Package() 270 | { 271 | "UsbConnector", 3, 272 | "port", Buffer() { 18, 0, 0, 0 }, 273 | }, 274 | "SS03", Package() 275 | { 276 | "UsbConnector", 3, 277 | "port", Buffer() { 19, 0, 0, 0 }, 278 | }, 279 | "SS04", Package() 280 | { 281 | "UsbConnector", 3, 282 | "port", Buffer() { 20, 0, 0, 0 }, 283 | }, 284 | "USR1", Package() 285 | { 286 | "UsbConnector", 3, 287 | "port", Buffer() { 15, 0, 0, 0 }, 288 | }, 289 | "USR2", Package() 290 | { 291 | "UsbConnector", 3, 292 | "port", Buffer() { 16, 0, 0, 0 }, 293 | }, 294 | }, 295 | }, 296 | "8086_06ed", Package() 297 | { 298 | "port-count", Buffer() { 26, 0, 0, 0 }, 299 | "ports", Package() 300 | { 301 | "HS01", Package() 302 | { 303 | "UsbConnector", 3, 304 | "port", Buffer() { 1, 0, 0, 0 }, 305 | }, 306 | "HS02", Package() 307 | { 308 | "UsbConnector", 3, 309 | "port", Buffer() { 2, 0, 0, 0 }, 310 | }, 311 | "HS03", Package() 312 | { 313 | "UsbConnector", 3, 314 | "port", Buffer() { 3, 0, 0, 0 }, 315 | }, 316 | "HS04", Package() 317 | { 318 | "UsbConnector", 3, 319 | "port", Buffer() { 4, 0, 0, 0 }, 320 | }, 321 | "HS05", Package() 322 | { 323 | "UsbConnector", 3, 324 | "port", Buffer() { 5, 0, 0, 0 }, 325 | }, 326 | "HS06", Package() 327 | { 328 | "UsbConnector", 3, 329 | "port", Buffer() { 6, 0, 0, 0 }, 330 | }, 331 | "HS07", Package() 332 | { 333 | "UsbConnector", 3, 334 | "port", Buffer() { 7, 0, 0, 0 }, 335 | }, 336 | "HS08", Package() 337 | { 338 | "UsbConnector", 3, 339 | "port", Buffer() { 8, 0, 0, 0 }, 340 | }, 341 | "HS09", Package() 342 | { 343 | "UsbConnector", 3, 344 | "port", Buffer() { 9, 0, 0, 0 }, 345 | }, 346 | "HS10", Package() 347 | { 348 | "UsbConnector", 3, 349 | "port", Buffer() { 10, 0, 0, 0 }, 350 | }, 351 | "HS11", Package() 352 | { 353 | "UsbConnector", 3, 354 | "port", Buffer() { 11, 0, 0, 0 }, 355 | }, 356 | "HS12", Package() 357 | { 358 | "UsbConnector", 3, 359 | "port", Buffer() { 12, 0, 0, 0 }, 360 | }, 361 | "HS13", Package() 362 | { 363 | "UsbConnector", 3, 364 | "port", Buffer() { 13, 0, 0, 0 }, 365 | }, 366 | "HS14", Package() 367 | { 368 | "UsbConnector", 3, 369 | "port", Buffer() { 14, 0, 0, 0 }, 370 | }, 371 | "SS01", Package() 372 | { 373 | "UsbConnector", 3, 374 | "port", Buffer() { 17, 0, 0, 0 }, 375 | }, 376 | "SS02", Package() 377 | { 378 | "UsbConnector", 3, 379 | "port", Buffer() { 18, 0, 0, 0 }, 380 | }, 381 | "SS03", Package() 382 | { 383 | "UsbConnector", 3, 384 | "port", Buffer() { 19, 0, 0, 0 }, 385 | }, 386 | "SS04", Package() 387 | { 388 | "UsbConnector", 3, 389 | "port", Buffer() { 20, 0, 0, 0 }, 390 | }, 391 | "SS05", Package() 392 | { 393 | "UsbConnector", 3, 394 | "port", Buffer() { 21, 0, 0, 0 }, 395 | }, 396 | "SS06", Package() 397 | { 398 | "UsbConnector", 3, 399 | "port", Buffer() { 22, 0, 0, 0 }, 400 | }, 401 | "SS07", Package() 402 | { 403 | "UsbConnector", 3, 404 | "port", Buffer() { 23, 0, 0, 0 }, 405 | }, 406 | "SS08", Package() 407 | { 408 | "UsbConnector", 3, 409 | "port", Buffer() { 24, 0, 0, 0 }, 410 | }, 411 | "SS09", Package() 412 | { 413 | "UsbConnector", 3, 414 | "port", Buffer() { 25, 0, 0, 0 }, 415 | }, 416 | "SS10", Package() 417 | { 418 | "UsbConnector", 3, 419 | "port", Buffer() { 26, 0, 0, 0 }, 420 | }, 421 | "USR1", Package() 422 | { 423 | "UsbConnector", 3, 424 | "port", Buffer() { 15, 0, 0, 0 }, 425 | }, 426 | "USR2", Package() 427 | { 428 | "UsbConnector", 3, 429 | "port", Buffer() { 16, 0, 0, 0 }, 430 | }, 431 | }, 432 | }, 433 | "8086_34ed", Package() 434 | { 435 | "port-count", Buffer() { 16, 0, 0, 0 }, 436 | "ports", Package() 437 | { 438 | "HS01", Package() 439 | { 440 | "UsbConnector", 3, 441 | "port", Buffer() { 1, 0, 0, 0 }, 442 | }, 443 | "HS02", Package() 444 | { 445 | "UsbConnector", 3, 446 | "port", Buffer() { 2, 0, 0, 0 }, 447 | }, 448 | "HS03", Package() 449 | { 450 | "UsbConnector", 3, 451 | "port", Buffer() { 3, 0, 0, 0 }, 452 | }, 453 | "HS04", Package() 454 | { 455 | "UsbConnector", 3, 456 | "port", Buffer() { 4, 0, 0, 0 }, 457 | }, 458 | "HS05", Package() 459 | { 460 | "UsbConnector", 3, 461 | "port", Buffer() { 5, 0, 0, 0 }, 462 | }, 463 | "HS06", Package() 464 | { 465 | "UsbConnector", 3, 466 | "port", Buffer() { 6, 0, 0, 0 }, 467 | }, 468 | "HS07", Package() 469 | { 470 | "UsbConnector", 3, 471 | "port", Buffer() { 7, 0, 0, 0 }, 472 | }, 473 | "HS08", Package() 474 | { 475 | "UsbConnector", 3, 476 | "port", Buffer() { 8, 0, 0, 0 }, 477 | }, 478 | "HS09", Package() 479 | { 480 | "UsbConnector", 3, 481 | "port", Buffer() { 9, 0, 0, 0 }, 482 | }, 483 | "HS10", Package() 484 | { 485 | "UsbConnector", 3, 486 | "port", Buffer() { 10, 0, 0, 0 }, 487 | }, 488 | "SS01", Package() 489 | { 490 | "UsbConnector", 3, 491 | "port", Buffer() { 17, 0, 0, 0 }, 492 | }, 493 | "SS02", Package() 494 | { 495 | "UsbConnector", 3, 496 | "port", Buffer() { 18, 0, 0, 0 }, 497 | }, 498 | "SS03", Package() 499 | { 500 | "UsbConnector", 3, 501 | "port", Buffer() { 19, 0, 0, 0 }, 502 | }, 503 | "SS04", Package() 504 | { 505 | "UsbConnector", 3, 506 | "port", Buffer() { 20, 0, 0, 0 }, 507 | }, 508 | "USR1", Package() 509 | { 510 | "UsbConnector", 3, 511 | "port", Buffer() { 15, 0, 0, 0 }, 512 | }, 513 | "USR2", Package() 514 | { 515 | "UsbConnector", 3, 516 | "port", Buffer() { 16, 0, 0, 0 }, 517 | }, 518 | }, 519 | }, 520 | "8086_1e31", Package() 521 | { 522 | "port-count", Buffer() { 8, 0, 0, 0 }, 523 | "ports", Package() 524 | { 525 | "HS01", Package() 526 | { 527 | "UsbConnector", 3, 528 | "port", Buffer() { 1, 0, 0, 0 }, 529 | }, 530 | "HS02", Package() 531 | { 532 | "UsbConnector", 3, 533 | "port", Buffer() { 2, 0, 0, 0 }, 534 | }, 535 | "HS03", Package() 536 | { 537 | "UsbConnector", 3, 538 | "port", Buffer() { 3, 0, 0, 0 }, 539 | }, 540 | "HS04", Package() 541 | { 542 | "UsbConnector", 3, 543 | "port", Buffer() { 4, 0, 0, 0 }, 544 | }, 545 | "SS01", Package() 546 | { 547 | "UsbConnector", 3, 548 | "port", Buffer() { 5, 0, 0, 0 }, 549 | }, 550 | "SS02", Package() 551 | { 552 | "UsbConnector", 3, 553 | "port", Buffer() { 6, 0, 0, 0 }, 554 | }, 555 | "SS03", Package() 556 | { 557 | "UsbConnector", 3, 558 | "port", Buffer() { 7, 0, 0, 0 }, 559 | }, 560 | "SS04", Package() 561 | { 562 | "UsbConnector", 3, 563 | "port", Buffer() { 8, 0, 0, 0 }, 564 | }, 565 | }, 566 | }, 567 | "8086_7ae0", Package() 568 | { 569 | "port-count", Buffer() { 26, 0, 0, 0 }, 570 | "ports", Package() 571 | { 572 | "HS01", Package() 573 | { 574 | "UsbConnector", 3, 575 | "port", Buffer() { 1, 0, 0, 0 }, 576 | }, 577 | "HS02", Package() 578 | { 579 | "UsbConnector", 3, 580 | "port", Buffer() { 2, 0, 0, 0 }, 581 | }, 582 | "HS03", Package() 583 | { 584 | "UsbConnector", 3, 585 | "port", Buffer() { 3, 0, 0, 0 }, 586 | }, 587 | "HS04", Package() 588 | { 589 | "UsbConnector", 3, 590 | "port", Buffer() { 4, 0, 0, 0 }, 591 | }, 592 | "HS05", Package() 593 | { 594 | "UsbConnector", 3, 595 | "port", Buffer() { 5, 0, 0, 0 }, 596 | }, 597 | "HS06", Package() 598 | { 599 | "UsbConnector", 3, 600 | "port", Buffer() { 6, 0, 0, 0 }, 601 | }, 602 | "HS07", Package() 603 | { 604 | "UsbConnector", 3, 605 | "port", Buffer() { 7, 0, 0, 0 }, 606 | }, 607 | "HS08", Package() 608 | { 609 | "UsbConnector", 3, 610 | "port", Buffer() { 8, 0, 0, 0 }, 611 | }, 612 | "HS09", Package() 613 | { 614 | "UsbConnector", 3, 615 | "port", Buffer() { 9, 0, 0, 0 }, 616 | }, 617 | "HS10", Package() 618 | { 619 | "UsbConnector", 3, 620 | "port", Buffer() { 10, 0, 0, 0 }, 621 | }, 622 | "HS11", Package() 623 | { 624 | "UsbConnector", 3, 625 | "port", Buffer() { 11, 0, 0, 0 }, 626 | }, 627 | "HS12", Package() 628 | { 629 | "UsbConnector", 3, 630 | "port", Buffer() { 12, 0, 0, 0 }, 631 | }, 632 | "HS13", Package() 633 | { 634 | "UsbConnector", 3, 635 | "port", Buffer() { 13, 0, 0, 0 }, 636 | }, 637 | "HS14", Package() 638 | { 639 | "UsbConnector", 3, 640 | "port", Buffer() { 14, 0, 0, 0 }, 641 | }, 642 | "SS01", Package() 643 | { 644 | "UsbConnector", 3, 645 | "port", Buffer() { 17, 0, 0, 0 }, 646 | }, 647 | "SS02", Package() 648 | { 649 | "UsbConnector", 3, 650 | "port", Buffer() { 18, 0, 0, 0 }, 651 | }, 652 | "SS03", Package() 653 | { 654 | "UsbConnector", 3, 655 | "port", Buffer() { 19, 0, 0, 0 }, 656 | }, 657 | "SS04", Package() 658 | { 659 | "UsbConnector", 3, 660 | "port", Buffer() { 20, 0, 0, 0 }, 661 | }, 662 | "SS05", Package() 663 | { 664 | "UsbConnector", 3, 665 | "port", Buffer() { 21, 0, 0, 0 }, 666 | }, 667 | "SS06", Package() 668 | { 669 | "UsbConnector", 3, 670 | "port", Buffer() { 22, 0, 0, 0 }, 671 | }, 672 | "SS07", Package() 673 | { 674 | "UsbConnector", 3, 675 | "port", Buffer() { 23, 0, 0, 0 }, 676 | }, 677 | "SS08", Package() 678 | { 679 | "UsbConnector", 3, 680 | "port", Buffer() { 24, 0, 0, 0 }, 681 | }, 682 | "SS09", Package() 683 | { 684 | "UsbConnector", 3, 685 | "port", Buffer() { 25, 0, 0, 0 }, 686 | }, 687 | "SS10", Package() 688 | { 689 | "UsbConnector", 3, 690 | "port", Buffer() { 26, 0, 0, 0 }, 691 | }, 692 | "USR1", Package() 693 | { 694 | "UsbConnector", 3, 695 | "port", Buffer() { 15, 0, 0, 0 }, 696 | }, 697 | "USR2", Package() 698 | { 699 | "UsbConnector", 3, 700 | "port", Buffer() { 16, 0, 0, 0 }, 701 | }, 702 | }, 703 | }, 704 | "8086_8xxx", Package() 705 | { 706 | "port-count", Buffer() { 21, 0, 0, 0 }, 707 | "ports", Package() 708 | { 709 | "HS01", Package() 710 | { 711 | "UsbConnector", 3, 712 | "port", Buffer() { 1, 0, 0, 0 }, 713 | }, 714 | "HS02", Package() 715 | { 716 | "UsbConnector", 3, 717 | "port", Buffer() { 2, 0, 0, 0 }, 718 | }, 719 | "HS03", Package() 720 | { 721 | "UsbConnector", 3, 722 | "port", Buffer() { 3, 0, 0, 0 }, 723 | }, 724 | "HS04", Package() 725 | { 726 | "UsbConnector", 3, 727 | "port", Buffer() { 4, 0, 0, 0 }, 728 | }, 729 | "HS05", Package() 730 | { 731 | "UsbConnector", 3, 732 | "port", Buffer() { 5, 0, 0, 0 }, 733 | }, 734 | "HS06", Package() 735 | { 736 | "UsbConnector", 3, 737 | "port", Buffer() { 6, 0, 0, 0 }, 738 | }, 739 | "HS07", Package() 740 | { 741 | "UsbConnector", 3, 742 | "port", Buffer() { 7, 0, 0, 0 }, 743 | }, 744 | "HS08", Package() 745 | { 746 | "UsbConnector", 3, 747 | "port", Buffer() { 8, 0, 0, 0 }, 748 | }, 749 | "HS09", Package() 750 | { 751 | "UsbConnector", 3, 752 | "port", Buffer() { 9, 0, 0, 0 }, 753 | }, 754 | "HS10", Package() 755 | { 756 | "UsbConnector", 3, 757 | "port", Buffer() { 10, 0, 0, 0 }, 758 | }, 759 | "HS11", Package() 760 | { 761 | "UsbConnector", 3, 762 | "port", Buffer() { 11, 0, 0, 0 }, 763 | }, 764 | "HS12", Package() 765 | { 766 | "UsbConnector", 3, 767 | "port", Buffer() { 12, 0, 0, 0 }, 768 | }, 769 | "HS13", Package() 770 | { 771 | "UsbConnector", 3, 772 | "port", Buffer() { 13, 0, 0, 0 }, 773 | }, 774 | "HS14", Package() 775 | { 776 | "UsbConnector", 3, 777 | "port", Buffer() { 14, 0, 0, 0 }, 778 | }, 779 | //HS15 is phantom port (port address 15 not used) 780 | "SS01", Package() 781 | { 782 | "UsbConnector", 3, 783 | "port", Buffer() { 16, 0, 0, 0 }, 784 | }, 785 | "SS02", Package() 786 | { 787 | "UsbConnector", 3, 788 | "port", Buffer() { 17, 0, 0, 0 }, 789 | }, 790 | "SS03", Package() 791 | { 792 | "UsbConnector", 3, 793 | "port", Buffer() { 18, 0, 0, 0 }, 794 | }, 795 | "SS04", Package() 796 | { 797 | "UsbConnector", 3, 798 | "port", Buffer() { 19, 0, 0, 0 }, 799 | }, 800 | "SS05", Package() 801 | { 802 | "UsbConnector", 3, 803 | "port", Buffer() { 20, 0, 0, 0 }, 804 | }, 805 | "SS06", Package() 806 | { 807 | "UsbConnector", 3, 808 | "port", Buffer() { 21, 0, 0, 0 }, 809 | }, 810 | }, 811 | }, 812 | "8086_9xxx", Package() 813 | { 814 | "port-count", Buffer() { 13, 0, 0, 0 }, 815 | "ports", Package() 816 | { 817 | "HS01", Package() 818 | { 819 | "UsbConnector", 3, 820 | "port", Buffer() { 1, 0, 0, 0 }, 821 | }, 822 | "HS02", Package() 823 | { 824 | "UsbConnector", 3, 825 | "port", Buffer() { 2, 0, 0, 0 }, 826 | }, 827 | "HS03", Package() 828 | { 829 | "UsbConnector", 3, 830 | "port", Buffer() { 3, 0, 0, 0 }, 831 | }, 832 | "HS04", Package() 833 | { 834 | "UsbConnector", 3, 835 | "port", Buffer() { 4, 0, 0, 0 }, 836 | }, 837 | "HS05", Package() 838 | { 839 | "UsbConnector", 3, 840 | "port", Buffer() { 5, 0, 0, 0 }, 841 | }, 842 | "HS06", Package() 843 | { 844 | "UsbConnector", 3, 845 | "port", Buffer() { 6, 0, 0, 0 }, 846 | }, 847 | "HS07", Package() 848 | { 849 | "UsbConnector", 3, 850 | "port", Buffer() { 7, 0, 0, 0 }, 851 | }, 852 | "HS08", Package() 853 | { 854 | "UsbConnector", 3, 855 | "port", Buffer() { 8, 0, 0, 0 }, 856 | }, 857 | "HS09", Package() 858 | { 859 | "UsbConnector", 3, 860 | "port", Buffer() { 9, 0, 0, 0 }, 861 | }, 862 | "SS01", Package() 863 | { 864 | "UsbConnector", 3, 865 | "port", Buffer() { 10, 0, 0, 0 }, 866 | }, 867 | "SS02", Package() 868 | { 869 | "UsbConnector", 3, 870 | "port", Buffer() { 11, 0, 0, 0 }, 871 | }, 872 | "SS03", Package() 873 | { 874 | "UsbConnector", 3, 875 | "port", Buffer() { 12, 0, 0, 0 }, 876 | }, 877 | "SS04", Package() 878 | { 879 | "UsbConnector", 3, 880 | "port", Buffer() { 13, 0, 0, 0 }, 881 | }, 882 | }, 883 | }, 884 | "8086_9cb1", Package() 885 | { 886 | "port-count", Buffer() { 15, 0, 0, 0 }, 887 | "ports", Package() 888 | { 889 | "HS01", Package() 890 | { 891 | "UsbConnector", 3, 892 | "port", Buffer() { 1, 0, 0, 0 }, 893 | }, 894 | "HS02", Package() 895 | { 896 | "UsbConnector", 3, 897 | "port", Buffer() { 2, 0, 0, 0 }, 898 | }, 899 | "HS03", Package() 900 | { 901 | "UsbConnector", 3, 902 | "port", Buffer() { 3, 0, 0, 0 }, 903 | }, 904 | "HS04", Package() 905 | { 906 | "UsbConnector", 3, 907 | "port", Buffer() { 4, 0, 0, 0 }, 908 | }, 909 | "HS05", Package() 910 | { 911 | "UsbConnector", 3, 912 | "port", Buffer() { 5, 0, 0, 0 }, 913 | }, 914 | "HS06", Package() 915 | { 916 | "UsbConnector", 3, 917 | "port", Buffer() { 6, 0, 0, 0 }, 918 | }, 919 | "HS07", Package() 920 | { 921 | "UsbConnector", 3, 922 | "port", Buffer() { 7, 0, 0, 0 }, 923 | }, 924 | "HS08", Package() 925 | { 926 | "UsbConnector", 3, 927 | "port", Buffer() { 8, 0, 0, 0 }, 928 | }, 929 | "HS09", Package() 930 | { 931 | "UsbConnector", 3, 932 | "port", Buffer() { 9, 0, 0, 0 }, 933 | }, 934 | "HS10", Package() 935 | { 936 | "UsbConnector", 3, 937 | "port", Buffer() { 10, 0, 0, 0 }, 938 | }, 939 | "HS11", Package() 940 | { 941 | "UsbConnector", 3, 942 | "port", Buffer() { 11, 0, 0, 0 }, 943 | }, 944 | "SS01", Package() 945 | { 946 | "UsbConnector", 3, 947 | "port", Buffer() { 12, 0, 0, 0 }, 948 | }, 949 | "SS02", Package() 950 | { 951 | "UsbConnector", 3, 952 | "port", Buffer() { 13, 0, 0, 0 }, 953 | }, 954 | "SS03", Package() 955 | { 956 | "UsbConnector", 3, 957 | "port", Buffer() { 14, 0, 0, 0 }, 958 | }, 959 | "SS04", Package() 960 | { 961 | "UsbConnector", 3, 962 | "port", Buffer() { 15, 0, 0, 0 }, 963 | }, 964 | }, 965 | }, 966 | "8086_a12f", Package() 967 | { 968 | "port-count", Buffer() { 26, 0, 0, 0 }, 969 | "ports", Package() 970 | { 971 | "HS01", Package() 972 | { 973 | "UsbConnector", 3, 974 | "port", Buffer() { 1, 0, 0, 0 }, 975 | }, 976 | "HS02", Package() 977 | { 978 | "UsbConnector", 3, 979 | "port", Buffer() { 2, 0, 0, 0 }, 980 | }, 981 | "HS03", Package() 982 | { 983 | "UsbConnector", 3, 984 | "port", Buffer() { 3, 0, 0, 0 }, 985 | }, 986 | "HS04", Package() 987 | { 988 | "UsbConnector", 3, 989 | "port", Buffer() { 4, 0, 0, 0 }, 990 | }, 991 | "HS05", Package() 992 | { 993 | "UsbConnector", 3, 994 | "port", Buffer() { 5, 0, 0, 0 }, 995 | }, 996 | "HS06", Package() 997 | { 998 | "UsbConnector", 3, 999 | "port", Buffer() { 6, 0, 0, 0 }, 1000 | }, 1001 | "HS07", Package() 1002 | { 1003 | "UsbConnector", 3, 1004 | "port", Buffer() { 7, 0, 0, 0 }, 1005 | }, 1006 | "HS08", Package() 1007 | { 1008 | "UsbConnector", 3, 1009 | "port", Buffer() { 8, 0, 0, 0 }, 1010 | }, 1011 | "HS09", Package() 1012 | { 1013 | "UsbConnector", 3, 1014 | "port", Buffer() { 9, 0, 0, 0 }, 1015 | }, 1016 | "HS10", Package() 1017 | { 1018 | "UsbConnector", 3, 1019 | "port", Buffer() { 10, 0, 0, 0 }, 1020 | }, 1021 | "HS11", Package() 1022 | { 1023 | "UsbConnector", 3, 1024 | "port", Buffer() { 11, 0, 0, 0 }, 1025 | }, 1026 | "HS12", Package() 1027 | { 1028 | "UsbConnector", 3, 1029 | "port", Buffer() { 12, 0, 0, 0 }, 1030 | }, 1031 | "HS13", Package() 1032 | { 1033 | "UsbConnector", 3, 1034 | "port", Buffer() { 13, 0, 0, 0 }, 1035 | }, 1036 | "HS14", Package() 1037 | { 1038 | "UsbConnector", 3, 1039 | "port", Buffer() { 14, 0, 0, 0 }, 1040 | }, 1041 | "SS01", Package() 1042 | { 1043 | "UsbConnector", 3, 1044 | "port", Buffer() { 17, 0, 0, 0 }, 1045 | }, 1046 | "SS02", Package() 1047 | { 1048 | "UsbConnector", 3, 1049 | "port", Buffer() { 18, 0, 0, 0 }, 1050 | }, 1051 | "SS03", Package() 1052 | { 1053 | "UsbConnector", 3, 1054 | "port", Buffer() { 19, 0, 0, 0 }, 1055 | }, 1056 | "SS04", Package() 1057 | { 1058 | "UsbConnector", 3, 1059 | "port", Buffer() { 20, 0, 0, 0 }, 1060 | }, 1061 | "SS05", Package() 1062 | { 1063 | "UsbConnector", 3, 1064 | "port", Buffer() { 21, 0, 0, 0 }, 1065 | }, 1066 | "SS06", Package() 1067 | { 1068 | "UsbConnector", 3, 1069 | "port", Buffer() { 22, 0, 0, 0 }, 1070 | }, 1071 | "SS07", Package() 1072 | { 1073 | "UsbConnector", 3, 1074 | "port", Buffer() { 23, 0, 0, 0 }, 1075 | }, 1076 | "SS08", Package() 1077 | { 1078 | "UsbConnector", 3, 1079 | "port", Buffer() { 24, 0, 0, 0 }, 1080 | }, 1081 | "SS09", Package() 1082 | { 1083 | "UsbConnector", 3, 1084 | "port", Buffer() { 25, 0, 0, 0 }, 1085 | }, 1086 | "SS10", Package() 1087 | { 1088 | "UsbConnector", 3, 1089 | "port", Buffer() { 26, 0, 0, 0 }, 1090 | }, 1091 | "USR1", Package() 1092 | { 1093 | "UsbConnector", 3, 1094 | "port", Buffer() { 15, 0, 0, 0 }, 1095 | }, 1096 | "USR2", Package() 1097 | { 1098 | "UsbConnector", 3, 1099 | "port", Buffer() { 16, 0, 0, 0 }, 1100 | }, 1101 | }, 1102 | }, 1103 | "8086_9dxx", Package() // examples: 0x9d2f, 0x9ded 1104 | { 1105 | "port-count", Buffer() { 18, 0, 0, 0 }, 1106 | "ports", Package() 1107 | { 1108 | "HS01", Package() 1109 | { 1110 | "UsbConnector", 3, 1111 | "port", Buffer() { 1, 0, 0, 0 }, 1112 | }, 1113 | "HS02", Package() 1114 | { 1115 | "UsbConnector", 3, 1116 | "port", Buffer() { 2, 0, 0, 0 }, 1117 | }, 1118 | "HS03", Package() 1119 | { 1120 | "UsbConnector", 3, 1121 | "port", Buffer() { 3, 0, 0, 0 }, 1122 | }, 1123 | "HS04", Package() 1124 | { 1125 | "UsbConnector", 3, 1126 | "port", Buffer() { 4, 0, 0, 0 }, 1127 | }, 1128 | "HS05", Package() 1129 | { 1130 | "UsbConnector", 3, 1131 | "port", Buffer() { 5, 0, 0, 0 }, 1132 | }, 1133 | "HS06", Package() 1134 | { 1135 | "UsbConnector", 3, 1136 | "port", Buffer() { 6, 0, 0, 0 }, 1137 | }, 1138 | "HS07", Package() 1139 | { 1140 | "UsbConnector", 3, 1141 | "port", Buffer() { 7, 0, 0, 0 }, 1142 | }, 1143 | "HS08", Package() 1144 | { 1145 | "UsbConnector", 3, 1146 | "port", Buffer() { 8, 0, 0, 0 }, 1147 | }, 1148 | "HS09", Package() 1149 | { 1150 | "UsbConnector", 3, 1151 | "port", Buffer() { 9, 0, 0, 0 }, 1152 | }, 1153 | "HS10", Package() 1154 | { 1155 | "UsbConnector", 3, 1156 | "port", Buffer() { 10, 0, 0, 0 }, 1157 | }, 1158 | "SS01", Package() 1159 | { 1160 | "UsbConnector", 3, 1161 | "port", Buffer() { 13, 0, 0, 0 }, 1162 | }, 1163 | "SS02", Package() 1164 | { 1165 | "UsbConnector", 3, 1166 | "port", Buffer() { 14, 0, 0, 0 }, 1167 | }, 1168 | "SS03", Package() 1169 | { 1170 | "UsbConnector", 3, 1171 | "port", Buffer() { 15, 0, 0, 0 }, 1172 | }, 1173 | "SS04", Package() 1174 | { 1175 | "UsbConnector", 3, 1176 | "port", Buffer() { 16, 0, 0, 0 }, 1177 | }, 1178 | "SS05", Package() 1179 | { 1180 | "UsbConnector", 3, 1181 | "port", Buffer() { 17, 0, 0, 0 }, 1182 | }, 1183 | "SS06", Package() 1184 | { 1185 | "UsbConnector", 3, 1186 | "port", Buffer() { 18, 0, 0, 0 }, 1187 | }, 1188 | "USR1", Package() 1189 | { 1190 | "UsbConnector", 3, 1191 | "port", Buffer() { 11, 0, 0, 0 }, 1192 | }, 1193 | "USR2", Package() 1194 | { 1195 | "UsbConnector", 3, 1196 | "port", Buffer() { 12, 0, 0, 0 }, 1197 | }, 1198 | }, 1199 | }, 1200 | "8086_a2af", Package() 1201 | { 1202 | "port-count", Buffer() { 26, 0, 0, 0 }, 1203 | "ports", Package() 1204 | { 1205 | "HS01", Package() 1206 | { 1207 | "UsbConnector", 3, 1208 | "port", Buffer() { 1, 0, 0, 0 }, 1209 | }, 1210 | "HS02", Package() 1211 | { 1212 | "UsbConnector", 3, 1213 | "port", Buffer() { 2, 0, 0, 0 }, 1214 | }, 1215 | "HS03", Package() 1216 | { 1217 | "UsbConnector", 3, 1218 | "port", Buffer() { 3, 0, 0, 0 }, 1219 | }, 1220 | "HS04", Package() 1221 | { 1222 | "UsbConnector", 3, 1223 | "port", Buffer() { 4, 0, 0, 0 }, 1224 | }, 1225 | "HS05", Package() 1226 | { 1227 | "UsbConnector", 3, 1228 | "port", Buffer() { 5, 0, 0, 0 }, 1229 | }, 1230 | "HS06", Package() 1231 | { 1232 | "UsbConnector", 3, 1233 | "port", Buffer() { 6, 0, 0, 0 }, 1234 | }, 1235 | "HS07", Package() 1236 | { 1237 | "UsbConnector", 3, 1238 | "port", Buffer() { 7, 0, 0, 0 }, 1239 | }, 1240 | "HS08", Package() 1241 | { 1242 | "UsbConnector", 3, 1243 | "port", Buffer() { 8, 0, 0, 0 }, 1244 | }, 1245 | "HS09", Package() 1246 | { 1247 | "UsbConnector", 3, 1248 | "port", Buffer() { 9, 0, 0, 0 }, 1249 | }, 1250 | "HS10", Package() 1251 | { 1252 | "UsbConnector", 3, 1253 | "port", Buffer() { 10, 0, 0, 0 }, 1254 | }, 1255 | "HS11", Package() 1256 | { 1257 | "UsbConnector", 3, 1258 | "port", Buffer() { 11, 0, 0, 0 }, 1259 | }, 1260 | "HS12", Package() 1261 | { 1262 | "UsbConnector", 3, 1263 | "port", Buffer() { 12, 0, 0, 0 }, 1264 | }, 1265 | "HS13", Package() 1266 | { 1267 | "UsbConnector", 3, 1268 | "port", Buffer() { 13, 0, 0, 0 }, 1269 | }, 1270 | "HS14", Package() 1271 | { 1272 | "UsbConnector", 3, 1273 | "port", Buffer() { 14, 0, 0, 0 }, 1274 | }, 1275 | "SS01", Package() 1276 | { 1277 | "UsbConnector", 3, 1278 | "port", Buffer() { 17, 0, 0, 0 }, 1279 | }, 1280 | "SS02", Package() 1281 | { 1282 | "UsbConnector", 3, 1283 | "port", Buffer() { 18, 0, 0, 0 }, 1284 | }, 1285 | "SS03", Package() 1286 | { 1287 | "UsbConnector", 3, 1288 | "port", Buffer() { 19, 0, 0, 0 }, 1289 | }, 1290 | "SS04", Package() 1291 | { 1292 | "UsbConnector", 3, 1293 | "port", Buffer() { 20, 0, 0, 0 }, 1294 | }, 1295 | "SS05", Package() 1296 | { 1297 | "UsbConnector", 3, 1298 | "port", Buffer() { 21, 0, 0, 0 }, 1299 | }, 1300 | "SS06", Package() 1301 | { 1302 | "UsbConnector", 3, 1303 | "port", Buffer() { 22, 0, 0, 0 }, 1304 | }, 1305 | "SS07", Package() 1306 | { 1307 | "UsbConnector", 3, 1308 | "port", Buffer() { 23, 0, 0, 0 }, 1309 | }, 1310 | "SS08", Package() 1311 | { 1312 | "UsbConnector", 3, 1313 | "port", Buffer() { 24, 0, 0, 0 }, 1314 | }, 1315 | "SS09", Package() 1316 | { 1317 | "UsbConnector", 3, 1318 | "port", Buffer() { 25, 0, 0, 0 }, 1319 | }, 1320 | "SS10", Package() 1321 | { 1322 | "UsbConnector", 3, 1323 | "port", Buffer() { 26, 0, 0, 0 }, 1324 | }, 1325 | "USR1", Package() 1326 | { 1327 | "UsbConnector", 3, 1328 | "port", Buffer() { 15, 0, 0, 0 }, 1329 | }, 1330 | "USR2", Package() 1331 | { 1332 | "UsbConnector", 3, 1333 | "port", Buffer() { 16, 0, 0, 0 }, 1334 | }, 1335 | }, 1336 | }, 1337 | "8086_a36d", Package() 1338 | { 1339 | "port-count", Buffer() { 26, 0, 0, 0 }, 1340 | "ports", Package() 1341 | { 1342 | "HS01", Package() 1343 | { 1344 | "UsbConnector", 3, 1345 | "port", Buffer() { 1, 0, 0, 0 }, 1346 | }, 1347 | "HS02", Package() 1348 | { 1349 | "UsbConnector", 3, 1350 | "port", Buffer() { 2, 0, 0, 0 }, 1351 | }, 1352 | "HS03", Package() 1353 | { 1354 | "UsbConnector", 3, 1355 | "port", Buffer() { 3, 0, 0, 0 }, 1356 | }, 1357 | "HS04", Package() 1358 | { 1359 | "UsbConnector", 3, 1360 | "port", Buffer() { 4, 0, 0, 0 }, 1361 | }, 1362 | "HS05", Package() 1363 | { 1364 | "UsbConnector", 3, 1365 | "port", Buffer() { 5, 0, 0, 0 }, 1366 | }, 1367 | "HS06", Package() 1368 | { 1369 | "UsbConnector", 3, 1370 | "port", Buffer() { 6, 0, 0, 0 }, 1371 | }, 1372 | "HS07", Package() 1373 | { 1374 | "UsbConnector", 3, 1375 | "port", Buffer() { 7, 0, 0, 0 }, 1376 | }, 1377 | "HS08", Package() 1378 | { 1379 | "UsbConnector", 3, 1380 | "port", Buffer() { 8, 0, 0, 0 }, 1381 | }, 1382 | "HS09", Package() 1383 | { 1384 | "UsbConnector", 3, 1385 | "port", Buffer() { 9, 0, 0, 0 }, 1386 | }, 1387 | "HS10", Package() 1388 | { 1389 | "UsbConnector", 3, 1390 | "port", Buffer() { 10, 0, 0, 0 }, 1391 | }, 1392 | "HS11", Package() 1393 | { 1394 | "UsbConnector", 3, 1395 | "port", Buffer() { 11, 0, 0, 0 }, 1396 | }, 1397 | "HS12", Package() 1398 | { 1399 | "UsbConnector", 3, 1400 | "port", Buffer() { 12, 0, 0, 0 }, 1401 | }, 1402 | "HS13", Package() 1403 | { 1404 | "UsbConnector", 3, 1405 | "port", Buffer() { 13, 0, 0, 0 }, 1406 | }, 1407 | "HS14", Package() 1408 | { 1409 | "UsbConnector", 3, 1410 | "port", Buffer() { 14, 0, 0, 0 }, 1411 | }, 1412 | "SS01", Package() 1413 | { 1414 | "UsbConnector", 3, 1415 | "port", Buffer() { 17, 0, 0, 0 }, 1416 | }, 1417 | "SS02", Package() 1418 | { 1419 | "UsbConnector", 3, 1420 | "port", Buffer() { 18, 0, 0, 0 }, 1421 | }, 1422 | "SS03", Package() 1423 | { 1424 | "UsbConnector", 3, 1425 | "port", Buffer() { 19, 0, 0, 0 }, 1426 | }, 1427 | "SS04", Package() 1428 | { 1429 | "UsbConnector", 3, 1430 | "port", Buffer() { 20, 0, 0, 0 }, 1431 | }, 1432 | "SS05", Package() 1433 | { 1434 | "UsbConnector", 3, 1435 | "port", Buffer() { 21, 0, 0, 0 }, 1436 | }, 1437 | "SS06", Package() 1438 | { 1439 | "UsbConnector", 3, 1440 | "port", Buffer() { 22, 0, 0, 0 }, 1441 | }, 1442 | "SS07", Package() 1443 | { 1444 | "UsbConnector", 3, 1445 | "port", Buffer() { 23, 0, 0, 0 }, 1446 | }, 1447 | "SS08", Package() 1448 | { 1449 | "UsbConnector", 3, 1450 | "port", Buffer() { 24, 0, 0, 0 }, 1451 | }, 1452 | "SS09", Package() 1453 | { 1454 | "UsbConnector", 3, 1455 | "port", Buffer() { 25, 0, 0, 0 }, 1456 | }, 1457 | "SS10", Package() 1458 | { 1459 | "UsbConnector", 3, 1460 | "port", Buffer() { 26, 0, 0, 0 }, 1461 | }, 1462 | "USR1", Package() 1463 | { 1464 | "UsbConnector", 3, 1465 | "port", Buffer() { 15, 0, 0, 0 }, 1466 | }, 1467 | "USR2", Package() 1468 | { 1469 | "UsbConnector", 3, 1470 | "port", Buffer() { 16, 0, 0, 0 }, 1471 | }, 1472 | }, 1473 | }, 1474 | "8086_a3af", Package() 1475 | { 1476 | "port-count", Buffer() { 26, 0, 0, 0 }, 1477 | "ports", Package() 1478 | { 1479 | "HS01", Package() 1480 | { 1481 | "UsbConnector", 3, 1482 | "port", Buffer() { 1, 0, 0, 0 }, 1483 | }, 1484 | "HS02", Package() 1485 | { 1486 | "UsbConnector", 3, 1487 | "port", Buffer() { 2, 0, 0, 0 }, 1488 | }, 1489 | "HS03", Package() 1490 | { 1491 | "UsbConnector", 3, 1492 | "port", Buffer() { 3, 0, 0, 0 }, 1493 | }, 1494 | "HS04", Package() 1495 | { 1496 | "UsbConnector", 3, 1497 | "port", Buffer() { 4, 0, 0, 0 }, 1498 | }, 1499 | "HS05", Package() 1500 | { 1501 | "UsbConnector", 3, 1502 | "port", Buffer() { 5, 0, 0, 0 }, 1503 | }, 1504 | "HS06", Package() 1505 | { 1506 | "UsbConnector", 3, 1507 | "port", Buffer() { 6, 0, 0, 0 }, 1508 | }, 1509 | "HS07", Package() 1510 | { 1511 | "UsbConnector", 3, 1512 | "port", Buffer() { 7, 0, 0, 0 }, 1513 | }, 1514 | "HS08", Package() 1515 | { 1516 | "UsbConnector", 3, 1517 | "port", Buffer() { 8, 0, 0, 0 }, 1518 | }, 1519 | "HS09", Package() 1520 | { 1521 | "UsbConnector", 3, 1522 | "port", Buffer() { 9, 0, 0, 0 }, 1523 | }, 1524 | "HS10", Package() 1525 | { 1526 | "UsbConnector", 3, 1527 | "port", Buffer() { 10, 0, 0, 0 }, 1528 | }, 1529 | "HS11", Package() 1530 | { 1531 | "UsbConnector", 3, 1532 | "port", Buffer() { 11, 0, 0, 0 }, 1533 | }, 1534 | "HS12", Package() 1535 | { 1536 | "UsbConnector", 3, 1537 | "port", Buffer() { 12, 0, 0, 0 }, 1538 | }, 1539 | "HS13", Package() 1540 | { 1541 | "UsbConnector", 3, 1542 | "port", Buffer() { 13, 0, 0, 0 }, 1543 | }, 1544 | "HS14", Package() 1545 | { 1546 | "UsbConnector", 3, 1547 | "port", Buffer() { 14, 0, 0, 0 }, 1548 | }, 1549 | "SS01", Package() 1550 | { 1551 | "UsbConnector", 3, 1552 | "port", Buffer() { 17, 0, 0, 0 }, 1553 | }, 1554 | "SS02", Package() 1555 | { 1556 | "UsbConnector", 3, 1557 | "port", Buffer() { 18, 0, 0, 0 }, 1558 | }, 1559 | "SS03", Package() 1560 | { 1561 | "UsbConnector", 3, 1562 | "port", Buffer() { 19, 0, 0, 0 }, 1563 | }, 1564 | "SS04", Package() 1565 | { 1566 | "UsbConnector", 3, 1567 | "port", Buffer() { 20, 0, 0, 0 }, 1568 | }, 1569 | "SS05", Package() 1570 | { 1571 | "UsbConnector", 3, 1572 | "port", Buffer() { 21, 0, 0, 0 }, 1573 | }, 1574 | "SS06", Package() 1575 | { 1576 | "UsbConnector", 3, 1577 | "port", Buffer() { 22, 0, 0, 0 }, 1578 | }, 1579 | "SS07", Package() 1580 | { 1581 | "UsbConnector", 3, 1582 | "port", Buffer() { 23, 0, 0, 0 }, 1583 | }, 1584 | "SS08", Package() 1585 | { 1586 | "UsbConnector", 3, 1587 | "port", Buffer() { 24, 0, 0, 0 }, 1588 | }, 1589 | "SS09", Package() 1590 | { 1591 | "UsbConnector", 3, 1592 | "port", Buffer() { 25, 0, 0, 0 }, 1593 | }, 1594 | "SS10", Package() 1595 | { 1596 | "UsbConnector", 3, 1597 | "port", Buffer() { 26, 0, 0, 0 }, 1598 | }, 1599 | "USR1", Package() 1600 | { 1601 | "UsbConnector", 3, 1602 | "port", Buffer() { 15, 0, 0, 0 }, 1603 | }, 1604 | "USR2", Package() 1605 | { 1606 | "UsbConnector", 3, 1607 | "port", Buffer() { 16, 0, 0, 0 }, 1608 | }, 1609 | }, 1610 | }, 1611 | "8086_43ed", Package() 1612 | { 1613 | "port-count", Buffer() { 26, 0, 0, 0 }, 1614 | "ports", Package() 1615 | { 1616 | "HS01", Package() 1617 | { 1618 | "UsbConnector", 3, 1619 | "port", Buffer() { 1, 0, 0, 0 }, 1620 | }, 1621 | "HS02", Package() 1622 | { 1623 | "UsbConnector", 3, 1624 | "port", Buffer() { 2, 0, 0, 0 }, 1625 | }, 1626 | "HS03", Package() 1627 | { 1628 | "UsbConnector", 3, 1629 | "port", Buffer() { 3, 0, 0, 0 }, 1630 | }, 1631 | "HS04", Package() 1632 | { 1633 | "UsbConnector", 3, 1634 | "port", Buffer() { 4, 0, 0, 0 }, 1635 | }, 1636 | "HS05", Package() 1637 | { 1638 | "UsbConnector", 3, 1639 | "port", Buffer() { 5, 0, 0, 0 }, 1640 | }, 1641 | "HS06", Package() 1642 | { 1643 | "UsbConnector", 3, 1644 | "port", Buffer() { 6, 0, 0, 0 }, 1645 | }, 1646 | "HS07", Package() 1647 | { 1648 | "UsbConnector", 3, 1649 | "port", Buffer() { 7, 0, 0, 0 }, 1650 | }, 1651 | "HS08", Package() 1652 | { 1653 | "UsbConnector", 3, 1654 | "port", Buffer() { 8, 0, 0, 0 }, 1655 | }, 1656 | "HS09", Package() 1657 | { 1658 | "UsbConnector", 3, 1659 | "port", Buffer() { 9, 0, 0, 0 }, 1660 | }, 1661 | "HS10", Package() 1662 | { 1663 | "UsbConnector", 3, 1664 | "port", Buffer() { 10, 0, 0, 0 }, 1665 | }, 1666 | "HS11", Package() 1667 | { 1668 | "UsbConnector", 3, 1669 | "port", Buffer() { 11, 0, 0, 0 }, 1670 | }, 1671 | "HS12", Package() 1672 | { 1673 | "UsbConnector", 3, 1674 | "port", Buffer() { 12, 0, 0, 0 }, 1675 | }, 1676 | "HS13", Package() 1677 | { 1678 | "UsbConnector", 3, 1679 | "port", Buffer() { 13, 0, 0, 0 }, 1680 | }, 1681 | "HS14", Package() 1682 | { 1683 | "UsbConnector", 3, 1684 | "port", Buffer() { 14, 0, 0, 0 }, 1685 | }, 1686 | "SS01", Package() 1687 | { 1688 | "UsbConnector", 3, 1689 | "port", Buffer() { 17, 0, 0, 0 }, 1690 | }, 1691 | "SS02", Package() 1692 | { 1693 | "UsbConnector", 3, 1694 | "port", Buffer() { 18, 0, 0, 0 }, 1695 | }, 1696 | "SS03", Package() 1697 | { 1698 | "UsbConnector", 3, 1699 | "port", Buffer() { 19, 0, 0, 0 }, 1700 | }, 1701 | "SS04", Package() 1702 | { 1703 | "UsbConnector", 3, 1704 | "port", Buffer() { 20, 0, 0, 0 }, 1705 | }, 1706 | "SS05", Package() 1707 | { 1708 | "UsbConnector", 3, 1709 | "port", Buffer() { 21, 0, 0, 0 }, 1710 | }, 1711 | "SS06", Package() 1712 | { 1713 | "UsbConnector", 3, 1714 | "port", Buffer() { 22, 0, 0, 0 }, 1715 | }, 1716 | "SS07", Package() 1717 | { 1718 | "UsbConnector", 3, 1719 | "port", Buffer() { 23, 0, 0, 0 }, 1720 | }, 1721 | "SS08", Package() 1722 | { 1723 | "UsbConnector", 3, 1724 | "port", Buffer() { 24, 0, 0, 0 }, 1725 | }, 1726 | "SS09", Package() 1727 | { 1728 | "UsbConnector", 3, 1729 | "port", Buffer() { 25, 0, 0, 0 }, 1730 | }, 1731 | "SS10", Package() 1732 | { 1733 | "UsbConnector", 3, 1734 | "port", Buffer() { 26, 0, 0, 0 }, 1735 | }, 1736 | "USR1", Package() 1737 | { 1738 | "UsbConnector", 3, 1739 | "port", Buffer() { 15, 0, 0, 0 }, 1740 | }, 1741 | "USR2", Package() 1742 | { 1743 | "UsbConnector", 3, 1744 | "port", Buffer() { 16, 0, 0, 0 }, 1745 | }, 1746 | }, 1747 | }, 1748 | }) 1749 | } 1750 | } 1751 | //EOF 1752 | -------------------------------------------------------------------------------- /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 | // Override for host defined _OSI to handle "Darwin"... 2 | 3 | #ifndef NO_DEFINITIONBLOCK 4 | DefinitionBlock("", "SSDT", 2, "hack", "_XOSI", 0) 5 | { 6 | #endif 7 | // All _OSI calls in DSDT are routed to XOSI... 8 | // As written, this XOSI simulates "Windows 2015" (which is Windows 10) 9 | // Note: According to ACPI spec, _OSI("Windows") must also return true 10 | // Also, it should return true for all previous versions of Windows. 11 | Method(XOSI, 1) 12 | { 13 | // simulation targets 14 | // source: (google 'Microsoft Windows _OSI') 15 | // https://docs.microsoft.com/en-us/windows-hardware/drivers/acpi/winacpi-osi 16 | Local0 = Package() 17 | { 18 | "Windows", // generic Windows query 19 | "Windows 2001", // Windows XP 20 | "Windows 2001 SP2", // Windows XP SP2 21 | //"Windows 2001.1", // Windows Server 2003 22 | //"Windows 2001.1 SP1", // Windows Server 2003 SP1 23 | "Windows 2006", // Windows Vista 24 | "Windows 2006 SP1", // Windows Vista SP1 25 | "Windows 2006.1", // Windows Server 2008 26 | "Windows 2009", // Windows 7/Windows Server 2008 R2 27 | "Windows 2012", // Windows 8/Windows Server 2012 28 | "Windows 2013", // Windows 8.1/Windows Server 2012 R2 29 | "Windows 2015", // Windows 10/Windows Server TP 30 | "Windows 2016", // Windows 10, version 1607 31 | "Windows 2017", // Windows 10, version 1703 32 | "Windows 2017.2", // Windows 10, version 1709 33 | "Windows 2018", // Windows 10, version 1803 34 | "Windows 2018.2", // Windows 10, version 1809 35 | "Windows 2019", // Windows 10, version 1903 36 | } 37 | Return (Ones != Match(Local0, MEQ, Arg0, MTR, 0, 0)) 38 | } 39 | #ifndef NO_DEFINITIONBLOCK 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /USBInjectAll.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 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 = "$(PROJECT_DIR)/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 | BuildIndependentTargetsInParallel = YES; 193 | LastUpgradeCheck = 1200; 194 | TargetAttributes = { 195 | 84D9F2A91BD60EA9003FC186 = { 196 | CreatedOnToolsVersion = 7.0.1; 197 | }; 198 | }; 199 | }; 200 | buildConfigurationList = 0C4B237614598AD10080D960 /* Build configuration list for PBXProject "USBInjectAll" */; 201 | compatibilityVersion = "Xcode 3.2"; 202 | developmentRegion = en; 203 | hasScannedForEncodings = 0; 204 | knownRegions = ( 205 | en, 206 | Base, 207 | ); 208 | mainGroup = 0C4B237114598AD10080D960; 209 | productRefGroup = 0C4B237F14598AD20080D960 /* Products */; 210 | projectDirPath = ""; 211 | projectRoot = ""; 212 | targets = ( 213 | 84D9F2A91BD60EA9003FC186 /* PreBuild */, 214 | 0C4B237D14598AD20080D960 /* USBInjectAll */, 215 | ); 216 | }; 217 | /* End PBXProject section */ 218 | 219 | /* Begin PBXResourcesBuildPhase section */ 220 | 0C4B237B14598AD20080D960 /* Resources */ = { 221 | isa = PBXResourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | /* End PBXResourcesBuildPhase section */ 228 | 229 | /* Begin PBXRezBuildPhase section */ 230 | 0C4B237C14598AD20080D960 /* Rez */ = { 231 | isa = PBXRezBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXRezBuildPhase section */ 238 | 239 | /* Begin PBXSourcesBuildPhase section */ 240 | 0C4B237814598AD20080D960 /* Sources */ = { 241 | isa = PBXSourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | 849921901600F4FC00CCDF3B /* USBInjectAll.cpp in Sources */, 245 | EDF7E2D9218A289A00A059C3 /* strstr.cpp in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXSourcesBuildPhase section */ 250 | 251 | /* Begin XCBuildConfiguration section */ 252 | 0C4B238E14598AD20080D960 /* Debug */ = { 253 | isa = XCBuildConfiguration; 254 | buildSettings = { 255 | ALWAYS_SEARCH_USER_PATHS = NO; 256 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 257 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 258 | CLANG_WARN_BOOL_CONVERSION = YES; 259 | CLANG_WARN_COMMA = YES; 260 | CLANG_WARN_CONSTANT_CONVERSION = YES; 261 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INFINITE_RECURSION = YES; 265 | CLANG_WARN_INT_CONVERSION = YES; 266 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 268 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 269 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 270 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 271 | CLANG_WARN_STRICT_PROTOTYPES = YES; 272 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 273 | CLANG_WARN_UNREACHABLE_CODE = YES; 274 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 275 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 276 | DEPLOYMENT_POSTPROCESSING = YES; 277 | ENABLE_STRICT_OBJC_MSGSEND = YES; 278 | ENABLE_TESTABILITY = YES; 279 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 280 | GCC_NO_COMMON_BLOCKS = YES; 281 | GCC_PREPROCESSOR_DEFINITIONS = ( 282 | "DEBUG=1", 283 | "DEBUG_MSG=1", 284 | "LOGNAME=\\\"${LOGNAME}\\\"", 285 | "$(inherited)", 286 | ); 287 | GCC_SYMBOLS_PRIVATE_EXTERN = YES; 288 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 289 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 290 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 291 | GCC_WARN_UNDECLARED_SELECTOR = YES; 292 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 293 | GCC_WARN_UNUSED_FUNCTION = 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.7; 299 | ONLY_ACTIVE_ARCH = YES; 300 | OTHER_CFLAGS = "-fno-stack-protector"; 301 | "OTHER_LDFLAGS[arch=x86_64]" = "-dead_strip"; 302 | SDKROOT = macosx; 303 | STRIP_STYLE = "non-global"; 304 | SYMROOT = build/Products; 305 | }; 306 | name = Debug; 307 | }; 308 | 0C4B238F14598AD20080D960 /* Release */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 313 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 314 | CLANG_WARN_BOOL_CONVERSION = YES; 315 | CLANG_WARN_COMMA = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 318 | CLANG_WARN_EMPTY_BODY = YES; 319 | CLANG_WARN_ENUM_CONVERSION = YES; 320 | CLANG_WARN_INFINITE_RECURSION = YES; 321 | CLANG_WARN_INT_CONVERSION = YES; 322 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 323 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 324 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 325 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 326 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 327 | CLANG_WARN_STRICT_PROTOTYPES = YES; 328 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 329 | CLANG_WARN_UNREACHABLE_CODE = YES; 330 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 331 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 332 | DEPLOYMENT_POSTPROCESSING = YES; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 335 | GCC_NO_COMMON_BLOCKS = YES; 336 | GCC_PREPROCESSOR_DEFINITIONS = "LOGNAME=\\\"${LOGNAME}\\\""; 337 | GCC_SYMBOLS_PRIVATE_EXTERN = YES; 338 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 339 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | LLVM_LTO = NO; 346 | "LLVM_LTO[arch=x86_64]" = YES; 347 | MACOSX_DEPLOYMENT_TARGET = 10.11; 348 | MODULE_VERSION = 0.7.7; 349 | OTHER_CFLAGS = "-fno-stack-protector"; 350 | "OTHER_LDFLAGS[arch=x86_64]" = "-dead_strip"; 351 | SDKROOT = macosx; 352 | STRIP_STYLE = "non-global"; 353 | SYMROOT = build/Products; 354 | }; 355 | name = Release; 356 | }; 357 | 0C4B239114598AD20080D960 /* Debug */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | CLANG_ANALYZER_DEADCODE_DEADSTORES = NO; 361 | CLANG_ANALYZER_DIVIDE_BY_ZERO = NO; 362 | CLANG_ANALYZER_NULL_DEREFERENCE = NO; 363 | CLANG_ENABLE_OBJC_WEAK = YES; 364 | CODE_SIGN_IDENTITY = "-"; 365 | COMBINE_HIDPI_IMAGES = YES; 366 | CURRENT_PROJECT_VERSION = 1; 367 | DEVELOPMENT_TEAM = ""; 368 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 369 | GCC_PREFIX_HEADER = "USBInjectAll/USBInjectAll-Prefix.pch"; 370 | INFOPLIST_FILE = "USBInjectAll/USBInjectAll-Info.plist"; 371 | MARKETING_VERSION = 0.8.1; 372 | MODULE_NAME = com.rehabman.driver.USBInjectAll; 373 | MODULE_VERSION = 0.8.1; 374 | PRODUCT_BUNDLE_IDENTIFIER = "${MODULE_NAME}"; 375 | PRODUCT_NAME = USBInjectAll; 376 | RUN_CLANG_STATIC_ANALYZER = YES; 377 | STRIP_INSTALLED_PRODUCT = YES; 378 | }; 379 | name = Debug; 380 | }; 381 | 0C4B239214598AD20080D960 /* Release */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | CLANG_ENABLE_OBJC_WEAK = YES; 385 | CODE_SIGN_IDENTITY = "-"; 386 | COMBINE_HIDPI_IMAGES = YES; 387 | CURRENT_PROJECT_VERSION = 1; 388 | DEVELOPMENT_TEAM = ""; 389 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 390 | GCC_PREFIX_HEADER = "USBInjectAll/USBInjectAll-Prefix.pch"; 391 | INFOPLIST_FILE = "USBInjectAll/USBInjectAll-Info.plist"; 392 | MARKETING_VERSION = 0.8.1; 393 | MODULE_NAME = com.rehabman.driver.USBInjectAll; 394 | MODULE_VERSION = 0.8.1; 395 | PRODUCT_BUNDLE_IDENTIFIER = "${MODULE_NAME}"; 396 | PRODUCT_NAME = USBInjectAll; 397 | STRIP_INSTALLED_PRODUCT = YES; 398 | }; 399 | name = Release; 400 | }; 401 | 84D9F2AA1BD60EA9003FC186 /* Debug */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 405 | CLANG_CXX_LIBRARY = "libc++"; 406 | CLANG_ENABLE_MODULES = YES; 407 | CLANG_ENABLE_OBJC_ARC = no; 408 | CLANG_ENABLE_OBJC_WEAK = YES; 409 | CLANG_WARN_BOOL_CONVERSION = YES; 410 | CLANG_WARN_CONSTANT_CONVERSION = YES; 411 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 412 | CLANG_WARN_EMPTY_BODY = YES; 413 | CLANG_WARN_ENUM_CONVERSION = YES; 414 | CLANG_WARN_INT_CONVERSION = YES; 415 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUGGING_SYMBOLS = YES; 420 | DEBUG_INFORMATION_FORMAT = dwarf; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | ENABLE_TESTABILITY = YES; 423 | GCC_C_LANGUAGE_STANDARD = gnu99; 424 | GCC_DYNAMIC_NO_PIC = NO; 425 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 426 | GCC_NO_COMMON_BLOCKS = YES; 427 | GCC_OPTIMIZATION_LEVEL = 0; 428 | GCC_PREPROCESSOR_DEFINITIONS = ( 429 | "DEBUG=1", 430 | "$(inherited)", 431 | ); 432 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 433 | GCC_WARN_UNDECLARED_SELECTOR = YES; 434 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 435 | GCC_WARN_UNUSED_FUNCTION = YES; 436 | MODULE_VERSION = 0.7.7; 437 | MTL_ENABLE_DEBUG_INFO = YES; 438 | ONLY_ACTIVE_ARCH = YES; 439 | OTHER_CFLAGS = ""; 440 | OTHER_LDFLAGS = ""; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | }; 443 | name = Debug; 444 | }; 445 | 84D9F2AB1BD60EA9003FC186 /* Release */ = { 446 | isa = XCBuildConfiguration; 447 | buildSettings = { 448 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 449 | CLANG_CXX_LIBRARY = "libc++"; 450 | CLANG_ENABLE_MODULES = YES; 451 | CLANG_ENABLE_OBJC_ARC = no; 452 | CLANG_ENABLE_OBJC_WEAK = YES; 453 | CLANG_WARN_BOOL_CONVERSION = YES; 454 | CLANG_WARN_CONSTANT_CONVERSION = YES; 455 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 456 | CLANG_WARN_EMPTY_BODY = YES; 457 | CLANG_WARN_ENUM_CONVERSION = YES; 458 | CLANG_WARN_INT_CONVERSION = YES; 459 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 460 | CLANG_WARN_UNREACHABLE_CODE = YES; 461 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 462 | COPY_PHASE_STRIP = NO; 463 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 464 | ENABLE_NS_ASSERTIONS = NO; 465 | ENABLE_STRICT_OBJC_MSGSEND = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu99; 467 | GCC_NO_COMMON_BLOCKS = YES; 468 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 469 | GCC_WARN_UNDECLARED_SELECTOR = YES; 470 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 471 | GCC_WARN_UNUSED_FUNCTION = YES; 472 | MODULE_VERSION = 0.7.7; 473 | MTL_ENABLE_DEBUG_INFO = NO; 474 | OTHER_CFLAGS = ""; 475 | OTHER_LDFLAGS = ""; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 0C4B237614598AD10080D960 /* Build configuration list for PBXProject "USBInjectAll" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 0C4B238E14598AD20080D960 /* Debug */, 487 | 0C4B238F14598AD20080D960 /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | 0C4B239014598AD20080D960 /* Build configuration list for PBXNativeTarget "USBInjectAll" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 0C4B239114598AD20080D960 /* Debug */, 496 | 0C4B239214598AD20080D960 /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | 84D9F2AC1BD60EA9003FC186 /* Build configuration list for PBXLegacyTarget "PreBuild" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | 84D9F2AA1BD60EA9003FC186 /* Debug */, 505 | 84D9F2AB1BD60EA9003FC186 /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | /* End XCConfigurationList section */ 511 | }; 512 | rootObject = 0C4B237314598AD10080D960 /* Project object */; 513 | } 514 | -------------------------------------------------------------------------------- /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 | 57 | 58 | 64 | 65 | 66 | 67 | 73 | 74 | 80 | 81 | 82 | 83 | 85 | 86 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /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 | OSSafeReleaseNULL(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 | OSSafeReleaseNULL(r); 466 | 467 | // must be dictionary after translation, even though array is possible 468 | OSDictionary* result = OSDynamicCast(OSDictionary, obj); 469 | if (!result) 470 | { 471 | OSSafeReleaseNULL(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 | -------------------------------------------------------------------------------- /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 | IOClass 45 | AppleUSBXHCILPTH 46 | IOPCIPauseCompatible 47 | 48 | IOPCIPrimaryMatch 49 | 0x8d318086 50 | IOPCITunnelCompatible 51 | 52 | IOProbeScore 53 | 900 54 | IOProviderClass 55 | IOPCIDevice 56 | alternate:IOClass 57 | AppleUSBXHCILPTHB 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 0x02ed8086 86 | IOPCITunnelCompatible 87 | 88 | IOProbeScore 89 | 900 90 | IOProviderClass 91 | IOPCIDevice 92 | 93 | AppleUSBXHCISPT 400 94 | 95 | CFBundleIdentifier 96 | com.apple.driver.usb.AppleUSBXHCIPCI 97 | IOClass 98 | AppleUSBXHCISPT 99 | IOPCIPauseCompatible 100 | 101 | IOPCIPrimaryMatch 102 | 0x34ed8086 0x06ed8086 0xa3af8086 103 | IOPCITunnelCompatible 104 | 105 | IOProbeScore 106 | 900 107 | IOProviderClass 108 | IOPCIDevice 109 | 110 | AppleUSBXHCISPT 500 111 | 112 | CFBundleIdentifier 113 | com.apple.driver.usb.AppleUSBXHCIPCI 114 | IOClass 115 | AppleUSBXHCISPT 116 | IOPCIPauseCompatible 117 | 118 | IOPCIPrimaryMatch 119 | 0x43ed8086 0xa0ed8086 120 | IOPCITunnelCompatible 121 | 122 | IOProbeScore 123 | 900 124 | IOProviderClass 125 | IOPCIDevice 126 | 127 | AppleUSBXHCISPT 600 128 | 129 | CFBundleIdentifier 130 | com.apple.driver.usb.AppleUSBXHCIPCI 131 | IOClass 132 | AppleUSBXHCISPT 133 | IOPCIPauseCompatible 134 | 135 | IOPCIPrimaryMatch 136 | 0x51ed8086 0x7ae08086 137 | IOPCITunnelCompatible 138 | 139 | IOProbeScore 140 | 900 141 | IOProviderClass 142 | IOPCIDevice 143 | 144 | AppleUSBXHCISPT 700 145 | 146 | CFBundleIdentifier 147 | com.apple.driver.usb.AppleUSBXHCIPCI 148 | IOClass 149 | AppleUSBXHCISPT 150 | IOPCIPauseCompatible 151 | 152 | IOPCIPrimaryMatch 153 | 0x7a608086 154 | IOPCITunnelCompatible 155 | 156 | IOProbeScore 157 | 900 158 | IOProviderClass 159 | IOPCIDevice 160 | 161 | 162 | OSBundleRequired 163 | Root 164 | 165 | 166 | -------------------------------------------------------------------------------- /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 | Find 54 | g72M/v//EA== 55 | MatchOS 56 | 10.11.x 57 | Name 58 | com.apple.driver.usb.AppleUSBXHCIPCI 59 | Replace 60 | g72M/v//Gw== 61 | 62 | 63 | Comment 64 | change 15 port limit to 26 in XHCI kext 65 | Find 66 | g710////EA== 67 | MatchOS 68 | 10.12.x 69 | Name 70 | com.apple.driver.usb.AppleUSBXHCIPCI 71 | Replace 72 | g710////Gw== 73 | 74 | 75 | Comment 76 | change 15 port limit to 26 in XHCI kext 77 | Find 78 | g32MEA== 79 | MatchOS 80 | 10.13.0,10.13.1,10.13.2,10.13.3 81 | Name 82 | com.apple.driver.usb.AppleUSBXHCIPCI 83 | Replace 84 | g32MGw== 85 | 86 | 87 | Comment 88 | disable port limit in XHCI kext (credit PMHeart) 89 | Find 90 | g32UDw+DlwQAAA== 91 | MatchOS 92 | 10.13.4,10.13.5 93 | Name 94 | com.apple.driver.usb.AppleUSBXHCI 95 | Replace 96 | g32UD5CQkJCQkA== 97 | 98 | 99 | Comment 100 | change 15 port limit to 26 in XHCI kext (credit FredWst) 101 | Find 102 | g32UDw+DlwQ= 103 | MatchOS 104 | 10.13.4,10.13.5 105 | Name 106 | com.apple.driver.usb.AppleUSBXHCI 107 | Replace 108 | g32UGg+DlwQ= 109 | 110 | 111 | Comment 112 | disable port limit in XHCI kext (credit RehabMan, based prior PMHeart patch) 113 | Find 114 | g32IDw+DpwQAAA== 115 | MatchOS 116 | 10.13.6 117 | Name 118 | com.apple.driver.usb.AppleUSBXHCI 119 | Replace 120 | g32ID5CQkJCQkA== 121 | 122 | 123 | Comment 124 | USB port limit patch #1/4 10.14.x modify by DalianSky (credit ydeng) 125 | Find 126 | g/sPDw== 127 | MatchOS 128 | 10.14.x 129 | Name 130 | com.apple.iokit.IOUSBHostFamily 131 | Replace 132 | g/s/Dw== 133 | 134 | 135 | Comment 136 | USB port limit patch #2/4 10.14.x modify by DalianSky (credit PMHeart) 137 | Find 138 | g+MP0w== 139 | MatchOS 140 | 10.14.x 141 | Name 142 | com.apple.iokit.IOUSBHostFamily 143 | Replace 144 | g+M/0w== 145 | 146 | 147 | Comment 148 | USB Port limit patch #3/4 10.14.x modify by DalianSky (credit PMheart) 149 | Find 150 | g/sPDw== 151 | MatchOS 152 | 10.14.x 153 | Name 154 | com.apple.driver.usb.AppleUSBXHCI 155 | Replace 156 | g/s/Dw== 157 | 158 | 159 | Comment 160 | USB Port limit patch #4/4 10.14.x modify by DalianSky (credit PMheart) 161 | Find 162 | g/8PDw== 163 | MatchOS 164 | 10.14.x 165 | Name 166 | com.apple.driver.usb.AppleUSBXHCI 167 | Replace 168 | g/8/Dw== 169 | 170 | 171 | Comment 172 | USB Port limit patch #1/2 10.15.x (credit DalianSky) 173 | Find 174 | g/sPDw== 175 | MatchOS 176 | 10.15.x 177 | Name 178 | com.apple.iokit.IOUSBHostFamily 179 | Replace 180 | g/s/Dw== 181 | 182 | 183 | Comment 184 | USB Port limit patch #2/2 10.15.x (credit DalianSky) 185 | Find 186 | g/kPDw== 187 | MatchOS 188 | 10.15.x 189 | Name 190 | com.apple.driver.usb.AppleUSBXHCI 191 | Replace 192 | g/k/Dw== 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /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 | mergeModelData "MacBookPro15,3" 56 | mergeModelData "MacBookPro15,4" 57 | mergeModelData "MacBookPro16,1" 58 | mergeModelData "MacBookPro16,2" 59 | mergeModelData "MacBookPro16,3" 60 | mergeModelData "MacBookPro16,4" 61 | 62 | # MacBookAir 63 | mergeModelData "MacBookAir4,1" EHCI 64 | mergeModelData "MacBookAir4,2" EHCI 65 | mergeModelData "MacBookAir5,1" EHCI 66 | mergeModelData "MacBookAir5,2" EHCI 67 | mergeModelData "MacBookAir6,1" EHCI 68 | mergeModelData "MacBookAir6,2" EHCI 69 | mergeModelData "MacBookAir7,1" EHCI 70 | mergeModelData "MacBookAir7,2" EHCI 71 | mergeModelData "MacBookAir8,1" 72 | mergeModelData "MacBookAir8,2" 73 | mergeModelData "MacBookAir9,1" 74 | 75 | # iMac 76 | mergeModelData "iMac4,1" EHCI 77 | mergeModelData "iMac4,2" EHCI 78 | mergeModelData "iMac5,1" EHCI 79 | mergeModelData "iMac6,1" EHCI 80 | mergeModelData "iMac7,1" EHCI 81 | mergeModelData "iMac8,1" EHCI 82 | mergeModelData "iMac9,1" EHCI 83 | mergeModelData "iMac10,1" EHCI 84 | mergeModelData "iMac11,1" EHCI 85 | mergeModelData "iMac11,2" EHCI 86 | mergeModelData "iMac11,3" EHCI 87 | mergeModelData "iMac12,1" EHCI 88 | mergeModelData "iMac12,2" EHCI 89 | mergeModelData "iMac13,1" EHCI 90 | mergeModelData "iMac13,2" EHCI 91 | mergeModelData "iMac14,1" EHCI 92 | mergeModelData "iMac14,2" EHCI 93 | mergeModelData "iMac14,3" EHCI 94 | mergeModelData "iMac15,1" EHCI 95 | mergeModelData "iMac16,1" EHCI 96 | mergeModelData "iMac16,2" EHCI 97 | mergeModelData "iMac17,1" 98 | mergeModelData "iMac18,1" 99 | mergeModelData "iMac18,2" 100 | mergeModelData "iMac18,3" 101 | mergeModelData "iMac19,1" 102 | mergeModelData "iMac19,2" 103 | mergeModelData "iMac20,1" 104 | mergeModelData "iMac20,2" 105 | 106 | # iMacPro 107 | mergeModelData "iMacPro1,1" 108 | 109 | # Macmini 110 | mergeModelData "Macmini5,1" EHCI 111 | mergeModelData "Macmini5,2" EHCI 112 | mergeModelData "Macmini5,3" EHCI 113 | mergeModelData "Macmini6,1" EHCI 114 | mergeModelData "Macmini6,2" EHCI 115 | mergeModelData "Macmini7,1" EHCI 116 | mergeModelData "Macmini8,1" 117 | 118 | # MacBook 119 | mergeModelData "MacBook8,1" EHCI 120 | mergeModelData "MacBook9,1" 121 | mergeModelData "MacBook10,1" 122 | 123 | # MacPro 124 | mergeModelData "MacPro3,1" EHCI 125 | mergeModelData "MacPro4,1" EHCI 126 | mergeModelData "MacPro5,1" EHCI 127 | mergeModelData "MacPro6,1" EHCI 128 | mergeModelData "MacPro7,1" EHCI 129 | 130 | # check to see if it was updated... 131 | cksum_old=`md5 -q $plist` 132 | cksum_new=`md5 -q $plist_temp` 133 | if [[ $cksum_new != $cksum_old ]]; then 134 | cp $plist_temp $plist 135 | echo "Updated Info.plist" 136 | else 137 | echo "Generated Info.plist is same as old, no need to update" 138 | fi 139 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------