xboxscene.org forums

OG Xbox Forums => Official MediaXMenu (MXM) Forum => Dashboard Forums => MXM ActionScripting Forum => Topic started by: pelago on June 22, 2004, 03:19:00 AM

Title: Question
Post by: pelago on June 22, 2004, 03:19:00 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.
Title: Question
Post by: flattspott on June 22, 2004, 06:45:00 AM
Yes you can in the WIP version.

http://www.mediaxmen...?rc=2&rs=69#s69

Look 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.
Title: Question
Post by: Yuyu on June 22, 2004, 07:22:00 AM
QUOTE (flattspott @ Jun 22 2004, 10:45 AM)
Yes you can in the WIP version.

http://www.mediaxmen...?rc=2&rs=69#s69

Look 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.

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 ?

Title: Question
Post by: flattspott on June 22, 2004, 05:08:00 PM
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
Title: Question
Post by: geniusalz on June 22, 2004, 05:18:00 PM
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.