Jump to content

-1 error with _HexToString


60aside
 Share

Recommended Posts

Merry Christmas everyone.

I have a small script I am working with to search the registry and find the location of the PST files in Outlook.

Here is the Script :-

#include <string.au3>

For $i= 1 to 1000
    $var = RegEnumKey("HKCU\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", $i)
        If @error <> 0 then ExitLoop
    $sKeyPath = ("HKCU\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" & $var)
    
    For $ii= 1 to 1000
    $sKey = RegEnumKey($sKeyPath, $ii)
        If @error <> 0 then ExitLoop
    
    For $iii = 1 to 1000
        $sEnumPath = $sKeyPath & "\" & $sKey
            $sKeyVal = RegEnumVal($sEnumPath, $iii)
        If @error <> 0 Then ExitLoop
            
        If $sKeyVal = "001f6700" Then
            
        $sRegVal = RegRead ($sEnumPath, $sKeyVal)
        
        $PST = _HexToString($sRegVal)
        msgbox(0,"Hex",$sRegVal)
        msgbox(0,"String",$PST)
        EndIf
        
Next
Next
Next

The problem is the HEX string retrieved looks fine and is correct, but when I use _HexToString it gives me a -1 value instead of

the location of the PST file.

Can anyone advise where this is going wrong?

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...