Skip to content
Snippets Groups Projects
Commit a134b760 authored by Brian Carrier's avatar Brian Carrier
Browse files

Merge branch 'develop' of github.com:sleuthkit/sleuthkit into develop

parents 6dc17399 323c3ae4
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
namespace Rejistry { namespace Rejistry {
const std::string VKRecord::MAGIC = "vk"; const std::string VKRecord::MAGIC = "vk";
const std::wstring VKRecord::DEFAULT_VALUE_NAME = L"(Default)";
VKRecord::VKRecord(RegistryByteBuffer * buf, uint32_t offset) : Record(buf, offset) { VKRecord::VKRecord(RegistryByteBuffer * buf, uint32_t offset) : Record(buf, offset) {
if (!(getMagic() == MAGIC)) { if (!(getMagic() == MAGIC)) {
...@@ -41,6 +42,9 @@ namespace Rejistry { ...@@ -41,6 +42,9 @@ namespace Rejistry {
} }
} }
VKRecord::VKRecord(const VKRecord& sourceRecord) : Record(sourceRecord._buf, sourceRecord._offset) {
}
bool VKRecord::hasName() const { bool VKRecord::hasName() const {
return (getWord(NAME_LENGTH_OFFSET) != 0x0); return (getWord(NAME_LENGTH_OFFSET) != 0x0);
} }
...@@ -51,7 +55,7 @@ namespace Rejistry { ...@@ -51,7 +55,7 @@ namespace Rejistry {
std::wstring VKRecord::getName() const { std::wstring VKRecord::getName() const {
if (! hasName()) { if (! hasName()) {
return L""; return VKRecord::DEFAULT_VALUE_NAME;
} }
uint32_t nameLength = getWord(NAME_LENGTH_OFFSET); uint32_t nameLength = getWord(NAME_LENGTH_OFFSET);
......
...@@ -43,6 +43,8 @@ namespace Rejistry { ...@@ -43,6 +43,8 @@ namespace Rejistry {
*/ */
class VKRecord : public Record { class VKRecord : public Record {
public: public:
static const std::wstring DEFAULT_VALUE_NAME;
typedef VKRecord * VKRecordPtr; typedef VKRecord * VKRecordPtr;
typedef std::vector< VKRecordPtr > VKRecordPtrList; typedef std::vector< VKRecordPtr > VKRecordPtrList;
...@@ -81,7 +83,7 @@ namespace Rejistry { ...@@ -81,7 +83,7 @@ namespace Rejistry {
}; };
VKRecord(RegistryByteBuffer * buf, uint32_t offset); VKRecord(RegistryByteBuffer * buf, uint32_t offset);
VKRecord(const VKRecord &);
virtual ~VKRecord() {} virtual ~VKRecord() {}
/** /**
......
...@@ -61,7 +61,10 @@ namespace Rejistry { ...@@ -61,7 +61,10 @@ namespace Rejistry {
VKRecord::VKRecordPtrList::iterator it = recordList.begin(); VKRecord::VKRecordPtrList::iterator it = recordList.begin();
for (; it != recordList.end(); ++it) { for (; it != recordList.end(); ++it) {
if (_wcsicmp(name.c_str(), (*it)->getName().c_str()) == 0) { // If we have a name match or we are searching for the "default" entry
// (which matches a record with no name) we are done.
if ((!(*it)->hasName() && name == VKRecord::DEFAULT_VALUE_NAME) ||
(_wcsicmp(name.c_str(), (*it)->getName().c_str()) == 0)) {
// Create a copy of the record to return as the records // Create a copy of the record to return as the records
// in the list will be deleted. // in the list will be deleted.
foundRecord = new VKRecord(*(*it)); foundRecord = new VKRecord(*(*it));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment