Users browsing this thread: 5 Guest(s)
hex editing multiple files
#6
Put all your files in a folder, for simplicity let's say you put it in C:\MyFiles. Then you'd use this script:

Code:
Get-ChildItem "C:\MyFiles" -Filter *.XA | `
Foreach-Object{
   $bytes = [System.IO.File]::ReadAllBytes($_.FullName);
   $bytes[2] = 0x4A;
   
   [System.IO.File]::WriteAllBytes("C:\MyFiles\" + $_.BaseName + ".XA", $bytes);
}

Change the directory on the first and second-to-last lines to the one your files are actually in. Make sure it's the absolute path, with the drive letter and everything. Save the file with a .ps1 extension.

To use this you need to run PowerShell in administrator mode. PowerShell comes along with Windows 7 and later, for previous versions you can download it manually.
Navigate to the place your script is in (using the "cd" command) and then run it using "& scriptname.ps1". I don't know how long it'll take but once it's done you'll be able to type stuff into the console again.

Not sure if sed is a better option, if it works and is easier than this then that's good. I found this though and thought it's pretty neat, I didn't even know this was possible before now Smile
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: SuperFlomm, Petie


Messages In This Thread
hex editing multiple files - by SuperFlomm - 06-02-2015, 12:36 PM
RE: hex editing multiple files - by Petie - 06-02-2015, 01:54 PM
RE: hex editing multiple files - by SuperFlomm - 06-02-2015, 02:29 PM
RE: hex editing multiple files - by Petie - 06-02-2015, 09:40 PM
RE: hex editing multiple files - by SuperFlomm - 06-02-2015, 11:19 PM
RE: hex editing multiple files - by puggsoy - 06-03-2015, 02:18 AM
RE: hex editing multiple files - by SuperFlomm - 06-03-2015, 12:25 PM
RE: hex editing multiple files - by puggsoy - 06-03-2015, 09:34 PM
RE: hex editing multiple files - by Petie - 06-03-2015, 02:30 PM

Forum Jump: