mkschreder/rockutil ? reverse-engineered prompt
Reverse engineered prompt
Build me a command line tool in C that can talk to Rockchip RK series devices over USB and handle the whole flashing flow from start to finish.
I want it to be able to find connected Rockusb and MaskROM devices, switch a device from MaskROM into loader mode, read basic chip and flash info, read and write raw sectors, erase ranges, and flash full firmware images. It should also understand Rockchip image formats like RKFW, RKAF, and RKBOOT, and be able to print or extract their contents. If a partition image is sparse, it should handle that too. I also want a way to turn a Rockchip parameter text file into a GPT image and erase partitions based on that file.
Please make it work in userspace with libusb, include a simple help and version output, and add tests so the main commands can be checked without real hardware if possible. Use the current docs online if you need to confirm any Rockchip details.
Are you gonna build this?
make sure you review the code using coderabbit