I'm sure the title of this post brought back some fond memories for other Amigans

To the gurus out there: I need a little help with the XModem / XModem-1K protocols (the latter being a simple extension with a larger packet size) - while not directly related to the Amiga itself, I still go overkill and run NComm under UAE for ALL my serial terminal work. I absolutely love it, and nothing windows or linux-based even comes close!
In a nutshell, I'm building some firmware upgrade jigs for Sony Bravia TVs. There's a microcontroller on my boards that simply reads firmware from one of two on-board flashroms, and sends it to the Sony DTAU boards using the XModem-1K protocol via a 16-18Pin FFC cable - the protocol is non-negotiable unfortunately, most of the branded TVs I've worked on use XModem-1K, my guess is for simplicity and ease of implementation.
Now, the XModem-1K protocol has a fixed packet length of 1028 bytes (4 bytes are headers/footers, and 1024 bytes /1KiB of file data) - if the file data should contain less than 1024 bytes, then it needs to be padded up with garbage. There's no implementation to send the file name or size over via XModem, so the receiving end relies on an EOT character (0x05) to determine when transmission has ended. Note that EOT/0x05 is sent alone AFTER all the 1028 bytes are transmitted, so the padded garbage is still present; you cant simply abandon transmission when thee file has finished streaming.
My question is, how is the receiving end supposed to determine where the file ends and garbage starts? One can't guarantee that the garbage characters aren't repeated elsewhere in the file, or even at the end of the file. Hyperterminal for example, sends 0x1A as a padding character according to Microschlong. While this appears to work, it's driving me nuts as to how the receiving end would filter it out without accidentally adding to or subtracting from the filesize.
When sending my own file data using XModem via NComm to another device, I can ensure the file is rounded off to the nearest 1K and use a known padding character that's easily identifiable. Unfortunately I can't do this with user provided files...
Any clues?