Skip to content

Instantly share code, notes, and snippets.

@brcontainer
Created August 3, 2017 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brcontainer/0b5b8322e8efbd8d9551ff18afb92efd to your computer and use it in GitHub Desktop.
Save brcontainer/0b5b8322e8efbd8d9551ff18afb92efd to your computer and use it in GitHub Desktop.
<?php
exec('reg export Hkey_local_Machine\Software\blabla C:\arquivo.reg');
$regfile = file_get_contents('C:/arquivo.reg');
$regfile = preg_replace('#(\r|\n)"|"(=)#', '$1$2', $regfile);
$parsed = parse_ini_string($regfile, false, INI_SCANNER_RAW);
print_r($parsed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment