• Stars
    star
    1,032
  • Rank 44,644 (Top 0.9 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python script for mapping USB ports in macOS and creating a custom injector kext.

USBMap

Python script for mapping USB ports in macOS and creating a custom injector kext.


Features

  • No dependency on USBInjectAll
  • Can map XHCI (chipset, third party, and AMD), EHCI, OHCI, and UHCI ports
  • Can map USB 2 HUBs (requires the HUB's parent port uses type 255)
  • Matches based on class name, not port or controller name
  • Allows setting nicknames to the last-seen populated ports in discovery
  • Aggregates connected devices via session id instead of the broken port addressing
  • Can use best-guess approaches to generate ACPI to rename controllers or reset RHUB devices as needed

Installation

With Git

Run the following one line at a time in Terminal:

git clone https://github.com/corpnewt/USBMap
cd USBMap
chmod +x USBMap.command

Then run with either ./USBMap.command or by double-clicking USBMap.command

Without Git

You can get the latest zip of this repo here. Then run by double-clicking USBMap.command


Quick Start

  1. Make sure you've run D. Discover Ports at least once from the main menu of USBMap.command so it knows what USB controllers you have
  2. Choose K. Create Dummy USBMap.kext via the main menu of USBMap.command
  3. Add the USBMap.kext dummy injector to your OC -> Kexts folder and config.plist -> Kernel -> Add
  4. Reboot
  5. Go into USBMap's D. Discover Ports and plug a USB 2 and USB 3 device into every port - letting the script refresh between each plug
  6. Use USBMapInjectorEdit.command to toggle off all non-essential seen ports (any of the first 15 that aren't a keyboard/mouse/etc which are needed for basic functionality)
  7. Reboot
  8. Go into USBMap's D. Discover Ports and plug a USB 2 and USB 3 device into every port - letting the script refresh between each plug
  9. Go into the P. Edit & Create USBMap.kext menu and change the types to match the physical port types and toggle which ports (up to 15) you want to preserve
  10. Build the final USBMap.kext and replace the dummy injector in your OC -> Kexts folder

The dummy injector + USBMapInjectorEdit steps are to allow you to map using a "sliding window" of sorts. Since you can only see 15 port personalities at one time, you need to map what's visible, then omit them to make room for the next sweep - then map again


FAQ

  • Intel Bluetooth Doesn't Show In Discovery
    • Due to the way Intel Bluetooth populates, it does not show in ioreg the same way other USB devices do. You can still find its address in System Information -> USB, then clicking on the bt device and taking note of its Location ID

More Repositories

1

gibMacOS

Py2/py3 script that can download macOS components direct from Apple
Python
5,727
star
2

ProperTree

Cross platform GUI plist editor written in python.
Python
2,587
star
3

GenSMBIOS

Py script that uses acidanthera's macserial to generate SMBIOS and optionally saves them to a plist.
Python
1,557
star
4

SSDTTime

SSDT/DSDT hotpatch attempts.
Python
1,039
star
5

MountEFI

An even more robust edition of my previous MountEFI scripts
Python
1,028
star
6

Hackintosh-Guide

474
star
7

Lilu-and-Friends

A python script that can download and build a number of kexts.
Python
365
star
8

OCConfigCompare

Python script to compare two plists and list missing keys in either.
Python
305
star
9

CorpBot.py

A very clumsy python bot for discord
Python
194
star
10

CPUFriendFriend

Py script to walk frequency vectors and leverage acidanthera's CPUFriend ResourceConverter.
Python
148
star
11

CPU-Name

Small py script to change the CPU name in About This Mac by leveraging functionality in Acidanthera's RestrictEvents
Python
95
star
12

Web-Driver-Toolkit

A small python script for downloading NVIDIA Web Drivers based on either the current OS build version - or a selected build version.
Python
87
star
13

Hackintosh-Tips-And-Tricks

A collection of things I've learned about Hackintosh - Hopefully it helps others!
82
star
14

KextExtractor

A py script to extract/copy a folder of kexts or zips to a target EFI partition
Python
75
star
15

USB-Installer-Creator

A subset of commands from Mac Multi-Tool that *only* build USB installers.
Python
49
star
16

EFI-Backup-Restore

A smallish script that can backup EFI partitions - and eventually restore them (hopefully).
Python
41
star
17

PyVega

Python fork (kinda) of lihaoyun6's VGTab
Python
39
star
18

UnPlugged

Bash script to help build and run an offline installer in recovery.
Shell
39
star
19

EssentialsList

A small python script that creates a timestamped zip on your Desktop containing troubleshooting info.
Python
38
star
20

Mac-Multi-Tool

A tool I put together for creating OSX86 installers (OS X 10.9+)
Shell
38
star
21

HackUpdate

Python script to automate Lilu and Friends, KextExtractor, OC-Update, and OCConfigCompare.
Python
34
star
22

NullCPUPowerManagement

NullCPUPowerManagement.kext tweaked to build on newer setups
C++
33
star
23

AMDVanillaPatches

Py script that can download and merge the AMD vanilla config.plist patches.
Python
26
star
24

OC-Update

Bash script to update OpenCore and some efi drivers
Shell
21
star
25

ACPIRename

Py script to list paths in DSDT as well as generate unique method/device renames.
Python
20
star
26

VGTabMerge

Small py script to merge aty_properties from a VGTab injector kext to the config.plist -> Devices -> Properties for WEG injection.
Python
15
star
27

CheckAudio

Small py script to offer some debugging info on HDEF and current outputs.
Python
15
star
28

CsrDecode

Small py script to show what different CsrActiveConfig values enable/disable
Batchfile
15
star
29

Plist-Tool

A sloppy plist patching tool (yay!)
Python
15
star
30

OCSnapshot

Python CLI version of ProperTree's OC Snapshot function.
Python
14
star
31

BootChime

Py script to aid in setting up the boot chime in OpenCore.
Python
13
star
32

gibMacRecovery

Wrapper around Acidanthera's macrecovery.py to help setup python and automate the process.
Python
12
star
33

BitmaskDecode

Python script to help demystify a number of known bitmasks.
Batchfile
11
star
34

FixHPET

Py script to examine a DSDT and attempt to patch out IRQ conflicts.
Python
11
star
35

CheckGPU

Small py script to offer some debugging info on GPUs.
Python
10
star
36

SetAudio

Small py/applescript combo script that allows the user to select audio input/output.
Python
10
star
37

Batch-Scripts

A collection of batch scripts I've written over the years.
Batchfile
10
star
38

CloverExtractor

Small py script to extract CLOVERX64.efi from an install package and copy it to a target drive's EFI partition.
Python
10
star
39

MmioDevirt

Python script to create a template MmioWhitelist.
Python
9
star
40

LogCheck

Py script to scrape high level info from an opencore log
Python
9
star
41

Mac-Multi-Tool-GUI

Attempt at an Objective C rewrite of my Mac Multi-Tool script
Objective-C
9
star
42

CleanDock

Small py script to remove any apps from the dock not in a settings.json file.
Python
8
star
43

BridgeBuilder

Python script to generate ACPI for PCI bridges using DSDT + Device Paths
Python
8
star
44

ForceRGB

Py script to download, run, and setup results of Andrew Daugherity’s patch-edid script
Python
8
star
45

Web-Driver-Getter

A small python script for downloading NVIDIA Web Drivers based on either the current OS build version - or a selected build version.
Python
7
star
46

AppleALC-Scrub

Dynamically reroutes layouts to valid counterparts in AppleHDA.kext
Python
7
star
47

pymodules

A repo of a number of helper modules I've made
Python
7
star
48

DevicePath

Py script to convert Windows device paths to fit OpenCore's expectations.
Batchfile
7
star
49

OpenConfig

Small bash script to mount the booted OC EFI and open the config.plist.
Shell
6
star
50

Hack-Fix-It

A custom script to aid in Hack setup
Shell
5
star
51

Convert.command

Small py2/py3 script to convert between a few value types
Batchfile
5
star
52

GPUP

Script to add/remove/edit GPU priority for apps in Windows 10
Batchfile
5
star
53

APFS-Non-Verbose

A small py script to patch apfs.efi
Python
4
star
54

PowerSettings

Py script to set some basic pmset commands and/or reset power settings.
Python
4
star
55

GetUUID

Bash script to grab UUID for the target volume
Shell
4
star
56

RoR2Unlocker

Py script to unlock characters and adjust lunar coins in Risk Of Rain 2
Python
4
star
57

OpenAsarInstall

Py script to fetch and install OpenAsar on macOS/Windows
Python
4
star
58

GetTex

Py script to download the Configuration.tex from the OpenCorePkg repo.
Python
4
star
59

icontool

A small script to take images and convert them to OSX icns files
Shell
4
star
60

IORegPy

Script to walk the plist output of the ioreg command
Python
3
star
61

Exclusions.bat

Small script to add/remove Windows Defender exclusions programatically.
Batchfile
3
star
62

CheckAPFS

Small py2 script to check the version of a passed, or local apfs.efi file.
Python
3
star
63

Start-Xcode

Bash script to directly launch Xcode via its binary
Shell
3
star
64

Check-Some

A small script to check OSX/macOS installer checksums
Shell
3
star
65

GetHash

Py script to list MD5, SHA1, and SHA256 of a specified file.
Python
3
star
66

ToggleDebug

A py script to toggle debug settings in an OC config.plist.
Python
3
star
67

CheckClover

Small py2 script to check the version of clover on a mounted EFI, or local CLOVERX64.efi file.
Batchfile
3
star
68

FontRendering

Py script to fix font rendering on non-HiDPI displays in Mojave.
Python
3
star
69

GetPlatforms

Small py2/py3 script to get ig/snb-platform-id's from Clover source or local gma.c file and format them for readability.
Batchfile
3
star
70

Mastermind

Single player python version of the Mastermind board game.
Python
3
star
71

GetHDEF

Small py script to locate HDEF in ioreg and print verbose info
Python
2
star
72

Bash-Scripts

Some Bash scripts I've written over the years.
Shell
2
star
73

OneScript

A little script to update some other scripts
Python
2
star
74

macrecovery-legacy

Python 2 and 3 compatible fork of macrecovery.py
Python
2
star
75

iasl-legacy

Rehost for legacy iasl tools.
1
star
76

CloverBootFiles

boot, boot0af, and boot1f32alt from Clover
1
star
77

StripPlistComments.py

A small script that should work on Python 2 or 3, macOS or Windows, that can strip plist comments
Python
1
star
78

Dilbert.py

A simple python script that crawls through Dilbert comics
Python
1
star
79

Essentials-Pruner

A private script (public now) to prune the essentials list against a preset list of kexts
Shell
1
star
80

RenameExt

A simple batch script to recursively rename files with a specified extension.
Batchfile
1
star
81

PyWordle

Python clone of Wordle for fun.
Python
1
star
82

linux_iasl

Rehost of the iasl.zip for Linux
1
star
83

Lavalink-Updater

Py script to update and launch Lavalink.jar
Python
1
star