checkStatus checks status of hardentools registry key (that tells if user environment is hardened / not hardened).
()
| 115 | // checkStatus checks status of hardentools registry key |
| 116 | // (that tells if user environment is hardened / not hardened). |
| 117 | func checkStatus() bool { |
| 118 | key, err := registry.OpenKey(registry.CURRENT_USER, hardentoolsKeyPath, |
| 119 | registry.READ) |
| 120 | if err != nil { |
| 121 | return false |
| 122 | } |
| 123 | defer key.Close() |
| 124 | |
| 125 | value, _, err := key.GetIntegerValue("Harden") |
| 126 | if err != nil { |
| 127 | return false |
| 128 | } |
| 129 | |
| 130 | if value == 1 { |
| 131 | return true |
| 132 | } |
| 133 | |
| 134 | return false |
| 135 | } |
| 136 | |
| 137 | // markStatus sets hardentools status registry key |
| 138 | // (that tells if user environment is hardened / not hardened). |
no outgoing calls
no test coverage detected