An open-source implementation of some of Boot Camp's keyboard services in C#.
- This program was developed by using clean-room reverse-engineering techniques, including decompiling Boot Camp services.
- This program, repository and its authors are not affiliated with Apple Inc. in any way, shape, or form.
OpenBootCamp currently implements the following features of Boot Camp Manager:
- Fn behaviour switching: Switch whether the default Fn behaviour should be the standard Fn keys, or the special function printed on each key.
- Special Fn key handling: This includes keys like the display brightness, keyboard brightness, and optical drive eject keys.
Additionally, the following bugs from the official Boot Camp Manager are fixed:
- Keyboard backlight state is not remembered across reboots
- Special Fn keys do not work before login (Apple's Boot Camp Manager doesn't run until a user logs in)
along with introducing a whole lot of other bugs/missing features, but still...
Roughly in priority order:
- An overlay when adjusting keyboard backlight, screen brightness, and volume (when not already handled by Windows)
- A config application. Learn to edit XML for now.
- A few power saving features:
- Turn off keyboard backlight when closing laptop lid (something which I would've thought would be done in hardware/drivers, but here we are)
- Set keyboard backlight state based on power source or battery charge (e.g. low battery, switching between AC and battery power)
- Turn off keyboard backlight when keyboard is inactive
- Volume control on older Windows versions (7 and earlier?)
- Smooth keyboard backlight animations
- More that I haven't thought of yet
Only Apple computers that can run Windows are supported (i.e. any Intel Mac). Any non-Apple Windows systems are not supported (even if using a Magic Mouse/Trackpad/Keyboard).
Windows 7 SP1 and later with .NET Framework 4.8 should work without issues.
Windows Vista/XP may work if you downgrade the project to .NET Framework 4.6 (for Vista SP2) or 4.0 (for XP SP3), but are currently unsupported.
The following drivers are required for OpenBootCamp to work:
- The Apple Keyboard driver (
Keymagic.sys
) for OSX Fn behaviour switching and enabling display brightness shortcuts on Windows 8 and later. KeyAgent.sys
for enabling other special Fn keys and for brightness/volume keys on Windows 7 and lower.MacHALDriver.sys
for keyboard backlight support.
Downloads are currently unavailable.
Please compile the program yourself in the meantime.
- Install Visual Studio 2022 with the
.NET Desktop Development
workload checked. - Download the code repository, or clone it with
git
. - Extract the downloaded code, if needed.
- Open
OBC.sln
in Visual Studio. - Click
Build
>Build Solution
to build everything. - Your output, assuming default build settings, is located in
OBC.Service\bin\Debug\net48\
. - ???
- Profit!
- Follow steps 1-3 above to install Visual Studio and download the code.
- Open
Developer Command Prompt for VS 2022
andcd
to your project directory. - Run
msbuild /t:restore
to restore the solution, including NuGet packages. - Run
msbuild OBC.sln /p:platform="Any CPU" /p:configuration="Debug"
to build the project, substitutingDebug
withRelease
for a Release build instead. - Your output should be located in
OBC.Service\bin\Debug\net48\
(or similar). - ???
- Profit!
By decompiling Bootcamp.exe
(located at C:\Program Files\Boot Camp
on a Mac
running Windows with Boot Camp installed) with Binary Ninja.
I was going to use ghidra, but found Binary Ninja produced more readable pseudo-code.
I will go more in-depth in another document soon.
Because I was/am unhappy with the Apple-provided Boot Camp services.
Also, reverse-engineering is fun :D (if you know what you're doing, that is)
- Obtain a copy of
KeyAgent.sys
andMacHALDriver.sys
for your laptop (see below). - Create a folder in the same location as
InstallMgr.exe
calledBootCamp
(if it doesn't exist), and move both files there. - Run
InstallMgr.exe
, and install bothKeyAgent.sys
andMacHALDriver.sys
, then reboot. - Run
InstallMgr.exe
again, then install and runOpenBootCamp service
. - ???
- Profit!
NOTE: if you try to uninstall MacHALDriver.sys
in the future, it might still
show as "Installed" until you reboot. This will be fixed in a future commit.
- Download the Boot Camp support software for your Mac using Boot Camp Assistant (or Brigadier if you're already on Windows).
- Navigate to and open
Drivers\Apple\BootCamp.msi
in 7-Zip. - Copy
KeyAgent.sys
andMacHALDriver.sys
to a folder namedBootCamp
in the same folder asInstallMgr.exe
, then follow the instructions to install them with OpenBootCamp.
While you're at it, install the Apple Keyboard drivers if you haven't already
(the installer's called AppleKeyboardInstaller64.exe
, and is in the same
folder as BootCamp.msi
).
If you couldn't find KeyAgent.sys
, but found KeyManager.sys
, your laptop is
currently too new for OpenBootCamp. Come back when someone adds support for
these laptops.
I won't be able to do this, as I don't have access to a Mac with this configuration.
Ask nicely in the issues, and I might add your feature if I know how, have time, and I think it'll benefit the project.
Alternatively, create a pull request and add the feature yourself.
No.
Linux already has native support for Apple hardware (at least on the laptops I tested it on), so a Linux port would be pointless.
Copyright © 2024-2025 Sparronator9999.
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 3 of the License, or (at your option) any later version.
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.