Sign in to follow this  
Followers 0
Dampe

_Hextostring help

5 posts in this topic

#1 ·  Posted (edited)

I'm attempting to read from the registry like this

#include <String.au3>
$email = RegRead ("HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings", "DefaultMemberName")
$string = _HexToString ($email)
MsgBox (0, "Email", $string)

When I run this, I am only getting the first letter of the real value back.

Please help =]

Edited by Dampe

Share this post


Link to post
Share on other sites



I'm attempting to read from the registry like this

#include <String.au3>
$email = RegRead ("HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings", "DefaultMemberName")
$string = _HexToString ($email)
MsgBox (0, "Email", $string)

When I run this, I am only getting the first letter of the real value back.

Please help =]

I know nothing about MSNMessenger but are you sure the email address is stored in hex? What is the value of $email after RegRead?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I am 100% sure it is stored in hex, because when I manually look at it through RegEdit I can see it.

$email after reg read = "73007400660075006F007200640064006F00730040006D0073006E002E0063006F006D000000"

(please don't post my email publicly if you view it :D)

$string after _HexToString = "s"


Share this post


Link to post
Share on other sites

It uses Unicode notation so you could just remove the hex 00 from the string when you don't use unicode characters like:

#include <String.au3>
$email = RegRead("HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings", "DefaultMemberName")
$email = StringReplace($email,"00","")
$string = _HexToString($email)
MsgBox(0, "Email", $string)

Else you will have to copy and modify the _HexToString() UDF to cope with UDF characters.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Brilliant, work's like a charm.

Thankyou.


Share this post


Link to post
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
Sign in to follow this  
Followers 0