Skip to content

Instantly share code, notes, and snippets.

@kruxmeier
kruxmeier / fix vmwp.bat
Last active August 16, 2022 12:46
enable hardware performance counters in WSL2
REM open cmd.exe as admin to run this
REM Creates a patched vmwp.exe replacing these bytes:
REM 0F B6 43 64 41 89 47 64 0F B6 43 65 41 89 47 68 0F B6 43 66 41 89 47 6C 0F B6 43 67 41 89 47 70
REM 41 C7 47 64 01 00 00 00 41 C7 47 68 01 00 00 00 41 C7 47 6C 01 00 00 00 41 C7 47 70 01 00 00 00
REM Enables PMU, LBR, PEBS, IPT
cd %TEMP%
copy %windir%\system32\vmwp.exe .