The javascript seems the easy part. The custom patch file is not documented anywhere explaining how to create it properly.
I'm trying to learn how to create it. I compared the old patches for 4.82-4.85 with the corresponding version of
nofsm_patch.bin from
@littlebalup PyPS3tools, but the files only matched partially.
Does someone have more information about how to create the custom patch? it would be very useful.
If someone is wondering if I plan to create a tool for that; the answer is no. I don't mess with flash stuff. I only want to learn, since the source code of the web flasher omitted that critical information for other developers.
For information, there's a couple of ways you could go about it, for instance you could dump the target OFW NOR, identify the active ROS (install ofw/hfw twice in a row so you avoid the possible inactive ros corruption after patching) and the CoreOS files that need patched by taking note of the offset entries in the ros table.
Then extract, decrypt, patch and reencrypt the required file(s), you need to hope that the size of the resulting file(s) hasn't changed. If not, you can reinsert it/them in the appropriate location in the ros data dump without further changes.
Once you are done patching the ros dump, you can extract the patch data.
It should start at sector 0x601 for NOR and cover 0x1802 sectors of continuous data data, each sector being 0x200 bytes in size.
For each ROS, the tool makes 4 storage write syscalls, 3 with 0x800 sectors and one with 2 sectors to complete the patch.
.. to make a web flasher support 4.80-4.89, I would have to modify the javascript to make the stack_frame apply the full nofsm_patch (7,340,000 bytes) instead the 4 custom chunks.
Yes, if you were to use this tool despite its inherent flaws, that would be the best option imho.
You would need to prep the patched ROS data in browser memory, dump the first sector of each ROS in browser memory first to keep the ros headers intact (0x20 bytes for one ROS and 0x30 bytes for the other iirc), then copy the 7Mb patch file from USB twice into memory to complete the ROSes prepping.
Finally apply the 14Mb of data for both ROSes in one continuous write sweep, 0x800 sectors at a time.
It's possible to write more than 0x800 sectors in a write syscall, up to 0x2000 iirc (TBC), but we noticed that on certain consoles from 0x1000 sectors up, some write syscalls happened to fail so because this tool doesn't do any checks of any kind, we couldn't detect any failures and we had to adjust the syscall calls argument to use 0x800 sectors max at a time to avoid any such issue which would inevitably lead to bricks without any warning whatsoever.