| 36 | } |
| 37 | |
| 38 | std::vector<uint8_t> ReadConfigStoreLocalBinary(const std::string& keyName) { |
| 39 | if (!g_pConfigStoreLocal || !oConfigStoreGetBinary) { |
| 40 | LOG_DECRYPTIONKEY_WARN("GetConfigStoreLocalBinary: ConfigStoreGetBinary not ready, cannot get binary value"); |
| 41 | return {}; |
| 42 | } |
| 43 | |
| 44 | std::vector<uint8_t> value(1024); |
| 45 | int32 result = oConfigStoreGetBinary(g_pConfigStoreLocal, k_EConfigStoreUserLocal, |
| 46 | keyName.c_str(), |
| 47 | reinterpret_cast<char*>(value.data()), |
| 48 | static_cast<uint32>(value.size())); |
| 49 | if (result <= 0) { |
| 50 | LOG_DECRYPTIONKEY_DEBUG("GetConfigStoreLocalBinary: failed to read KeyName='{}'", keyName); |
| 51 | return {}; |
| 52 | } |
| 53 | |
| 54 | value.resize(result); |
| 55 | LOG_DECRYPTIONKEY_DEBUG("GetConfigStoreLocalBinary: got value for KeyName='{}' ({} bytes)", |
| 56 | keyName, value.size()); |
| 57 | return value; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | namespace Hooks_Decryption { |
no test coverage detected