• Looking for editor program

    Author
    Topic
    #494866

    Hi,
    I’m not sure if this is an appropriate place to post this question, so apologies if I’ve made a ‘Boo-Boo’:o

    I have a bunch of Song files which are related to one model of a Technics Musical Instrument keyboard, which I wish to use on another model of Technics keyboard.
    All the Song files are located on an SD Card and each file contains a group of 7 other sub-files.
    The file formats required for both keyboards are very similar except that there is a group of 4 bytes at the start of each sub-file which identify the individual keyboard which the files were originally designed to play on. Unless the particular keyboard ‘sees’ the correct 4 identifier bytes, the files will not load.

    If by using a Hex Editor, on my Win 7 PC, I change the 4 bytes in each of the 7 sub-files of the original Song file, and then save the modified file to an SD Card, the files will load and play correctly on the alternative keyboard.

    However, since there are a total of around 150 Song files, containing 7 sub-files, it would be an extremely long process to manually modify all these files one at a time, since there are over 1000 of these sub-files……

    So, my question is : Does anyone know of a PC program / Hex Editor which is capable of searching through all the content of the group of files on an SD card, for a particular set of 4 contiguous Bytes ( for example $4C, $4B, $47, $44 ) and changing this set of Bytes to say $4A, $20, $4B, $44 ?

    Any suggestions would be very much appreciated 🙂

    Viewing 2 reply threads
    Author
    Replies
    • #1453906

      One used to be able to do that with WordPad, I haven’t tried it lately though. Also back in the DOS days this could be easily done with a batch file and debug, haven’t used it in while either.
      However you may want to consider putting the four bytes you need in place, even if it over-writes the same existing bytes. It may be easier to find or write a macro to do that. Of course make sure you have good backup before attempting any solution. 🙂

      Check out http://www.ollydbg.de/ for a possible solution. Or a hex editor with command line capability that you could use with a batch file like FrHed: http://frhed.sourceforge.net/en/

    • #1453951

      Thanks RussB – I’ll check these suggestions 🙂

    • #1453953

      Willum,

      Here’s a small PowerShell program that will do the trick of reading all the files in the drive/directorypath given in the first prompt to the drive/directorypath given in the second prompt. Make sure both directories exist. See the PowerShell forum if you don’t know how to get started in PS see the 2nd post here.

      Code:
      
      $DriveToFiles = Read-Host "Enter the Drive:path to your PDF Files"
      $DriveToNewFiles = Read-Host "Enter the Drive:path for changed files"
      
      Get-ChildItem "$DriveToFiles*.*"  | `
        Foreach-Object { 
                        $bytes  = [System.IO.File]::ReadAllBytes($_.FullName)
                        $FSpec= $_.name
                        $offset = 0
                        $bytes[$offset]   = 0x41  #Change HEX as necessary
                        $bytes[$offset+1] = 0x42
                        $bytes[$offset+2] = 0x43
                        $bytes[$offset+3] = 0x44
                        $DestFile = "$DriveToNewFiles$FSpec"
                        [System.IO.File]::WriteAllBytes($DestFile, $bytes)
                       }
      

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1454227

        Thank you all very much for your help… I will certainly try your suggestions……

    Viewing 2 reply threads
    Reply To: Looking for editor program

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: