@123serge123 Thanks a lot man! I tought i would be a lot slower following your instructions but i made it! Here is what i did:
-
got tplink-safeloader.c, md5.c and md5.h from the lede-project github page
-
compiled md5 and the tplink-safeloader:
gcc -c md5.c
gcc tplink-safeloader.c md5.c -o tplink-safeloader
- got an older version of the original firmware (so i could update it after, using the webpage) and ran the tool: (got the arguments and board model (ARCHER-C6-V2) digging through the tplink-safeloader.c code)
mkdir firmware
./tplink-safeloader -B "ARCHER-C6-V2" -x ArcherC6v2_eu-up-ver1-1-0-P1[20190115-rel71848].bin -d firmware/
- added pad to the kernel file (the partition is 0x100000, so hex to dec, 1048576 bytes minus the size of kernel (
wc -c < os-image
) = #your own value# (so people don't lead into error))
cd firmware
dd if=/dev/zero bs=1 count=#your own value# >> os-image
- appended the two files:
dd if=os-image >> original_sysupdate.bin
dd if=file-system >> original_sysupdate.bin
-
using the openwrt web interface i flashed the new original_sysupdate.bin image with the option to force the update (risking bricking it if i didn't know how to recover)
-
now on tplinks web interface i updated to the latest firmware and voila, running oem again!
P.S.: Thanks a lot for the help @123serge123. And if i mistyped something please say so.