Skip to content

Instantly share code, notes, and snippets.

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 poundbangbash/10f896865f57eb74d20d to your computer and use it in GitHub Desktop.
Save poundbangbash/10f896865f57eb74d20d to your computer and use it in GitHub Desktop.
Database located at ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg
- Created on first launch
Table HKEY_CURRENT_USER_VALUES:
node_id 626*
name OpenSaveLocally
type 4
value 1
Table HKEY_CURRENT_USER:
node_id 626
parent_id 6 (parent_id appears to be consistently the node_id of the first "Common" entry in HKEY_CURRENT_USER)
name "Common"
write_time <possibly inconsequential>
*node_id varies by user
- Once the setting is set via the app the node_id is set
- Manually adding and removing works as long as the same node_id is used
- Tried 2 machines, one had node_id 626, the other 61. Could not get it to work with each other's node_id or random node_id
node_id in "HKEY_CURRENT_USER_values" is tied to a matching node_id value in "HKEY_CURRENT_USER"
Attempts to create the database from scratch, mimicing the first launch creation. The structure works. Launching apps use the DB but pre-populating the DB with the node_id and values don't take. The app just creates its own entry:
sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg "CREATE TABLE HKEY_CURRENT_USER (node_id INTEGER PRIMARY KEY ASC, parent_id, name TEXT COLLATE nocase, write_time, UNIQUE (parent_id, name))"
sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg "CREATE TABLE HKEY_CURRENT_USER_values (node_id INTEGER, name TEXT COLLATE nocase, type INTEGER, value, UNIQUE (node_id, name))"
sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg "CREATE TABLE db_metadata (schema_ver INTEGER, min_schema_ver INTEGER, cache_table BINARY)"
But the "HKEY_CURRENT_USER_values" links to the "HKEY_CURRENT_USER" entry and the "HKEY_CURRENT_USER" entry links to a parent_id in the database.
- Discovery of the parent_id is done by 'SELECT node_id from HKEY_CURRENT_USER WHERE name = 'Common' ORDER BY node_id LIMIT 1' *but that only works if the apps have been launched and the database populated.*
The following commmands could be used to create the setting.
The second value being set is the referencing parent_id. parent_id appears to need to be the "Common" value in the 5-6 id range in "HKEY_CURRENT_USER"
This script can parse the existing entries and setup the key to save locally if the apps have been launched once so the .reg file has been created:
#!/bin/bash
parent_id=$(sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg "SELECT node_id from HKEY_CURRENT_USER WHERE name = 'Common' ORDER BY node_id LIMIT 1")
sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg "INSERT INTO HKEY_CURRENT_USER VALUES(999,${parent_id},'FileUI',X'')"
sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftRegistrationDB.reg "INSERT INTO HKEY_CURRENT_USER_values VALUES(999,'OpenSaveLocally',4,1)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment