L
lha404
Hello
I am new to perl, I am looking to write a perl script which will
convert the the HEX to ASCII for registry exports - an example
follows
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders]
"Common Startup"=hex(2):25,00,41,00,4c,00,4c,00,55,00,53,00,45,00,52,00,53,00,\
converted = % A L L U S E R
S
this translates in the following way
25 ~ decimal 37 ~ ASCII %
41 ~ decimal 61 ~ ASCII A
4c ~ decimal 65 ~ ASCII L
4c ~ decimal 65 ~ ASCII L
bla bla bla ...
There are two reasons for doing this :
1 - I am learing perl and have absorbed some of the basics but when
presented with a real problem such as this am finding it hard to
decide what the best approach would be and would like some advice on
how to decide on stratagies for tackling problems. I can imagine a
number of ways to convert the text but the two main concepts are.
- strip out the hex code from a file then assign an arrary the values
then work on the elements of the array sending the output to another
file.
- use transiteration to substitute the vales
2 - because I frequently have to look at regexports which have this
particualr formatting of ASCII and have no control over the
originating process.
The current ways of converting are a complete waste of time.
For all I know there is some simple way of doing this that I have
overlooked or there is a perl module which can convert, I really dont
know where to start though.
It seems so simple but now my brain hurts and just need some sort of
idea from another human being.
I dont expect any one gives a toss but even the process of posting my
problem may give me ideas.
I am new to perl, I am looking to write a perl script which will
convert the the HEX to ASCII for registry exports - an example
follows
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders]
"Common Startup"=hex(2):25,00,41,00,4c,00,4c,00,55,00,53,00,45,00,52,00,53,00,\
converted = % A L L U S E R
S
this translates in the following way
25 ~ decimal 37 ~ ASCII %
41 ~ decimal 61 ~ ASCII A
4c ~ decimal 65 ~ ASCII L
4c ~ decimal 65 ~ ASCII L
bla bla bla ...
There are two reasons for doing this :
1 - I am learing perl and have absorbed some of the basics but when
presented with a real problem such as this am finding it hard to
decide what the best approach would be and would like some advice on
how to decide on stratagies for tackling problems. I can imagine a
number of ways to convert the text but the two main concepts are.
- strip out the hex code from a file then assign an arrary the values
then work on the elements of the array sending the output to another
file.
- use transiteration to substitute the vales
2 - because I frequently have to look at regexports which have this
particualr formatting of ASCII and have no control over the
originating process.
The current ways of converting are a complete waste of time.
For all I know there is some simple way of doing this that I have
overlooked or there is a perl module which can convert, I really dont
know where to start though.
It seems so simple but now my brain hurts and just need some sort of
idea from another human being.
I dont expect any one gives a toss but even the process of posting my
problem may give me ideas.