SOLVED: Adding LF/CR To Long String In Property

I am trying to get LF/CR after each %0d%0a but it appears I have the code incorrect.

Here’s an example:

Current relevance statement

Q:concatenation “%0d%0a” of hexadecimal string (value “AccessProtectionUserRules” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\McAfee\SystemCore\VSCore\On Access Scanner\BehaviourBlocking” of registry as string)

A: Blah%0d%0aBlah%0d%0aBlah%0d%0aBlah%0d%0aBlah%0d%0aBlah%0d%0aBlah%0d%0aBlah%0d%0a

What I am looking to get

A: Blah
A: Blah
A: Blah
A: Blah
A: Blah

Where am I going wrong?

Any assistance is greatly appreciated.

Did you try this in the console? I’d bet it is correct, just that the Fixlet Debugger is showing you % encoded strings.

Try changing this setting.

1 Like

Unchecked this, and it worked like a charm!

Thanks JG!

Not that you are asking, but this is not how I would recommend reading this value.

values "AccessProtectionUserRules" of keys "HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\SystemCore\VSCore\On Access Scanner\BehaviourBlocking" of (x64 registries; x32 registries)

This is how I would recommend reading the raw values.

Then this for the final result:

concatenations "%0d%0a" of (hexadecimal strings it) of unique values of (it as string) of values "AccessProtectionUserRules" of keys "HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\SystemCore\VSCore\On Access Scanner\BehaviourBlocking" of (x64 registries; x32 registries)
1 Like

Yeah, but it’s in Hex, I need the client to convert it to string values.

I’m saying the query part of the statement could be better, but then add in the rest, like this:

concatenations "%0d%0a" of (hexadecimal strings it) of unique values of (it as string) of values "AccessProtectionUserRules" of keys "HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\SystemCore\VSCore\On Access Scanner\BehaviourBlocking" of (x64 registries; x32 registries)

The way your query was written, it wouldn’t work on 32bit systems, and it would have issues in some other cases. You might not have 32bit systems, but even so, I’d still recommend writing it like this.

1 Like

That is a bit cleaner. Thanks!

1 Like

Also, just want to add that I’m not actually testing this since I don’t have this product installed. I’m just rewriting it the way I think would be best, but I’m doing some guess work here since I can’t test it myself. I’m trying to point out the general form, not the exact details.

Just like all the other relevance assistance you’ve provided in the past… It just works.

1 Like

I’ll also add that unique values of could be removed depending on your needs, but I generally like to include it even when not needed. It does have the effect of alphabetizing the results, which can be either an advantage or a disadvantage if you need to maintain the order.