DEBUG: can not find fwuphdr | Trying to revert to stock firmware TL-WPA8630 (UK) v1

Hello, I am trying to build a sysupgrade compatible OEM firmware for my TL-WPA8630 (UK) v1. I believe I correctly identified that I need to use the ath79/generic image builder. Here is the output of my terminal:

debian@debian:~$  staging_dir/host/bin/tplink-safeloader -z wpa8630v1_uk_1_0_1_up\(170406\)-20170406.bin -o oem-sysupgrade.bin
DEBUG: can not find fwuphdr
Segmentation fault

What am I doing wrong?

As an alternative, I have serial UART access to the device so if I could somehow flash stock that way, that could also work.

My regards, Sven

Helpful https://github.com/openwrt/openwrt/issues/8630 ?

Thank you frollic, yes I think this might be useful. I have managed to open the oem firmware file for my device in a hex editor program but I am unable to figure out how to find such offsets. There don't seem to be strings such as "fwup-ptn" in my file (which I gather might be important based on this github page)

EDIT: I don't think this will actual matter right now anyway since there doesn't seem to be any firmware layout information for my device in tplink-safeloader.c