clogicgmather
Jun 22 2004, 05:17 AM
Ive read through the pinned reference section of the mxm action scripting but i cannot find out if mxm allows you to edit files 1 byte at a time (id use the search but lately it never seems to be disabled) The reason for asking is because i have written a program in C to edit xbox bios files so you can change the colour of the startup and the camera animation etc, id love to have a go at writing a script to do this in mxm but cannot findout if this is beyond the scope of the scripting langauge.
Regards, Guy
pelago
Jun 22 2004, 10:19 AM
I think this capability is only in the WIP (beta) versions at the moment, as I believe they have 'proper' file i/o functions.
flattspott
Jun 22 2004, 01:45 PM
Yes you can in the WIP version.
http://www.mediaxmenu.com/reference.php?rc=2&rs=69#s69Look at the Buffers section. While you wont be able to test it yourself you could still try to write a script based on the WIP specs.
Yuyu
Jun 22 2004, 02:22 PM
Hmm, maybe you could or someone else could post an example of how to begin editing a file, using buffers, 1 byte at a time ?
flattspott
Jun 23 2004, 12:08 AM
Well I'm not the ideal person to ask... but
This is how I would think it could be done. Mind you I tried this with the default.xbe and changed the Matrix Init screen from green to blue.
First you need to know the Buffersize you want to work with.
This is how i did it
| CODE |
Set COLOR RED
SetFunc SizeOfBuffer FileSize $ActualPath$\default.xbe
OpenRead InFile $ActualPath$\default.xbe OpenWrite OutFile $ActualPath$\default.xbe.patched
CreateBuffer PATCH %SizeOfBuffer% ReadToBuffer InFile PATCH
Goto %COLOR%
:BLUE SetBufferByte PATCH 1977788 0x32 SetBufferByte PATCH 1977789 0x58 Goto Done
:RED SetBufferByte PATCH 1977788 0x31 SetBufferByte PATCH 1977789 0x33
:Done
WriteFromBuffer OutFile PATCH
CloseHandle PATCH CloseFile InFile CloseFile OutFile |
geniusalz
Jun 23 2004, 12:18 AM
You could also read in only the part that you want to edit (instead of loading the whole file into memory), and write that part out.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.