Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Dec 2009
    Location
    North Yorkshire UK
    Posts
    44
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Question Looking for editor program

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

    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

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    5 Star Lounger RussB's Avatar
    Join Date
    Dec 2009
    Location
    Grand Rapids, Michigan
    Posts
    662
    Thanks
    8
    Thanked 38 Times in 37 Posts
    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/
    Last edited by RussB; 2014-05-22 at 10:26.
    Do you "Believe"? Do you vote? Please Read:
    LEARN something today so you can TEACH something tomorrow.
    DETAIL in your question promotes DETAIL in my answer.
    Dominus Vobiscum <))>(

  4. The Following User Says Thank You to RussB For This Useful Post:

    willum08 (2014-05-22)

  5. #3
    Lounger
    Join Date
    Dec 2009
    Location
    North Yorkshire UK
    Posts
    44
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Thanks RussB - I'll check these suggestions

  6. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,158
    Thanks
    200
    Thanked 781 Times in 715 Posts
    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:
    <# +-------------------------------------------+
       | Program Name: PrintAllPDFs.ps1            |
       | Programmed by: ComputerMentor             |
       |           AKA: RetiredGeek                |
       | Created      : 05/22/2014                 |
       | Last Update  :                            |
       | Version No.  : 1.0                        |
       +-------------------------------------------+
    
    Will change the first 4 bytes of files found in the directory
    the user provides via the prompt and writes to the directory
    specified by the second prompt.
    #>
    
    $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
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  7. The Following User Says Thank You to RetiredGeek For This Useful Post:

    willum08 (2014-05-23)

  8. #5
    Lounger
    Join Date
    Dec 2009
    Location
    North Yorkshire UK
    Posts
    44
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Thank you all very much for your help... I will certainly try your suggestions......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •