ascii to hex converter app that can do so in registry format?  

Page 1 of 2 12 LastLast

  1. Posts : 740
    Windows 10 x64 Pro
       #1

    ascii to hex converter app that can do so in registry format?


    So i know a plethora of online ones exist. Even so, they've all failed me in the simplicity im looking for. Plus id prefer one i can run local.

    Seem pretty rare best i can tell.

    Anyone know of anything?

    I'd like it to be able to do string to hex or the other direction, and include or have the option to include the commas, 00's, and \ neecessary to create a regfile.

    Something like that out there or is it the long n hard way for everyone that requires this?
      My Computer


  2. Posts : 40,593
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    ASCII Converter download | SourceForge.net
    This ASCII converter can convert plain text to hex and back using the standard ASCII character set. Useful for interpreting computer hex codes.
    There is freeware out there- try searching using e.g.
    convert ASCII to hex freeware
      My Computers


  3. Posts : 740
    Windows 10 x64 Pro
    Thread Starter
       #3

    thank you for the reply.

    yes that is one i came across, unfortunately it doesnt allow for commas (admittedly one of the smaller details as a find/replace in notepad++ would just add 1 additional step)

    the bigger problem is it doesnt add the 00's or the \ required for proper importation into the registry. Going through and figuring that out on my own is gonna be time consuming and not worth on the degree I need.

    I have a bunch of entries that required reg extend sz and imported as reg sz, the result is a hot mess im trying to clean up :P

    if i can find a piece of software that fits the bill it will be a great toolkit addition for the future thats for sure.
      My Computer


  4. Posts : 988
    Microsoft Windows 10 Home
       #4

    Have you thought about using the registry & related commands themselves.

    If you create a "dummy" registry key, you can create REG_EXPAND_SZ values from literal strings, then export to a temp file:

    Code:
    $PSkey = 'HKCU:\Software\MyDummyKey'  ### Created manually for demo
    $Exportkey = $PSkey -replace ':'
    $Text = '%USERPROFILE%\Documents'
    $TEmpFile = "$Home\Sandbox\temp.reg"
    
    $Splat = @{
        Path = $PSkey
        Name = 'MyDummyValue'
        PropertyType = 'ExpandString'
        Value = $Text
    }
    Remove-ItemProperty $PSkey 'MyDummyValue'-ea Silent
    New-ItemProperty @Splat | out-null
    reg export $Exportkey $TempFile /y | out-null
    Get-Content $TempFile
    Output:
    Code:
    PS C:\> $PSkey = 'HKCU:\Software\MyDummyKey'  ### Created manually for demo
    >> $Exportkey = $PSkey -replace ':'
    >> $Text = '%USERPROFILE%\Documents'
    >> $TEmpFile = "$Home\Sandbox\temp.reg"
    >>
    >> $Splat = @{
    >>     Path = $PSkey
    >>     Name = 'MyDummyValue'
    >>     PropertyType = 'ExpandString'
    >>     Value = $Text
    >> }
    >> Remove-ItemProperty $PSkey 'MyDummyValue'-ea Silent
    >> New-ItemProperty @Splat | out-null
    >> reg export $Exportkey $TempFile /y | out-null
    >> Get-Content $TempFile
    >>
     Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\MyDummyKey]
    "MyDummyValue"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,\
      00,4c,00,45,00,25,00,5c,00,44,00,6f,00,63,00,75,00,6d,00,65,00,6e,00,74,00,\
      73,00,00,00
    Last edited by KeithM; 03 Mar 2020 at 16:38.
      My Computer


  5. Posts : 740
    Windows 10 x64 Pro
    Thread Starter
       #5

    Nope, that goes a tad above my head :)

    so, at a glance with limited understanding - that first (powershell script?) creates a dummy key in a predetermined location which you can navigate to, assign a value in ascii and export it and you'll get the hex?

    errr rather you crate the key in that or whatever location is determined by the script, then run the script and it will export it to whatever determined location but as hex so you can re-import as reg_expand_sz?
      My Computer


  6. Posts : 988
    Microsoft Windows 10 Home
       #6

    Yes, it's a PowerShell script. The key itself was created manually (via regedit.exe). Its name & location are purely arbitrary --- just be sure you're not in conflict with a valid key.

    The first code block in my post is working code, you can copy & paste into a PowerShell window and then execute. The second code block is just a copy & paste from PowerShell after pasting & executing the code from the first block.

    As it stands, the script exports the dummy key and echos its contents. That's all I can do without a better understanding of what you're trying to do.

    You say you're wanting to create .reg files. The easiet way to get a proper .reg file is to export a key. You might find it easiest to create a dummy key with all your desiered EXPAND_SZ values, then export that key. Again, without a better understanding of your final goal, it's hard to be more precise.
      My Computer


  7. Posts : 40,593
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #7

    These look more interesting:
    4 Tools to Decode and Convert Windows Registry Hex Values to Text • Raymond.CC

    E.g.
    Old Timer’s ConvertIt is a simple to use tool that will convert single and multiple hex strings to ASCII text and also the reverse of creating hex values from ASCII text. It supports both the old Windows 9x version 4 and the modern version 5 registry .reg files. Paste in the hex (everything after the colon in the .reg file) or text value, select the conversion method and click the button. The result is clean and stripped of erroneous characters. Hex(2) is for a single line value, Hex(7) is a multiple line value. OTConverIt is only 174KB in size and portable.
    Read More: 4 Tools to Decode and Convert Windows Registry Hex Values to Text • Raymond.CC
    Another:
    MetadataConsulting.ca: RegtoText - NEW command-line executable converts Windows Registry file to human readable text
      My Computers


  8. Posts : 988
    Microsoft Windows 10 Home
       #8

    As I read the OP, he want's to go the other way. He wants to convert a string, like "%USERPROFILE%\Docuements" to the text representation of the component bytes as seen in a registry export with type EXPAND_SZ.

    He seems to imply he wants to cobble together a .reg file that can be imported.
      My Computer


  9. Posts : 40,593
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #9

    will convert single and multiple hex strings to ASCII text and also the reverse

    - both ways..

    anyway, it's there if it's of any use. 4 possible tools. That's just one extract.
      My Computers


  10. Posts : 988
    Microsoft Windows 10 Home
       #10

    Copy this code into PowerShell if you just want the Unicode bytes:

    Code:
    $enc = [System.Text.Encoding]::UniCode
    $text ="%USERPROFILE%\Documents"
    $UnicodeBytes = $enc.GetBytes($Text)
    
    $UniCodeBytes
    
    $UnicodeBytes | Format-hex
    
    ( $UnicodeBytes | ForEach{ '{0:x2}' -f $_ } ) -join ','
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:35.
Find Us




Windows 10 Forums